From de2612e95a9fb7b54f056dcdcf176cf9edc8f57b Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Tue, 4 Jun 2024 18:25:01 +0000 Subject: [PATCH] Regenerated Clients --- .../2d116c1b62ff41ee9d9e00f9779af4be.json | 8 + .../41575353444b40ffbf474f4155544f00.json | 8 + .../7bd96efca5a9448f992c23b3cd98b272.json | 8 + .../a26e635c0dbe4d8eb5f05f3239479ecd.json | 8 + .../e79229d4128144a7a5c7c35dc2f762d7.json | 8 + service/docdb/internal/endpoints/endpoints.go | 72 +- service/ec2/types/enums.go | 1610 ++++---- .../internal/endpoints/endpoints.go | 3 + .../neptune/internal/endpoints/endpoints.go | 72 +- service/pipes/deserializers.go | 451 +++ service/pipes/serializers.go | 197 + service/pipes/types/enums.go | 84 + service/pipes/types/types.go | 240 +- service/pipes/validators.go | 193 + service/rds/internal/endpoints/endpoints.go | 72 +- .../sagemaker/api_op_DescribeClusterNode.go | 8 +- service/sagemaker/deserializers.go | 72 + service/sagemaker/types/types.go | 25 + service/taxsettings/LICENSE.txt | 202 + service/taxsettings/api_client.go | 537 +++ service/taxsettings/api_client_test.go | 127 + .../api_op_BatchDeleteTaxRegistration.go | 145 + .../api_op_BatchPutTaxRegistration.go | 275 ++ .../api_op_DeleteTaxRegistration.go | 133 + .../taxsettings/api_op_GetTaxRegistration.go | 131 + .../api_op_GetTaxRegistrationDocument.go | 143 + .../api_op_ListTaxRegistrations.go | 233 ++ .../taxsettings/api_op_PutTaxRegistration.go | 265 ++ service/taxsettings/auth.go | 284 ++ service/taxsettings/deserializers.go | 3250 +++++++++++++++++ service/taxsettings/doc.go | 17 + service/taxsettings/endpoints.go | 516 +++ service/taxsettings/endpoints_config_test.go | 139 + service/taxsettings/endpoints_test.go | 820 +++++ service/taxsettings/generated.json | 39 + service/taxsettings/go.mod | 16 + service/taxsettings/go.sum | 2 + service/taxsettings/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 296 ++ .../internal/endpoints/endpoints_test.go | 11 + service/taxsettings/options.go | 224 ++ service/taxsettings/protocol_test.go | 3 + service/taxsettings/serializers.go | 1131 ++++++ .../api_op_BatchDeleteTaxRegistration.go.snap | 34 + .../api_op_BatchPutTaxRegistration.go.snap | 34 + .../api_op_DeleteTaxRegistration.go.snap | 33 + .../api_op_GetTaxRegistration.go.snap | 33 + .../api_op_GetTaxRegistrationDocument.go.snap | 34 + .../api_op_ListTaxRegistrations.go.snap | 33 + .../api_op_PutTaxRegistration.go.snap | 34 + service/taxsettings/snapshot_test.go | 230 ++ service/taxsettings/types/enums.go | 307 ++ service/taxsettings/types/errors.go | 122 + service/taxsettings/types/types.go | 788 ++++ service/taxsettings/validators.go | 551 +++ .../internal/endpoints/endpoints.go | 6 + 56 files changed, 13317 insertions(+), 1006 deletions(-) create mode 100644 .changelog/2d116c1b62ff41ee9d9e00f9779af4be.json create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/7bd96efca5a9448f992c23b3cd98b272.json create mode 100644 .changelog/a26e635c0dbe4d8eb5f05f3239479ecd.json create mode 100644 .changelog/e79229d4128144a7a5c7c35dc2f762d7.json create mode 100644 service/taxsettings/LICENSE.txt create mode 100644 service/taxsettings/api_client.go create mode 100644 service/taxsettings/api_client_test.go create mode 100644 service/taxsettings/api_op_BatchDeleteTaxRegistration.go create mode 100644 service/taxsettings/api_op_BatchPutTaxRegistration.go create mode 100644 service/taxsettings/api_op_DeleteTaxRegistration.go create mode 100644 service/taxsettings/api_op_GetTaxRegistration.go create mode 100644 service/taxsettings/api_op_GetTaxRegistrationDocument.go create mode 100644 service/taxsettings/api_op_ListTaxRegistrations.go create mode 100644 service/taxsettings/api_op_PutTaxRegistration.go create mode 100644 service/taxsettings/auth.go create mode 100644 service/taxsettings/deserializers.go create mode 100644 service/taxsettings/doc.go create mode 100644 service/taxsettings/endpoints.go create mode 100644 service/taxsettings/endpoints_config_test.go create mode 100644 service/taxsettings/endpoints_test.go create mode 100644 service/taxsettings/generated.json create mode 100644 service/taxsettings/go.mod create mode 100644 service/taxsettings/go.sum create mode 100644 service/taxsettings/go_module_metadata.go create mode 100644 service/taxsettings/internal/endpoints/endpoints.go create mode 100644 service/taxsettings/internal/endpoints/endpoints_test.go create mode 100644 service/taxsettings/options.go create mode 100644 service/taxsettings/protocol_test.go create mode 100644 service/taxsettings/serializers.go create mode 100644 service/taxsettings/snapshot/api_op_BatchDeleteTaxRegistration.go.snap create mode 100644 service/taxsettings/snapshot/api_op_BatchPutTaxRegistration.go.snap create mode 100644 service/taxsettings/snapshot/api_op_DeleteTaxRegistration.go.snap create mode 100644 service/taxsettings/snapshot/api_op_GetTaxRegistration.go.snap create mode 100644 service/taxsettings/snapshot/api_op_GetTaxRegistrationDocument.go.snap create mode 100644 service/taxsettings/snapshot/api_op_ListTaxRegistrations.go.snap create mode 100644 service/taxsettings/snapshot/api_op_PutTaxRegistration.go.snap create mode 100644 service/taxsettings/snapshot_test.go create mode 100644 service/taxsettings/types/enums.go create mode 100644 service/taxsettings/types/errors.go create mode 100644 service/taxsettings/types/types.go create mode 100644 service/taxsettings/validators.go diff --git a/.changelog/2d116c1b62ff41ee9d9e00f9779af4be.json b/.changelog/2d116c1b62ff41ee9d9e00f9779af4be.json new file mode 100644 index 00000000000..c31860e550a --- /dev/null +++ b/.changelog/2d116c1b62ff41ee9d9e00f9779af4be.json @@ -0,0 +1,8 @@ +{ + "id": "2d116c1b-62ff-41ee-9d9e-00f9779af4be", + "type": "feature", + "description": "U7i instances with up to 32 TiB of DDR5 memory and 896 vCPUs are now available. C7i-flex instances are launched and are lower-priced variants of the Amazon EC2 C7i instances that offer a baseline level of CPU performance with the ability to scale up to the full compute performance 95% of the time.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..d47a8c10430 --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/taxsettings" + ] +} \ No newline at end of file diff --git a/.changelog/7bd96efca5a9448f992c23b3cd98b272.json b/.changelog/7bd96efca5a9448f992c23b3cd98b272.json new file mode 100644 index 00000000000..cdf44bb5947 --- /dev/null +++ b/.changelog/7bd96efca5a9448f992c23b3cd98b272.json @@ -0,0 +1,8 @@ +{ + "id": "7bd96efc-a5a9-448f-992c-23b3cd98b272", + "type": "feature", + "description": "Extend DescribeClusterNode response with private DNS hostname and IP address, and placement information about availability zone and availability zone ID.", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/a26e635c0dbe4d8eb5f05f3239479ecd.json b/.changelog/a26e635c0dbe4d8eb5f05f3239479ecd.json new file mode 100644 index 00000000000..8c1c6155d83 --- /dev/null +++ b/.changelog/a26e635c0dbe4d8eb5f05f3239479ecd.json @@ -0,0 +1,8 @@ +{ + "id": "a26e635c-0dbe-4d8e-b5f0-5f3239479ecd", + "type": "feature", + "description": "Initial release of AWS Tax Settings API", + "modules": [ + "service/taxsettings" + ] +} \ No newline at end of file diff --git a/.changelog/e79229d4128144a7a5c7c35dc2f762d7.json b/.changelog/e79229d4128144a7a5c7c35dc2f762d7.json new file mode 100644 index 00000000000..1c0fccac7c8 --- /dev/null +++ b/.changelog/e79229d4128144a7a5c7c35dc2f762d7.json @@ -0,0 +1,8 @@ +{ + "id": "e79229d4-1281-44a7-a5c7-c35dc2f762d7", + "type": "feature", + "description": "This release adds Timestream for LiveAnalytics as a supported target in EventBridge Pipes", + "modules": [ + "service/pipes" + ] +} \ No newline at end of file diff --git a/service/docdb/internal/endpoints/endpoints.go b/service/docdb/internal/endpoints/endpoints.go index 1c7992b1129..5d4818bd380 100644 --- a/service/docdb/internal/endpoints/endpoints.go +++ b/service/docdb/internal/endpoints/endpoints.go @@ -544,37 +544,10 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "rds-fips.us-iso-east-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds-fips.us-iso-west-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-west-1", - }, - Deprecated: aws.TrueTernary, - }, endpoints.EndpointKey{ Region: "rds.us-iso-east-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-iso-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-east-1", }, @@ -583,16 +556,7 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "rds.us-iso-west-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-iso-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-west-1", }, @@ -605,12 +569,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-iso-east-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", }, endpoints.EndpointKey{ Region: "us-iso-east-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-east-1", }, @@ -623,12 +587,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-iso-west-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", }, endpoints.EndpointKey{ Region: "us-iso-west-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-west-1", }, @@ -657,28 +621,10 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "rds-fips.us-isob-east-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - Deprecated: aws.TrueTernary, - }, endpoints.EndpointKey{ Region: "rds.us-isob-east-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-isob-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-isob-east-1", }, @@ -691,12 +637,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-isob-east-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", }, endpoints.EndpointKey{ Region: "us-isob-east-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-isob-east-1", }, diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 6ab11c18077..402f00be739 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -3141,802 +3141,811 @@ type InstanceType string // Enum values for InstanceType const ( - InstanceTypeA1Medium InstanceType = "a1.medium" - InstanceTypeA1Large InstanceType = "a1.large" - InstanceTypeA1Xlarge InstanceType = "a1.xlarge" - InstanceTypeA12xlarge InstanceType = "a1.2xlarge" - InstanceTypeA14xlarge InstanceType = "a1.4xlarge" - InstanceTypeA1Metal InstanceType = "a1.metal" - InstanceTypeC1Medium InstanceType = "c1.medium" - InstanceTypeC1Xlarge InstanceType = "c1.xlarge" - InstanceTypeC3Large InstanceType = "c3.large" - InstanceTypeC3Xlarge InstanceType = "c3.xlarge" - InstanceTypeC32xlarge InstanceType = "c3.2xlarge" - InstanceTypeC34xlarge InstanceType = "c3.4xlarge" - InstanceTypeC38xlarge InstanceType = "c3.8xlarge" - InstanceTypeC4Large InstanceType = "c4.large" - InstanceTypeC4Xlarge InstanceType = "c4.xlarge" - InstanceTypeC42xlarge InstanceType = "c4.2xlarge" - InstanceTypeC44xlarge InstanceType = "c4.4xlarge" - InstanceTypeC48xlarge InstanceType = "c4.8xlarge" - InstanceTypeC5Large InstanceType = "c5.large" - InstanceTypeC5Xlarge InstanceType = "c5.xlarge" - InstanceTypeC52xlarge InstanceType = "c5.2xlarge" - InstanceTypeC54xlarge InstanceType = "c5.4xlarge" - InstanceTypeC59xlarge InstanceType = "c5.9xlarge" - InstanceTypeC512xlarge InstanceType = "c5.12xlarge" - InstanceTypeC518xlarge InstanceType = "c5.18xlarge" - InstanceTypeC524xlarge InstanceType = "c5.24xlarge" - InstanceTypeC5Metal InstanceType = "c5.metal" - InstanceTypeC5aLarge InstanceType = "c5a.large" - InstanceTypeC5aXlarge InstanceType = "c5a.xlarge" - InstanceTypeC5a2xlarge InstanceType = "c5a.2xlarge" - InstanceTypeC5a4xlarge InstanceType = "c5a.4xlarge" - InstanceTypeC5a8xlarge InstanceType = "c5a.8xlarge" - InstanceTypeC5a12xlarge InstanceType = "c5a.12xlarge" - InstanceTypeC5a16xlarge InstanceType = "c5a.16xlarge" - InstanceTypeC5a24xlarge InstanceType = "c5a.24xlarge" - InstanceTypeC5adLarge InstanceType = "c5ad.large" - InstanceTypeC5adXlarge InstanceType = "c5ad.xlarge" - InstanceTypeC5ad2xlarge InstanceType = "c5ad.2xlarge" - InstanceTypeC5ad4xlarge InstanceType = "c5ad.4xlarge" - InstanceTypeC5ad8xlarge InstanceType = "c5ad.8xlarge" - InstanceTypeC5ad12xlarge InstanceType = "c5ad.12xlarge" - InstanceTypeC5ad16xlarge InstanceType = "c5ad.16xlarge" - InstanceTypeC5ad24xlarge InstanceType = "c5ad.24xlarge" - InstanceTypeC5dLarge InstanceType = "c5d.large" - InstanceTypeC5dXlarge InstanceType = "c5d.xlarge" - InstanceTypeC5d2xlarge InstanceType = "c5d.2xlarge" - InstanceTypeC5d4xlarge InstanceType = "c5d.4xlarge" - InstanceTypeC5d9xlarge InstanceType = "c5d.9xlarge" - InstanceTypeC5d12xlarge InstanceType = "c5d.12xlarge" - InstanceTypeC5d18xlarge InstanceType = "c5d.18xlarge" - InstanceTypeC5d24xlarge InstanceType = "c5d.24xlarge" - InstanceTypeC5dMetal InstanceType = "c5d.metal" - InstanceTypeC5nLarge InstanceType = "c5n.large" - InstanceTypeC5nXlarge InstanceType = "c5n.xlarge" - InstanceTypeC5n2xlarge InstanceType = "c5n.2xlarge" - InstanceTypeC5n4xlarge InstanceType = "c5n.4xlarge" - InstanceTypeC5n9xlarge InstanceType = "c5n.9xlarge" - InstanceTypeC5n18xlarge InstanceType = "c5n.18xlarge" - InstanceTypeC5nMetal InstanceType = "c5n.metal" - InstanceTypeC6gMedium InstanceType = "c6g.medium" - InstanceTypeC6gLarge InstanceType = "c6g.large" - InstanceTypeC6gXlarge InstanceType = "c6g.xlarge" - InstanceTypeC6g2xlarge InstanceType = "c6g.2xlarge" - InstanceTypeC6g4xlarge InstanceType = "c6g.4xlarge" - InstanceTypeC6g8xlarge InstanceType = "c6g.8xlarge" - InstanceTypeC6g12xlarge InstanceType = "c6g.12xlarge" - InstanceTypeC6g16xlarge InstanceType = "c6g.16xlarge" - InstanceTypeC6gMetal InstanceType = "c6g.metal" - InstanceTypeC6gdMedium InstanceType = "c6gd.medium" - InstanceTypeC6gdLarge InstanceType = "c6gd.large" - InstanceTypeC6gdXlarge InstanceType = "c6gd.xlarge" - InstanceTypeC6gd2xlarge InstanceType = "c6gd.2xlarge" - InstanceTypeC6gd4xlarge InstanceType = "c6gd.4xlarge" - InstanceTypeC6gd8xlarge InstanceType = "c6gd.8xlarge" - InstanceTypeC6gd12xlarge InstanceType = "c6gd.12xlarge" - InstanceTypeC6gd16xlarge InstanceType = "c6gd.16xlarge" - InstanceTypeC6gdMetal InstanceType = "c6gd.metal" - InstanceTypeC6gnMedium InstanceType = "c6gn.medium" - InstanceTypeC6gnLarge InstanceType = "c6gn.large" - InstanceTypeC6gnXlarge InstanceType = "c6gn.xlarge" - InstanceTypeC6gn2xlarge InstanceType = "c6gn.2xlarge" - InstanceTypeC6gn4xlarge InstanceType = "c6gn.4xlarge" - InstanceTypeC6gn8xlarge InstanceType = "c6gn.8xlarge" - InstanceTypeC6gn12xlarge InstanceType = "c6gn.12xlarge" - InstanceTypeC6gn16xlarge InstanceType = "c6gn.16xlarge" - InstanceTypeC6iLarge InstanceType = "c6i.large" - InstanceTypeC6iXlarge InstanceType = "c6i.xlarge" - InstanceTypeC6i2xlarge InstanceType = "c6i.2xlarge" - InstanceTypeC6i4xlarge InstanceType = "c6i.4xlarge" - InstanceTypeC6i8xlarge InstanceType = "c6i.8xlarge" - InstanceTypeC6i12xlarge InstanceType = "c6i.12xlarge" - InstanceTypeC6i16xlarge InstanceType = "c6i.16xlarge" - InstanceTypeC6i24xlarge InstanceType = "c6i.24xlarge" - InstanceTypeC6i32xlarge InstanceType = "c6i.32xlarge" - InstanceTypeC6iMetal InstanceType = "c6i.metal" - InstanceTypeCc14xlarge InstanceType = "cc1.4xlarge" - InstanceTypeCc28xlarge InstanceType = "cc2.8xlarge" - InstanceTypeCg14xlarge InstanceType = "cg1.4xlarge" - InstanceTypeCr18xlarge InstanceType = "cr1.8xlarge" - InstanceTypeD2Xlarge InstanceType = "d2.xlarge" - InstanceTypeD22xlarge InstanceType = "d2.2xlarge" - InstanceTypeD24xlarge InstanceType = "d2.4xlarge" - InstanceTypeD28xlarge InstanceType = "d2.8xlarge" - InstanceTypeD3Xlarge InstanceType = "d3.xlarge" - InstanceTypeD32xlarge InstanceType = "d3.2xlarge" - InstanceTypeD34xlarge InstanceType = "d3.4xlarge" - InstanceTypeD38xlarge InstanceType = "d3.8xlarge" - InstanceTypeD3enXlarge InstanceType = "d3en.xlarge" - InstanceTypeD3en2xlarge InstanceType = "d3en.2xlarge" - InstanceTypeD3en4xlarge InstanceType = "d3en.4xlarge" - InstanceTypeD3en6xlarge InstanceType = "d3en.6xlarge" - InstanceTypeD3en8xlarge InstanceType = "d3en.8xlarge" - InstanceTypeD3en12xlarge InstanceType = "d3en.12xlarge" - InstanceTypeDl124xlarge InstanceType = "dl1.24xlarge" - InstanceTypeF12xlarge InstanceType = "f1.2xlarge" - InstanceTypeF14xlarge InstanceType = "f1.4xlarge" - InstanceTypeF116xlarge InstanceType = "f1.16xlarge" - InstanceTypeG22xlarge InstanceType = "g2.2xlarge" - InstanceTypeG28xlarge InstanceType = "g2.8xlarge" - InstanceTypeG34xlarge InstanceType = "g3.4xlarge" - InstanceTypeG38xlarge InstanceType = "g3.8xlarge" - InstanceTypeG316xlarge InstanceType = "g3.16xlarge" - InstanceTypeG3sXlarge InstanceType = "g3s.xlarge" - InstanceTypeG4adXlarge InstanceType = "g4ad.xlarge" - InstanceTypeG4ad2xlarge InstanceType = "g4ad.2xlarge" - InstanceTypeG4ad4xlarge InstanceType = "g4ad.4xlarge" - InstanceTypeG4ad8xlarge InstanceType = "g4ad.8xlarge" - InstanceTypeG4ad16xlarge InstanceType = "g4ad.16xlarge" - InstanceTypeG4dnXlarge InstanceType = "g4dn.xlarge" - InstanceTypeG4dn2xlarge InstanceType = "g4dn.2xlarge" - InstanceTypeG4dn4xlarge InstanceType = "g4dn.4xlarge" - InstanceTypeG4dn8xlarge InstanceType = "g4dn.8xlarge" - InstanceTypeG4dn12xlarge InstanceType = "g4dn.12xlarge" - InstanceTypeG4dn16xlarge InstanceType = "g4dn.16xlarge" - InstanceTypeG4dnMetal InstanceType = "g4dn.metal" - InstanceTypeG5Xlarge InstanceType = "g5.xlarge" - InstanceTypeG52xlarge InstanceType = "g5.2xlarge" - InstanceTypeG54xlarge InstanceType = "g5.4xlarge" - InstanceTypeG58xlarge InstanceType = "g5.8xlarge" - InstanceTypeG512xlarge InstanceType = "g5.12xlarge" - InstanceTypeG516xlarge InstanceType = "g5.16xlarge" - InstanceTypeG524xlarge InstanceType = "g5.24xlarge" - InstanceTypeG548xlarge InstanceType = "g5.48xlarge" - InstanceTypeG5gXlarge InstanceType = "g5g.xlarge" - InstanceTypeG5g2xlarge InstanceType = "g5g.2xlarge" - InstanceTypeG5g4xlarge InstanceType = "g5g.4xlarge" - InstanceTypeG5g8xlarge InstanceType = "g5g.8xlarge" - InstanceTypeG5g16xlarge InstanceType = "g5g.16xlarge" - InstanceTypeG5gMetal InstanceType = "g5g.metal" - InstanceTypeHi14xlarge InstanceType = "hi1.4xlarge" - InstanceTypeHpc6a48xlarge InstanceType = "hpc6a.48xlarge" - InstanceTypeHs18xlarge InstanceType = "hs1.8xlarge" - InstanceTypeH12xlarge InstanceType = "h1.2xlarge" - InstanceTypeH14xlarge InstanceType = "h1.4xlarge" - InstanceTypeH18xlarge InstanceType = "h1.8xlarge" - InstanceTypeH116xlarge InstanceType = "h1.16xlarge" - InstanceTypeI2Xlarge InstanceType = "i2.xlarge" - InstanceTypeI22xlarge InstanceType = "i2.2xlarge" - InstanceTypeI24xlarge InstanceType = "i2.4xlarge" - InstanceTypeI28xlarge InstanceType = "i2.8xlarge" - InstanceTypeI3Large InstanceType = "i3.large" - InstanceTypeI3Xlarge InstanceType = "i3.xlarge" - InstanceTypeI32xlarge InstanceType = "i3.2xlarge" - InstanceTypeI34xlarge InstanceType = "i3.4xlarge" - InstanceTypeI38xlarge InstanceType = "i3.8xlarge" - InstanceTypeI316xlarge InstanceType = "i3.16xlarge" - InstanceTypeI3Metal InstanceType = "i3.metal" - InstanceTypeI3enLarge InstanceType = "i3en.large" - InstanceTypeI3enXlarge InstanceType = "i3en.xlarge" - InstanceTypeI3en2xlarge InstanceType = "i3en.2xlarge" - InstanceTypeI3en3xlarge InstanceType = "i3en.3xlarge" - InstanceTypeI3en6xlarge InstanceType = "i3en.6xlarge" - InstanceTypeI3en12xlarge InstanceType = "i3en.12xlarge" - InstanceTypeI3en24xlarge InstanceType = "i3en.24xlarge" - InstanceTypeI3enMetal InstanceType = "i3en.metal" - InstanceTypeIm4gnLarge InstanceType = "im4gn.large" - InstanceTypeIm4gnXlarge InstanceType = "im4gn.xlarge" - InstanceTypeIm4gn2xlarge InstanceType = "im4gn.2xlarge" - InstanceTypeIm4gn4xlarge InstanceType = "im4gn.4xlarge" - InstanceTypeIm4gn8xlarge InstanceType = "im4gn.8xlarge" - InstanceTypeIm4gn16xlarge InstanceType = "im4gn.16xlarge" - InstanceTypeInf1Xlarge InstanceType = "inf1.xlarge" - InstanceTypeInf12xlarge InstanceType = "inf1.2xlarge" - InstanceTypeInf16xlarge InstanceType = "inf1.6xlarge" - InstanceTypeInf124xlarge InstanceType = "inf1.24xlarge" - InstanceTypeIs4genMedium InstanceType = "is4gen.medium" - InstanceTypeIs4genLarge InstanceType = "is4gen.large" - InstanceTypeIs4genXlarge InstanceType = "is4gen.xlarge" - InstanceTypeIs4gen2xlarge InstanceType = "is4gen.2xlarge" - InstanceTypeIs4gen4xlarge InstanceType = "is4gen.4xlarge" - InstanceTypeIs4gen8xlarge InstanceType = "is4gen.8xlarge" - InstanceTypeM1Small InstanceType = "m1.small" - InstanceTypeM1Medium InstanceType = "m1.medium" - InstanceTypeM1Large InstanceType = "m1.large" - InstanceTypeM1Xlarge InstanceType = "m1.xlarge" - InstanceTypeM2Xlarge InstanceType = "m2.xlarge" - InstanceTypeM22xlarge InstanceType = "m2.2xlarge" - InstanceTypeM24xlarge InstanceType = "m2.4xlarge" - InstanceTypeM3Medium InstanceType = "m3.medium" - InstanceTypeM3Large InstanceType = "m3.large" - InstanceTypeM3Xlarge InstanceType = "m3.xlarge" - InstanceTypeM32xlarge InstanceType = "m3.2xlarge" - InstanceTypeM4Large InstanceType = "m4.large" - InstanceTypeM4Xlarge InstanceType = "m4.xlarge" - InstanceTypeM42xlarge InstanceType = "m4.2xlarge" - InstanceTypeM44xlarge InstanceType = "m4.4xlarge" - InstanceTypeM410xlarge InstanceType = "m4.10xlarge" - InstanceTypeM416xlarge InstanceType = "m4.16xlarge" - InstanceTypeM5Large InstanceType = "m5.large" - InstanceTypeM5Xlarge InstanceType = "m5.xlarge" - InstanceTypeM52xlarge InstanceType = "m5.2xlarge" - InstanceTypeM54xlarge InstanceType = "m5.4xlarge" - InstanceTypeM58xlarge InstanceType = "m5.8xlarge" - InstanceTypeM512xlarge InstanceType = "m5.12xlarge" - InstanceTypeM516xlarge InstanceType = "m5.16xlarge" - InstanceTypeM524xlarge InstanceType = "m5.24xlarge" - InstanceTypeM5Metal InstanceType = "m5.metal" - InstanceTypeM5aLarge InstanceType = "m5a.large" - InstanceTypeM5aXlarge InstanceType = "m5a.xlarge" - InstanceTypeM5a2xlarge InstanceType = "m5a.2xlarge" - InstanceTypeM5a4xlarge InstanceType = "m5a.4xlarge" - InstanceTypeM5a8xlarge InstanceType = "m5a.8xlarge" - InstanceTypeM5a12xlarge InstanceType = "m5a.12xlarge" - InstanceTypeM5a16xlarge InstanceType = "m5a.16xlarge" - InstanceTypeM5a24xlarge InstanceType = "m5a.24xlarge" - InstanceTypeM5adLarge InstanceType = "m5ad.large" - InstanceTypeM5adXlarge InstanceType = "m5ad.xlarge" - InstanceTypeM5ad2xlarge InstanceType = "m5ad.2xlarge" - InstanceTypeM5ad4xlarge InstanceType = "m5ad.4xlarge" - InstanceTypeM5ad8xlarge InstanceType = "m5ad.8xlarge" - InstanceTypeM5ad12xlarge InstanceType = "m5ad.12xlarge" - InstanceTypeM5ad16xlarge InstanceType = "m5ad.16xlarge" - InstanceTypeM5ad24xlarge InstanceType = "m5ad.24xlarge" - InstanceTypeM5dLarge InstanceType = "m5d.large" - InstanceTypeM5dXlarge InstanceType = "m5d.xlarge" - InstanceTypeM5d2xlarge InstanceType = "m5d.2xlarge" - InstanceTypeM5d4xlarge InstanceType = "m5d.4xlarge" - InstanceTypeM5d8xlarge InstanceType = "m5d.8xlarge" - InstanceTypeM5d12xlarge InstanceType = "m5d.12xlarge" - InstanceTypeM5d16xlarge InstanceType = "m5d.16xlarge" - InstanceTypeM5d24xlarge InstanceType = "m5d.24xlarge" - InstanceTypeM5dMetal InstanceType = "m5d.metal" - InstanceTypeM5dnLarge InstanceType = "m5dn.large" - InstanceTypeM5dnXlarge InstanceType = "m5dn.xlarge" - InstanceTypeM5dn2xlarge InstanceType = "m5dn.2xlarge" - InstanceTypeM5dn4xlarge InstanceType = "m5dn.4xlarge" - InstanceTypeM5dn8xlarge InstanceType = "m5dn.8xlarge" - InstanceTypeM5dn12xlarge InstanceType = "m5dn.12xlarge" - InstanceTypeM5dn16xlarge InstanceType = "m5dn.16xlarge" - InstanceTypeM5dn24xlarge InstanceType = "m5dn.24xlarge" - InstanceTypeM5dnMetal InstanceType = "m5dn.metal" - InstanceTypeM5nLarge InstanceType = "m5n.large" - InstanceTypeM5nXlarge InstanceType = "m5n.xlarge" - InstanceTypeM5n2xlarge InstanceType = "m5n.2xlarge" - InstanceTypeM5n4xlarge InstanceType = "m5n.4xlarge" - InstanceTypeM5n8xlarge InstanceType = "m5n.8xlarge" - InstanceTypeM5n12xlarge InstanceType = "m5n.12xlarge" - InstanceTypeM5n16xlarge InstanceType = "m5n.16xlarge" - InstanceTypeM5n24xlarge InstanceType = "m5n.24xlarge" - InstanceTypeM5nMetal InstanceType = "m5n.metal" - InstanceTypeM5znLarge InstanceType = "m5zn.large" - InstanceTypeM5znXlarge InstanceType = "m5zn.xlarge" - InstanceTypeM5zn2xlarge InstanceType = "m5zn.2xlarge" - InstanceTypeM5zn3xlarge InstanceType = "m5zn.3xlarge" - InstanceTypeM5zn6xlarge InstanceType = "m5zn.6xlarge" - InstanceTypeM5zn12xlarge InstanceType = "m5zn.12xlarge" - InstanceTypeM5znMetal InstanceType = "m5zn.metal" - InstanceTypeM6aLarge InstanceType = "m6a.large" - InstanceTypeM6aXlarge InstanceType = "m6a.xlarge" - InstanceTypeM6a2xlarge InstanceType = "m6a.2xlarge" - InstanceTypeM6a4xlarge InstanceType = "m6a.4xlarge" - InstanceTypeM6a8xlarge InstanceType = "m6a.8xlarge" - InstanceTypeM6a12xlarge InstanceType = "m6a.12xlarge" - InstanceTypeM6a16xlarge InstanceType = "m6a.16xlarge" - InstanceTypeM6a24xlarge InstanceType = "m6a.24xlarge" - InstanceTypeM6a32xlarge InstanceType = "m6a.32xlarge" - InstanceTypeM6a48xlarge InstanceType = "m6a.48xlarge" - InstanceTypeM6gMetal InstanceType = "m6g.metal" - InstanceTypeM6gMedium InstanceType = "m6g.medium" - InstanceTypeM6gLarge InstanceType = "m6g.large" - InstanceTypeM6gXlarge InstanceType = "m6g.xlarge" - InstanceTypeM6g2xlarge InstanceType = "m6g.2xlarge" - InstanceTypeM6g4xlarge InstanceType = "m6g.4xlarge" - InstanceTypeM6g8xlarge InstanceType = "m6g.8xlarge" - InstanceTypeM6g12xlarge InstanceType = "m6g.12xlarge" - InstanceTypeM6g16xlarge InstanceType = "m6g.16xlarge" - InstanceTypeM6gdMetal InstanceType = "m6gd.metal" - InstanceTypeM6gdMedium InstanceType = "m6gd.medium" - InstanceTypeM6gdLarge InstanceType = "m6gd.large" - InstanceTypeM6gdXlarge InstanceType = "m6gd.xlarge" - InstanceTypeM6gd2xlarge InstanceType = "m6gd.2xlarge" - InstanceTypeM6gd4xlarge InstanceType = "m6gd.4xlarge" - InstanceTypeM6gd8xlarge InstanceType = "m6gd.8xlarge" - InstanceTypeM6gd12xlarge InstanceType = "m6gd.12xlarge" - InstanceTypeM6gd16xlarge InstanceType = "m6gd.16xlarge" - InstanceTypeM6iLarge InstanceType = "m6i.large" - InstanceTypeM6iXlarge InstanceType = "m6i.xlarge" - InstanceTypeM6i2xlarge InstanceType = "m6i.2xlarge" - InstanceTypeM6i4xlarge InstanceType = "m6i.4xlarge" - InstanceTypeM6i8xlarge InstanceType = "m6i.8xlarge" - InstanceTypeM6i12xlarge InstanceType = "m6i.12xlarge" - InstanceTypeM6i16xlarge InstanceType = "m6i.16xlarge" - InstanceTypeM6i24xlarge InstanceType = "m6i.24xlarge" - InstanceTypeM6i32xlarge InstanceType = "m6i.32xlarge" - InstanceTypeM6iMetal InstanceType = "m6i.metal" - InstanceTypeMac1Metal InstanceType = "mac1.metal" - InstanceTypeP2Xlarge InstanceType = "p2.xlarge" - InstanceTypeP28xlarge InstanceType = "p2.8xlarge" - InstanceTypeP216xlarge InstanceType = "p2.16xlarge" - InstanceTypeP32xlarge InstanceType = "p3.2xlarge" - InstanceTypeP38xlarge InstanceType = "p3.8xlarge" - InstanceTypeP316xlarge InstanceType = "p3.16xlarge" - InstanceTypeP3dn24xlarge InstanceType = "p3dn.24xlarge" - InstanceTypeP4d24xlarge InstanceType = "p4d.24xlarge" - InstanceTypeR3Large InstanceType = "r3.large" - InstanceTypeR3Xlarge InstanceType = "r3.xlarge" - InstanceTypeR32xlarge InstanceType = "r3.2xlarge" - InstanceTypeR34xlarge InstanceType = "r3.4xlarge" - InstanceTypeR38xlarge InstanceType = "r3.8xlarge" - InstanceTypeR4Large InstanceType = "r4.large" - InstanceTypeR4Xlarge InstanceType = "r4.xlarge" - InstanceTypeR42xlarge InstanceType = "r4.2xlarge" - InstanceTypeR44xlarge InstanceType = "r4.4xlarge" - InstanceTypeR48xlarge InstanceType = "r4.8xlarge" - InstanceTypeR416xlarge InstanceType = "r4.16xlarge" - InstanceTypeR5Large InstanceType = "r5.large" - InstanceTypeR5Xlarge InstanceType = "r5.xlarge" - InstanceTypeR52xlarge InstanceType = "r5.2xlarge" - InstanceTypeR54xlarge InstanceType = "r5.4xlarge" - InstanceTypeR58xlarge InstanceType = "r5.8xlarge" - InstanceTypeR512xlarge InstanceType = "r5.12xlarge" - InstanceTypeR516xlarge InstanceType = "r5.16xlarge" - InstanceTypeR524xlarge InstanceType = "r5.24xlarge" - InstanceTypeR5Metal InstanceType = "r5.metal" - InstanceTypeR5aLarge InstanceType = "r5a.large" - InstanceTypeR5aXlarge InstanceType = "r5a.xlarge" - InstanceTypeR5a2xlarge InstanceType = "r5a.2xlarge" - InstanceTypeR5a4xlarge InstanceType = "r5a.4xlarge" - InstanceTypeR5a8xlarge InstanceType = "r5a.8xlarge" - InstanceTypeR5a12xlarge InstanceType = "r5a.12xlarge" - InstanceTypeR5a16xlarge InstanceType = "r5a.16xlarge" - InstanceTypeR5a24xlarge InstanceType = "r5a.24xlarge" - InstanceTypeR5adLarge InstanceType = "r5ad.large" - InstanceTypeR5adXlarge InstanceType = "r5ad.xlarge" - InstanceTypeR5ad2xlarge InstanceType = "r5ad.2xlarge" - InstanceTypeR5ad4xlarge InstanceType = "r5ad.4xlarge" - InstanceTypeR5ad8xlarge InstanceType = "r5ad.8xlarge" - InstanceTypeR5ad12xlarge InstanceType = "r5ad.12xlarge" - InstanceTypeR5ad16xlarge InstanceType = "r5ad.16xlarge" - InstanceTypeR5ad24xlarge InstanceType = "r5ad.24xlarge" - InstanceTypeR5bLarge InstanceType = "r5b.large" - InstanceTypeR5bXlarge InstanceType = "r5b.xlarge" - InstanceTypeR5b2xlarge InstanceType = "r5b.2xlarge" - InstanceTypeR5b4xlarge InstanceType = "r5b.4xlarge" - InstanceTypeR5b8xlarge InstanceType = "r5b.8xlarge" - InstanceTypeR5b12xlarge InstanceType = "r5b.12xlarge" - InstanceTypeR5b16xlarge InstanceType = "r5b.16xlarge" - InstanceTypeR5b24xlarge InstanceType = "r5b.24xlarge" - InstanceTypeR5bMetal InstanceType = "r5b.metal" - InstanceTypeR5dLarge InstanceType = "r5d.large" - InstanceTypeR5dXlarge InstanceType = "r5d.xlarge" - InstanceTypeR5d2xlarge InstanceType = "r5d.2xlarge" - InstanceTypeR5d4xlarge InstanceType = "r5d.4xlarge" - InstanceTypeR5d8xlarge InstanceType = "r5d.8xlarge" - InstanceTypeR5d12xlarge InstanceType = "r5d.12xlarge" - InstanceTypeR5d16xlarge InstanceType = "r5d.16xlarge" - InstanceTypeR5d24xlarge InstanceType = "r5d.24xlarge" - InstanceTypeR5dMetal InstanceType = "r5d.metal" - InstanceTypeR5dnLarge InstanceType = "r5dn.large" - InstanceTypeR5dnXlarge InstanceType = "r5dn.xlarge" - InstanceTypeR5dn2xlarge InstanceType = "r5dn.2xlarge" - InstanceTypeR5dn4xlarge InstanceType = "r5dn.4xlarge" - InstanceTypeR5dn8xlarge InstanceType = "r5dn.8xlarge" - InstanceTypeR5dn12xlarge InstanceType = "r5dn.12xlarge" - InstanceTypeR5dn16xlarge InstanceType = "r5dn.16xlarge" - InstanceTypeR5dn24xlarge InstanceType = "r5dn.24xlarge" - InstanceTypeR5dnMetal InstanceType = "r5dn.metal" - InstanceTypeR5nLarge InstanceType = "r5n.large" - InstanceTypeR5nXlarge InstanceType = "r5n.xlarge" - InstanceTypeR5n2xlarge InstanceType = "r5n.2xlarge" - InstanceTypeR5n4xlarge InstanceType = "r5n.4xlarge" - InstanceTypeR5n8xlarge InstanceType = "r5n.8xlarge" - InstanceTypeR5n12xlarge InstanceType = "r5n.12xlarge" - InstanceTypeR5n16xlarge InstanceType = "r5n.16xlarge" - InstanceTypeR5n24xlarge InstanceType = "r5n.24xlarge" - InstanceTypeR5nMetal InstanceType = "r5n.metal" - InstanceTypeR6gMedium InstanceType = "r6g.medium" - InstanceTypeR6gLarge InstanceType = "r6g.large" - InstanceTypeR6gXlarge InstanceType = "r6g.xlarge" - InstanceTypeR6g2xlarge InstanceType = "r6g.2xlarge" - InstanceTypeR6g4xlarge InstanceType = "r6g.4xlarge" - InstanceTypeR6g8xlarge InstanceType = "r6g.8xlarge" - InstanceTypeR6g12xlarge InstanceType = "r6g.12xlarge" - InstanceTypeR6g16xlarge InstanceType = "r6g.16xlarge" - InstanceTypeR6gMetal InstanceType = "r6g.metal" - InstanceTypeR6gdMedium InstanceType = "r6gd.medium" - InstanceTypeR6gdLarge InstanceType = "r6gd.large" - InstanceTypeR6gdXlarge InstanceType = "r6gd.xlarge" - InstanceTypeR6gd2xlarge InstanceType = "r6gd.2xlarge" - InstanceTypeR6gd4xlarge InstanceType = "r6gd.4xlarge" - InstanceTypeR6gd8xlarge InstanceType = "r6gd.8xlarge" - InstanceTypeR6gd12xlarge InstanceType = "r6gd.12xlarge" - InstanceTypeR6gd16xlarge InstanceType = "r6gd.16xlarge" - InstanceTypeR6gdMetal InstanceType = "r6gd.metal" - InstanceTypeR6iLarge InstanceType = "r6i.large" - InstanceTypeR6iXlarge InstanceType = "r6i.xlarge" - InstanceTypeR6i2xlarge InstanceType = "r6i.2xlarge" - InstanceTypeR6i4xlarge InstanceType = "r6i.4xlarge" - InstanceTypeR6i8xlarge InstanceType = "r6i.8xlarge" - InstanceTypeR6i12xlarge InstanceType = "r6i.12xlarge" - InstanceTypeR6i16xlarge InstanceType = "r6i.16xlarge" - InstanceTypeR6i24xlarge InstanceType = "r6i.24xlarge" - InstanceTypeR6i32xlarge InstanceType = "r6i.32xlarge" - InstanceTypeR6iMetal InstanceType = "r6i.metal" - InstanceTypeT1Micro InstanceType = "t1.micro" - InstanceTypeT2Nano InstanceType = "t2.nano" - InstanceTypeT2Micro InstanceType = "t2.micro" - InstanceTypeT2Small InstanceType = "t2.small" - InstanceTypeT2Medium InstanceType = "t2.medium" - InstanceTypeT2Large InstanceType = "t2.large" - InstanceTypeT2Xlarge InstanceType = "t2.xlarge" - InstanceTypeT22xlarge InstanceType = "t2.2xlarge" - InstanceTypeT3Nano InstanceType = "t3.nano" - InstanceTypeT3Micro InstanceType = "t3.micro" - InstanceTypeT3Small InstanceType = "t3.small" - InstanceTypeT3Medium InstanceType = "t3.medium" - InstanceTypeT3Large InstanceType = "t3.large" - InstanceTypeT3Xlarge InstanceType = "t3.xlarge" - InstanceTypeT32xlarge InstanceType = "t3.2xlarge" - InstanceTypeT3aNano InstanceType = "t3a.nano" - InstanceTypeT3aMicro InstanceType = "t3a.micro" - InstanceTypeT3aSmall InstanceType = "t3a.small" - InstanceTypeT3aMedium InstanceType = "t3a.medium" - InstanceTypeT3aLarge InstanceType = "t3a.large" - InstanceTypeT3aXlarge InstanceType = "t3a.xlarge" - InstanceTypeT3a2xlarge InstanceType = "t3a.2xlarge" - InstanceTypeT4gNano InstanceType = "t4g.nano" - InstanceTypeT4gMicro InstanceType = "t4g.micro" - InstanceTypeT4gSmall InstanceType = "t4g.small" - InstanceTypeT4gMedium InstanceType = "t4g.medium" - InstanceTypeT4gLarge InstanceType = "t4g.large" - InstanceTypeT4gXlarge InstanceType = "t4g.xlarge" - InstanceTypeT4g2xlarge InstanceType = "t4g.2xlarge" - InstanceTypeU6tb156xlarge InstanceType = "u-6tb1.56xlarge" - InstanceTypeU6tb1112xlarge InstanceType = "u-6tb1.112xlarge" - InstanceTypeU9tb1112xlarge InstanceType = "u-9tb1.112xlarge" - InstanceTypeU12tb1112xlarge InstanceType = "u-12tb1.112xlarge" - InstanceTypeU6tb1Metal InstanceType = "u-6tb1.metal" - InstanceTypeU9tb1Metal InstanceType = "u-9tb1.metal" - InstanceTypeU12tb1Metal InstanceType = "u-12tb1.metal" - InstanceTypeU18tb1Metal InstanceType = "u-18tb1.metal" - InstanceTypeU24tb1Metal InstanceType = "u-24tb1.metal" - InstanceTypeVt13xlarge InstanceType = "vt1.3xlarge" - InstanceTypeVt16xlarge InstanceType = "vt1.6xlarge" - InstanceTypeVt124xlarge InstanceType = "vt1.24xlarge" - InstanceTypeX116xlarge InstanceType = "x1.16xlarge" - InstanceTypeX132xlarge InstanceType = "x1.32xlarge" - InstanceTypeX1eXlarge InstanceType = "x1e.xlarge" - InstanceTypeX1e2xlarge InstanceType = "x1e.2xlarge" - InstanceTypeX1e4xlarge InstanceType = "x1e.4xlarge" - InstanceTypeX1e8xlarge InstanceType = "x1e.8xlarge" - InstanceTypeX1e16xlarge InstanceType = "x1e.16xlarge" - InstanceTypeX1e32xlarge InstanceType = "x1e.32xlarge" - InstanceTypeX2iezn2xlarge InstanceType = "x2iezn.2xlarge" - InstanceTypeX2iezn4xlarge InstanceType = "x2iezn.4xlarge" - InstanceTypeX2iezn6xlarge InstanceType = "x2iezn.6xlarge" - InstanceTypeX2iezn8xlarge InstanceType = "x2iezn.8xlarge" - InstanceTypeX2iezn12xlarge InstanceType = "x2iezn.12xlarge" - InstanceTypeX2ieznMetal InstanceType = "x2iezn.metal" - InstanceTypeX2gdMedium InstanceType = "x2gd.medium" - InstanceTypeX2gdLarge InstanceType = "x2gd.large" - InstanceTypeX2gdXlarge InstanceType = "x2gd.xlarge" - InstanceTypeX2gd2xlarge InstanceType = "x2gd.2xlarge" - InstanceTypeX2gd4xlarge InstanceType = "x2gd.4xlarge" - InstanceTypeX2gd8xlarge InstanceType = "x2gd.8xlarge" - InstanceTypeX2gd12xlarge InstanceType = "x2gd.12xlarge" - InstanceTypeX2gd16xlarge InstanceType = "x2gd.16xlarge" - InstanceTypeX2gdMetal InstanceType = "x2gd.metal" - InstanceTypeZ1dLarge InstanceType = "z1d.large" - InstanceTypeZ1dXlarge InstanceType = "z1d.xlarge" - InstanceTypeZ1d2xlarge InstanceType = "z1d.2xlarge" - InstanceTypeZ1d3xlarge InstanceType = "z1d.3xlarge" - InstanceTypeZ1d6xlarge InstanceType = "z1d.6xlarge" - InstanceTypeZ1d12xlarge InstanceType = "z1d.12xlarge" - InstanceTypeZ1dMetal InstanceType = "z1d.metal" - InstanceTypeX2idn16xlarge InstanceType = "x2idn.16xlarge" - InstanceTypeX2idn24xlarge InstanceType = "x2idn.24xlarge" - InstanceTypeX2idn32xlarge InstanceType = "x2idn.32xlarge" - InstanceTypeX2iednXlarge InstanceType = "x2iedn.xlarge" - InstanceTypeX2iedn2xlarge InstanceType = "x2iedn.2xlarge" - InstanceTypeX2iedn4xlarge InstanceType = "x2iedn.4xlarge" - InstanceTypeX2iedn8xlarge InstanceType = "x2iedn.8xlarge" - InstanceTypeX2iedn16xlarge InstanceType = "x2iedn.16xlarge" - InstanceTypeX2iedn24xlarge InstanceType = "x2iedn.24xlarge" - InstanceTypeX2iedn32xlarge InstanceType = "x2iedn.32xlarge" - InstanceTypeC6aLarge InstanceType = "c6a.large" - InstanceTypeC6aXlarge InstanceType = "c6a.xlarge" - InstanceTypeC6a2xlarge InstanceType = "c6a.2xlarge" - InstanceTypeC6a4xlarge InstanceType = "c6a.4xlarge" - InstanceTypeC6a8xlarge InstanceType = "c6a.8xlarge" - InstanceTypeC6a12xlarge InstanceType = "c6a.12xlarge" - InstanceTypeC6a16xlarge InstanceType = "c6a.16xlarge" - InstanceTypeC6a24xlarge InstanceType = "c6a.24xlarge" - InstanceTypeC6a32xlarge InstanceType = "c6a.32xlarge" - InstanceTypeC6a48xlarge InstanceType = "c6a.48xlarge" - InstanceTypeC6aMetal InstanceType = "c6a.metal" - InstanceTypeM6aMetal InstanceType = "m6a.metal" - InstanceTypeI4iLarge InstanceType = "i4i.large" - InstanceTypeI4iXlarge InstanceType = "i4i.xlarge" - InstanceTypeI4i2xlarge InstanceType = "i4i.2xlarge" - InstanceTypeI4i4xlarge InstanceType = "i4i.4xlarge" - InstanceTypeI4i8xlarge InstanceType = "i4i.8xlarge" - InstanceTypeI4i16xlarge InstanceType = "i4i.16xlarge" - InstanceTypeI4i32xlarge InstanceType = "i4i.32xlarge" - InstanceTypeI4iMetal InstanceType = "i4i.metal" - InstanceTypeX2idnMetal InstanceType = "x2idn.metal" - InstanceTypeX2iednMetal InstanceType = "x2iedn.metal" - InstanceTypeC7gMedium InstanceType = "c7g.medium" - InstanceTypeC7gLarge InstanceType = "c7g.large" - InstanceTypeC7gXlarge InstanceType = "c7g.xlarge" - InstanceTypeC7g2xlarge InstanceType = "c7g.2xlarge" - InstanceTypeC7g4xlarge InstanceType = "c7g.4xlarge" - InstanceTypeC7g8xlarge InstanceType = "c7g.8xlarge" - InstanceTypeC7g12xlarge InstanceType = "c7g.12xlarge" - InstanceTypeC7g16xlarge InstanceType = "c7g.16xlarge" - InstanceTypeMac2Metal InstanceType = "mac2.metal" - InstanceTypeC6idLarge InstanceType = "c6id.large" - InstanceTypeC6idXlarge InstanceType = "c6id.xlarge" - InstanceTypeC6id2xlarge InstanceType = "c6id.2xlarge" - InstanceTypeC6id4xlarge InstanceType = "c6id.4xlarge" - InstanceTypeC6id8xlarge InstanceType = "c6id.8xlarge" - InstanceTypeC6id12xlarge InstanceType = "c6id.12xlarge" - InstanceTypeC6id16xlarge InstanceType = "c6id.16xlarge" - InstanceTypeC6id24xlarge InstanceType = "c6id.24xlarge" - InstanceTypeC6id32xlarge InstanceType = "c6id.32xlarge" - InstanceTypeC6idMetal InstanceType = "c6id.metal" - InstanceTypeM6idLarge InstanceType = "m6id.large" - InstanceTypeM6idXlarge InstanceType = "m6id.xlarge" - InstanceTypeM6id2xlarge InstanceType = "m6id.2xlarge" - InstanceTypeM6id4xlarge InstanceType = "m6id.4xlarge" - InstanceTypeM6id8xlarge InstanceType = "m6id.8xlarge" - InstanceTypeM6id12xlarge InstanceType = "m6id.12xlarge" - InstanceTypeM6id16xlarge InstanceType = "m6id.16xlarge" - InstanceTypeM6id24xlarge InstanceType = "m6id.24xlarge" - InstanceTypeM6id32xlarge InstanceType = "m6id.32xlarge" - InstanceTypeM6idMetal InstanceType = "m6id.metal" - InstanceTypeR6idLarge InstanceType = "r6id.large" - InstanceTypeR6idXlarge InstanceType = "r6id.xlarge" - InstanceTypeR6id2xlarge InstanceType = "r6id.2xlarge" - InstanceTypeR6id4xlarge InstanceType = "r6id.4xlarge" - InstanceTypeR6id8xlarge InstanceType = "r6id.8xlarge" - InstanceTypeR6id12xlarge InstanceType = "r6id.12xlarge" - InstanceTypeR6id16xlarge InstanceType = "r6id.16xlarge" - InstanceTypeR6id24xlarge InstanceType = "r6id.24xlarge" - InstanceTypeR6id32xlarge InstanceType = "r6id.32xlarge" - InstanceTypeR6idMetal InstanceType = "r6id.metal" - InstanceTypeR6aLarge InstanceType = "r6a.large" - InstanceTypeR6aXlarge InstanceType = "r6a.xlarge" - InstanceTypeR6a2xlarge InstanceType = "r6a.2xlarge" - InstanceTypeR6a4xlarge InstanceType = "r6a.4xlarge" - InstanceTypeR6a8xlarge InstanceType = "r6a.8xlarge" - InstanceTypeR6a12xlarge InstanceType = "r6a.12xlarge" - InstanceTypeR6a16xlarge InstanceType = "r6a.16xlarge" - InstanceTypeR6a24xlarge InstanceType = "r6a.24xlarge" - InstanceTypeR6a32xlarge InstanceType = "r6a.32xlarge" - InstanceTypeR6a48xlarge InstanceType = "r6a.48xlarge" - InstanceTypeR6aMetal InstanceType = "r6a.metal" - InstanceTypeP4de24xlarge InstanceType = "p4de.24xlarge" - InstanceTypeU3tb156xlarge InstanceType = "u-3tb1.56xlarge" - InstanceTypeU18tb1112xlarge InstanceType = "u-18tb1.112xlarge" - InstanceTypeU24tb1112xlarge InstanceType = "u-24tb1.112xlarge" - InstanceTypeTrn12xlarge InstanceType = "trn1.2xlarge" - InstanceTypeTrn132xlarge InstanceType = "trn1.32xlarge" - InstanceTypeHpc6id32xlarge InstanceType = "hpc6id.32xlarge" - InstanceTypeC6inLarge InstanceType = "c6in.large" - InstanceTypeC6inXlarge InstanceType = "c6in.xlarge" - InstanceTypeC6in2xlarge InstanceType = "c6in.2xlarge" - InstanceTypeC6in4xlarge InstanceType = "c6in.4xlarge" - InstanceTypeC6in8xlarge InstanceType = "c6in.8xlarge" - InstanceTypeC6in12xlarge InstanceType = "c6in.12xlarge" - InstanceTypeC6in16xlarge InstanceType = "c6in.16xlarge" - InstanceTypeC6in24xlarge InstanceType = "c6in.24xlarge" - InstanceTypeC6in32xlarge InstanceType = "c6in.32xlarge" - InstanceTypeM6inLarge InstanceType = "m6in.large" - InstanceTypeM6inXlarge InstanceType = "m6in.xlarge" - InstanceTypeM6in2xlarge InstanceType = "m6in.2xlarge" - InstanceTypeM6in4xlarge InstanceType = "m6in.4xlarge" - InstanceTypeM6in8xlarge InstanceType = "m6in.8xlarge" - InstanceTypeM6in12xlarge InstanceType = "m6in.12xlarge" - InstanceTypeM6in16xlarge InstanceType = "m6in.16xlarge" - InstanceTypeM6in24xlarge InstanceType = "m6in.24xlarge" - InstanceTypeM6in32xlarge InstanceType = "m6in.32xlarge" - InstanceTypeM6idnLarge InstanceType = "m6idn.large" - InstanceTypeM6idnXlarge InstanceType = "m6idn.xlarge" - InstanceTypeM6idn2xlarge InstanceType = "m6idn.2xlarge" - InstanceTypeM6idn4xlarge InstanceType = "m6idn.4xlarge" - InstanceTypeM6idn8xlarge InstanceType = "m6idn.8xlarge" - InstanceTypeM6idn12xlarge InstanceType = "m6idn.12xlarge" - InstanceTypeM6idn16xlarge InstanceType = "m6idn.16xlarge" - InstanceTypeM6idn24xlarge InstanceType = "m6idn.24xlarge" - InstanceTypeM6idn32xlarge InstanceType = "m6idn.32xlarge" - InstanceTypeR6inLarge InstanceType = "r6in.large" - InstanceTypeR6inXlarge InstanceType = "r6in.xlarge" - InstanceTypeR6in2xlarge InstanceType = "r6in.2xlarge" - InstanceTypeR6in4xlarge InstanceType = "r6in.4xlarge" - InstanceTypeR6in8xlarge InstanceType = "r6in.8xlarge" - InstanceTypeR6in12xlarge InstanceType = "r6in.12xlarge" - InstanceTypeR6in16xlarge InstanceType = "r6in.16xlarge" - InstanceTypeR6in24xlarge InstanceType = "r6in.24xlarge" - InstanceTypeR6in32xlarge InstanceType = "r6in.32xlarge" - InstanceTypeR6idnLarge InstanceType = "r6idn.large" - InstanceTypeR6idnXlarge InstanceType = "r6idn.xlarge" - InstanceTypeR6idn2xlarge InstanceType = "r6idn.2xlarge" - InstanceTypeR6idn4xlarge InstanceType = "r6idn.4xlarge" - InstanceTypeR6idn8xlarge InstanceType = "r6idn.8xlarge" - InstanceTypeR6idn12xlarge InstanceType = "r6idn.12xlarge" - InstanceTypeR6idn16xlarge InstanceType = "r6idn.16xlarge" - InstanceTypeR6idn24xlarge InstanceType = "r6idn.24xlarge" - InstanceTypeR6idn32xlarge InstanceType = "r6idn.32xlarge" - InstanceTypeC7gMetal InstanceType = "c7g.metal" - InstanceTypeM7gMedium InstanceType = "m7g.medium" - InstanceTypeM7gLarge InstanceType = "m7g.large" - InstanceTypeM7gXlarge InstanceType = "m7g.xlarge" - InstanceTypeM7g2xlarge InstanceType = "m7g.2xlarge" - InstanceTypeM7g4xlarge InstanceType = "m7g.4xlarge" - InstanceTypeM7g8xlarge InstanceType = "m7g.8xlarge" - InstanceTypeM7g12xlarge InstanceType = "m7g.12xlarge" - InstanceTypeM7g16xlarge InstanceType = "m7g.16xlarge" - InstanceTypeM7gMetal InstanceType = "m7g.metal" - InstanceTypeR7gMedium InstanceType = "r7g.medium" - InstanceTypeR7gLarge InstanceType = "r7g.large" - InstanceTypeR7gXlarge InstanceType = "r7g.xlarge" - InstanceTypeR7g2xlarge InstanceType = "r7g.2xlarge" - InstanceTypeR7g4xlarge InstanceType = "r7g.4xlarge" - InstanceTypeR7g8xlarge InstanceType = "r7g.8xlarge" - InstanceTypeR7g12xlarge InstanceType = "r7g.12xlarge" - InstanceTypeR7g16xlarge InstanceType = "r7g.16xlarge" - InstanceTypeR7gMetal InstanceType = "r7g.metal" - InstanceTypeC6inMetal InstanceType = "c6in.metal" - InstanceTypeM6inMetal InstanceType = "m6in.metal" - InstanceTypeM6idnMetal InstanceType = "m6idn.metal" - InstanceTypeR6inMetal InstanceType = "r6in.metal" - InstanceTypeR6idnMetal InstanceType = "r6idn.metal" - InstanceTypeInf2Xlarge InstanceType = "inf2.xlarge" - InstanceTypeInf28xlarge InstanceType = "inf2.8xlarge" - InstanceTypeInf224xlarge InstanceType = "inf2.24xlarge" - InstanceTypeInf248xlarge InstanceType = "inf2.48xlarge" - InstanceTypeTrn1n32xlarge InstanceType = "trn1n.32xlarge" - InstanceTypeI4gLarge InstanceType = "i4g.large" - InstanceTypeI4gXlarge InstanceType = "i4g.xlarge" - InstanceTypeI4g2xlarge InstanceType = "i4g.2xlarge" - InstanceTypeI4g4xlarge InstanceType = "i4g.4xlarge" - InstanceTypeI4g8xlarge InstanceType = "i4g.8xlarge" - InstanceTypeI4g16xlarge InstanceType = "i4g.16xlarge" - InstanceTypeHpc7g4xlarge InstanceType = "hpc7g.4xlarge" - InstanceTypeHpc7g8xlarge InstanceType = "hpc7g.8xlarge" - InstanceTypeHpc7g16xlarge InstanceType = "hpc7g.16xlarge" - InstanceTypeC7gnMedium InstanceType = "c7gn.medium" - InstanceTypeC7gnLarge InstanceType = "c7gn.large" - InstanceTypeC7gnXlarge InstanceType = "c7gn.xlarge" - InstanceTypeC7gn2xlarge InstanceType = "c7gn.2xlarge" - InstanceTypeC7gn4xlarge InstanceType = "c7gn.4xlarge" - InstanceTypeC7gn8xlarge InstanceType = "c7gn.8xlarge" - InstanceTypeC7gn12xlarge InstanceType = "c7gn.12xlarge" - InstanceTypeC7gn16xlarge InstanceType = "c7gn.16xlarge" - InstanceTypeP548xlarge InstanceType = "p5.48xlarge" - InstanceTypeM7iLarge InstanceType = "m7i.large" - InstanceTypeM7iXlarge InstanceType = "m7i.xlarge" - InstanceTypeM7i2xlarge InstanceType = "m7i.2xlarge" - InstanceTypeM7i4xlarge InstanceType = "m7i.4xlarge" - InstanceTypeM7i8xlarge InstanceType = "m7i.8xlarge" - InstanceTypeM7i12xlarge InstanceType = "m7i.12xlarge" - InstanceTypeM7i16xlarge InstanceType = "m7i.16xlarge" - InstanceTypeM7i24xlarge InstanceType = "m7i.24xlarge" - InstanceTypeM7i48xlarge InstanceType = "m7i.48xlarge" - InstanceTypeM7iFlexLarge InstanceType = "m7i-flex.large" - InstanceTypeM7iFlexXlarge InstanceType = "m7i-flex.xlarge" - InstanceTypeM7iFlex2xlarge InstanceType = "m7i-flex.2xlarge" - InstanceTypeM7iFlex4xlarge InstanceType = "m7i-flex.4xlarge" - InstanceTypeM7iFlex8xlarge InstanceType = "m7i-flex.8xlarge" - InstanceTypeM7aMedium InstanceType = "m7a.medium" - InstanceTypeM7aLarge InstanceType = "m7a.large" - InstanceTypeM7aXlarge InstanceType = "m7a.xlarge" - InstanceTypeM7a2xlarge InstanceType = "m7a.2xlarge" - InstanceTypeM7a4xlarge InstanceType = "m7a.4xlarge" - InstanceTypeM7a8xlarge InstanceType = "m7a.8xlarge" - InstanceTypeM7a12xlarge InstanceType = "m7a.12xlarge" - InstanceTypeM7a16xlarge InstanceType = "m7a.16xlarge" - InstanceTypeM7a24xlarge InstanceType = "m7a.24xlarge" - InstanceTypeM7a32xlarge InstanceType = "m7a.32xlarge" - InstanceTypeM7a48xlarge InstanceType = "m7a.48xlarge" - InstanceTypeM7aMetal48xl InstanceType = "m7a.metal-48xl" - InstanceTypeHpc7a12xlarge InstanceType = "hpc7a.12xlarge" - InstanceTypeHpc7a24xlarge InstanceType = "hpc7a.24xlarge" - InstanceTypeHpc7a48xlarge InstanceType = "hpc7a.48xlarge" - InstanceTypeHpc7a96xlarge InstanceType = "hpc7a.96xlarge" - InstanceTypeC7gdMedium InstanceType = "c7gd.medium" - InstanceTypeC7gdLarge InstanceType = "c7gd.large" - InstanceTypeC7gdXlarge InstanceType = "c7gd.xlarge" - InstanceTypeC7gd2xlarge InstanceType = "c7gd.2xlarge" - InstanceTypeC7gd4xlarge InstanceType = "c7gd.4xlarge" - InstanceTypeC7gd8xlarge InstanceType = "c7gd.8xlarge" - InstanceTypeC7gd12xlarge InstanceType = "c7gd.12xlarge" - InstanceTypeC7gd16xlarge InstanceType = "c7gd.16xlarge" - InstanceTypeM7gdMedium InstanceType = "m7gd.medium" - InstanceTypeM7gdLarge InstanceType = "m7gd.large" - InstanceTypeM7gdXlarge InstanceType = "m7gd.xlarge" - InstanceTypeM7gd2xlarge InstanceType = "m7gd.2xlarge" - InstanceTypeM7gd4xlarge InstanceType = "m7gd.4xlarge" - InstanceTypeM7gd8xlarge InstanceType = "m7gd.8xlarge" - InstanceTypeM7gd12xlarge InstanceType = "m7gd.12xlarge" - InstanceTypeM7gd16xlarge InstanceType = "m7gd.16xlarge" - InstanceTypeR7gdMedium InstanceType = "r7gd.medium" - InstanceTypeR7gdLarge InstanceType = "r7gd.large" - InstanceTypeR7gdXlarge InstanceType = "r7gd.xlarge" - InstanceTypeR7gd2xlarge InstanceType = "r7gd.2xlarge" - InstanceTypeR7gd4xlarge InstanceType = "r7gd.4xlarge" - InstanceTypeR7gd8xlarge InstanceType = "r7gd.8xlarge" - InstanceTypeR7gd12xlarge InstanceType = "r7gd.12xlarge" - InstanceTypeR7gd16xlarge InstanceType = "r7gd.16xlarge" - InstanceTypeR7aMedium InstanceType = "r7a.medium" - InstanceTypeR7aLarge InstanceType = "r7a.large" - InstanceTypeR7aXlarge InstanceType = "r7a.xlarge" - InstanceTypeR7a2xlarge InstanceType = "r7a.2xlarge" - InstanceTypeR7a4xlarge InstanceType = "r7a.4xlarge" - InstanceTypeR7a8xlarge InstanceType = "r7a.8xlarge" - InstanceTypeR7a12xlarge InstanceType = "r7a.12xlarge" - InstanceTypeR7a16xlarge InstanceType = "r7a.16xlarge" - InstanceTypeR7a24xlarge InstanceType = "r7a.24xlarge" - InstanceTypeR7a32xlarge InstanceType = "r7a.32xlarge" - InstanceTypeR7a48xlarge InstanceType = "r7a.48xlarge" - InstanceTypeC7iLarge InstanceType = "c7i.large" - InstanceTypeC7iXlarge InstanceType = "c7i.xlarge" - InstanceTypeC7i2xlarge InstanceType = "c7i.2xlarge" - InstanceTypeC7i4xlarge InstanceType = "c7i.4xlarge" - InstanceTypeC7i8xlarge InstanceType = "c7i.8xlarge" - InstanceTypeC7i12xlarge InstanceType = "c7i.12xlarge" - InstanceTypeC7i16xlarge InstanceType = "c7i.16xlarge" - InstanceTypeC7i24xlarge InstanceType = "c7i.24xlarge" - InstanceTypeC7i48xlarge InstanceType = "c7i.48xlarge" - InstanceTypeMac2M2proMetal InstanceType = "mac2-m2pro.metal" - InstanceTypeR7izLarge InstanceType = "r7iz.large" - InstanceTypeR7izXlarge InstanceType = "r7iz.xlarge" - InstanceTypeR7iz2xlarge InstanceType = "r7iz.2xlarge" - InstanceTypeR7iz4xlarge InstanceType = "r7iz.4xlarge" - InstanceTypeR7iz8xlarge InstanceType = "r7iz.8xlarge" - InstanceTypeR7iz12xlarge InstanceType = "r7iz.12xlarge" - InstanceTypeR7iz16xlarge InstanceType = "r7iz.16xlarge" - InstanceTypeR7iz32xlarge InstanceType = "r7iz.32xlarge" - InstanceTypeC7aMedium InstanceType = "c7a.medium" - InstanceTypeC7aLarge InstanceType = "c7a.large" - InstanceTypeC7aXlarge InstanceType = "c7a.xlarge" - InstanceTypeC7a2xlarge InstanceType = "c7a.2xlarge" - InstanceTypeC7a4xlarge InstanceType = "c7a.4xlarge" - InstanceTypeC7a8xlarge InstanceType = "c7a.8xlarge" - InstanceTypeC7a12xlarge InstanceType = "c7a.12xlarge" - InstanceTypeC7a16xlarge InstanceType = "c7a.16xlarge" - InstanceTypeC7a24xlarge InstanceType = "c7a.24xlarge" - InstanceTypeC7a32xlarge InstanceType = "c7a.32xlarge" - InstanceTypeC7a48xlarge InstanceType = "c7a.48xlarge" - InstanceTypeC7aMetal48xl InstanceType = "c7a.metal-48xl" - InstanceTypeR7aMetal48xl InstanceType = "r7a.metal-48xl" - InstanceTypeR7iLarge InstanceType = "r7i.large" - InstanceTypeR7iXlarge InstanceType = "r7i.xlarge" - InstanceTypeR7i2xlarge InstanceType = "r7i.2xlarge" - InstanceTypeR7i4xlarge InstanceType = "r7i.4xlarge" - InstanceTypeR7i8xlarge InstanceType = "r7i.8xlarge" - InstanceTypeR7i12xlarge InstanceType = "r7i.12xlarge" - InstanceTypeR7i16xlarge InstanceType = "r7i.16xlarge" - InstanceTypeR7i24xlarge InstanceType = "r7i.24xlarge" - InstanceTypeR7i48xlarge InstanceType = "r7i.48xlarge" - InstanceTypeDl2q24xlarge InstanceType = "dl2q.24xlarge" - InstanceTypeMac2M2Metal InstanceType = "mac2-m2.metal" - InstanceTypeI4i12xlarge InstanceType = "i4i.12xlarge" - InstanceTypeI4i24xlarge InstanceType = "i4i.24xlarge" - InstanceTypeC7iMetal24xl InstanceType = "c7i.metal-24xl" - InstanceTypeC7iMetal48xl InstanceType = "c7i.metal-48xl" - InstanceTypeM7iMetal24xl InstanceType = "m7i.metal-24xl" - InstanceTypeM7iMetal48xl InstanceType = "m7i.metal-48xl" - InstanceTypeR7iMetal24xl InstanceType = "r7i.metal-24xl" - InstanceTypeR7iMetal48xl InstanceType = "r7i.metal-48xl" - InstanceTypeR7izMetal16xl InstanceType = "r7iz.metal-16xl" - InstanceTypeR7izMetal32xl InstanceType = "r7iz.metal-32xl" - InstanceTypeC7gdMetal InstanceType = "c7gd.metal" - InstanceTypeM7gdMetal InstanceType = "m7gd.metal" - InstanceTypeR7gdMetal InstanceType = "r7gd.metal" - InstanceTypeG6Xlarge InstanceType = "g6.xlarge" - InstanceTypeG62xlarge InstanceType = "g6.2xlarge" - InstanceTypeG64xlarge InstanceType = "g6.4xlarge" - InstanceTypeG68xlarge InstanceType = "g6.8xlarge" - InstanceTypeG612xlarge InstanceType = "g6.12xlarge" - InstanceTypeG616xlarge InstanceType = "g6.16xlarge" - InstanceTypeG624xlarge InstanceType = "g6.24xlarge" - InstanceTypeG648xlarge InstanceType = "g6.48xlarge" - InstanceTypeGr64xlarge InstanceType = "gr6.4xlarge" - InstanceTypeGr68xlarge InstanceType = "gr6.8xlarge" + InstanceTypeA1Medium InstanceType = "a1.medium" + InstanceTypeA1Large InstanceType = "a1.large" + InstanceTypeA1Xlarge InstanceType = "a1.xlarge" + InstanceTypeA12xlarge InstanceType = "a1.2xlarge" + InstanceTypeA14xlarge InstanceType = "a1.4xlarge" + InstanceTypeA1Metal InstanceType = "a1.metal" + InstanceTypeC1Medium InstanceType = "c1.medium" + InstanceTypeC1Xlarge InstanceType = "c1.xlarge" + InstanceTypeC3Large InstanceType = "c3.large" + InstanceTypeC3Xlarge InstanceType = "c3.xlarge" + InstanceTypeC32xlarge InstanceType = "c3.2xlarge" + InstanceTypeC34xlarge InstanceType = "c3.4xlarge" + InstanceTypeC38xlarge InstanceType = "c3.8xlarge" + InstanceTypeC4Large InstanceType = "c4.large" + InstanceTypeC4Xlarge InstanceType = "c4.xlarge" + InstanceTypeC42xlarge InstanceType = "c4.2xlarge" + InstanceTypeC44xlarge InstanceType = "c4.4xlarge" + InstanceTypeC48xlarge InstanceType = "c4.8xlarge" + InstanceTypeC5Large InstanceType = "c5.large" + InstanceTypeC5Xlarge InstanceType = "c5.xlarge" + InstanceTypeC52xlarge InstanceType = "c5.2xlarge" + InstanceTypeC54xlarge InstanceType = "c5.4xlarge" + InstanceTypeC59xlarge InstanceType = "c5.9xlarge" + InstanceTypeC512xlarge InstanceType = "c5.12xlarge" + InstanceTypeC518xlarge InstanceType = "c5.18xlarge" + InstanceTypeC524xlarge InstanceType = "c5.24xlarge" + InstanceTypeC5Metal InstanceType = "c5.metal" + InstanceTypeC5aLarge InstanceType = "c5a.large" + InstanceTypeC5aXlarge InstanceType = "c5a.xlarge" + InstanceTypeC5a2xlarge InstanceType = "c5a.2xlarge" + InstanceTypeC5a4xlarge InstanceType = "c5a.4xlarge" + InstanceTypeC5a8xlarge InstanceType = "c5a.8xlarge" + InstanceTypeC5a12xlarge InstanceType = "c5a.12xlarge" + InstanceTypeC5a16xlarge InstanceType = "c5a.16xlarge" + InstanceTypeC5a24xlarge InstanceType = "c5a.24xlarge" + InstanceTypeC5adLarge InstanceType = "c5ad.large" + InstanceTypeC5adXlarge InstanceType = "c5ad.xlarge" + InstanceTypeC5ad2xlarge InstanceType = "c5ad.2xlarge" + InstanceTypeC5ad4xlarge InstanceType = "c5ad.4xlarge" + InstanceTypeC5ad8xlarge InstanceType = "c5ad.8xlarge" + InstanceTypeC5ad12xlarge InstanceType = "c5ad.12xlarge" + InstanceTypeC5ad16xlarge InstanceType = "c5ad.16xlarge" + InstanceTypeC5ad24xlarge InstanceType = "c5ad.24xlarge" + InstanceTypeC5dLarge InstanceType = "c5d.large" + InstanceTypeC5dXlarge InstanceType = "c5d.xlarge" + InstanceTypeC5d2xlarge InstanceType = "c5d.2xlarge" + InstanceTypeC5d4xlarge InstanceType = "c5d.4xlarge" + InstanceTypeC5d9xlarge InstanceType = "c5d.9xlarge" + InstanceTypeC5d12xlarge InstanceType = "c5d.12xlarge" + InstanceTypeC5d18xlarge InstanceType = "c5d.18xlarge" + InstanceTypeC5d24xlarge InstanceType = "c5d.24xlarge" + InstanceTypeC5dMetal InstanceType = "c5d.metal" + InstanceTypeC5nLarge InstanceType = "c5n.large" + InstanceTypeC5nXlarge InstanceType = "c5n.xlarge" + InstanceTypeC5n2xlarge InstanceType = "c5n.2xlarge" + InstanceTypeC5n4xlarge InstanceType = "c5n.4xlarge" + InstanceTypeC5n9xlarge InstanceType = "c5n.9xlarge" + InstanceTypeC5n18xlarge InstanceType = "c5n.18xlarge" + InstanceTypeC5nMetal InstanceType = "c5n.metal" + InstanceTypeC6gMedium InstanceType = "c6g.medium" + InstanceTypeC6gLarge InstanceType = "c6g.large" + InstanceTypeC6gXlarge InstanceType = "c6g.xlarge" + InstanceTypeC6g2xlarge InstanceType = "c6g.2xlarge" + InstanceTypeC6g4xlarge InstanceType = "c6g.4xlarge" + InstanceTypeC6g8xlarge InstanceType = "c6g.8xlarge" + InstanceTypeC6g12xlarge InstanceType = "c6g.12xlarge" + InstanceTypeC6g16xlarge InstanceType = "c6g.16xlarge" + InstanceTypeC6gMetal InstanceType = "c6g.metal" + InstanceTypeC6gdMedium InstanceType = "c6gd.medium" + InstanceTypeC6gdLarge InstanceType = "c6gd.large" + InstanceTypeC6gdXlarge InstanceType = "c6gd.xlarge" + InstanceTypeC6gd2xlarge InstanceType = "c6gd.2xlarge" + InstanceTypeC6gd4xlarge InstanceType = "c6gd.4xlarge" + InstanceTypeC6gd8xlarge InstanceType = "c6gd.8xlarge" + InstanceTypeC6gd12xlarge InstanceType = "c6gd.12xlarge" + InstanceTypeC6gd16xlarge InstanceType = "c6gd.16xlarge" + InstanceTypeC6gdMetal InstanceType = "c6gd.metal" + InstanceTypeC6gnMedium InstanceType = "c6gn.medium" + InstanceTypeC6gnLarge InstanceType = "c6gn.large" + InstanceTypeC6gnXlarge InstanceType = "c6gn.xlarge" + InstanceTypeC6gn2xlarge InstanceType = "c6gn.2xlarge" + InstanceTypeC6gn4xlarge InstanceType = "c6gn.4xlarge" + InstanceTypeC6gn8xlarge InstanceType = "c6gn.8xlarge" + InstanceTypeC6gn12xlarge InstanceType = "c6gn.12xlarge" + InstanceTypeC6gn16xlarge InstanceType = "c6gn.16xlarge" + InstanceTypeC6iLarge InstanceType = "c6i.large" + InstanceTypeC6iXlarge InstanceType = "c6i.xlarge" + InstanceTypeC6i2xlarge InstanceType = "c6i.2xlarge" + InstanceTypeC6i4xlarge InstanceType = "c6i.4xlarge" + InstanceTypeC6i8xlarge InstanceType = "c6i.8xlarge" + InstanceTypeC6i12xlarge InstanceType = "c6i.12xlarge" + InstanceTypeC6i16xlarge InstanceType = "c6i.16xlarge" + InstanceTypeC6i24xlarge InstanceType = "c6i.24xlarge" + InstanceTypeC6i32xlarge InstanceType = "c6i.32xlarge" + InstanceTypeC6iMetal InstanceType = "c6i.metal" + InstanceTypeCc14xlarge InstanceType = "cc1.4xlarge" + InstanceTypeCc28xlarge InstanceType = "cc2.8xlarge" + InstanceTypeCg14xlarge InstanceType = "cg1.4xlarge" + InstanceTypeCr18xlarge InstanceType = "cr1.8xlarge" + InstanceTypeD2Xlarge InstanceType = "d2.xlarge" + InstanceTypeD22xlarge InstanceType = "d2.2xlarge" + InstanceTypeD24xlarge InstanceType = "d2.4xlarge" + InstanceTypeD28xlarge InstanceType = "d2.8xlarge" + InstanceTypeD3Xlarge InstanceType = "d3.xlarge" + InstanceTypeD32xlarge InstanceType = "d3.2xlarge" + InstanceTypeD34xlarge InstanceType = "d3.4xlarge" + InstanceTypeD38xlarge InstanceType = "d3.8xlarge" + InstanceTypeD3enXlarge InstanceType = "d3en.xlarge" + InstanceTypeD3en2xlarge InstanceType = "d3en.2xlarge" + InstanceTypeD3en4xlarge InstanceType = "d3en.4xlarge" + InstanceTypeD3en6xlarge InstanceType = "d3en.6xlarge" + InstanceTypeD3en8xlarge InstanceType = "d3en.8xlarge" + InstanceTypeD3en12xlarge InstanceType = "d3en.12xlarge" + InstanceTypeDl124xlarge InstanceType = "dl1.24xlarge" + InstanceTypeF12xlarge InstanceType = "f1.2xlarge" + InstanceTypeF14xlarge InstanceType = "f1.4xlarge" + InstanceTypeF116xlarge InstanceType = "f1.16xlarge" + InstanceTypeG22xlarge InstanceType = "g2.2xlarge" + InstanceTypeG28xlarge InstanceType = "g2.8xlarge" + InstanceTypeG34xlarge InstanceType = "g3.4xlarge" + InstanceTypeG38xlarge InstanceType = "g3.8xlarge" + InstanceTypeG316xlarge InstanceType = "g3.16xlarge" + InstanceTypeG3sXlarge InstanceType = "g3s.xlarge" + InstanceTypeG4adXlarge InstanceType = "g4ad.xlarge" + InstanceTypeG4ad2xlarge InstanceType = "g4ad.2xlarge" + InstanceTypeG4ad4xlarge InstanceType = "g4ad.4xlarge" + InstanceTypeG4ad8xlarge InstanceType = "g4ad.8xlarge" + InstanceTypeG4ad16xlarge InstanceType = "g4ad.16xlarge" + InstanceTypeG4dnXlarge InstanceType = "g4dn.xlarge" + InstanceTypeG4dn2xlarge InstanceType = "g4dn.2xlarge" + InstanceTypeG4dn4xlarge InstanceType = "g4dn.4xlarge" + InstanceTypeG4dn8xlarge InstanceType = "g4dn.8xlarge" + InstanceTypeG4dn12xlarge InstanceType = "g4dn.12xlarge" + InstanceTypeG4dn16xlarge InstanceType = "g4dn.16xlarge" + InstanceTypeG4dnMetal InstanceType = "g4dn.metal" + InstanceTypeG5Xlarge InstanceType = "g5.xlarge" + InstanceTypeG52xlarge InstanceType = "g5.2xlarge" + InstanceTypeG54xlarge InstanceType = "g5.4xlarge" + InstanceTypeG58xlarge InstanceType = "g5.8xlarge" + InstanceTypeG512xlarge InstanceType = "g5.12xlarge" + InstanceTypeG516xlarge InstanceType = "g5.16xlarge" + InstanceTypeG524xlarge InstanceType = "g5.24xlarge" + InstanceTypeG548xlarge InstanceType = "g5.48xlarge" + InstanceTypeG5gXlarge InstanceType = "g5g.xlarge" + InstanceTypeG5g2xlarge InstanceType = "g5g.2xlarge" + InstanceTypeG5g4xlarge InstanceType = "g5g.4xlarge" + InstanceTypeG5g8xlarge InstanceType = "g5g.8xlarge" + InstanceTypeG5g16xlarge InstanceType = "g5g.16xlarge" + InstanceTypeG5gMetal InstanceType = "g5g.metal" + InstanceTypeHi14xlarge InstanceType = "hi1.4xlarge" + InstanceTypeHpc6a48xlarge InstanceType = "hpc6a.48xlarge" + InstanceTypeHs18xlarge InstanceType = "hs1.8xlarge" + InstanceTypeH12xlarge InstanceType = "h1.2xlarge" + InstanceTypeH14xlarge InstanceType = "h1.4xlarge" + InstanceTypeH18xlarge InstanceType = "h1.8xlarge" + InstanceTypeH116xlarge InstanceType = "h1.16xlarge" + InstanceTypeI2Xlarge InstanceType = "i2.xlarge" + InstanceTypeI22xlarge InstanceType = "i2.2xlarge" + InstanceTypeI24xlarge InstanceType = "i2.4xlarge" + InstanceTypeI28xlarge InstanceType = "i2.8xlarge" + InstanceTypeI3Large InstanceType = "i3.large" + InstanceTypeI3Xlarge InstanceType = "i3.xlarge" + InstanceTypeI32xlarge InstanceType = "i3.2xlarge" + InstanceTypeI34xlarge InstanceType = "i3.4xlarge" + InstanceTypeI38xlarge InstanceType = "i3.8xlarge" + InstanceTypeI316xlarge InstanceType = "i3.16xlarge" + InstanceTypeI3Metal InstanceType = "i3.metal" + InstanceTypeI3enLarge InstanceType = "i3en.large" + InstanceTypeI3enXlarge InstanceType = "i3en.xlarge" + InstanceTypeI3en2xlarge InstanceType = "i3en.2xlarge" + InstanceTypeI3en3xlarge InstanceType = "i3en.3xlarge" + InstanceTypeI3en6xlarge InstanceType = "i3en.6xlarge" + InstanceTypeI3en12xlarge InstanceType = "i3en.12xlarge" + InstanceTypeI3en24xlarge InstanceType = "i3en.24xlarge" + InstanceTypeI3enMetal InstanceType = "i3en.metal" + InstanceTypeIm4gnLarge InstanceType = "im4gn.large" + InstanceTypeIm4gnXlarge InstanceType = "im4gn.xlarge" + InstanceTypeIm4gn2xlarge InstanceType = "im4gn.2xlarge" + InstanceTypeIm4gn4xlarge InstanceType = "im4gn.4xlarge" + InstanceTypeIm4gn8xlarge InstanceType = "im4gn.8xlarge" + InstanceTypeIm4gn16xlarge InstanceType = "im4gn.16xlarge" + InstanceTypeInf1Xlarge InstanceType = "inf1.xlarge" + InstanceTypeInf12xlarge InstanceType = "inf1.2xlarge" + InstanceTypeInf16xlarge InstanceType = "inf1.6xlarge" + InstanceTypeInf124xlarge InstanceType = "inf1.24xlarge" + InstanceTypeIs4genMedium InstanceType = "is4gen.medium" + InstanceTypeIs4genLarge InstanceType = "is4gen.large" + InstanceTypeIs4genXlarge InstanceType = "is4gen.xlarge" + InstanceTypeIs4gen2xlarge InstanceType = "is4gen.2xlarge" + InstanceTypeIs4gen4xlarge InstanceType = "is4gen.4xlarge" + InstanceTypeIs4gen8xlarge InstanceType = "is4gen.8xlarge" + InstanceTypeM1Small InstanceType = "m1.small" + InstanceTypeM1Medium InstanceType = "m1.medium" + InstanceTypeM1Large InstanceType = "m1.large" + InstanceTypeM1Xlarge InstanceType = "m1.xlarge" + InstanceTypeM2Xlarge InstanceType = "m2.xlarge" + InstanceTypeM22xlarge InstanceType = "m2.2xlarge" + InstanceTypeM24xlarge InstanceType = "m2.4xlarge" + InstanceTypeM3Medium InstanceType = "m3.medium" + InstanceTypeM3Large InstanceType = "m3.large" + InstanceTypeM3Xlarge InstanceType = "m3.xlarge" + InstanceTypeM32xlarge InstanceType = "m3.2xlarge" + InstanceTypeM4Large InstanceType = "m4.large" + InstanceTypeM4Xlarge InstanceType = "m4.xlarge" + InstanceTypeM42xlarge InstanceType = "m4.2xlarge" + InstanceTypeM44xlarge InstanceType = "m4.4xlarge" + InstanceTypeM410xlarge InstanceType = "m4.10xlarge" + InstanceTypeM416xlarge InstanceType = "m4.16xlarge" + InstanceTypeM5Large InstanceType = "m5.large" + InstanceTypeM5Xlarge InstanceType = "m5.xlarge" + InstanceTypeM52xlarge InstanceType = "m5.2xlarge" + InstanceTypeM54xlarge InstanceType = "m5.4xlarge" + InstanceTypeM58xlarge InstanceType = "m5.8xlarge" + InstanceTypeM512xlarge InstanceType = "m5.12xlarge" + InstanceTypeM516xlarge InstanceType = "m5.16xlarge" + InstanceTypeM524xlarge InstanceType = "m5.24xlarge" + InstanceTypeM5Metal InstanceType = "m5.metal" + InstanceTypeM5aLarge InstanceType = "m5a.large" + InstanceTypeM5aXlarge InstanceType = "m5a.xlarge" + InstanceTypeM5a2xlarge InstanceType = "m5a.2xlarge" + InstanceTypeM5a4xlarge InstanceType = "m5a.4xlarge" + InstanceTypeM5a8xlarge InstanceType = "m5a.8xlarge" + InstanceTypeM5a12xlarge InstanceType = "m5a.12xlarge" + InstanceTypeM5a16xlarge InstanceType = "m5a.16xlarge" + InstanceTypeM5a24xlarge InstanceType = "m5a.24xlarge" + InstanceTypeM5adLarge InstanceType = "m5ad.large" + InstanceTypeM5adXlarge InstanceType = "m5ad.xlarge" + InstanceTypeM5ad2xlarge InstanceType = "m5ad.2xlarge" + InstanceTypeM5ad4xlarge InstanceType = "m5ad.4xlarge" + InstanceTypeM5ad8xlarge InstanceType = "m5ad.8xlarge" + InstanceTypeM5ad12xlarge InstanceType = "m5ad.12xlarge" + InstanceTypeM5ad16xlarge InstanceType = "m5ad.16xlarge" + InstanceTypeM5ad24xlarge InstanceType = "m5ad.24xlarge" + InstanceTypeM5dLarge InstanceType = "m5d.large" + InstanceTypeM5dXlarge InstanceType = "m5d.xlarge" + InstanceTypeM5d2xlarge InstanceType = "m5d.2xlarge" + InstanceTypeM5d4xlarge InstanceType = "m5d.4xlarge" + InstanceTypeM5d8xlarge InstanceType = "m5d.8xlarge" + InstanceTypeM5d12xlarge InstanceType = "m5d.12xlarge" + InstanceTypeM5d16xlarge InstanceType = "m5d.16xlarge" + InstanceTypeM5d24xlarge InstanceType = "m5d.24xlarge" + InstanceTypeM5dMetal InstanceType = "m5d.metal" + InstanceTypeM5dnLarge InstanceType = "m5dn.large" + InstanceTypeM5dnXlarge InstanceType = "m5dn.xlarge" + InstanceTypeM5dn2xlarge InstanceType = "m5dn.2xlarge" + InstanceTypeM5dn4xlarge InstanceType = "m5dn.4xlarge" + InstanceTypeM5dn8xlarge InstanceType = "m5dn.8xlarge" + InstanceTypeM5dn12xlarge InstanceType = "m5dn.12xlarge" + InstanceTypeM5dn16xlarge InstanceType = "m5dn.16xlarge" + InstanceTypeM5dn24xlarge InstanceType = "m5dn.24xlarge" + InstanceTypeM5dnMetal InstanceType = "m5dn.metal" + InstanceTypeM5nLarge InstanceType = "m5n.large" + InstanceTypeM5nXlarge InstanceType = "m5n.xlarge" + InstanceTypeM5n2xlarge InstanceType = "m5n.2xlarge" + InstanceTypeM5n4xlarge InstanceType = "m5n.4xlarge" + InstanceTypeM5n8xlarge InstanceType = "m5n.8xlarge" + InstanceTypeM5n12xlarge InstanceType = "m5n.12xlarge" + InstanceTypeM5n16xlarge InstanceType = "m5n.16xlarge" + InstanceTypeM5n24xlarge InstanceType = "m5n.24xlarge" + InstanceTypeM5nMetal InstanceType = "m5n.metal" + InstanceTypeM5znLarge InstanceType = "m5zn.large" + InstanceTypeM5znXlarge InstanceType = "m5zn.xlarge" + InstanceTypeM5zn2xlarge InstanceType = "m5zn.2xlarge" + InstanceTypeM5zn3xlarge InstanceType = "m5zn.3xlarge" + InstanceTypeM5zn6xlarge InstanceType = "m5zn.6xlarge" + InstanceTypeM5zn12xlarge InstanceType = "m5zn.12xlarge" + InstanceTypeM5znMetal InstanceType = "m5zn.metal" + InstanceTypeM6aLarge InstanceType = "m6a.large" + InstanceTypeM6aXlarge InstanceType = "m6a.xlarge" + InstanceTypeM6a2xlarge InstanceType = "m6a.2xlarge" + InstanceTypeM6a4xlarge InstanceType = "m6a.4xlarge" + InstanceTypeM6a8xlarge InstanceType = "m6a.8xlarge" + InstanceTypeM6a12xlarge InstanceType = "m6a.12xlarge" + InstanceTypeM6a16xlarge InstanceType = "m6a.16xlarge" + InstanceTypeM6a24xlarge InstanceType = "m6a.24xlarge" + InstanceTypeM6a32xlarge InstanceType = "m6a.32xlarge" + InstanceTypeM6a48xlarge InstanceType = "m6a.48xlarge" + InstanceTypeM6gMetal InstanceType = "m6g.metal" + InstanceTypeM6gMedium InstanceType = "m6g.medium" + InstanceTypeM6gLarge InstanceType = "m6g.large" + InstanceTypeM6gXlarge InstanceType = "m6g.xlarge" + InstanceTypeM6g2xlarge InstanceType = "m6g.2xlarge" + InstanceTypeM6g4xlarge InstanceType = "m6g.4xlarge" + InstanceTypeM6g8xlarge InstanceType = "m6g.8xlarge" + InstanceTypeM6g12xlarge InstanceType = "m6g.12xlarge" + InstanceTypeM6g16xlarge InstanceType = "m6g.16xlarge" + InstanceTypeM6gdMetal InstanceType = "m6gd.metal" + InstanceTypeM6gdMedium InstanceType = "m6gd.medium" + InstanceTypeM6gdLarge InstanceType = "m6gd.large" + InstanceTypeM6gdXlarge InstanceType = "m6gd.xlarge" + InstanceTypeM6gd2xlarge InstanceType = "m6gd.2xlarge" + InstanceTypeM6gd4xlarge InstanceType = "m6gd.4xlarge" + InstanceTypeM6gd8xlarge InstanceType = "m6gd.8xlarge" + InstanceTypeM6gd12xlarge InstanceType = "m6gd.12xlarge" + InstanceTypeM6gd16xlarge InstanceType = "m6gd.16xlarge" + InstanceTypeM6iLarge InstanceType = "m6i.large" + InstanceTypeM6iXlarge InstanceType = "m6i.xlarge" + InstanceTypeM6i2xlarge InstanceType = "m6i.2xlarge" + InstanceTypeM6i4xlarge InstanceType = "m6i.4xlarge" + InstanceTypeM6i8xlarge InstanceType = "m6i.8xlarge" + InstanceTypeM6i12xlarge InstanceType = "m6i.12xlarge" + InstanceTypeM6i16xlarge InstanceType = "m6i.16xlarge" + InstanceTypeM6i24xlarge InstanceType = "m6i.24xlarge" + InstanceTypeM6i32xlarge InstanceType = "m6i.32xlarge" + InstanceTypeM6iMetal InstanceType = "m6i.metal" + InstanceTypeMac1Metal InstanceType = "mac1.metal" + InstanceTypeP2Xlarge InstanceType = "p2.xlarge" + InstanceTypeP28xlarge InstanceType = "p2.8xlarge" + InstanceTypeP216xlarge InstanceType = "p2.16xlarge" + InstanceTypeP32xlarge InstanceType = "p3.2xlarge" + InstanceTypeP38xlarge InstanceType = "p3.8xlarge" + InstanceTypeP316xlarge InstanceType = "p3.16xlarge" + InstanceTypeP3dn24xlarge InstanceType = "p3dn.24xlarge" + InstanceTypeP4d24xlarge InstanceType = "p4d.24xlarge" + InstanceTypeR3Large InstanceType = "r3.large" + InstanceTypeR3Xlarge InstanceType = "r3.xlarge" + InstanceTypeR32xlarge InstanceType = "r3.2xlarge" + InstanceTypeR34xlarge InstanceType = "r3.4xlarge" + InstanceTypeR38xlarge InstanceType = "r3.8xlarge" + InstanceTypeR4Large InstanceType = "r4.large" + InstanceTypeR4Xlarge InstanceType = "r4.xlarge" + InstanceTypeR42xlarge InstanceType = "r4.2xlarge" + InstanceTypeR44xlarge InstanceType = "r4.4xlarge" + InstanceTypeR48xlarge InstanceType = "r4.8xlarge" + InstanceTypeR416xlarge InstanceType = "r4.16xlarge" + InstanceTypeR5Large InstanceType = "r5.large" + InstanceTypeR5Xlarge InstanceType = "r5.xlarge" + InstanceTypeR52xlarge InstanceType = "r5.2xlarge" + InstanceTypeR54xlarge InstanceType = "r5.4xlarge" + InstanceTypeR58xlarge InstanceType = "r5.8xlarge" + InstanceTypeR512xlarge InstanceType = "r5.12xlarge" + InstanceTypeR516xlarge InstanceType = "r5.16xlarge" + InstanceTypeR524xlarge InstanceType = "r5.24xlarge" + InstanceTypeR5Metal InstanceType = "r5.metal" + InstanceTypeR5aLarge InstanceType = "r5a.large" + InstanceTypeR5aXlarge InstanceType = "r5a.xlarge" + InstanceTypeR5a2xlarge InstanceType = "r5a.2xlarge" + InstanceTypeR5a4xlarge InstanceType = "r5a.4xlarge" + InstanceTypeR5a8xlarge InstanceType = "r5a.8xlarge" + InstanceTypeR5a12xlarge InstanceType = "r5a.12xlarge" + InstanceTypeR5a16xlarge InstanceType = "r5a.16xlarge" + InstanceTypeR5a24xlarge InstanceType = "r5a.24xlarge" + InstanceTypeR5adLarge InstanceType = "r5ad.large" + InstanceTypeR5adXlarge InstanceType = "r5ad.xlarge" + InstanceTypeR5ad2xlarge InstanceType = "r5ad.2xlarge" + InstanceTypeR5ad4xlarge InstanceType = "r5ad.4xlarge" + InstanceTypeR5ad8xlarge InstanceType = "r5ad.8xlarge" + InstanceTypeR5ad12xlarge InstanceType = "r5ad.12xlarge" + InstanceTypeR5ad16xlarge InstanceType = "r5ad.16xlarge" + InstanceTypeR5ad24xlarge InstanceType = "r5ad.24xlarge" + InstanceTypeR5bLarge InstanceType = "r5b.large" + InstanceTypeR5bXlarge InstanceType = "r5b.xlarge" + InstanceTypeR5b2xlarge InstanceType = "r5b.2xlarge" + InstanceTypeR5b4xlarge InstanceType = "r5b.4xlarge" + InstanceTypeR5b8xlarge InstanceType = "r5b.8xlarge" + InstanceTypeR5b12xlarge InstanceType = "r5b.12xlarge" + InstanceTypeR5b16xlarge InstanceType = "r5b.16xlarge" + InstanceTypeR5b24xlarge InstanceType = "r5b.24xlarge" + InstanceTypeR5bMetal InstanceType = "r5b.metal" + InstanceTypeR5dLarge InstanceType = "r5d.large" + InstanceTypeR5dXlarge InstanceType = "r5d.xlarge" + InstanceTypeR5d2xlarge InstanceType = "r5d.2xlarge" + InstanceTypeR5d4xlarge InstanceType = "r5d.4xlarge" + InstanceTypeR5d8xlarge InstanceType = "r5d.8xlarge" + InstanceTypeR5d12xlarge InstanceType = "r5d.12xlarge" + InstanceTypeR5d16xlarge InstanceType = "r5d.16xlarge" + InstanceTypeR5d24xlarge InstanceType = "r5d.24xlarge" + InstanceTypeR5dMetal InstanceType = "r5d.metal" + InstanceTypeR5dnLarge InstanceType = "r5dn.large" + InstanceTypeR5dnXlarge InstanceType = "r5dn.xlarge" + InstanceTypeR5dn2xlarge InstanceType = "r5dn.2xlarge" + InstanceTypeR5dn4xlarge InstanceType = "r5dn.4xlarge" + InstanceTypeR5dn8xlarge InstanceType = "r5dn.8xlarge" + InstanceTypeR5dn12xlarge InstanceType = "r5dn.12xlarge" + InstanceTypeR5dn16xlarge InstanceType = "r5dn.16xlarge" + InstanceTypeR5dn24xlarge InstanceType = "r5dn.24xlarge" + InstanceTypeR5dnMetal InstanceType = "r5dn.metal" + InstanceTypeR5nLarge InstanceType = "r5n.large" + InstanceTypeR5nXlarge InstanceType = "r5n.xlarge" + InstanceTypeR5n2xlarge InstanceType = "r5n.2xlarge" + InstanceTypeR5n4xlarge InstanceType = "r5n.4xlarge" + InstanceTypeR5n8xlarge InstanceType = "r5n.8xlarge" + InstanceTypeR5n12xlarge InstanceType = "r5n.12xlarge" + InstanceTypeR5n16xlarge InstanceType = "r5n.16xlarge" + InstanceTypeR5n24xlarge InstanceType = "r5n.24xlarge" + InstanceTypeR5nMetal InstanceType = "r5n.metal" + InstanceTypeR6gMedium InstanceType = "r6g.medium" + InstanceTypeR6gLarge InstanceType = "r6g.large" + InstanceTypeR6gXlarge InstanceType = "r6g.xlarge" + InstanceTypeR6g2xlarge InstanceType = "r6g.2xlarge" + InstanceTypeR6g4xlarge InstanceType = "r6g.4xlarge" + InstanceTypeR6g8xlarge InstanceType = "r6g.8xlarge" + InstanceTypeR6g12xlarge InstanceType = "r6g.12xlarge" + InstanceTypeR6g16xlarge InstanceType = "r6g.16xlarge" + InstanceTypeR6gMetal InstanceType = "r6g.metal" + InstanceTypeR6gdMedium InstanceType = "r6gd.medium" + InstanceTypeR6gdLarge InstanceType = "r6gd.large" + InstanceTypeR6gdXlarge InstanceType = "r6gd.xlarge" + InstanceTypeR6gd2xlarge InstanceType = "r6gd.2xlarge" + InstanceTypeR6gd4xlarge InstanceType = "r6gd.4xlarge" + InstanceTypeR6gd8xlarge InstanceType = "r6gd.8xlarge" + InstanceTypeR6gd12xlarge InstanceType = "r6gd.12xlarge" + InstanceTypeR6gd16xlarge InstanceType = "r6gd.16xlarge" + InstanceTypeR6gdMetal InstanceType = "r6gd.metal" + InstanceTypeR6iLarge InstanceType = "r6i.large" + InstanceTypeR6iXlarge InstanceType = "r6i.xlarge" + InstanceTypeR6i2xlarge InstanceType = "r6i.2xlarge" + InstanceTypeR6i4xlarge InstanceType = "r6i.4xlarge" + InstanceTypeR6i8xlarge InstanceType = "r6i.8xlarge" + InstanceTypeR6i12xlarge InstanceType = "r6i.12xlarge" + InstanceTypeR6i16xlarge InstanceType = "r6i.16xlarge" + InstanceTypeR6i24xlarge InstanceType = "r6i.24xlarge" + InstanceTypeR6i32xlarge InstanceType = "r6i.32xlarge" + InstanceTypeR6iMetal InstanceType = "r6i.metal" + InstanceTypeT1Micro InstanceType = "t1.micro" + InstanceTypeT2Nano InstanceType = "t2.nano" + InstanceTypeT2Micro InstanceType = "t2.micro" + InstanceTypeT2Small InstanceType = "t2.small" + InstanceTypeT2Medium InstanceType = "t2.medium" + InstanceTypeT2Large InstanceType = "t2.large" + InstanceTypeT2Xlarge InstanceType = "t2.xlarge" + InstanceTypeT22xlarge InstanceType = "t2.2xlarge" + InstanceTypeT3Nano InstanceType = "t3.nano" + InstanceTypeT3Micro InstanceType = "t3.micro" + InstanceTypeT3Small InstanceType = "t3.small" + InstanceTypeT3Medium InstanceType = "t3.medium" + InstanceTypeT3Large InstanceType = "t3.large" + InstanceTypeT3Xlarge InstanceType = "t3.xlarge" + InstanceTypeT32xlarge InstanceType = "t3.2xlarge" + InstanceTypeT3aNano InstanceType = "t3a.nano" + InstanceTypeT3aMicro InstanceType = "t3a.micro" + InstanceTypeT3aSmall InstanceType = "t3a.small" + InstanceTypeT3aMedium InstanceType = "t3a.medium" + InstanceTypeT3aLarge InstanceType = "t3a.large" + InstanceTypeT3aXlarge InstanceType = "t3a.xlarge" + InstanceTypeT3a2xlarge InstanceType = "t3a.2xlarge" + InstanceTypeT4gNano InstanceType = "t4g.nano" + InstanceTypeT4gMicro InstanceType = "t4g.micro" + InstanceTypeT4gSmall InstanceType = "t4g.small" + InstanceTypeT4gMedium InstanceType = "t4g.medium" + InstanceTypeT4gLarge InstanceType = "t4g.large" + InstanceTypeT4gXlarge InstanceType = "t4g.xlarge" + InstanceTypeT4g2xlarge InstanceType = "t4g.2xlarge" + InstanceTypeU6tb156xlarge InstanceType = "u-6tb1.56xlarge" + InstanceTypeU6tb1112xlarge InstanceType = "u-6tb1.112xlarge" + InstanceTypeU9tb1112xlarge InstanceType = "u-9tb1.112xlarge" + InstanceTypeU12tb1112xlarge InstanceType = "u-12tb1.112xlarge" + InstanceTypeU6tb1Metal InstanceType = "u-6tb1.metal" + InstanceTypeU9tb1Metal InstanceType = "u-9tb1.metal" + InstanceTypeU12tb1Metal InstanceType = "u-12tb1.metal" + InstanceTypeU18tb1Metal InstanceType = "u-18tb1.metal" + InstanceTypeU24tb1Metal InstanceType = "u-24tb1.metal" + InstanceTypeVt13xlarge InstanceType = "vt1.3xlarge" + InstanceTypeVt16xlarge InstanceType = "vt1.6xlarge" + InstanceTypeVt124xlarge InstanceType = "vt1.24xlarge" + InstanceTypeX116xlarge InstanceType = "x1.16xlarge" + InstanceTypeX132xlarge InstanceType = "x1.32xlarge" + InstanceTypeX1eXlarge InstanceType = "x1e.xlarge" + InstanceTypeX1e2xlarge InstanceType = "x1e.2xlarge" + InstanceTypeX1e4xlarge InstanceType = "x1e.4xlarge" + InstanceTypeX1e8xlarge InstanceType = "x1e.8xlarge" + InstanceTypeX1e16xlarge InstanceType = "x1e.16xlarge" + InstanceTypeX1e32xlarge InstanceType = "x1e.32xlarge" + InstanceTypeX2iezn2xlarge InstanceType = "x2iezn.2xlarge" + InstanceTypeX2iezn4xlarge InstanceType = "x2iezn.4xlarge" + InstanceTypeX2iezn6xlarge InstanceType = "x2iezn.6xlarge" + InstanceTypeX2iezn8xlarge InstanceType = "x2iezn.8xlarge" + InstanceTypeX2iezn12xlarge InstanceType = "x2iezn.12xlarge" + InstanceTypeX2ieznMetal InstanceType = "x2iezn.metal" + InstanceTypeX2gdMedium InstanceType = "x2gd.medium" + InstanceTypeX2gdLarge InstanceType = "x2gd.large" + InstanceTypeX2gdXlarge InstanceType = "x2gd.xlarge" + InstanceTypeX2gd2xlarge InstanceType = "x2gd.2xlarge" + InstanceTypeX2gd4xlarge InstanceType = "x2gd.4xlarge" + InstanceTypeX2gd8xlarge InstanceType = "x2gd.8xlarge" + InstanceTypeX2gd12xlarge InstanceType = "x2gd.12xlarge" + InstanceTypeX2gd16xlarge InstanceType = "x2gd.16xlarge" + InstanceTypeX2gdMetal InstanceType = "x2gd.metal" + InstanceTypeZ1dLarge InstanceType = "z1d.large" + InstanceTypeZ1dXlarge InstanceType = "z1d.xlarge" + InstanceTypeZ1d2xlarge InstanceType = "z1d.2xlarge" + InstanceTypeZ1d3xlarge InstanceType = "z1d.3xlarge" + InstanceTypeZ1d6xlarge InstanceType = "z1d.6xlarge" + InstanceTypeZ1d12xlarge InstanceType = "z1d.12xlarge" + InstanceTypeZ1dMetal InstanceType = "z1d.metal" + InstanceTypeX2idn16xlarge InstanceType = "x2idn.16xlarge" + InstanceTypeX2idn24xlarge InstanceType = "x2idn.24xlarge" + InstanceTypeX2idn32xlarge InstanceType = "x2idn.32xlarge" + InstanceTypeX2iednXlarge InstanceType = "x2iedn.xlarge" + InstanceTypeX2iedn2xlarge InstanceType = "x2iedn.2xlarge" + InstanceTypeX2iedn4xlarge InstanceType = "x2iedn.4xlarge" + InstanceTypeX2iedn8xlarge InstanceType = "x2iedn.8xlarge" + InstanceTypeX2iedn16xlarge InstanceType = "x2iedn.16xlarge" + InstanceTypeX2iedn24xlarge InstanceType = "x2iedn.24xlarge" + InstanceTypeX2iedn32xlarge InstanceType = "x2iedn.32xlarge" + InstanceTypeC6aLarge InstanceType = "c6a.large" + InstanceTypeC6aXlarge InstanceType = "c6a.xlarge" + InstanceTypeC6a2xlarge InstanceType = "c6a.2xlarge" + InstanceTypeC6a4xlarge InstanceType = "c6a.4xlarge" + InstanceTypeC6a8xlarge InstanceType = "c6a.8xlarge" + InstanceTypeC6a12xlarge InstanceType = "c6a.12xlarge" + InstanceTypeC6a16xlarge InstanceType = "c6a.16xlarge" + InstanceTypeC6a24xlarge InstanceType = "c6a.24xlarge" + InstanceTypeC6a32xlarge InstanceType = "c6a.32xlarge" + InstanceTypeC6a48xlarge InstanceType = "c6a.48xlarge" + InstanceTypeC6aMetal InstanceType = "c6a.metal" + InstanceTypeM6aMetal InstanceType = "m6a.metal" + InstanceTypeI4iLarge InstanceType = "i4i.large" + InstanceTypeI4iXlarge InstanceType = "i4i.xlarge" + InstanceTypeI4i2xlarge InstanceType = "i4i.2xlarge" + InstanceTypeI4i4xlarge InstanceType = "i4i.4xlarge" + InstanceTypeI4i8xlarge InstanceType = "i4i.8xlarge" + InstanceTypeI4i16xlarge InstanceType = "i4i.16xlarge" + InstanceTypeI4i32xlarge InstanceType = "i4i.32xlarge" + InstanceTypeI4iMetal InstanceType = "i4i.metal" + InstanceTypeX2idnMetal InstanceType = "x2idn.metal" + InstanceTypeX2iednMetal InstanceType = "x2iedn.metal" + InstanceTypeC7gMedium InstanceType = "c7g.medium" + InstanceTypeC7gLarge InstanceType = "c7g.large" + InstanceTypeC7gXlarge InstanceType = "c7g.xlarge" + InstanceTypeC7g2xlarge InstanceType = "c7g.2xlarge" + InstanceTypeC7g4xlarge InstanceType = "c7g.4xlarge" + InstanceTypeC7g8xlarge InstanceType = "c7g.8xlarge" + InstanceTypeC7g12xlarge InstanceType = "c7g.12xlarge" + InstanceTypeC7g16xlarge InstanceType = "c7g.16xlarge" + InstanceTypeMac2Metal InstanceType = "mac2.metal" + InstanceTypeC6idLarge InstanceType = "c6id.large" + InstanceTypeC6idXlarge InstanceType = "c6id.xlarge" + InstanceTypeC6id2xlarge InstanceType = "c6id.2xlarge" + InstanceTypeC6id4xlarge InstanceType = "c6id.4xlarge" + InstanceTypeC6id8xlarge InstanceType = "c6id.8xlarge" + InstanceTypeC6id12xlarge InstanceType = "c6id.12xlarge" + InstanceTypeC6id16xlarge InstanceType = "c6id.16xlarge" + InstanceTypeC6id24xlarge InstanceType = "c6id.24xlarge" + InstanceTypeC6id32xlarge InstanceType = "c6id.32xlarge" + InstanceTypeC6idMetal InstanceType = "c6id.metal" + InstanceTypeM6idLarge InstanceType = "m6id.large" + InstanceTypeM6idXlarge InstanceType = "m6id.xlarge" + InstanceTypeM6id2xlarge InstanceType = "m6id.2xlarge" + InstanceTypeM6id4xlarge InstanceType = "m6id.4xlarge" + InstanceTypeM6id8xlarge InstanceType = "m6id.8xlarge" + InstanceTypeM6id12xlarge InstanceType = "m6id.12xlarge" + InstanceTypeM6id16xlarge InstanceType = "m6id.16xlarge" + InstanceTypeM6id24xlarge InstanceType = "m6id.24xlarge" + InstanceTypeM6id32xlarge InstanceType = "m6id.32xlarge" + InstanceTypeM6idMetal InstanceType = "m6id.metal" + InstanceTypeR6idLarge InstanceType = "r6id.large" + InstanceTypeR6idXlarge InstanceType = "r6id.xlarge" + InstanceTypeR6id2xlarge InstanceType = "r6id.2xlarge" + InstanceTypeR6id4xlarge InstanceType = "r6id.4xlarge" + InstanceTypeR6id8xlarge InstanceType = "r6id.8xlarge" + InstanceTypeR6id12xlarge InstanceType = "r6id.12xlarge" + InstanceTypeR6id16xlarge InstanceType = "r6id.16xlarge" + InstanceTypeR6id24xlarge InstanceType = "r6id.24xlarge" + InstanceTypeR6id32xlarge InstanceType = "r6id.32xlarge" + InstanceTypeR6idMetal InstanceType = "r6id.metal" + InstanceTypeR6aLarge InstanceType = "r6a.large" + InstanceTypeR6aXlarge InstanceType = "r6a.xlarge" + InstanceTypeR6a2xlarge InstanceType = "r6a.2xlarge" + InstanceTypeR6a4xlarge InstanceType = "r6a.4xlarge" + InstanceTypeR6a8xlarge InstanceType = "r6a.8xlarge" + InstanceTypeR6a12xlarge InstanceType = "r6a.12xlarge" + InstanceTypeR6a16xlarge InstanceType = "r6a.16xlarge" + InstanceTypeR6a24xlarge InstanceType = "r6a.24xlarge" + InstanceTypeR6a32xlarge InstanceType = "r6a.32xlarge" + InstanceTypeR6a48xlarge InstanceType = "r6a.48xlarge" + InstanceTypeR6aMetal InstanceType = "r6a.metal" + InstanceTypeP4de24xlarge InstanceType = "p4de.24xlarge" + InstanceTypeU3tb156xlarge InstanceType = "u-3tb1.56xlarge" + InstanceTypeU18tb1112xlarge InstanceType = "u-18tb1.112xlarge" + InstanceTypeU24tb1112xlarge InstanceType = "u-24tb1.112xlarge" + InstanceTypeTrn12xlarge InstanceType = "trn1.2xlarge" + InstanceTypeTrn132xlarge InstanceType = "trn1.32xlarge" + InstanceTypeHpc6id32xlarge InstanceType = "hpc6id.32xlarge" + InstanceTypeC6inLarge InstanceType = "c6in.large" + InstanceTypeC6inXlarge InstanceType = "c6in.xlarge" + InstanceTypeC6in2xlarge InstanceType = "c6in.2xlarge" + InstanceTypeC6in4xlarge InstanceType = "c6in.4xlarge" + InstanceTypeC6in8xlarge InstanceType = "c6in.8xlarge" + InstanceTypeC6in12xlarge InstanceType = "c6in.12xlarge" + InstanceTypeC6in16xlarge InstanceType = "c6in.16xlarge" + InstanceTypeC6in24xlarge InstanceType = "c6in.24xlarge" + InstanceTypeC6in32xlarge InstanceType = "c6in.32xlarge" + InstanceTypeM6inLarge InstanceType = "m6in.large" + InstanceTypeM6inXlarge InstanceType = "m6in.xlarge" + InstanceTypeM6in2xlarge InstanceType = "m6in.2xlarge" + InstanceTypeM6in4xlarge InstanceType = "m6in.4xlarge" + InstanceTypeM6in8xlarge InstanceType = "m6in.8xlarge" + InstanceTypeM6in12xlarge InstanceType = "m6in.12xlarge" + InstanceTypeM6in16xlarge InstanceType = "m6in.16xlarge" + InstanceTypeM6in24xlarge InstanceType = "m6in.24xlarge" + InstanceTypeM6in32xlarge InstanceType = "m6in.32xlarge" + InstanceTypeM6idnLarge InstanceType = "m6idn.large" + InstanceTypeM6idnXlarge InstanceType = "m6idn.xlarge" + InstanceTypeM6idn2xlarge InstanceType = "m6idn.2xlarge" + InstanceTypeM6idn4xlarge InstanceType = "m6idn.4xlarge" + InstanceTypeM6idn8xlarge InstanceType = "m6idn.8xlarge" + InstanceTypeM6idn12xlarge InstanceType = "m6idn.12xlarge" + InstanceTypeM6idn16xlarge InstanceType = "m6idn.16xlarge" + InstanceTypeM6idn24xlarge InstanceType = "m6idn.24xlarge" + InstanceTypeM6idn32xlarge InstanceType = "m6idn.32xlarge" + InstanceTypeR6inLarge InstanceType = "r6in.large" + InstanceTypeR6inXlarge InstanceType = "r6in.xlarge" + InstanceTypeR6in2xlarge InstanceType = "r6in.2xlarge" + InstanceTypeR6in4xlarge InstanceType = "r6in.4xlarge" + InstanceTypeR6in8xlarge InstanceType = "r6in.8xlarge" + InstanceTypeR6in12xlarge InstanceType = "r6in.12xlarge" + InstanceTypeR6in16xlarge InstanceType = "r6in.16xlarge" + InstanceTypeR6in24xlarge InstanceType = "r6in.24xlarge" + InstanceTypeR6in32xlarge InstanceType = "r6in.32xlarge" + InstanceTypeR6idnLarge InstanceType = "r6idn.large" + InstanceTypeR6idnXlarge InstanceType = "r6idn.xlarge" + InstanceTypeR6idn2xlarge InstanceType = "r6idn.2xlarge" + InstanceTypeR6idn4xlarge InstanceType = "r6idn.4xlarge" + InstanceTypeR6idn8xlarge InstanceType = "r6idn.8xlarge" + InstanceTypeR6idn12xlarge InstanceType = "r6idn.12xlarge" + InstanceTypeR6idn16xlarge InstanceType = "r6idn.16xlarge" + InstanceTypeR6idn24xlarge InstanceType = "r6idn.24xlarge" + InstanceTypeR6idn32xlarge InstanceType = "r6idn.32xlarge" + InstanceTypeC7gMetal InstanceType = "c7g.metal" + InstanceTypeM7gMedium InstanceType = "m7g.medium" + InstanceTypeM7gLarge InstanceType = "m7g.large" + InstanceTypeM7gXlarge InstanceType = "m7g.xlarge" + InstanceTypeM7g2xlarge InstanceType = "m7g.2xlarge" + InstanceTypeM7g4xlarge InstanceType = "m7g.4xlarge" + InstanceTypeM7g8xlarge InstanceType = "m7g.8xlarge" + InstanceTypeM7g12xlarge InstanceType = "m7g.12xlarge" + InstanceTypeM7g16xlarge InstanceType = "m7g.16xlarge" + InstanceTypeM7gMetal InstanceType = "m7g.metal" + InstanceTypeR7gMedium InstanceType = "r7g.medium" + InstanceTypeR7gLarge InstanceType = "r7g.large" + InstanceTypeR7gXlarge InstanceType = "r7g.xlarge" + InstanceTypeR7g2xlarge InstanceType = "r7g.2xlarge" + InstanceTypeR7g4xlarge InstanceType = "r7g.4xlarge" + InstanceTypeR7g8xlarge InstanceType = "r7g.8xlarge" + InstanceTypeR7g12xlarge InstanceType = "r7g.12xlarge" + InstanceTypeR7g16xlarge InstanceType = "r7g.16xlarge" + InstanceTypeR7gMetal InstanceType = "r7g.metal" + InstanceTypeC6inMetal InstanceType = "c6in.metal" + InstanceTypeM6inMetal InstanceType = "m6in.metal" + InstanceTypeM6idnMetal InstanceType = "m6idn.metal" + InstanceTypeR6inMetal InstanceType = "r6in.metal" + InstanceTypeR6idnMetal InstanceType = "r6idn.metal" + InstanceTypeInf2Xlarge InstanceType = "inf2.xlarge" + InstanceTypeInf28xlarge InstanceType = "inf2.8xlarge" + InstanceTypeInf224xlarge InstanceType = "inf2.24xlarge" + InstanceTypeInf248xlarge InstanceType = "inf2.48xlarge" + InstanceTypeTrn1n32xlarge InstanceType = "trn1n.32xlarge" + InstanceTypeI4gLarge InstanceType = "i4g.large" + InstanceTypeI4gXlarge InstanceType = "i4g.xlarge" + InstanceTypeI4g2xlarge InstanceType = "i4g.2xlarge" + InstanceTypeI4g4xlarge InstanceType = "i4g.4xlarge" + InstanceTypeI4g8xlarge InstanceType = "i4g.8xlarge" + InstanceTypeI4g16xlarge InstanceType = "i4g.16xlarge" + InstanceTypeHpc7g4xlarge InstanceType = "hpc7g.4xlarge" + InstanceTypeHpc7g8xlarge InstanceType = "hpc7g.8xlarge" + InstanceTypeHpc7g16xlarge InstanceType = "hpc7g.16xlarge" + InstanceTypeC7gnMedium InstanceType = "c7gn.medium" + InstanceTypeC7gnLarge InstanceType = "c7gn.large" + InstanceTypeC7gnXlarge InstanceType = "c7gn.xlarge" + InstanceTypeC7gn2xlarge InstanceType = "c7gn.2xlarge" + InstanceTypeC7gn4xlarge InstanceType = "c7gn.4xlarge" + InstanceTypeC7gn8xlarge InstanceType = "c7gn.8xlarge" + InstanceTypeC7gn12xlarge InstanceType = "c7gn.12xlarge" + InstanceTypeC7gn16xlarge InstanceType = "c7gn.16xlarge" + InstanceTypeP548xlarge InstanceType = "p5.48xlarge" + InstanceTypeM7iLarge InstanceType = "m7i.large" + InstanceTypeM7iXlarge InstanceType = "m7i.xlarge" + InstanceTypeM7i2xlarge InstanceType = "m7i.2xlarge" + InstanceTypeM7i4xlarge InstanceType = "m7i.4xlarge" + InstanceTypeM7i8xlarge InstanceType = "m7i.8xlarge" + InstanceTypeM7i12xlarge InstanceType = "m7i.12xlarge" + InstanceTypeM7i16xlarge InstanceType = "m7i.16xlarge" + InstanceTypeM7i24xlarge InstanceType = "m7i.24xlarge" + InstanceTypeM7i48xlarge InstanceType = "m7i.48xlarge" + InstanceTypeM7iFlexLarge InstanceType = "m7i-flex.large" + InstanceTypeM7iFlexXlarge InstanceType = "m7i-flex.xlarge" + InstanceTypeM7iFlex2xlarge InstanceType = "m7i-flex.2xlarge" + InstanceTypeM7iFlex4xlarge InstanceType = "m7i-flex.4xlarge" + InstanceTypeM7iFlex8xlarge InstanceType = "m7i-flex.8xlarge" + InstanceTypeM7aMedium InstanceType = "m7a.medium" + InstanceTypeM7aLarge InstanceType = "m7a.large" + InstanceTypeM7aXlarge InstanceType = "m7a.xlarge" + InstanceTypeM7a2xlarge InstanceType = "m7a.2xlarge" + InstanceTypeM7a4xlarge InstanceType = "m7a.4xlarge" + InstanceTypeM7a8xlarge InstanceType = "m7a.8xlarge" + InstanceTypeM7a12xlarge InstanceType = "m7a.12xlarge" + InstanceTypeM7a16xlarge InstanceType = "m7a.16xlarge" + InstanceTypeM7a24xlarge InstanceType = "m7a.24xlarge" + InstanceTypeM7a32xlarge InstanceType = "m7a.32xlarge" + InstanceTypeM7a48xlarge InstanceType = "m7a.48xlarge" + InstanceTypeM7aMetal48xl InstanceType = "m7a.metal-48xl" + InstanceTypeHpc7a12xlarge InstanceType = "hpc7a.12xlarge" + InstanceTypeHpc7a24xlarge InstanceType = "hpc7a.24xlarge" + InstanceTypeHpc7a48xlarge InstanceType = "hpc7a.48xlarge" + InstanceTypeHpc7a96xlarge InstanceType = "hpc7a.96xlarge" + InstanceTypeC7gdMedium InstanceType = "c7gd.medium" + InstanceTypeC7gdLarge InstanceType = "c7gd.large" + InstanceTypeC7gdXlarge InstanceType = "c7gd.xlarge" + InstanceTypeC7gd2xlarge InstanceType = "c7gd.2xlarge" + InstanceTypeC7gd4xlarge InstanceType = "c7gd.4xlarge" + InstanceTypeC7gd8xlarge InstanceType = "c7gd.8xlarge" + InstanceTypeC7gd12xlarge InstanceType = "c7gd.12xlarge" + InstanceTypeC7gd16xlarge InstanceType = "c7gd.16xlarge" + InstanceTypeM7gdMedium InstanceType = "m7gd.medium" + InstanceTypeM7gdLarge InstanceType = "m7gd.large" + InstanceTypeM7gdXlarge InstanceType = "m7gd.xlarge" + InstanceTypeM7gd2xlarge InstanceType = "m7gd.2xlarge" + InstanceTypeM7gd4xlarge InstanceType = "m7gd.4xlarge" + InstanceTypeM7gd8xlarge InstanceType = "m7gd.8xlarge" + InstanceTypeM7gd12xlarge InstanceType = "m7gd.12xlarge" + InstanceTypeM7gd16xlarge InstanceType = "m7gd.16xlarge" + InstanceTypeR7gdMedium InstanceType = "r7gd.medium" + InstanceTypeR7gdLarge InstanceType = "r7gd.large" + InstanceTypeR7gdXlarge InstanceType = "r7gd.xlarge" + InstanceTypeR7gd2xlarge InstanceType = "r7gd.2xlarge" + InstanceTypeR7gd4xlarge InstanceType = "r7gd.4xlarge" + InstanceTypeR7gd8xlarge InstanceType = "r7gd.8xlarge" + InstanceTypeR7gd12xlarge InstanceType = "r7gd.12xlarge" + InstanceTypeR7gd16xlarge InstanceType = "r7gd.16xlarge" + InstanceTypeR7aMedium InstanceType = "r7a.medium" + InstanceTypeR7aLarge InstanceType = "r7a.large" + InstanceTypeR7aXlarge InstanceType = "r7a.xlarge" + InstanceTypeR7a2xlarge InstanceType = "r7a.2xlarge" + InstanceTypeR7a4xlarge InstanceType = "r7a.4xlarge" + InstanceTypeR7a8xlarge InstanceType = "r7a.8xlarge" + InstanceTypeR7a12xlarge InstanceType = "r7a.12xlarge" + InstanceTypeR7a16xlarge InstanceType = "r7a.16xlarge" + InstanceTypeR7a24xlarge InstanceType = "r7a.24xlarge" + InstanceTypeR7a32xlarge InstanceType = "r7a.32xlarge" + InstanceTypeR7a48xlarge InstanceType = "r7a.48xlarge" + InstanceTypeC7iLarge InstanceType = "c7i.large" + InstanceTypeC7iXlarge InstanceType = "c7i.xlarge" + InstanceTypeC7i2xlarge InstanceType = "c7i.2xlarge" + InstanceTypeC7i4xlarge InstanceType = "c7i.4xlarge" + InstanceTypeC7i8xlarge InstanceType = "c7i.8xlarge" + InstanceTypeC7i12xlarge InstanceType = "c7i.12xlarge" + InstanceTypeC7i16xlarge InstanceType = "c7i.16xlarge" + InstanceTypeC7i24xlarge InstanceType = "c7i.24xlarge" + InstanceTypeC7i48xlarge InstanceType = "c7i.48xlarge" + InstanceTypeMac2M2proMetal InstanceType = "mac2-m2pro.metal" + InstanceTypeR7izLarge InstanceType = "r7iz.large" + InstanceTypeR7izXlarge InstanceType = "r7iz.xlarge" + InstanceTypeR7iz2xlarge InstanceType = "r7iz.2xlarge" + InstanceTypeR7iz4xlarge InstanceType = "r7iz.4xlarge" + InstanceTypeR7iz8xlarge InstanceType = "r7iz.8xlarge" + InstanceTypeR7iz12xlarge InstanceType = "r7iz.12xlarge" + InstanceTypeR7iz16xlarge InstanceType = "r7iz.16xlarge" + InstanceTypeR7iz32xlarge InstanceType = "r7iz.32xlarge" + InstanceTypeC7aMedium InstanceType = "c7a.medium" + InstanceTypeC7aLarge InstanceType = "c7a.large" + InstanceTypeC7aXlarge InstanceType = "c7a.xlarge" + InstanceTypeC7a2xlarge InstanceType = "c7a.2xlarge" + InstanceTypeC7a4xlarge InstanceType = "c7a.4xlarge" + InstanceTypeC7a8xlarge InstanceType = "c7a.8xlarge" + InstanceTypeC7a12xlarge InstanceType = "c7a.12xlarge" + InstanceTypeC7a16xlarge InstanceType = "c7a.16xlarge" + InstanceTypeC7a24xlarge InstanceType = "c7a.24xlarge" + InstanceTypeC7a32xlarge InstanceType = "c7a.32xlarge" + InstanceTypeC7a48xlarge InstanceType = "c7a.48xlarge" + InstanceTypeC7aMetal48xl InstanceType = "c7a.metal-48xl" + InstanceTypeR7aMetal48xl InstanceType = "r7a.metal-48xl" + InstanceTypeR7iLarge InstanceType = "r7i.large" + InstanceTypeR7iXlarge InstanceType = "r7i.xlarge" + InstanceTypeR7i2xlarge InstanceType = "r7i.2xlarge" + InstanceTypeR7i4xlarge InstanceType = "r7i.4xlarge" + InstanceTypeR7i8xlarge InstanceType = "r7i.8xlarge" + InstanceTypeR7i12xlarge InstanceType = "r7i.12xlarge" + InstanceTypeR7i16xlarge InstanceType = "r7i.16xlarge" + InstanceTypeR7i24xlarge InstanceType = "r7i.24xlarge" + InstanceTypeR7i48xlarge InstanceType = "r7i.48xlarge" + InstanceTypeDl2q24xlarge InstanceType = "dl2q.24xlarge" + InstanceTypeMac2M2Metal InstanceType = "mac2-m2.metal" + InstanceTypeI4i12xlarge InstanceType = "i4i.12xlarge" + InstanceTypeI4i24xlarge InstanceType = "i4i.24xlarge" + InstanceTypeC7iMetal24xl InstanceType = "c7i.metal-24xl" + InstanceTypeC7iMetal48xl InstanceType = "c7i.metal-48xl" + InstanceTypeM7iMetal24xl InstanceType = "m7i.metal-24xl" + InstanceTypeM7iMetal48xl InstanceType = "m7i.metal-48xl" + InstanceTypeR7iMetal24xl InstanceType = "r7i.metal-24xl" + InstanceTypeR7iMetal48xl InstanceType = "r7i.metal-48xl" + InstanceTypeR7izMetal16xl InstanceType = "r7iz.metal-16xl" + InstanceTypeR7izMetal32xl InstanceType = "r7iz.metal-32xl" + InstanceTypeC7gdMetal InstanceType = "c7gd.metal" + InstanceTypeM7gdMetal InstanceType = "m7gd.metal" + InstanceTypeR7gdMetal InstanceType = "r7gd.metal" + InstanceTypeG6Xlarge InstanceType = "g6.xlarge" + InstanceTypeG62xlarge InstanceType = "g6.2xlarge" + InstanceTypeG64xlarge InstanceType = "g6.4xlarge" + InstanceTypeG68xlarge InstanceType = "g6.8xlarge" + InstanceTypeG612xlarge InstanceType = "g6.12xlarge" + InstanceTypeG616xlarge InstanceType = "g6.16xlarge" + InstanceTypeG624xlarge InstanceType = "g6.24xlarge" + InstanceTypeG648xlarge InstanceType = "g6.48xlarge" + InstanceTypeGr64xlarge InstanceType = "gr6.4xlarge" + InstanceTypeGr68xlarge InstanceType = "gr6.8xlarge" + InstanceTypeC7iFlexLarge InstanceType = "c7i-flex.large" + InstanceTypeC7iFlexXlarge InstanceType = "c7i-flex.xlarge" + InstanceTypeC7iFlex2xlarge InstanceType = "c7i-flex.2xlarge" + InstanceTypeC7iFlex4xlarge InstanceType = "c7i-flex.4xlarge" + InstanceTypeC7iFlex8xlarge InstanceType = "c7i-flex.8xlarge" + InstanceTypeU7i12tb224xlarge InstanceType = "u7i-12tb.224xlarge" + InstanceTypeU7in16tb224xlarge InstanceType = "u7in-16tb.224xlarge" + InstanceTypeU7in24tb224xlarge InstanceType = "u7in-24tb.224xlarge" + InstanceTypeU7in32tb224xlarge InstanceType = "u7in-32tb.224xlarge" ) // Values returns all known values for InstanceType. Note that this can be @@ -4741,6 +4750,15 @@ func (InstanceType) Values() []InstanceType { "g6.48xlarge", "gr6.4xlarge", "gr6.8xlarge", + "c7i-flex.large", + "c7i-flex.xlarge", + "c7i-flex.2xlarge", + "c7i-flex.4xlarge", + "c7i-flex.8xlarge", + "u7i-12tb.224xlarge", + "u7in-16tb.224xlarge", + "u7in-24tb.224xlarge", + "u7in-32tb.224xlarge", } } diff --git a/service/identitystore/internal/endpoints/endpoints.go b/service/identitystore/internal/endpoints/endpoints.go index 663341b10ca..e090dbf1dcb 100644 --- a/service/identitystore/internal/endpoints/endpoints.go +++ b/service/identitystore/internal/endpoints/endpoints.go @@ -175,6 +175,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, diff --git a/service/neptune/internal/endpoints/endpoints.go b/service/neptune/internal/endpoints/endpoints.go index e4637a1d422..9771aab57a0 100644 --- a/service/neptune/internal/endpoints/endpoints.go +++ b/service/neptune/internal/endpoints/endpoints.go @@ -544,37 +544,10 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "rds-fips.us-iso-east-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds-fips.us-iso-west-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-west-1", - }, - Deprecated: aws.TrueTernary, - }, endpoints.EndpointKey{ Region: "rds.us-iso-east-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-iso-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-east-1", }, @@ -583,16 +556,7 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "rds.us-iso-west-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-iso-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-west-1", }, @@ -605,12 +569,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-iso-east-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", }, endpoints.EndpointKey{ Region: "us-iso-east-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-east-1", }, @@ -623,12 +587,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-iso-west-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", }, endpoints.EndpointKey{ Region: "us-iso-west-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-west-1", }, @@ -657,28 +621,10 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "rds-fips.us-isob-east-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - Deprecated: aws.TrueTernary, - }, endpoints.EndpointKey{ Region: "rds.us-isob-east-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-isob-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-isob-east-1", }, @@ -691,12 +637,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-isob-east-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", }, endpoints.EndpointKey{ Region: "us-isob-east-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-isob-east-1", }, diff --git a/service/pipes/deserializers.go b/service/pipes/deserializers.go index 24130dd09fe..1c59a2001d3 100644 --- a/service/pipes/deserializers.go +++ b/service/pipes/deserializers.go @@ -2905,6 +2905,98 @@ func awsRestjson1_deserializeDocumentDeadLetterConfig(v **types.DeadLetterConfig return nil } +func awsRestjson1_deserializeDocumentDimensionMapping(v **types.DimensionMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DimensionMapping + if *v == nil { + sv = &types.DimensionMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DimensionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value) + } + sv.DimensionName = ptr.String(jtv) + } + + case "DimensionValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DimensionValue to be of type string, got %T instead", value) + } + sv.DimensionValue = ptr.String(jtv) + } + + case "DimensionValueType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DimensionValueType to be of type string, got %T instead", value) + } + sv.DimensionValueType = types.DimensionValueType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDimensionMappings(v *[]types.DimensionMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.DimensionMapping + if *v == nil { + cv = []types.DimensionMapping{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DimensionMapping + destAddr := &col + if err := awsRestjson1_deserializeDocumentDimensionMapping(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentEcsContainerOverride(v **types.EcsContainerOverride, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3939,6 +4031,177 @@ loop: return nil } +func awsRestjson1_deserializeDocumentMultiMeasureAttributeMapping(v **types.MultiMeasureAttributeMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MultiMeasureAttributeMapping + if *v == nil { + sv = &types.MultiMeasureAttributeMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MeasureValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MeasureValue to be of type string, got %T instead", value) + } + sv.MeasureValue = ptr.String(jtv) + } + + case "MeasureValueType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MeasureValueType to be of type string, got %T instead", value) + } + sv.MeasureValueType = types.MeasureValueType(jtv) + } + + case "MultiMeasureAttributeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MultiMeasureAttributeName to be of type string, got %T instead", value) + } + sv.MultiMeasureAttributeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMultiMeasureAttributeMappings(v *[]types.MultiMeasureAttributeMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.MultiMeasureAttributeMapping + if *v == nil { + cv = []types.MultiMeasureAttributeMapping{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MultiMeasureAttributeMapping + destAddr := &col + if err := awsRestjson1_deserializeDocumentMultiMeasureAttributeMapping(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMultiMeasureMapping(v **types.MultiMeasureMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MultiMeasureMapping + if *v == nil { + sv = &types.MultiMeasureMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MultiMeasureAttributeMappings": + if err := awsRestjson1_deserializeDocumentMultiMeasureAttributeMappings(&sv.MultiMeasureAttributeMappings, value); err != nil { + return err + } + + case "MultiMeasureName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MultiMeasureName to be of type string, got %T instead", value) + } + sv.MultiMeasureName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMultiMeasureMappings(v *[]types.MultiMeasureMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.MultiMeasureMapping + if *v == nil { + cv = []types.MultiMeasureMapping{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MultiMeasureMapping + destAddr := &col + if err := awsRestjson1_deserializeDocumentMultiMeasureMapping(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentNetworkConfiguration(v **types.NetworkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5654,6 +5917,11 @@ func awsRestjson1_deserializeDocumentPipeTargetParameters(v **types.PipeTargetPa return err } + case "TimestreamParameters": + if err := awsRestjson1_deserializeDocumentPipeTargetTimestreamParameters(&sv.TimestreamParameters, value); err != nil { + return err + } + default: _, _ = key, value @@ -5869,6 +6137,97 @@ func awsRestjson1_deserializeDocumentPipeTargetStateMachineParameters(v **types. return nil } +func awsRestjson1_deserializeDocumentPipeTargetTimestreamParameters(v **types.PipeTargetTimestreamParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PipeTargetTimestreamParameters + if *v == nil { + sv = &types.PipeTargetTimestreamParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DimensionMappings": + if err := awsRestjson1_deserializeDocumentDimensionMappings(&sv.DimensionMappings, value); err != nil { + return err + } + + case "EpochTimeUnit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EpochTimeUnit to be of type string, got %T instead", value) + } + sv.EpochTimeUnit = types.EpochTimeUnit(jtv) + } + + case "MultiMeasureMappings": + if err := awsRestjson1_deserializeDocumentMultiMeasureMappings(&sv.MultiMeasureMappings, value); err != nil { + return err + } + + case "SingleMeasureMappings": + if err := awsRestjson1_deserializeDocumentSingleMeasureMappings(&sv.SingleMeasureMappings, value); err != nil { + return err + } + + case "TimeFieldType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeFieldType to be of type string, got %T instead", value) + } + sv.TimeFieldType = types.TimeFieldType(jtv) + } + + case "TimestampFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + sv.TimestampFormat = ptr.String(jtv) + } + + case "TimeValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeValue to be of type string, got %T instead", value) + } + sv.TimeValue = ptr.String(jtv) + } + + case "VersionValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionValue to be of type string, got %T instead", value) + } + sv.VersionValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPlacementConstraint(v **types.PlacementConstraint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6488,6 +6847,98 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsRestjson1_deserializeDocumentSingleMeasureMapping(v **types.SingleMeasureMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SingleMeasureMapping + if *v == nil { + sv = &types.SingleMeasureMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MeasureName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MeasureName to be of type string, got %T instead", value) + } + sv.MeasureName = ptr.String(jtv) + } + + case "MeasureValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MeasureValue to be of type string, got %T instead", value) + } + sv.MeasureValue = ptr.String(jtv) + } + + case "MeasureValueType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MeasureValueType to be of type string, got %T instead", value) + } + sv.MeasureValueType = types.MeasureValueType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSingleMeasureMappings(v *[]types.SingleMeasureMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.SingleMeasureMapping + if *v == nil { + cv = []types.SingleMeasureMapping{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SingleMeasureMapping + destAddr := &col + if err := awsRestjson1_deserializeDocumentSingleMeasureMapping(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentSqls(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/pipes/serializers.go b/service/pipes/serializers.go index ef8b47ef3c6..3e5ce5eca90 100644 --- a/service/pipes/serializers.go +++ b/service/pipes/serializers.go @@ -1112,6 +1112,41 @@ func awsRestjson1_serializeDocumentDeadLetterConfig(v *types.DeadLetterConfig, v return nil } +func awsRestjson1_serializeDocumentDimensionMapping(v *types.DimensionMapping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DimensionName != nil { + ok := object.Key("DimensionName") + ok.String(*v.DimensionName) + } + + if v.DimensionValue != nil { + ok := object.Key("DimensionValue") + ok.String(*v.DimensionValue) + } + + if len(v.DimensionValueType) > 0 { + ok := object.Key("DimensionValueType") + ok.String(string(v.DimensionValueType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentDimensionMappings(v []types.DimensionMapping, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDimensionMapping(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentEcsContainerOverride(v *types.EcsContainerOverride, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1491,6 +1526,73 @@ func awsRestjson1_serializeDocumentMSKAccessCredentials(v types.MSKAccessCredent return nil } +func awsRestjson1_serializeDocumentMultiMeasureAttributeMapping(v *types.MultiMeasureAttributeMapping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MeasureValue != nil { + ok := object.Key("MeasureValue") + ok.String(*v.MeasureValue) + } + + if len(v.MeasureValueType) > 0 { + ok := object.Key("MeasureValueType") + ok.String(string(v.MeasureValueType)) + } + + if v.MultiMeasureAttributeName != nil { + ok := object.Key("MultiMeasureAttributeName") + ok.String(*v.MultiMeasureAttributeName) + } + + return nil +} + +func awsRestjson1_serializeDocumentMultiMeasureAttributeMappings(v []types.MultiMeasureAttributeMapping, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentMultiMeasureAttributeMapping(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentMultiMeasureMapping(v *types.MultiMeasureMapping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MultiMeasureAttributeMappings != nil { + ok := object.Key("MultiMeasureAttributeMappings") + if err := awsRestjson1_serializeDocumentMultiMeasureAttributeMappings(v.MultiMeasureAttributeMappings, ok); err != nil { + return err + } + } + + if v.MultiMeasureName != nil { + ok := object.Key("MultiMeasureName") + ok.String(*v.MultiMeasureName) + } + + return nil +} + +func awsRestjson1_serializeDocumentMultiMeasureMappings(v []types.MultiMeasureMapping, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentMultiMeasureMapping(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentNetworkConfiguration(v *types.NetworkConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2281,6 +2383,13 @@ func awsRestjson1_serializeDocumentPipeTargetParameters(v *types.PipeTargetParam } } + if v.TimestreamParameters != nil { + ok := object.Key("TimestreamParameters") + if err := awsRestjson1_serializeDocumentPipeTargetTimestreamParameters(v.TimestreamParameters, ok); err != nil { + return err + } + } + return nil } @@ -2366,6 +2475,59 @@ func awsRestjson1_serializeDocumentPipeTargetStateMachineParameters(v *types.Pip return nil } +func awsRestjson1_serializeDocumentPipeTargetTimestreamParameters(v *types.PipeTargetTimestreamParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DimensionMappings != nil { + ok := object.Key("DimensionMappings") + if err := awsRestjson1_serializeDocumentDimensionMappings(v.DimensionMappings, ok); err != nil { + return err + } + } + + if len(v.EpochTimeUnit) > 0 { + ok := object.Key("EpochTimeUnit") + ok.String(string(v.EpochTimeUnit)) + } + + if v.MultiMeasureMappings != nil { + ok := object.Key("MultiMeasureMappings") + if err := awsRestjson1_serializeDocumentMultiMeasureMappings(v.MultiMeasureMappings, ok); err != nil { + return err + } + } + + if v.SingleMeasureMappings != nil { + ok := object.Key("SingleMeasureMappings") + if err := awsRestjson1_serializeDocumentSingleMeasureMappings(v.SingleMeasureMappings, ok); err != nil { + return err + } + } + + if len(v.TimeFieldType) > 0 { + ok := object.Key("TimeFieldType") + ok.String(string(v.TimeFieldType)) + } + + if v.TimestampFormat != nil { + ok := object.Key("TimestampFormat") + ok.String(*v.TimestampFormat) + } + + if v.TimeValue != nil { + ok := object.Key("TimeValue") + ok.String(*v.TimeValue) + } + + if v.VersionValue != nil { + ok := object.Key("VersionValue") + ok.String(*v.VersionValue) + } + + return nil +} + func awsRestjson1_serializeDocumentPlacementConstraint(v *types.PlacementConstraint, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2565,6 +2727,41 @@ func awsRestjson1_serializeDocumentSelfManagedKafkaAccessConfigurationVpc(v *typ return nil } +func awsRestjson1_serializeDocumentSingleMeasureMapping(v *types.SingleMeasureMapping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MeasureName != nil { + ok := object.Key("MeasureName") + ok.String(*v.MeasureName) + } + + if v.MeasureValue != nil { + ok := object.Key("MeasureValue") + ok.String(*v.MeasureValue) + } + + if len(v.MeasureValueType) > 0 { + ok := object.Key("MeasureValueType") + ok.String(string(v.MeasureValueType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSingleMeasureMappings(v []types.SingleMeasureMapping, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSingleMeasureMapping(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentSqls(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/pipes/types/enums.go b/service/pipes/types/enums.go index 4c3ef757f78..139618471ff 100644 --- a/service/pipes/types/enums.go +++ b/service/pipes/types/enums.go @@ -62,6 +62,23 @@ func (BatchResourceRequirementType) Values() []BatchResourceRequirementType { } } +type DimensionValueType string + +// Enum values for DimensionValueType +const ( + DimensionValueTypeVarchar DimensionValueType = "VARCHAR" +) + +// Values returns all known values for DimensionValueType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DimensionValueType) Values() []DimensionValueType { + return []DimensionValueType{ + "VARCHAR", + } +} + type DynamoDBStreamStartPosition string // Enum values for DynamoDBStreamStartPosition @@ -117,6 +134,29 @@ func (EcsResourceRequirementType) Values() []EcsResourceRequirementType { } } +type EpochTimeUnit string + +// Enum values for EpochTimeUnit +const ( + EpochTimeUnitMilliseconds EpochTimeUnit = "MILLISECONDS" + EpochTimeUnitSeconds EpochTimeUnit = "SECONDS" + EpochTimeUnitMicroseconds EpochTimeUnit = "MICROSECONDS" + EpochTimeUnitNanoseconds EpochTimeUnit = "NANOSECONDS" +) + +// Values returns all known values for EpochTimeUnit. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EpochTimeUnit) Values() []EpochTimeUnit { + return []EpochTimeUnit{ + "MILLISECONDS", + "SECONDS", + "MICROSECONDS", + "NANOSECONDS", + } +} + type IncludeExecutionDataOption string // Enum values for IncludeExecutionDataOption @@ -199,6 +239,31 @@ func (LogLevel) Values() []LogLevel { } } +type MeasureValueType string + +// Enum values for MeasureValueType +const ( + MeasureValueTypeDouble MeasureValueType = "DOUBLE" + MeasureValueTypeBigint MeasureValueType = "BIGINT" + MeasureValueTypeVarchar MeasureValueType = "VARCHAR" + MeasureValueTypeBoolean MeasureValueType = "BOOLEAN" + MeasureValueTypeTimestamp MeasureValueType = "TIMESTAMP" +) + +// Values returns all known values for MeasureValueType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (MeasureValueType) Values() []MeasureValueType { + return []MeasureValueType{ + "DOUBLE", + "BIGINT", + "VARCHAR", + "BOOLEAN", + "TIMESTAMP", + } +} + type MSKStartPosition string // Enum values for MSKStartPosition @@ -438,3 +503,22 @@ func (SelfManagedKafkaStartPosition) Values() []SelfManagedKafkaStartPosition { "LATEST", } } + +type TimeFieldType string + +// Enum values for TimeFieldType +const ( + TimeFieldTypeEpoch TimeFieldType = "EPOCH" + TimeFieldTypeTimestampFormat TimeFieldType = "TIMESTAMP_FORMAT" +) + +// Values returns all known values for TimeFieldType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TimeFieldType) Values() []TimeFieldType { + return []TimeFieldType{ + "EPOCH", + "TIMESTAMP_FORMAT", + } +} diff --git a/service/pipes/types/types.go b/service/pipes/types/types.go index 207603802f0..cdc18d26be0 100644 --- a/service/pipes/types/types.go +++ b/service/pipes/types/types.go @@ -288,6 +288,34 @@ type DeadLetterConfig struct { noSmithyDocumentSerde } +// Maps source data to a dimension in the target Timestream for LiveAnalytics +// table. +// +// For more information, see [Amazon Timestream for LiveAnalytics concepts] +// +// [Amazon Timestream for LiveAnalytics concepts]: https://docs.aws.amazon.com/timestream/latest/developerguide/concepts.html +type DimensionMapping struct { + + // The metadata attributes of the time series. For example, the name and + // Availability Zone of an Amazon EC2 instance or the name of the manufacturer of a + // wind turbine are dimensions. + // + // This member is required. + DimensionName *string + + // Dynamic path to the dimension value in the source event. + // + // This member is required. + DimensionValue *string + + // The data type of the dimension for the time-series data. + // + // This member is required. + DimensionValueType DimensionValueType + + noSmithyDocumentSerde +} + // The overrides that are sent to a container. An empty container override can be // passed in. An example of an empty container override is {"containerOverrides": // [ ] } . If a non-empty container override is specified, the name parameter must @@ -529,21 +557,21 @@ type FilterCriteria struct { noSmithyDocumentSerde } -// The Amazon Kinesis Data Firehose logging configuration settings for the pipe. +// The Amazon Data Firehose logging configuration settings for the pipe. type FirehoseLogDestination struct { - // The Amazon Resource Name (ARN) of the Kinesis Data Firehose delivery stream to - // which EventBridge delivers the pipe log records. + // The Amazon Resource Name (ARN) of the Firehose delivery stream to which + // EventBridge delivers the pipe log records. DeliveryStreamArn *string noSmithyDocumentSerde } -// The Amazon Kinesis Data Firehose logging configuration settings for the pipe. +// The Amazon Data Firehose logging configuration settings for the pipe. type FirehoseLogDestinationParameters struct { - // Specifies the Amazon Resource Name (ARN) of the Kinesis Data Firehose delivery - // stream to which EventBridge delivers the pipe log records. + // Specifies the Amazon Resource Name (ARN) of the Firehose delivery stream to + // which EventBridge delivers the pipe log records. // // This member is required. DeliveryStreamArn *string @@ -597,6 +625,50 @@ type MSKAccessCredentialsMemberSaslScram512Auth struct { func (*MSKAccessCredentialsMemberSaslScram512Auth) isMSKAccessCredentials() {} +// A mapping of a source event data field to a measure in a Timestream for +// LiveAnalytics record. +type MultiMeasureAttributeMapping struct { + + // Dynamic path to the measurement attribute in the source event. + // + // This member is required. + MeasureValue *string + + // Data type of the measurement attribute in the source event. + // + // This member is required. + MeasureValueType MeasureValueType + + // Target measure name to be used. + // + // This member is required. + MultiMeasureAttributeName *string + + noSmithyDocumentSerde +} + +// Maps multiple measures from the source event to the same Timestream for +// LiveAnalytics record. +// +// For more information, see [Amazon Timestream for LiveAnalytics concepts] +// +// [Amazon Timestream for LiveAnalytics concepts]: https://docs.aws.amazon.com/timestream/latest/developerguide/concepts.html +type MultiMeasureMapping struct { + + // Mappings that represent multiple source event fields mapped to measures in the + // same Timestream for LiveAnalytics record. + // + // This member is required. + MultiMeasureAttributeMappings []MultiMeasureAttributeMapping + + // The name of the multiple measurements per record (multi-measure). + // + // This member is required. + MultiMeasureName *string + + noSmithyDocumentSerde +} + // This structure specifies the network configuration for an Amazon ECS task. type NetworkConfiguration struct { @@ -699,7 +771,7 @@ type PipeLogConfiguration struct { // The Amazon CloudWatch Logs logging configuration settings for the pipe. CloudwatchLogsLogDestination *CloudwatchLogsLogDestination - // The Amazon Kinesis Data Firehose logging configuration settings for the pipe. + // The Amazon Data Firehose logging configuration settings for the pipe. FirehoseLogDestination *FirehoseLogDestination // Whether the execution data (specifically, the payload , awsRequest , and @@ -732,12 +804,12 @@ type PipeLogConfiguration struct { // S3LogDestinationParameters ), EventBridge sets that field to its system-default // value during the update. // -// For example, suppose when you created the pipe you specified a Kinesis Data -// Firehose stream log destination. You then update the pipe to add an Amazon S3 -// log destination. In addition to specifying the S3LogDestinationParameters for -// the new log destination, you must also specify the fields in the -// FirehoseLogDestinationParameters object in order to retain the Kinesis Data -// Firehose stream log destination. +// For example, suppose when you created the pipe you specified a Firehose stream +// log destination. You then update the pipe to add an Amazon S3 log destination. +// In addition to specifying the S3LogDestinationParameters for the new log +// destination, you must also specify the fields in the +// FirehoseLogDestinationParameters object in order to retain the Firehose stream +// log destination. // // For more information on generating pipe log records, see Log EventBridge Pipes in the Amazon // EventBridge User Guide. @@ -756,17 +828,17 @@ type PipeLogConfigurationParameters struct { // The Amazon CloudWatch Logs logging configuration settings for the pipe. CloudwatchLogsLogDestination *CloudwatchLogsLogDestinationParameters - // The Amazon Kinesis Data Firehose logging configuration settings for the pipe. + // The Amazon Data Firehose logging configuration settings for the pipe. FirehoseLogDestination *FirehoseLogDestinationParameters - // Specify ON to include the execution data (specifically, the payload and - // awsRequest fields) in the log messages for this pipe. + // Specify ALL to include the execution data (specifically, the payload , + // awsRequest , and awsResponse fields) in the log messages for this pipe. // // This applies to all log destinations for the pipe. // // For more information, see [Including execution data in logs] in the Amazon EventBridge User Guide. // - // The default is OFF . + // By default, execution data is not included. // // [Including execution data in logs]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-execution-data IncludeExecutionData []IncludeExecutionDataOption @@ -938,6 +1010,16 @@ type PipeSourceParameters struct { RabbitMQBrokerParameters *PipeSourceRabbitMQBrokerParameters // The parameters for using a self-managed Apache Kafka stream as a source. + // + // A self managed cluster refers to any Apache Kafka cluster not hosted by Amazon + // Web Services. This includes both clusters you manage yourself, as well as those + // hosted by a third-party provider, such as [Confluent Cloud], [CloudKarafka], or [Redpanda]. For more information, see [Apache Kafka streams as a source] + // in the Amazon EventBridge User Guide. + // + // [CloudKarafka]: https://www.cloudkarafka.com/ + // [Apache Kafka streams as a source]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-kafka.html + // [Confluent Cloud]: https://www.confluent.io/ + // [Redpanda]: https://redpanda.com/ SelfManagedKafkaParameters *PipeSourceSelfManagedKafkaParameters // The parameters for using a Amazon SQS stream as a source. @@ -972,6 +1054,16 @@ type PipeSourceRabbitMQBrokerParameters struct { } // The parameters for using a self-managed Apache Kafka stream as a source. +// +// A self managed cluster refers to any Apache Kafka cluster not hosted by Amazon +// Web Services. This includes both clusters you manage yourself, as well as those +// hosted by a third-party provider, such as [Confluent Cloud], [CloudKarafka], or [Redpanda]. For more information, see [Apache Kafka streams as a source] +// in the Amazon EventBridge User Guide. +// +// [CloudKarafka]: https://www.cloudkarafka.com/ +// [Apache Kafka streams as a source]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-kafka.html +// [Confluent Cloud]: https://www.confluent.io/ +// [Redpanda]: https://redpanda.com/ type PipeSourceSelfManagedKafkaParameters struct { // The name of the topic that the pipe will read from. @@ -1309,6 +1401,9 @@ type PipeTargetParameters struct { // The parameters for using a Step Functions state machine as a target. StepFunctionStateMachineParameters *PipeTargetStateMachineParameters + // The parameters for using a Timestream for LiveAnalytics table as a target. + TimestreamParameters *PipeTargetTimestreamParameters + noSmithyDocumentSerde } @@ -1394,6 +1489,71 @@ type PipeTargetStateMachineParameters struct { noSmithyDocumentSerde } +// The parameters for using a Timestream for LiveAnalytics table as a target. +type PipeTargetTimestreamParameters struct { + + // Map source data to dimensions in the target Timestream for LiveAnalytics table. + // + // For more information, see [Amazon Timestream for LiveAnalytics concepts] + // + // [Amazon Timestream for LiveAnalytics concepts]: https://docs.aws.amazon.com/timestream/latest/developerguide/concepts.html + // + // This member is required. + DimensionMappings []DimensionMapping + + // Dynamic path to the source data field that represents the time value for your + // data. + // + // This member is required. + TimeValue *string + + // 64 bit version value or source data field that represents the version value for + // your data. + // + // Write requests with a higher version number will update the existing measure + // values of the record and version. In cases where the measure value is the same, + // the version will still be updated. + // + // Default value is 1. + // + // Timestream for LiveAnalytics does not support updating partial measure values + // in a record. + // + // Write requests for duplicate data with a higher version number will update the + // existing measure value and version. In cases where the measure value is the + // same, Version will still be updated. Default value is 1 . + // + // Version must be 1 or greater, or you will receive a ValidationException error. + // + // This member is required. + VersionValue *string + + // The granularity of the time units used. Default is MILLISECONDS . + // + // Required if TimeFieldType is specified as EPOCH . + EpochTimeUnit EpochTimeUnit + + // Maps multiple measures from the source event to the same record in the + // specified Timestream for LiveAnalytics table. + MultiMeasureMappings []MultiMeasureMapping + + // Mappings of single source data fields to individual records in the specified + // Timestream for LiveAnalytics table. + SingleMeasureMappings []SingleMeasureMapping + + // The type of time value used. + // + // The default is EPOCH . + TimeFieldType TimeFieldType + + // How to format the timestamps. For example, YYYY-MM-DDThh:mm:ss.sssTZD . + // + // Required if TimeFieldType is specified as TIMESTAMP_FORMAT . + TimestampFormat *string + + noSmithyDocumentSerde +} + // An object representing a constraint on task placement. To learn more, see [Task Placement Constraints] in // the Amazon Elastic Container Service Developer Guide. // @@ -1599,6 +1759,32 @@ type SelfManagedKafkaAccessConfigurationVpc struct { noSmithyDocumentSerde } +// Maps a single source data field to a single record in the specified Timestream +// for LiveAnalytics table. +// +// For more information, see [Amazon Timestream for LiveAnalytics concepts] +// +// [Amazon Timestream for LiveAnalytics concepts]: https://docs.aws.amazon.com/timestream/latest/developerguide/concepts.html +type SingleMeasureMapping struct { + + // Target measure name for the measurement attribute in the Timestream table. + // + // This member is required. + MeasureName *string + + // Dynamic path of the source field to map to the measure in the record. + // + // This member is required. + MeasureValue *string + + // Data type of the source field. + // + // This member is required. + MeasureValueType MeasureValueType + + noSmithyDocumentSerde +} + // A key-value pair associated with an Amazon Web Services resource. In // EventBridge, rules and event buses support tagging. type Tag struct { @@ -1748,6 +1934,16 @@ type UpdatePipeSourceParameters struct { RabbitMQBrokerParameters *UpdatePipeSourceRabbitMQBrokerParameters // The parameters for using a self-managed Apache Kafka stream as a source. + // + // A self managed cluster refers to any Apache Kafka cluster not hosted by Amazon + // Web Services. This includes both clusters you manage yourself, as well as those + // hosted by a third-party provider, such as [Confluent Cloud], [CloudKarafka], or [Redpanda]. For more information, see [Apache Kafka streams as a source] + // in the Amazon EventBridge User Guide. + // + // [CloudKarafka]: https://www.cloudkarafka.com/ + // [Apache Kafka streams as a source]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-kafka.html + // [Confluent Cloud]: https://www.confluent.io/ + // [Redpanda]: https://redpanda.com/ SelfManagedKafkaParameters *UpdatePipeSourceSelfManagedKafkaParameters // The parameters for using a Amazon SQS stream as a source. @@ -1774,6 +1970,16 @@ type UpdatePipeSourceRabbitMQBrokerParameters struct { } // The parameters for using a self-managed Apache Kafka stream as a source. +// +// A self managed cluster refers to any Apache Kafka cluster not hosted by Amazon +// Web Services. This includes both clusters you manage yourself, as well as those +// hosted by a third-party provider, such as [Confluent Cloud], [CloudKarafka], or [Redpanda]. For more information, see [Apache Kafka streams as a source] +// in the Amazon EventBridge User Guide. +// +// [CloudKarafka]: https://www.cloudkarafka.com/ +// [Apache Kafka streams as a source]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-kafka.html +// [Confluent Cloud]: https://www.confluent.io/ +// [Redpanda]: https://redpanda.com/ type UpdatePipeSourceSelfManagedKafkaParameters struct { // The maximum number of records to include in each batch. diff --git a/service/pipes/validators.go b/service/pipes/validators.go index 212ce40a1a7..21d17438997 100644 --- a/service/pipes/validators.go +++ b/service/pipes/validators.go @@ -340,6 +340,44 @@ func validateCloudwatchLogsLogDestinationParameters(v *types.CloudwatchLogsLogDe } } +func validateDimensionMapping(v *types.DimensionMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DimensionMapping"} + if v.DimensionValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("DimensionValue")) + } + if len(v.DimensionValueType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DimensionValueType")) + } + if v.DimensionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DimensionName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDimensionMappings(v []types.DimensionMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DimensionMappings"} + for i := range v { + if err := validateDimensionMapping(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateEcsContainerOverride(v *types.EcsContainerOverride) error { if v == nil { return nil @@ -501,6 +539,83 @@ func validateFirehoseLogDestinationParameters(v *types.FirehoseLogDestinationPar } } +func validateMultiMeasureAttributeMapping(v *types.MultiMeasureAttributeMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MultiMeasureAttributeMapping"} + if v.MeasureValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("MeasureValue")) + } + if len(v.MeasureValueType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("MeasureValueType")) + } + if v.MultiMeasureAttributeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MultiMeasureAttributeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMultiMeasureAttributeMappings(v []types.MultiMeasureAttributeMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MultiMeasureAttributeMappings"} + for i := range v { + if err := validateMultiMeasureAttributeMapping(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMultiMeasureMapping(v *types.MultiMeasureMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MultiMeasureMapping"} + if v.MultiMeasureName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MultiMeasureName")) + } + if v.MultiMeasureAttributeMappings == nil { + invalidParams.Add(smithy.NewErrParamRequired("MultiMeasureAttributeMappings")) + } else if v.MultiMeasureAttributeMappings != nil { + if err := validateMultiMeasureAttributeMappings(v.MultiMeasureAttributeMappings); err != nil { + invalidParams.AddNested("MultiMeasureAttributeMappings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMultiMeasureMappings(v []types.MultiMeasureMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MultiMeasureMappings"} + for i := range v { + if err := validateMultiMeasureMapping(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateNetworkConfiguration(v *types.NetworkConfiguration) error { if v == nil { return nil @@ -789,6 +904,11 @@ func validatePipeTargetParameters(v *types.PipeTargetParameters) error { invalidParams.AddNested("SageMakerPipelineParameters", err.(smithy.InvalidParamsError)) } } + if v.TimestreamParameters != nil { + if err := validatePipeTargetTimestreamParameters(v.TimestreamParameters); err != nil { + invalidParams.AddNested("TimestreamParameters", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -831,6 +951,41 @@ func validatePipeTargetSageMakerPipelineParameters(v *types.PipeTargetSageMakerP } } +func validatePipeTargetTimestreamParameters(v *types.PipeTargetTimestreamParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PipeTargetTimestreamParameters"} + if v.TimeValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("TimeValue")) + } + if v.VersionValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("VersionValue")) + } + if v.DimensionMappings == nil { + invalidParams.Add(smithy.NewErrParamRequired("DimensionMappings")) + } else if v.DimensionMappings != nil { + if err := validateDimensionMappings(v.DimensionMappings); err != nil { + invalidParams.AddNested("DimensionMappings", err.(smithy.InvalidParamsError)) + } + } + if v.SingleMeasureMappings != nil { + if err := validateSingleMeasureMappings(v.SingleMeasureMappings); err != nil { + invalidParams.AddNested("SingleMeasureMappings", err.(smithy.InvalidParamsError)) + } + } + if v.MultiMeasureMappings != nil { + if err := validateMultiMeasureMappings(v.MultiMeasureMappings); err != nil { + invalidParams.AddNested("MultiMeasureMappings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateS3LogDestinationParameters(v *types.S3LogDestinationParameters) error { if v == nil { return nil @@ -884,6 +1039,44 @@ func validateSageMakerPipelineParameterList(v []types.SageMakerPipelineParameter } } +func validateSingleMeasureMapping(v *types.SingleMeasureMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SingleMeasureMapping"} + if v.MeasureValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("MeasureValue")) + } + if len(v.MeasureValueType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("MeasureValueType")) + } + if v.MeasureName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MeasureName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSingleMeasureMappings(v []types.SingleMeasureMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SingleMeasureMappings"} + for i := range v { + if err := validateSingleMeasureMapping(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil diff --git a/service/rds/internal/endpoints/endpoints.go b/service/rds/internal/endpoints/endpoints.go index 5ca6411274e..e3cc623761d 100644 --- a/service/rds/internal/endpoints/endpoints.go +++ b/service/rds/internal/endpoints/endpoints.go @@ -544,37 +544,10 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "rds-fips.us-iso-east-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds-fips.us-iso-west-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-west-1", - }, - Deprecated: aws.TrueTernary, - }, endpoints.EndpointKey{ Region: "rds.us-iso-east-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-iso-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-east-1", }, @@ -583,16 +556,7 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "rds.us-iso-west-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-iso-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-west-1", }, @@ -605,12 +569,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-iso-east-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", }, endpoints.EndpointKey{ Region: "us-iso-east-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov", + Hostname: "rds.us-iso-east-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-east-1", }, @@ -623,12 +587,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-iso-west-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", }, endpoints.EndpointKey{ Region: "us-iso-west-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov", + Hostname: "rds.us-iso-west-1.c2s.ic.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-iso-west-1", }, @@ -657,28 +621,10 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "rds-fips.us-isob-east-1", - }: endpoints.Endpoint{ - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - Deprecated: aws.TrueTernary, - }, endpoints.EndpointKey{ Region: "rds.us-isob-east-1", }: endpoints.Endpoint{ - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "rds.us-isob-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-isob-east-1", }, @@ -691,12 +637,12 @@ var defaultPartitions = endpoints.Partitions{ Region: "us-isob-east-1", Variant: endpoints.FIPSVariant, }: { - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", }, endpoints.EndpointKey{ Region: "us-isob-east-1-fips", }: endpoints.Endpoint{ - Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov", + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", CredentialScope: endpoints.CredentialScope{ Region: "us-isob-east-1", }, diff --git a/service/sagemaker/api_op_DescribeClusterNode.go b/service/sagemaker/api_op_DescribeClusterNode.go index ae76483540c..fd83ea2231e 100644 --- a/service/sagemaker/api_op_DescribeClusterNode.go +++ b/service/sagemaker/api_op_DescribeClusterNode.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves information of an instance (also called a node interchangeably) of a +// Retrieves information of a node (also called a instance interchangeably) of a // SageMaker HyperPod cluster. func (c *Client) DescribeClusterNode(ctx context.Context, params *DescribeClusterNodeInput, optFns ...func(*Options)) (*DescribeClusterNodeOutput, error) { if params == nil { @@ -31,12 +31,12 @@ func (c *Client) DescribeClusterNode(ctx context.Context, params *DescribeCluste type DescribeClusterNodeInput struct { // The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod - // cluster in which the instance is. + // cluster in which the node is. // // This member is required. ClusterName *string - // The ID of the instance. + // The ID of the SageMaker HyperPod cluster node. // // This member is required. NodeId *string @@ -46,7 +46,7 @@ type DescribeClusterNodeInput struct { type DescribeClusterNodeOutput struct { - // The details of the instance. + // The details of the SageMaker HyperPod cluster node. // // This member is required. NodeDetails *types.ClusterNodeDetails diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index accff6caf5d..619e8fcb4ea 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -39482,6 +39482,55 @@ func awsAwsjson11_deserializeDocumentClusterInstanceGroupDetailsList(v *[]types. return nil } +func awsAwsjson11_deserializeDocumentClusterInstancePlacement(v **types.ClusterInstancePlacement, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ClusterInstancePlacement + if *v == nil { + sv = &types.ClusterInstancePlacement{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AvailabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClusterAvailabilityZone to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "AvailabilityZoneId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClusterAvailabilityZoneId to be of type string, got %T instead", value) + } + sv.AvailabilityZoneId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentClusterInstanceStatusDetails(v **types.ClusterInstanceStatusDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -39655,6 +39704,29 @@ func awsAwsjson11_deserializeDocumentClusterNodeDetails(v **types.ClusterNodeDet return err } + case "Placement": + if err := awsAwsjson11_deserializeDocumentClusterInstancePlacement(&sv.Placement, value); err != nil { + return err + } + + case "PrivateDnsHostname": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClusterPrivateDnsHostname to be of type string, got %T instead", value) + } + sv.PrivateDnsHostname = ptr.String(jtv) + } + + case "PrivatePrimaryIp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClusterPrivatePrimaryIp to be of type string, got %T instead", value) + } + sv.PrivatePrimaryIp = ptr.String(jtv) + } + case "ThreadsPerCore": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index a02f3fd06ee..8ec943ac481 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -3208,6 +3208,22 @@ type ClusterInstanceGroupSpecification struct { noSmithyDocumentSerde } +// Specifies the placement details for the node in the SageMaker HyperPod cluster, +// including the Availability Zone and the unique identifier (ID) of the +// Availability Zone. +type ClusterInstancePlacement struct { + + // The Availability Zone where the node in the SageMaker HyperPod cluster is + // launched. + AvailabilityZone *string + + // The unique identifier (ID) of the Availability Zone where the node in the + // SageMaker HyperPod cluster is launched. + AvailabilityZoneId *string + + noSmithyDocumentSerde +} + // Details of an instance in a SageMaker HyperPod cluster. type ClusterInstanceStatusDetails struct { @@ -3268,6 +3284,15 @@ type ClusterNodeDetails struct { // The LifeCycle configuration applied to the instance. LifeCycleConfig *ClusterLifeCycleConfig + // The placement details of the SageMaker HyperPod cluster node. + Placement *ClusterInstancePlacement + + // The private DNS hostname of the SageMaker HyperPod cluster node. + PrivateDnsHostname *string + + // The private primary IP address of the SageMaker HyperPod cluster node. + PrivatePrimaryIp *string + // The number of threads per CPU core you specified under CreateCluster . ThreadsPerCore *int32 diff --git a/service/taxsettings/LICENSE.txt b/service/taxsettings/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/taxsettings/LICENSE.txt @@ -0,0 +1,202 @@ + + 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/service/taxsettings/api_client.go b/service/taxsettings/api_client.go new file mode 100644 index 00000000000..77bb55bf0db --- /dev/null +++ b/service/taxsettings/api_client.go @@ -0,0 +1,537 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "TaxSettings" +const ServiceAPIVersion = "2018-05-10" + +// Client provides the API client to make operations call for Tax Settings. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "taxsettings", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/service/taxsettings/api_client_test.go b/service/taxsettings/api_client_test.go new file mode 100644 index 00000000000..b38a40f24b6 --- /dev/null +++ b/service/taxsettings/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/taxsettings/api_op_BatchDeleteTaxRegistration.go b/service/taxsettings/api_op_BatchDeleteTaxRegistration.go new file mode 100644 index 00000000000..2fe62a5dd01 --- /dev/null +++ b/service/taxsettings/api_op_BatchDeleteTaxRegistration.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes tax registration for multiple accounts in batch. This can be used to +// delete tax registrations for up to five accounts in one batch. +// +// This API operation can't be used to delete your tax registration in Brazil. Use +// the [Payment preferences]page in the Billing and Cost Management console instead. +// +// [Payment preferences]: https://console.aws.amazon.com/billing/home#/paymentpreferences/paymentmethods +func (c *Client) BatchDeleteTaxRegistration(ctx context.Context, params *BatchDeleteTaxRegistrationInput, optFns ...func(*Options)) (*BatchDeleteTaxRegistrationOutput, error) { + if params == nil { + params = &BatchDeleteTaxRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDeleteTaxRegistration", params, optFns, c.addOperationBatchDeleteTaxRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDeleteTaxRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDeleteTaxRegistrationInput struct { + + // List of unique account identifiers. + // + // This member is required. + AccountIds []string + + noSmithyDocumentSerde +} + +type BatchDeleteTaxRegistrationOutput struct { + + // The list of errors for the accounts the TRN information could not be deleted + // for. + // + // This member is required. + Errors []types.BatchDeleteTaxRegistrationError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDeleteTaxRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchDeleteTaxRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchDeleteTaxRegistration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchDeleteTaxRegistration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpBatchDeleteTaxRegistrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteTaxRegistration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchDeleteTaxRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchDeleteTaxRegistration", + } +} diff --git a/service/taxsettings/api_op_BatchPutTaxRegistration.go b/service/taxsettings/api_op_BatchPutTaxRegistration.go new file mode 100644 index 00000000000..27e074d988e --- /dev/null +++ b/service/taxsettings/api_op_BatchPutTaxRegistration.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds or updates tax registration for multiple accounts in batch. This can be +// used to add or update tax registrations for up to five accounts in one batch. +// You can't set a TRN if there's a pending TRN. You'll need to delete the pending +// TRN first. +// +// To call this API operation for specific countries, see the following +// country-specific requirements. +// +// Bangladesh +// +// - You must specify the tax registration certificate document in the +// taxRegistrationDocuments field of the VerificationDetails object. +// +// Brazil +// +// - You must complete the tax registration process in the [Payment preferences]page in the Billing +// and Cost Management console. After your TRN and billing address are verified, +// you can call this API operation. +// +// - For Amazon Web Services accounts created through Organizations, you can +// call this API operation when you don't have a billing address. +// +// Georgia +// +// - The valid personType values are Physical Person and Business . +// +// Kenya +// +// - You must specify the personType in the kenyaAdditionalInfo field of the +// additionalTaxInformation object. +// +// - If the personType is Physical Person , you must specify the tax registration +// certificate document in the taxRegistrationDocuments field of the +// VerificationDetails object. +// +// Malaysia +// +// - If you use this operation to set a tax registration number (TRN) in +// Malaysia, only resellers with a valid sales and service tax (SST) number are +// required to provide tax registration information. +// +// - By using this API operation to set a TRN in Malaysia, Amazon Web Services +// will regard you as self-declaring that you're an authorized business reseller +// registered with the Royal Malaysia Customs Department (RMCD) and have a valid +// SST number. +// +// - Amazon Web Services reserves the right to seek additional information +// and/or take other actions to support your self-declaration as appropriate. +// +// - If you're not a reseller of Amazon Web Services, we don't recommend that +// you use this operation to set the TRN in Malaysia. +// +// - Only use this API operation to upload the TRNs for accounts through which +// you're reselling Amazon Web Services. +// +// - Amazon Web Services is currently registered under the following service tax +// codes. You must include at least one of the service tax codes in the service tax +// code strings to declare yourself as an authorized registered business reseller. +// +// Taxable service and service tax codes: +// +// # Consultancy - 9907061674 +// +// # Training or coaching service - 9907071685 +// +// # IT service - 9907101676 +// +// # Digital services and electronic medium - 9907121690 +// +// Nepal +// +// - The sector valid values are Business and Individual . +// +// Saudi Arabia +// +// - For address , you must specify addressLine3 . +// +// South Korea +// +// - You must specify the certifiedEmailId and legalName in the +// TaxRegistrationEntry object. Use Korean characters for legalName . +// +// - You must specify the businessRepresentativeName , itemOfBusiness , and +// lineOfBusiness in the southKoreaAdditionalInfo field of the +// additionalTaxInformation object. Use Korean characters for these fields. +// +// - You must specify the tax registration certificate document in the +// taxRegistrationDocuments field of the VerificationDetails object. +// +// - For the address object, use Korean characters for addressLine1 , +// addressLine2 city , postalCode , and stateOrRegion . +// +// Spain +// +// - You must specify the registrationType in the spainAdditionalInfo field of +// the additionalTaxInformation object. +// +// - If the registrationType is Local , you must specify the tax registration +// certificate document in the taxRegistrationDocuments field of the +// VerificationDetails object. +// +// Turkey +// +// - You must specify the sector in the taxRegistrationEntry object. +// +// - If your sector is Business , Individual , or Government : +// +// - Specify the taxOffice . If your sector is Individual , don't enter this +// value. +// +// - (Optional) Specify the kepEmailId . If your sector is Individual , don't +// enter this value. +// +// - Note: In the Tax Settings page of the Billing console, Government appears as +// Public institutions +// +// - If your sector is Business and you're subject to KDV tax, you must specify +// your industry in the industries field. +// +// - For address , you must specify districtOrCounty . +// +// Ukraine +// +// - The sector valid values are Business and Individual . +// +// [Payment preferences]: https://console.aws.amazon.com/billing/home#/paymentpreferences/paymentmethods +func (c *Client) BatchPutTaxRegistration(ctx context.Context, params *BatchPutTaxRegistrationInput, optFns ...func(*Options)) (*BatchPutTaxRegistrationOutput, error) { + if params == nil { + params = &BatchPutTaxRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchPutTaxRegistration", params, optFns, c.addOperationBatchPutTaxRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchPutTaxRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchPutTaxRegistrationInput struct { + + // List of unique account identifiers. + // + // This member is required. + AccountIds []string + + // Your TRN information that will be stored to the accounts mentioned in putEntries + // . + // + // This member is required. + TaxRegistrationEntry *types.TaxRegistrationEntry + + noSmithyDocumentSerde +} + +type BatchPutTaxRegistrationOutput struct { + + // List of errors for the accounts the TRN information could not be added or + // updated to. + // + // This member is required. + Errors []types.BatchPutTaxRegistrationError + + // The status of your TRN stored in the system after processing. Based on the + // validation occurring on the TRN, the status can be Verified , Pending or + // Rejected . + Status types.TaxRegistrationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchPutTaxRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchPutTaxRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchPutTaxRegistration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchPutTaxRegistration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpBatchPutTaxRegistrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchPutTaxRegistration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchPutTaxRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchPutTaxRegistration", + } +} diff --git a/service/taxsettings/api_op_DeleteTaxRegistration.go b/service/taxsettings/api_op_DeleteTaxRegistration.go new file mode 100644 index 00000000000..c57c699ebb5 --- /dev/null +++ b/service/taxsettings/api_op_DeleteTaxRegistration.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes tax registration for a single account. +// +// This API operation can't be used to delete your tax registration in Brazil. Use +// the [Payment preferences]page in the Billing and Cost Management console instead. +// +// [Payment preferences]: https://console.aws.amazon.com/billing/home#/paymentpreferences/paymentmethods +func (c *Client) DeleteTaxRegistration(ctx context.Context, params *DeleteTaxRegistrationInput, optFns ...func(*Options)) (*DeleteTaxRegistrationOutput, error) { + if params == nil { + params = &DeleteTaxRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTaxRegistration", params, optFns, c.addOperationDeleteTaxRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTaxRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTaxRegistrationInput struct { + + // Unique account identifier for the TRN information that needs to be deleted. If + // this isn't passed, the account ID corresponding to the credentials of the API + // caller will be used for this parameter. + AccountId *string + + noSmithyDocumentSerde +} + +type DeleteTaxRegistrationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTaxRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteTaxRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteTaxRegistration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTaxRegistration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTaxRegistration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteTaxRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteTaxRegistration", + } +} diff --git a/service/taxsettings/api_op_GetTaxRegistration.go b/service/taxsettings/api_op_GetTaxRegistration.go new file mode 100644 index 00000000000..73580dc1131 --- /dev/null +++ b/service/taxsettings/api_op_GetTaxRegistration.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves tax registration for a single account. +func (c *Client) GetTaxRegistration(ctx context.Context, params *GetTaxRegistrationInput, optFns ...func(*Options)) (*GetTaxRegistrationOutput, error) { + if params == nil { + params = &GetTaxRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTaxRegistration", params, optFns, c.addOperationGetTaxRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTaxRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTaxRegistrationInput struct { + + // Your unique account identifier. + AccountId *string + + noSmithyDocumentSerde +} + +type GetTaxRegistrationOutput struct { + + // TRN information of the account mentioned in the request. + TaxRegistration *types.TaxRegistration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTaxRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTaxRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTaxRegistration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTaxRegistration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTaxRegistration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetTaxRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTaxRegistration", + } +} diff --git a/service/taxsettings/api_op_GetTaxRegistrationDocument.go b/service/taxsettings/api_op_GetTaxRegistrationDocument.go new file mode 100644 index 00000000000..5345ee56239 --- /dev/null +++ b/service/taxsettings/api_op_GetTaxRegistrationDocument.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Downloads your tax documents to the Amazon S3 bucket that you specify in your +// request. +func (c *Client) GetTaxRegistrationDocument(ctx context.Context, params *GetTaxRegistrationDocumentInput, optFns ...func(*Options)) (*GetTaxRegistrationDocumentOutput, error) { + if params == nil { + params = &GetTaxRegistrationDocumentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTaxRegistrationDocument", params, optFns, c.addOperationGetTaxRegistrationDocumentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTaxRegistrationDocumentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTaxRegistrationDocumentInput struct { + + // The Amazon S3 bucket that you specify to download your tax documents to. + // + // This member is required. + DestinationS3Location *types.DestinationS3Location + + // The metadata for your tax document. + // + // This member is required. + TaxDocumentMetadata *types.TaxDocumentMetadata + + noSmithyDocumentSerde +} + +type GetTaxRegistrationDocumentOutput struct { + + // The file path of the Amazon S3 bucket where you want to download your tax + // document to. + DestinationFilePath *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTaxRegistrationDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTaxRegistrationDocument{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTaxRegistrationDocument{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTaxRegistrationDocument"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetTaxRegistrationDocumentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTaxRegistrationDocument(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetTaxRegistrationDocument(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTaxRegistrationDocument", + } +} diff --git a/service/taxsettings/api_op_ListTaxRegistrations.go b/service/taxsettings/api_op_ListTaxRegistrations.go new file mode 100644 index 00000000000..71c490c22fe --- /dev/null +++ b/service/taxsettings/api_op_ListTaxRegistrations.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the tax registration of accounts listed in a consolidated billing +// family. This can be used to retrieve up to 100 accounts' tax registrations in +// one call (default 50). +func (c *Client) ListTaxRegistrations(ctx context.Context, params *ListTaxRegistrationsInput, optFns ...func(*Options)) (*ListTaxRegistrationsOutput, error) { + if params == nil { + params = &ListTaxRegistrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTaxRegistrations", params, optFns, c.addOperationListTaxRegistrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTaxRegistrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTaxRegistrationsInput struct { + + // Number of accountDetails results you want in one response. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListTaxRegistrationsOutput struct { + + // The list of account details. This contains account Ids and TRN Information for + // each of the linked accounts. + // + // This member is required. + AccountDetails []types.AccountDetails + + // The token to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTaxRegistrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTaxRegistrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTaxRegistrations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTaxRegistrations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTaxRegistrations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListTaxRegistrationsAPIClient is a client that implements the +// ListTaxRegistrations operation. +type ListTaxRegistrationsAPIClient interface { + ListTaxRegistrations(context.Context, *ListTaxRegistrationsInput, ...func(*Options)) (*ListTaxRegistrationsOutput, error) +} + +var _ ListTaxRegistrationsAPIClient = (*Client)(nil) + +// ListTaxRegistrationsPaginatorOptions is the paginator options for +// ListTaxRegistrations +type ListTaxRegistrationsPaginatorOptions struct { + // Number of accountDetails results you want in one response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListTaxRegistrationsPaginator is a paginator for ListTaxRegistrations +type ListTaxRegistrationsPaginator struct { + options ListTaxRegistrationsPaginatorOptions + client ListTaxRegistrationsAPIClient + params *ListTaxRegistrationsInput + nextToken *string + firstPage bool +} + +// NewListTaxRegistrationsPaginator returns a new ListTaxRegistrationsPaginator +func NewListTaxRegistrationsPaginator(client ListTaxRegistrationsAPIClient, params *ListTaxRegistrationsInput, optFns ...func(*ListTaxRegistrationsPaginatorOptions)) *ListTaxRegistrationsPaginator { + if params == nil { + params = &ListTaxRegistrationsInput{} + } + + options := ListTaxRegistrationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTaxRegistrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTaxRegistrationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTaxRegistrations page. +func (p *ListTaxRegistrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTaxRegistrationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListTaxRegistrations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListTaxRegistrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTaxRegistrations", + } +} diff --git a/service/taxsettings/api_op_PutTaxRegistration.go b/service/taxsettings/api_op_PutTaxRegistration.go new file mode 100644 index 00000000000..39500474de5 --- /dev/null +++ b/service/taxsettings/api_op_PutTaxRegistration.go @@ -0,0 +1,265 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds or updates tax registration for a single account. You can't set a TRN if +// there's a pending TRN. You'll need to delete the pending TRN first. +// +// To call this API operation for specific countries, see the following +// country-specific requirements. +// +// Bangladesh +// +// - You must specify the tax registration certificate document in the +// taxRegistrationDocuments field of the VerificationDetails object. +// +// Brazil +// +// - You must complete the tax registration process in the [Payment preferences]page in the Billing +// and Cost Management console. After your TRN and billing address are verified, +// you can call this API operation. +// +// - For Amazon Web Services accounts created through Organizations, you can +// call this API operation when you don't have a billing address. +// +// Georgia +// +// - The valid personType values are Physical Person and Business . +// +// Kenya +// +// - You must specify the personType in the kenyaAdditionalInfo field of the +// additionalTaxInformation object. +// +// - If the personType is Physical Person , you must specify the tax registration +// certificate document in the taxRegistrationDocuments field of the +// VerificationDetails object. +// +// Malaysia +// +// - If you use this operation to set a tax registration number (TRN) in +// Malaysia, only resellers with a valid sales and service tax (SST) number are +// required to provide tax registration information. +// +// - By using this API operation to set a TRN in Malaysia, Amazon Web Services +// will regard you as self-declaring that you're an authorized business reseller +// registered with the Royal Malaysia Customs Department (RMCD) and have a valid +// SST number. +// +// - Amazon Web Services reserves the right to seek additional information +// and/or take other actions to support your self-declaration as appropriate. +// +// - If you're not a reseller of Amazon Web Services, we don't recommend that +// you use this operation to set the TRN in Malaysia. +// +// - Only use this API operation to upload the TRNs for accounts through which +// you're reselling Amazon Web Services. +// +// - Amazon Web Services is currently registered under the following service tax +// codes. You must include at least one of the service tax codes in the service tax +// code strings to declare yourself as an authorized registered business reseller. +// +// Taxable service and service tax codes: +// +// # Consultancy - 9907061674 +// +// # Training or coaching service - 9907071685 +// +// # IT service - 9907101676 +// +// # Digital services and electronic medium - 9907121690 +// +// Nepal +// +// - The sector valid values are Business and Individual . +// +// Saudi Arabia +// +// - For address , you must specify addressLine3 . +// +// South Korea +// +// - You must specify the certifiedEmailId and legalName in the +// TaxRegistrationEntry object. Use Korean characters for legalName . +// +// - You must specify the businessRepresentativeName , itemOfBusiness , and +// lineOfBusiness in the southKoreaAdditionalInfo field of the +// additionalTaxInformation object. Use Korean characters for these fields. +// +// - You must specify the tax registration certificate document in the +// taxRegistrationDocuments field of the VerificationDetails object. +// +// - For the address object, use Korean characters for addressLine1 , +// addressLine2 city , postalCode , and stateOrRegion . +// +// Spain +// +// - You must specify the registrationType in the spainAdditionalInfo field of +// the additionalTaxInformation object. +// +// - If the registrationType is Local , you must specify the tax registration +// certificate document in the taxRegistrationDocuments field of the +// VerificationDetails object. +// +// Turkey +// +// - You must specify the sector in the taxRegistrationEntry object. +// +// - If your sector is Business , Individual , or Government : +// +// - Specify the taxOffice . If your sector is Individual , don't enter this +// value. +// +// - (Optional) Specify the kepEmailId . If your sector is Individual , don't +// enter this value. +// +// - Note: In the Tax Settings page of the Billing console, Government appears as +// Public institutions +// +// - If your sector is Business and you're subject to KDV tax, you must specify +// your industry in the industries field. +// +// - For address , you must specify districtOrCounty . +// +// Ukraine +// +// - The sector valid values are Business and Individual . +// +// [Payment preferences]: https://console.aws.amazon.com/billing/home#/paymentpreferences/paymentmethods +func (c *Client) PutTaxRegistration(ctx context.Context, params *PutTaxRegistrationInput, optFns ...func(*Options)) (*PutTaxRegistrationOutput, error) { + if params == nil { + params = &PutTaxRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutTaxRegistration", params, optFns, c.addOperationPutTaxRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutTaxRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutTaxRegistrationInput struct { + + // Your TRN information that will be stored to the account mentioned in accountId + // . + // + // This member is required. + TaxRegistrationEntry *types.TaxRegistrationEntry + + // Your unique account identifier. + AccountId *string + + noSmithyDocumentSerde +} + +type PutTaxRegistrationOutput struct { + + // The status of your TRN stored in the system after processing. Based on the + // validation occurring on the TRN, the status can be Verified , Pending or + // Rejected . + Status types.TaxRegistrationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutTaxRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutTaxRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutTaxRegistration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutTaxRegistration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpPutTaxRegistrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutTaxRegistration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutTaxRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutTaxRegistration", + } +} diff --git a/service/taxsettings/auth.go b/service/taxsettings/auth.go new file mode 100644 index 00000000000..59aafbdac2c --- /dev/null +++ b/service/taxsettings/auth.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "tax") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/taxsettings/deserializers.go b/service/taxsettings/deserializers.go new file mode 100644 index 00000000000..4a5dc3596ae --- /dev/null +++ b/service/taxsettings/deserializers.go @@ -0,0 +1,3250 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpBatchDeleteTaxRegistration struct { +} + +func (*awsRestjson1_deserializeOpBatchDeleteTaxRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchDeleteTaxRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorBatchDeleteTaxRegistration(response, &metadata) + } + output := &BatchDeleteTaxRegistrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentBatchDeleteTaxRegistrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchDeleteTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchDeleteTaxRegistrationOutput(v **BatchDeleteTaxRegistrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchDeleteTaxRegistrationOutput + if *v == nil { + sv = &BatchDeleteTaxRegistrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsRestjson1_deserializeDocumentBatchDeleteTaxRegistrationErrors(&sv.Errors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpBatchPutTaxRegistration struct { +} + +func (*awsRestjson1_deserializeOpBatchPutTaxRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchPutTaxRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorBatchPutTaxRegistration(response, &metadata) + } + output := &BatchPutTaxRegistrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentBatchPutTaxRegistrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchPutTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchPutTaxRegistrationOutput(v **BatchPutTaxRegistrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchPutTaxRegistrationOutput + if *v == nil { + sv = &BatchPutTaxRegistrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsRestjson1_deserializeDocumentBatchPutTaxRegistrationErrors(&sv.Errors, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationStatus to be of type string, got %T instead", value) + } + sv.Status = types.TaxRegistrationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteTaxRegistration struct { +} + +func (*awsRestjson1_deserializeOpDeleteTaxRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteTaxRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteTaxRegistration(response, &metadata) + } + output := &DeleteTaxRegistrationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetTaxRegistration struct { +} + +func (*awsRestjson1_deserializeOpGetTaxRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTaxRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetTaxRegistration(response, &metadata) + } + output := &GetTaxRegistrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetTaxRegistrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetTaxRegistrationOutput(v **GetTaxRegistrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTaxRegistrationOutput + if *v == nil { + sv = &GetTaxRegistrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taxRegistration": + if err := awsRestjson1_deserializeDocumentTaxRegistration(&sv.TaxRegistration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetTaxRegistrationDocument struct { +} + +func (*awsRestjson1_deserializeOpGetTaxRegistrationDocument) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTaxRegistrationDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetTaxRegistrationDocument(response, &metadata) + } + output := &GetTaxRegistrationDocumentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetTaxRegistrationDocumentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetTaxRegistrationDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetTaxRegistrationDocumentOutput(v **GetTaxRegistrationDocumentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTaxRegistrationDocumentOutput + if *v == nil { + sv = &GetTaxRegistrationDocumentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destinationFilePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationFilePath to be of type string, got %T instead", value) + } + sv.DestinationFilePath = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTaxRegistrations struct { +} + +func (*awsRestjson1_deserializeOpListTaxRegistrations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTaxRegistrations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTaxRegistrations(response, &metadata) + } + output := &ListTaxRegistrationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTaxRegistrationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTaxRegistrations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTaxRegistrationsOutput(v **ListTaxRegistrationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTaxRegistrationsOutput + if *v == nil { + sv = &ListTaxRegistrationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountDetails": + if err := awsRestjson1_deserializeDocumentAccountDetailsList(&sv.AccountDetails, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutTaxRegistration struct { +} + +func (*awsRestjson1_deserializeOpPutTaxRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutTaxRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutTaxRegistration(response, &metadata) + } + output := &PutTaxRegistrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentPutTaxRegistrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutTaxRegistrationOutput(v **PutTaxRegistrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutTaxRegistrationOutput + if *v == nil { + sv = &PutTaxRegistrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationStatus to be of type string, got %T instead", value) + } + sv.Status = types.TaxRegistrationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccountDetails(v **types.AccountDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccountDetails + if *v == nil { + sv = &types.AccountDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "accountMetaData": + if err := awsRestjson1_deserializeDocumentAccountMetaData(&sv.AccountMetaData, value); err != nil { + return err + } + + case "taxInheritanceDetails": + if err := awsRestjson1_deserializeDocumentTaxInheritanceDetails(&sv.TaxInheritanceDetails, value); err != nil { + return err + } + + case "taxRegistration": + if err := awsRestjson1_deserializeDocumentTaxRegistrationWithJurisdiction(&sv.TaxRegistration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountDetailsList(v *[]types.AccountDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AccountDetails + if *v == nil { + cv = []types.AccountDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccountDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAccountMetaData(v **types.AccountMetaData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccountMetaData + if *v == nil { + sv = &types.AccountMetaData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountName to be of type string, got %T instead", value) + } + sv.AccountName = ptr.String(jtv) + } + + case "address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "addressRoleMap": + if err := awsRestjson1_deserializeDocumentAddressRoleMap(&sv.AddressRoleMap, value); err != nil { + return err + } + + case "addressType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AddressRoleType to be of type string, got %T instead", value) + } + sv.AddressType = types.AddressRoleType(jtv) + } + + case "seller": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Seller to be of type string, got %T instead", value) + } + sv.Seller = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAdditionalInfoResponse(v **types.AdditionalInfoResponse, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AdditionalInfoResponse + if *v == nil { + sv = &types.AdditionalInfoResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "brazilAdditionalInfo": + if err := awsRestjson1_deserializeDocumentBrazilAdditionalInfo(&sv.BrazilAdditionalInfo, value); err != nil { + return err + } + + case "canadaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentCanadaAdditionalInfo(&sv.CanadaAdditionalInfo, value); err != nil { + return err + } + + case "estoniaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentEstoniaAdditionalInfo(&sv.EstoniaAdditionalInfo, value); err != nil { + return err + } + + case "georgiaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentGeorgiaAdditionalInfo(&sv.GeorgiaAdditionalInfo, value); err != nil { + return err + } + + case "indiaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentIndiaAdditionalInfo(&sv.IndiaAdditionalInfo, value); err != nil { + return err + } + + case "israelAdditionalInfo": + if err := awsRestjson1_deserializeDocumentIsraelAdditionalInfo(&sv.IsraelAdditionalInfo, value); err != nil { + return err + } + + case "italyAdditionalInfo": + if err := awsRestjson1_deserializeDocumentItalyAdditionalInfo(&sv.ItalyAdditionalInfo, value); err != nil { + return err + } + + case "kenyaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentKenyaAdditionalInfo(&sv.KenyaAdditionalInfo, value); err != nil { + return err + } + + case "malaysiaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentMalaysiaAdditionalInfo(&sv.MalaysiaAdditionalInfo, value); err != nil { + return err + } + + case "polandAdditionalInfo": + if err := awsRestjson1_deserializeDocumentPolandAdditionalInfo(&sv.PolandAdditionalInfo, value); err != nil { + return err + } + + case "romaniaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentRomaniaAdditionalInfo(&sv.RomaniaAdditionalInfo, value); err != nil { + return err + } + + case "saudiArabiaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentSaudiArabiaAdditionalInfo(&sv.SaudiArabiaAdditionalInfo, value); err != nil { + return err + } + + case "southKoreaAdditionalInfo": + if err := awsRestjson1_deserializeDocumentSouthKoreaAdditionalInfo(&sv.SouthKoreaAdditionalInfo, value); err != nil { + return err + } + + case "spainAdditionalInfo": + if err := awsRestjson1_deserializeDocumentSpainAdditionalInfo(&sv.SpainAdditionalInfo, value); err != nil { + return err + } + + case "turkeyAdditionalInfo": + if err := awsRestjson1_deserializeDocumentTurkeyAdditionalInfo(&sv.TurkeyAdditionalInfo, value); err != nil { + return err + } + + case "ukraineAdditionalInfo": + if err := awsRestjson1_deserializeDocumentUkraineAdditionalInfo(&sv.UkraineAdditionalInfo, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAddress(v **types.Address, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Address + if *v == nil { + sv = &types.Address{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "addressLine1": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AddressLine1 to be of type string, got %T instead", value) + } + sv.AddressLine1 = ptr.String(jtv) + } + + case "addressLine2": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AddressLine2 to be of type string, got %T instead", value) + } + sv.AddressLine2 = ptr.String(jtv) + } + + case "addressLine3": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AddressLine3 to be of type string, got %T instead", value) + } + sv.AddressLine3 = ptr.String(jtv) + } + + case "city": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected City to be of type string, got %T instead", value) + } + sv.City = ptr.String(jtv) + } + + case "countryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode to be of type string, got %T instead", value) + } + sv.CountryCode = ptr.String(jtv) + } + + case "districtOrCounty": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected District to be of type string, got %T instead", value) + } + sv.DistrictOrCounty = ptr.String(jtv) + } + + case "postalCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PostalCode to be of type string, got %T instead", value) + } + sv.PostalCode = ptr.String(jtv) + } + + case "stateOrRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected State to be of type string, got %T instead", value) + } + sv.StateOrRegion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAddressRoleMap(v *map[string]types.Jurisdiction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.Jurisdiction + if *v == nil { + mv = map[string]types.Jurisdiction{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.Jurisdiction + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentJurisdiction(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentBatchDeleteTaxRegistrationError(v **types.BatchDeleteTaxRegistrationError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchDeleteTaxRegistrationError + if *v == nil { + sv = &types.BatchDeleteTaxRegistrationError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchDeleteTaxRegistrationErrors(v *[]types.BatchDeleteTaxRegistrationError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.BatchDeleteTaxRegistrationError + if *v == nil { + cv = []types.BatchDeleteTaxRegistrationError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchDeleteTaxRegistrationError + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchDeleteTaxRegistrationError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchPutTaxRegistrationError(v **types.BatchPutTaxRegistrationError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchPutTaxRegistrationError + if *v == nil { + sv = &types.BatchPutTaxRegistrationError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchPutTaxRegistrationErrors(v *[]types.BatchPutTaxRegistrationError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.BatchPutTaxRegistrationError + if *v == nil { + cv = []types.BatchPutTaxRegistrationError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchPutTaxRegistrationError + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchPutTaxRegistrationError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBrazilAdditionalInfo(v **types.BrazilAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BrazilAdditionalInfo + if *v == nil { + sv = &types.BrazilAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ccmCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CcmCode to be of type string, got %T instead", value) + } + sv.CcmCode = ptr.String(jtv) + } + + case "legalNatureCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LegalNatureCode to be of type string, got %T instead", value) + } + sv.LegalNatureCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCanadaAdditionalInfo(v **types.CanadaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CanadaAdditionalInfo + if *v == nil { + sv = &types.CanadaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "canadaQuebecSalesTaxNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CanadaQuebecSalesTaxNumberString to be of type string, got %T instead", value) + } + sv.CanadaQuebecSalesTaxNumber = ptr.String(jtv) + } + + case "canadaRetailSalesTaxNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CanadaRetailSalesTaxNumberString to be of type string, got %T instead", value) + } + sv.CanadaRetailSalesTaxNumber = ptr.String(jtv) + } + + case "isResellerAccount": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsResellerAccount = ptr.Bool(jtv) + } + + case "provincialSalesTaxId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CanadaProvincialSalesTaxIdString to be of type string, got %T instead", value) + } + sv.ProvincialSalesTaxId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEstoniaAdditionalInfo(v **types.EstoniaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EstoniaAdditionalInfo + if *v == nil { + sv = &types.EstoniaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "registryCommercialCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistryCommercialCode to be of type string, got %T instead", value) + } + sv.RegistryCommercialCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGeorgiaAdditionalInfo(v **types.GeorgiaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GeorgiaAdditionalInfo + if *v == nil { + sv = &types.GeorgiaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "personType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PersonType to be of type string, got %T instead", value) + } + sv.PersonType = types.PersonType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIndiaAdditionalInfo(v **types.IndiaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IndiaAdditionalInfo + if *v == nil { + sv = &types.IndiaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "pan": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Pan to be of type string, got %T instead", value) + } + sv.Pan = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIsraelAdditionalInfo(v **types.IsraelAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IsraelAdditionalInfo + if *v == nil { + sv = &types.IsraelAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "customerType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IsraelCustomerType to be of type string, got %T instead", value) + } + sv.CustomerType = types.IsraelCustomerType(jtv) + } + + case "dealerType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IsraelDealerType to be of type string, got %T instead", value) + } + sv.DealerType = types.IsraelDealerType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentItalyAdditionalInfo(v **types.ItalyAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ItalyAdditionalInfo + if *v == nil { + sv = &types.ItalyAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cigNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CigNumber to be of type string, got %T instead", value) + } + sv.CigNumber = ptr.String(jtv) + } + + case "cupNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CupNumber to be of type string, got %T instead", value) + } + sv.CupNumber = ptr.String(jtv) + } + + case "sdiAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SdiAccountId to be of type string, got %T instead", value) + } + sv.SdiAccountId = ptr.String(jtv) + } + + case "taxCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxCode to be of type string, got %T instead", value) + } + sv.TaxCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentJurisdiction(v **types.Jurisdiction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Jurisdiction + if *v == nil { + sv = &types.Jurisdiction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "countryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode to be of type string, got %T instead", value) + } + sv.CountryCode = ptr.String(jtv) + } + + case "stateOrRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected State to be of type string, got %T instead", value) + } + sv.StateOrRegion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKenyaAdditionalInfo(v **types.KenyaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KenyaAdditionalInfo + if *v == nil { + sv = &types.KenyaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "personType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PersonType to be of type string, got %T instead", value) + } + sv.PersonType = types.PersonType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMalaysiaAdditionalInfo(v **types.MalaysiaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MalaysiaAdditionalInfo + if *v == nil { + sv = &types.MalaysiaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "serviceTaxCodes": + if err := awsRestjson1_deserializeDocumentMalaysiaServiceTaxCodesList(&sv.ServiceTaxCodes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMalaysiaServiceTaxCodesList(v *[]types.MalaysiaServiceTaxCode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.MalaysiaServiceTaxCode + if *v == nil { + cv = []types.MalaysiaServiceTaxCode{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MalaysiaServiceTaxCode + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MalaysiaServiceTaxCode to be of type string, got %T instead", value) + } + col = types.MalaysiaServiceTaxCode(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPolandAdditionalInfo(v **types.PolandAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PolandAdditionalInfo + if *v == nil { + sv = &types.PolandAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "individualRegistrationNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndividualRegistrationNumber to be of type string, got %T instead", value) + } + sv.IndividualRegistrationNumber = ptr.String(jtv) + } + + case "isGroupVatEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsGroupVatEnabled = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode_ = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRomaniaAdditionalInfo(v **types.RomaniaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RomaniaAdditionalInfo + if *v == nil { + sv = &types.RomaniaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taxRegistrationNumberType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationNumberType to be of type string, got %T instead", value) + } + sv.TaxRegistrationNumberType = types.TaxRegistrationNumberType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSaudiArabiaAdditionalInfo(v **types.SaudiArabiaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SaudiArabiaAdditionalInfo + if *v == nil { + sv = &types.SaudiArabiaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taxRegistrationNumberType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SaudiArabiaTaxRegistrationNumberType to be of type string, got %T instead", value) + } + sv.TaxRegistrationNumberType = types.SaudiArabiaTaxRegistrationNumberType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSouthKoreaAdditionalInfo(v **types.SouthKoreaAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SouthKoreaAdditionalInfo + if *v == nil { + sv = &types.SouthKoreaAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "businessRepresentativeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BusinessRepresentativeName to be of type string, got %T instead", value) + } + sv.BusinessRepresentativeName = ptr.String(jtv) + } + + case "itemOfBusiness": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ItemOfBusiness to be of type string, got %T instead", value) + } + sv.ItemOfBusiness = ptr.String(jtv) + } + + case "lineOfBusiness": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LineOfBusiness to be of type string, got %T instead", value) + } + sv.LineOfBusiness = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSpainAdditionalInfo(v **types.SpainAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SpainAdditionalInfo + if *v == nil { + sv = &types.SpainAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "registrationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistrationType to be of type string, got %T instead", value) + } + sv.RegistrationType = types.RegistrationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTaxDocumentMetadata(v **types.TaxDocumentMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TaxDocumentMetadata + if *v == nil { + sv = &types.TaxDocumentMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taxDocumentAccessToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxDocumentAccessToken to be of type string, got %T instead", value) + } + sv.TaxDocumentAccessToken = ptr.String(jtv) + } + + case "taxDocumentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxDocumentName to be of type string, got %T instead", value) + } + sv.TaxDocumentName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTaxDocumentMetadatas(v *[]types.TaxDocumentMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.TaxDocumentMetadata + if *v == nil { + cv = []types.TaxDocumentMetadata{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TaxDocumentMetadata + destAddr := &col + if err := awsRestjson1_deserializeDocumentTaxDocumentMetadata(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTaxInheritanceDetails(v **types.TaxInheritanceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TaxInheritanceDetails + if *v == nil { + sv = &types.TaxInheritanceDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "inheritanceObtainedReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InheritanceObtainedReason to be of type string, got %T instead", value) + } + sv.InheritanceObtainedReason = ptr.String(jtv) + } + + case "parentEntityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.ParentEntityId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTaxRegistration(v **types.TaxRegistration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TaxRegistration + if *v == nil { + sv = &types.TaxRegistration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalTaxInformation": + if err := awsRestjson1_deserializeDocumentAdditionalInfoResponse(&sv.AdditionalTaxInformation, value); err != nil { + return err + } + + case "certifiedEmailId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertifiedEmailId to be of type string, got %T instead", value) + } + sv.CertifiedEmailId = ptr.String(jtv) + } + + case "legalAddress": + if err := awsRestjson1_deserializeDocumentAddress(&sv.LegalAddress, value); err != nil { + return err + } + + case "legalName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LegalName to be of type string, got %T instead", value) + } + sv.LegalName = ptr.String(jtv) + } + + case "registrationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistrationId to be of type string, got %T instead", value) + } + sv.RegistrationId = ptr.String(jtv) + } + + case "registrationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationType to be of type string, got %T instead", value) + } + sv.RegistrationType = types.TaxRegistrationType(jtv) + } + + case "sector": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Sector to be of type string, got %T instead", value) + } + sv.Sector = types.Sector(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationStatus to be of type string, got %T instead", value) + } + sv.Status = types.TaxRegistrationStatus(jtv) + } + + case "taxDocumentMetadatas": + if err := awsRestjson1_deserializeDocumentTaxDocumentMetadatas(&sv.TaxDocumentMetadatas, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTaxRegistrationWithJurisdiction(v **types.TaxRegistrationWithJurisdiction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TaxRegistrationWithJurisdiction + if *v == nil { + sv = &types.TaxRegistrationWithJurisdiction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalTaxInformation": + if err := awsRestjson1_deserializeDocumentAdditionalInfoResponse(&sv.AdditionalTaxInformation, value); err != nil { + return err + } + + case "certifiedEmailId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertifiedEmailId to be of type string, got %T instead", value) + } + sv.CertifiedEmailId = ptr.String(jtv) + } + + case "jurisdiction": + if err := awsRestjson1_deserializeDocumentJurisdiction(&sv.Jurisdiction, value); err != nil { + return err + } + + case "legalName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LegalName to be of type string, got %T instead", value) + } + sv.LegalName = ptr.String(jtv) + } + + case "registrationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistrationId to be of type string, got %T instead", value) + } + sv.RegistrationId = ptr.String(jtv) + } + + case "registrationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationType to be of type string, got %T instead", value) + } + sv.RegistrationType = types.TaxRegistrationType(jtv) + } + + case "sector": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Sector to be of type string, got %T instead", value) + } + sv.Sector = types.Sector(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationStatus to be of type string, got %T instead", value) + } + sv.Status = types.TaxRegistrationStatus(jtv) + } + + case "taxDocumentMetadatas": + if err := awsRestjson1_deserializeDocumentTaxDocumentMetadatas(&sv.TaxDocumentMetadatas, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTurkeyAdditionalInfo(v **types.TurkeyAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TurkeyAdditionalInfo + if *v == nil { + sv = &types.TurkeyAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "industries": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Industries to be of type string, got %T instead", value) + } + sv.Industries = types.Industries(jtv) + } + + case "kepEmailId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KepEmailId to be of type string, got %T instead", value) + } + sv.KepEmailId = ptr.String(jtv) + } + + case "secondaryTaxId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecondaryTaxId to be of type string, got %T instead", value) + } + sv.SecondaryTaxId = ptr.String(jtv) + } + + case "taxOffice": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxOffice to be of type string, got %T instead", value) + } + sv.TaxOffice = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUkraineAdditionalInfo(v **types.UkraineAdditionalInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UkraineAdditionalInfo + if *v == nil { + sv = &types.UkraineAdditionalInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ukraineTrnType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UkraineTrnType to be of type string, got %T instead", value) + } + sv.UkraineTrnType = types.UkraineTrnType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode_ = types.ValidationExceptionErrorCode(jtv) + } + + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/taxsettings/doc.go b/service/taxsettings/doc.go new file mode 100644 index 00000000000..63667bc6ea7 --- /dev/null +++ b/service/taxsettings/doc.go @@ -0,0 +1,17 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package taxsettings provides the API client, operations, and parameter types +// for Tax Settings. +// +// You can use the tax setting API to programmatically set, modify, and delete the +// tax registration number (TRN), associated business legal name, and address +// (Collectively referred to as "TRN information"). You can also programmatically +// view TRN information and tax addresses ("Tax profiles"). +// +// You can use this API to automate your TRN information settings instead of +// manually using the console. +// +// Service Endpoint +// +// - https://tax.us-east-1.amazonaws.com +package taxsettings diff --git a/service/taxsettings/endpoints.go b/service/taxsettings/endpoints.go new file mode 100644 index 00000000000..0acd97587ce --- /dev/null +++ b/service/taxsettings/endpoints.go @@ -0,0 +1,516 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/taxsettings/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "tax" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_TAXSETTINGS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "TaxSettings", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://tax-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://tax-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://tax.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://tax.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/service/taxsettings/endpoints_config_test.go b/service/taxsettings/endpoints_config_test.go new file mode 100644 index 00000000000..974f642615b --- /dev/null +++ b/service/taxsettings/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-taxsettings.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-taxsettings.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-taxsettings.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-taxsettings.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-taxsettings.dev", + expectURL: aws.String("https://env-taxsettings.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-taxsettings.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-taxsettings.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-taxsettings.dev", + expectURL: aws.String("http://config-taxsettings.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-taxsettings.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-taxsettings.dev", + clientEndpoint: aws.String("https://client-taxsettings.dev"), + expectURL: aws.String("https://client-taxsettings.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_TAXSETTINGS", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/taxsettings/endpoints_test.go b/service/taxsettings/endpoints_test.go new file mode 100644 index 00000000000..7d0d790b5f5 --- /dev/null +++ b/service/taxsettings/endpoints_test.go @@ -0,0 +1,820 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.us-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack disabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://tax.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with region set and fips disabled and dualstack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with region not set and fips disabled and dualstack disabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled and dualstack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/taxsettings/generated.json b/service/taxsettings/generated.json new file mode 100644 index 00000000000..bfe4c8c8457 --- /dev/null +++ b/service/taxsettings/generated.json @@ -0,0 +1,39 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_BatchDeleteTaxRegistration.go", + "api_op_BatchPutTaxRegistration.go", + "api_op_DeleteTaxRegistration.go", + "api_op_GetTaxRegistration.go", + "api_op_GetTaxRegistrationDocument.go", + "api_op_ListTaxRegistrations.go", + "api_op_PutTaxRegistration.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/taxsettings", + "unstable": false +} diff --git a/service/taxsettings/go.mod b/service/taxsettings/go.mod new file mode 100644 index 00000000000..dde937c57ec --- /dev/null +++ b/service/taxsettings/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/taxsettings + +go 1.20 + +require ( + github.com/aws/aws-sdk-go-v2 v1.27.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.8 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.8 + github.com/aws/smithy-go v1.20.2 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/taxsettings/go.sum b/service/taxsettings/go.sum new file mode 100644 index 00000000000..4641fc37614 --- /dev/null +++ b/service/taxsettings/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= +github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= diff --git a/service/taxsettings/go_module_metadata.go b/service/taxsettings/go_module_metadata.go new file mode 100644 index 00000000000..51f57192157 --- /dev/null +++ b/service/taxsettings/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package taxsettings + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/taxsettings/internal/endpoints/endpoints.go b/service/taxsettings/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..383d21bf7b1 --- /dev/null +++ b/service/taxsettings/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver TaxSettings endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tax.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tax-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tax-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tax.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tax.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tax-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tax-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tax.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tax-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tax.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tax-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tax.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tax-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tax.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tax-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tax.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tax.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tax-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tax-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tax.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/taxsettings/internal/endpoints/endpoints_test.go b/service/taxsettings/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/taxsettings/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/taxsettings/options.go b/service/taxsettings/options.go new file mode 100644 index 00000000000..a17bfef8bb3 --- /dev/null +++ b/service/taxsettings/options.go @@ -0,0 +1,224 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/service/taxsettings/protocol_test.go b/service/taxsettings/protocol_test.go new file mode 100644 index 00000000000..a61398d89b4 --- /dev/null +++ b/service/taxsettings/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings diff --git a/service/taxsettings/serializers.go b/service/taxsettings/serializers.go new file mode 100644 index 00000000000..b988a73273e --- /dev/null +++ b/service/taxsettings/serializers.go @@ -0,0 +1,1131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpBatchDeleteTaxRegistration struct { +} + +func (*awsRestjson1_serializeOpBatchDeleteTaxRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchDeleteTaxRegistration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchDeleteTaxRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/BatchDeleteTaxRegistration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchDeleteTaxRegistrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchDeleteTaxRegistrationInput(v *BatchDeleteTaxRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchDeleteTaxRegistrationInput(v *BatchDeleteTaxRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsRestjson1_serializeDocumentAccountIds(v.AccountIds, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpBatchPutTaxRegistration struct { +} + +func (*awsRestjson1_serializeOpBatchPutTaxRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchPutTaxRegistration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchPutTaxRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/BatchPutTaxRegistration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchPutTaxRegistrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchPutTaxRegistrationInput(v *BatchPutTaxRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchPutTaxRegistrationInput(v *BatchPutTaxRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("accountIds") + if err := awsRestjson1_serializeDocumentAccountIds(v.AccountIds, ok); err != nil { + return err + } + } + + if v.TaxRegistrationEntry != nil { + ok := object.Key("taxRegistrationEntry") + if err := awsRestjson1_serializeDocumentTaxRegistrationEntry(v.TaxRegistrationEntry, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteTaxRegistration struct { +} + +func (*awsRestjson1_serializeOpDeleteTaxRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteTaxRegistration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteTaxRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteTaxRegistration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteTaxRegistrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteTaxRegistrationInput(v *DeleteTaxRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteTaxRegistrationInput(v *DeleteTaxRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("accountId") + ok.String(*v.AccountId) + } + + return nil +} + +type awsRestjson1_serializeOpGetTaxRegistration struct { +} + +func (*awsRestjson1_serializeOpGetTaxRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetTaxRegistration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTaxRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetTaxRegistration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetTaxRegistrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetTaxRegistrationInput(v *GetTaxRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetTaxRegistrationInput(v *GetTaxRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("accountId") + ok.String(*v.AccountId) + } + + return nil +} + +type awsRestjson1_serializeOpGetTaxRegistrationDocument struct { +} + +func (*awsRestjson1_serializeOpGetTaxRegistrationDocument) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetTaxRegistrationDocument) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTaxRegistrationDocumentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetTaxRegistrationDocument") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetTaxRegistrationDocumentInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetTaxRegistrationDocumentInput(v *GetTaxRegistrationDocumentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetTaxRegistrationDocumentInput(v *GetTaxRegistrationDocumentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DestinationS3Location != nil { + ok := object.Key("destinationS3Location") + if err := awsRestjson1_serializeDocumentDestinationS3Location(v.DestinationS3Location, ok); err != nil { + return err + } + } + + if v.TaxDocumentMetadata != nil { + ok := object.Key("taxDocumentMetadata") + if err := awsRestjson1_serializeDocumentTaxDocumentMetadata(v.TaxDocumentMetadata, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListTaxRegistrations struct { +} + +func (*awsRestjson1_serializeOpListTaxRegistrations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTaxRegistrations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTaxRegistrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListTaxRegistrations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListTaxRegistrationsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTaxRegistrationsInput(v *ListTaxRegistrationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListTaxRegistrationsInput(v *ListTaxRegistrationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpPutTaxRegistration struct { +} + +func (*awsRestjson1_serializeOpPutTaxRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutTaxRegistration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutTaxRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/PutTaxRegistration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutTaxRegistrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutTaxRegistrationInput(v *PutTaxRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutTaxRegistrationInput(v *PutTaxRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("accountId") + ok.String(*v.AccountId) + } + + if v.TaxRegistrationEntry != nil { + ok := object.Key("taxRegistrationEntry") + if err := awsRestjson1_serializeDocumentTaxRegistrationEntry(v.TaxRegistrationEntry, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAccountIds(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentAdditionalInfoRequest(v *types.AdditionalInfoRequest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CanadaAdditionalInfo != nil { + ok := object.Key("canadaAdditionalInfo") + if err := awsRestjson1_serializeDocumentCanadaAdditionalInfo(v.CanadaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.EstoniaAdditionalInfo != nil { + ok := object.Key("estoniaAdditionalInfo") + if err := awsRestjson1_serializeDocumentEstoniaAdditionalInfo(v.EstoniaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.GeorgiaAdditionalInfo != nil { + ok := object.Key("georgiaAdditionalInfo") + if err := awsRestjson1_serializeDocumentGeorgiaAdditionalInfo(v.GeorgiaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.IsraelAdditionalInfo != nil { + ok := object.Key("israelAdditionalInfo") + if err := awsRestjson1_serializeDocumentIsraelAdditionalInfo(v.IsraelAdditionalInfo, ok); err != nil { + return err + } + } + + if v.ItalyAdditionalInfo != nil { + ok := object.Key("italyAdditionalInfo") + if err := awsRestjson1_serializeDocumentItalyAdditionalInfo(v.ItalyAdditionalInfo, ok); err != nil { + return err + } + } + + if v.KenyaAdditionalInfo != nil { + ok := object.Key("kenyaAdditionalInfo") + if err := awsRestjson1_serializeDocumentKenyaAdditionalInfo(v.KenyaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.MalaysiaAdditionalInfo != nil { + ok := object.Key("malaysiaAdditionalInfo") + if err := awsRestjson1_serializeDocumentMalaysiaAdditionalInfo(v.MalaysiaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.PolandAdditionalInfo != nil { + ok := object.Key("polandAdditionalInfo") + if err := awsRestjson1_serializeDocumentPolandAdditionalInfo(v.PolandAdditionalInfo, ok); err != nil { + return err + } + } + + if v.RomaniaAdditionalInfo != nil { + ok := object.Key("romaniaAdditionalInfo") + if err := awsRestjson1_serializeDocumentRomaniaAdditionalInfo(v.RomaniaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.SaudiArabiaAdditionalInfo != nil { + ok := object.Key("saudiArabiaAdditionalInfo") + if err := awsRestjson1_serializeDocumentSaudiArabiaAdditionalInfo(v.SaudiArabiaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.SouthKoreaAdditionalInfo != nil { + ok := object.Key("southKoreaAdditionalInfo") + if err := awsRestjson1_serializeDocumentSouthKoreaAdditionalInfo(v.SouthKoreaAdditionalInfo, ok); err != nil { + return err + } + } + + if v.SpainAdditionalInfo != nil { + ok := object.Key("spainAdditionalInfo") + if err := awsRestjson1_serializeDocumentSpainAdditionalInfo(v.SpainAdditionalInfo, ok); err != nil { + return err + } + } + + if v.TurkeyAdditionalInfo != nil { + ok := object.Key("turkeyAdditionalInfo") + if err := awsRestjson1_serializeDocumentTurkeyAdditionalInfo(v.TurkeyAdditionalInfo, ok); err != nil { + return err + } + } + + if v.UkraineAdditionalInfo != nil { + ok := object.Key("ukraineAdditionalInfo") + if err := awsRestjson1_serializeDocumentUkraineAdditionalInfo(v.UkraineAdditionalInfo, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAddress(v *types.Address, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddressLine1 != nil { + ok := object.Key("addressLine1") + ok.String(*v.AddressLine1) + } + + if v.AddressLine2 != nil { + ok := object.Key("addressLine2") + ok.String(*v.AddressLine2) + } + + if v.AddressLine3 != nil { + ok := object.Key("addressLine3") + ok.String(*v.AddressLine3) + } + + if v.City != nil { + ok := object.Key("city") + ok.String(*v.City) + } + + if v.CountryCode != nil { + ok := object.Key("countryCode") + ok.String(*v.CountryCode) + } + + if v.DistrictOrCounty != nil { + ok := object.Key("districtOrCounty") + ok.String(*v.DistrictOrCounty) + } + + if v.PostalCode != nil { + ok := object.Key("postalCode") + ok.String(*v.PostalCode) + } + + if v.StateOrRegion != nil { + ok := object.Key("stateOrRegion") + ok.String(*v.StateOrRegion) + } + + return nil +} + +func awsRestjson1_serializeDocumentCanadaAdditionalInfo(v *types.CanadaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CanadaQuebecSalesTaxNumber != nil { + ok := object.Key("canadaQuebecSalesTaxNumber") + ok.String(*v.CanadaQuebecSalesTaxNumber) + } + + if v.CanadaRetailSalesTaxNumber != nil { + ok := object.Key("canadaRetailSalesTaxNumber") + ok.String(*v.CanadaRetailSalesTaxNumber) + } + + if v.IsResellerAccount != nil { + ok := object.Key("isResellerAccount") + ok.Boolean(*v.IsResellerAccount) + } + + if v.ProvincialSalesTaxId != nil { + ok := object.Key("provincialSalesTaxId") + ok.String(*v.ProvincialSalesTaxId) + } + + return nil +} + +func awsRestjson1_serializeDocumentDestinationS3Location(v *types.DestinationS3Location, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Bucket != nil { + ok := object.Key("bucket") + ok.String(*v.Bucket) + } + + if v.Prefix != nil { + ok := object.Key("prefix") + ok.String(*v.Prefix) + } + + return nil +} + +func awsRestjson1_serializeDocumentEstoniaAdditionalInfo(v *types.EstoniaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RegistryCommercialCode != nil { + ok := object.Key("registryCommercialCode") + ok.String(*v.RegistryCommercialCode) + } + + return nil +} + +func awsRestjson1_serializeDocumentGeorgiaAdditionalInfo(v *types.GeorgiaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.PersonType) > 0 { + ok := object.Key("personType") + ok.String(string(v.PersonType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsraelAdditionalInfo(v *types.IsraelAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.CustomerType) > 0 { + ok := object.Key("customerType") + ok.String(string(v.CustomerType)) + } + + if len(v.DealerType) > 0 { + ok := object.Key("dealerType") + ok.String(string(v.DealerType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentItalyAdditionalInfo(v *types.ItalyAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CigNumber != nil { + ok := object.Key("cigNumber") + ok.String(*v.CigNumber) + } + + if v.CupNumber != nil { + ok := object.Key("cupNumber") + ok.String(*v.CupNumber) + } + + if v.SdiAccountId != nil { + ok := object.Key("sdiAccountId") + ok.String(*v.SdiAccountId) + } + + if v.TaxCode != nil { + ok := object.Key("taxCode") + ok.String(*v.TaxCode) + } + + return nil +} + +func awsRestjson1_serializeDocumentKenyaAdditionalInfo(v *types.KenyaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.PersonType) > 0 { + ok := object.Key("personType") + ok.String(string(v.PersonType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentMalaysiaAdditionalInfo(v *types.MalaysiaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ServiceTaxCodes != nil { + ok := object.Key("serviceTaxCodes") + if err := awsRestjson1_serializeDocumentMalaysiaServiceTaxCodesList(v.ServiceTaxCodes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentMalaysiaServiceTaxCodesList(v []types.MalaysiaServiceTaxCode, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentPolandAdditionalInfo(v *types.PolandAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IndividualRegistrationNumber != nil { + ok := object.Key("individualRegistrationNumber") + ok.String(*v.IndividualRegistrationNumber) + } + + if v.IsGroupVatEnabled != nil { + ok := object.Key("isGroupVatEnabled") + ok.Boolean(*v.IsGroupVatEnabled) + } + + return nil +} + +func awsRestjson1_serializeDocumentRomaniaAdditionalInfo(v *types.RomaniaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.TaxRegistrationNumberType) > 0 { + ok := object.Key("taxRegistrationNumberType") + ok.String(string(v.TaxRegistrationNumberType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSaudiArabiaAdditionalInfo(v *types.SaudiArabiaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.TaxRegistrationNumberType) > 0 { + ok := object.Key("taxRegistrationNumberType") + ok.String(string(v.TaxRegistrationNumberType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSourceS3Location(v *types.SourceS3Location, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Bucket != nil { + ok := object.Key("bucket") + ok.String(*v.Bucket) + } + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeDocumentSouthKoreaAdditionalInfo(v *types.SouthKoreaAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BusinessRepresentativeName != nil { + ok := object.Key("businessRepresentativeName") + ok.String(*v.BusinessRepresentativeName) + } + + if v.ItemOfBusiness != nil { + ok := object.Key("itemOfBusiness") + ok.String(*v.ItemOfBusiness) + } + + if v.LineOfBusiness != nil { + ok := object.Key("lineOfBusiness") + ok.String(*v.LineOfBusiness) + } + + return nil +} + +func awsRestjson1_serializeDocumentSpainAdditionalInfo(v *types.SpainAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.RegistrationType) > 0 { + ok := object.Key("registrationType") + ok.String(string(v.RegistrationType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentTaxDocumentMetadata(v *types.TaxDocumentMetadata, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TaxDocumentAccessToken != nil { + ok := object.Key("taxDocumentAccessToken") + ok.String(*v.TaxDocumentAccessToken) + } + + if v.TaxDocumentName != nil { + ok := object.Key("taxDocumentName") + ok.String(*v.TaxDocumentName) + } + + return nil +} + +func awsRestjson1_serializeDocumentTaxRegistrationDocument(v *types.TaxRegistrationDocument, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Location != nil { + ok := object.Key("s3Location") + if err := awsRestjson1_serializeDocumentSourceS3Location(v.S3Location, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTaxRegistrationDocuments(v []types.TaxRegistrationDocument, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTaxRegistrationDocument(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTaxRegistrationEntry(v *types.TaxRegistrationEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalTaxInformation != nil { + ok := object.Key("additionalTaxInformation") + if err := awsRestjson1_serializeDocumentAdditionalInfoRequest(v.AdditionalTaxInformation, ok); err != nil { + return err + } + } + + if v.CertifiedEmailId != nil { + ok := object.Key("certifiedEmailId") + ok.String(*v.CertifiedEmailId) + } + + if v.LegalAddress != nil { + ok := object.Key("legalAddress") + if err := awsRestjson1_serializeDocumentAddress(v.LegalAddress, ok); err != nil { + return err + } + } + + if v.LegalName != nil { + ok := object.Key("legalName") + ok.String(*v.LegalName) + } + + if v.RegistrationId != nil { + ok := object.Key("registrationId") + ok.String(*v.RegistrationId) + } + + if len(v.RegistrationType) > 0 { + ok := object.Key("registrationType") + ok.String(string(v.RegistrationType)) + } + + if len(v.Sector) > 0 { + ok := object.Key("sector") + ok.String(string(v.Sector)) + } + + if v.VerificationDetails != nil { + ok := object.Key("verificationDetails") + if err := awsRestjson1_serializeDocumentVerificationDetails(v.VerificationDetails, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTurkeyAdditionalInfo(v *types.TurkeyAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Industries) > 0 { + ok := object.Key("industries") + ok.String(string(v.Industries)) + } + + if v.KepEmailId != nil { + ok := object.Key("kepEmailId") + ok.String(*v.KepEmailId) + } + + if v.SecondaryTaxId != nil { + ok := object.Key("secondaryTaxId") + ok.String(*v.SecondaryTaxId) + } + + if v.TaxOffice != nil { + ok := object.Key("taxOffice") + ok.String(*v.TaxOffice) + } + + return nil +} + +func awsRestjson1_serializeDocumentUkraineAdditionalInfo(v *types.UkraineAdditionalInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.UkraineTrnType) > 0 { + ok := object.Key("ukraineTrnType") + ok.String(string(v.UkraineTrnType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentVerificationDetails(v *types.VerificationDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DateOfBirth != nil { + ok := object.Key("dateOfBirth") + ok.String(*v.DateOfBirth) + } + + if v.TaxRegistrationDocuments != nil { + ok := object.Key("taxRegistrationDocuments") + if err := awsRestjson1_serializeDocumentTaxRegistrationDocuments(v.TaxRegistrationDocuments, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/taxsettings/snapshot/api_op_BatchDeleteTaxRegistration.go.snap b/service/taxsettings/snapshot/api_op_BatchDeleteTaxRegistration.go.snap new file mode 100644 index 00000000000..ee30a8087bf --- /dev/null +++ b/service/taxsettings/snapshot/api_op_BatchDeleteTaxRegistration.go.snap @@ -0,0 +1,34 @@ +BatchDeleteTaxRegistration + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/taxsettings/snapshot/api_op_BatchPutTaxRegistration.go.snap b/service/taxsettings/snapshot/api_op_BatchPutTaxRegistration.go.snap new file mode 100644 index 00000000000..b56f2edec7c --- /dev/null +++ b/service/taxsettings/snapshot/api_op_BatchPutTaxRegistration.go.snap @@ -0,0 +1,34 @@ +BatchPutTaxRegistration + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/taxsettings/snapshot/api_op_DeleteTaxRegistration.go.snap b/service/taxsettings/snapshot/api_op_DeleteTaxRegistration.go.snap new file mode 100644 index 00000000000..cca28316b3e --- /dev/null +++ b/service/taxsettings/snapshot/api_op_DeleteTaxRegistration.go.snap @@ -0,0 +1,33 @@ +DeleteTaxRegistration + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/taxsettings/snapshot/api_op_GetTaxRegistration.go.snap b/service/taxsettings/snapshot/api_op_GetTaxRegistration.go.snap new file mode 100644 index 00000000000..9f2b03c482b --- /dev/null +++ b/service/taxsettings/snapshot/api_op_GetTaxRegistration.go.snap @@ -0,0 +1,33 @@ +GetTaxRegistration + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/taxsettings/snapshot/api_op_GetTaxRegistrationDocument.go.snap b/service/taxsettings/snapshot/api_op_GetTaxRegistrationDocument.go.snap new file mode 100644 index 00000000000..5ef0ffe8c82 --- /dev/null +++ b/service/taxsettings/snapshot/api_op_GetTaxRegistrationDocument.go.snap @@ -0,0 +1,34 @@ +GetTaxRegistrationDocument + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/taxsettings/snapshot/api_op_ListTaxRegistrations.go.snap b/service/taxsettings/snapshot/api_op_ListTaxRegistrations.go.snap new file mode 100644 index 00000000000..4fac2d9204a --- /dev/null +++ b/service/taxsettings/snapshot/api_op_ListTaxRegistrations.go.snap @@ -0,0 +1,33 @@ +ListTaxRegistrations + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/taxsettings/snapshot/api_op_PutTaxRegistration.go.snap b/service/taxsettings/snapshot/api_op_PutTaxRegistration.go.snap new file mode 100644 index 00000000000..1c6e8e9773a --- /dev/null +++ b/service/taxsettings/snapshot/api_op_PutTaxRegistration.go.snap @@ -0,0 +1,34 @@ +PutTaxRegistration + Initialize stack step + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + Serialize stack step + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + RecursionDetection + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + RecordResponseTiming + RequestResponseLogger diff --git a/service/taxsettings/snapshot_test.go b/service/taxsettings/snapshot_test.go new file mode 100644 index 00000000000..045d7743d68 --- /dev/null +++ b/service/taxsettings/snapshot_test.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package taxsettings + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_BatchDeleteTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchDeleteTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "BatchDeleteTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_BatchPutTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchPutTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "BatchPutTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetTaxRegistrationDocument(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTaxRegistrationDocument(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetTaxRegistrationDocument") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListTaxRegistrations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTaxRegistrations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTaxRegistrations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_PutTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_BatchDeleteTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchDeleteTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "BatchDeleteTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_BatchPutTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchPutTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "BatchPutTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetTaxRegistrationDocument(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTaxRegistrationDocument(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetTaxRegistrationDocument") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListTaxRegistrations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTaxRegistrations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTaxRegistrations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_PutTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/taxsettings/types/enums.go b/service/taxsettings/types/enums.go new file mode 100644 index 00000000000..b7693589a8c --- /dev/null +++ b/service/taxsettings/types/enums.go @@ -0,0 +1,307 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AddressRoleType string + +// Enum values for AddressRoleType +const ( + AddressRoleTypeTaxAddress AddressRoleType = "TaxAddress" + AddressRoleTypeBillingAddress AddressRoleType = "BillingAddress" + AddressRoleTypeContactAddress AddressRoleType = "ContactAddress" +) + +// Values returns all known values for AddressRoleType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AddressRoleType) Values() []AddressRoleType { + return []AddressRoleType{ + "TaxAddress", + "BillingAddress", + "ContactAddress", + } +} + +type Industries string + +// Enum values for Industries +const ( + IndustriesCirculatingOrg Industries = "CirculatingOrg" + IndustriesProfessionalOrg Industries = "ProfessionalOrg" + IndustriesBanks Industries = "Banks" + IndustriesInsurance Industries = "Insurance" + IndustriesPensionAndBenefitFunds Industries = "PensionAndBenefitFunds" + IndustriesDevelopmentAgencies Industries = "DevelopmentAgencies" +) + +// Values returns all known values for Industries. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (Industries) Values() []Industries { + return []Industries{ + "CirculatingOrg", + "ProfessionalOrg", + "Banks", + "Insurance", + "PensionAndBenefitFunds", + "DevelopmentAgencies", + } +} + +type IsraelCustomerType string + +// Enum values for IsraelCustomerType +const ( + IsraelCustomerTypeBusiness IsraelCustomerType = "Business" + IsraelCustomerTypeIndividual IsraelCustomerType = "Individual" +) + +// Values returns all known values for IsraelCustomerType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (IsraelCustomerType) Values() []IsraelCustomerType { + return []IsraelCustomerType{ + "Business", + "Individual", + } +} + +type IsraelDealerType string + +// Enum values for IsraelDealerType +const ( + IsraelDealerTypeAuthorized IsraelDealerType = "Authorized" + IsraelDealerTypeNonAuthorized IsraelDealerType = "Non-authorized" +) + +// Values returns all known values for IsraelDealerType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (IsraelDealerType) Values() []IsraelDealerType { + return []IsraelDealerType{ + "Authorized", + "Non-authorized", + } +} + +type MalaysiaServiceTaxCode string + +// Enum values for MalaysiaServiceTaxCode +const ( + MalaysiaServiceTaxCodeConsultancy MalaysiaServiceTaxCode = "Consultancy" + MalaysiaServiceTaxCodeDigitalSvcElectronicMedium MalaysiaServiceTaxCode = "Digital Service And Electronic Medium" + MalaysiaServiceTaxCodeItServices MalaysiaServiceTaxCode = "IT Services" + MalaysiaServiceTaxCodeTrainingOrCoaching MalaysiaServiceTaxCode = "Training Or Coaching" +) + +// Values returns all known values for MalaysiaServiceTaxCode. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (MalaysiaServiceTaxCode) Values() []MalaysiaServiceTaxCode { + return []MalaysiaServiceTaxCode{ + "Consultancy", + "Digital Service And Electronic Medium", + "IT Services", + "Training Or Coaching", + } +} + +type PersonType string + +// Enum values for PersonType +const ( + PersonTypeLegalPerson PersonType = "Legal Person" + PersonTypePhysicalPerson PersonType = "Physical Person" + PersonTypeBusiness PersonType = "Business" +) + +// Values returns all known values for PersonType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (PersonType) Values() []PersonType { + return []PersonType{ + "Legal Person", + "Physical Person", + "Business", + } +} + +type RegistrationType string + +// Enum values for RegistrationType +const ( + RegistrationTypeIntraEu RegistrationType = "Intra-EU" + RegistrationTypeLocal RegistrationType = "Local" +) + +// Values returns all known values for RegistrationType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (RegistrationType) Values() []RegistrationType { + return []RegistrationType{ + "Intra-EU", + "Local", + } +} + +type SaudiArabiaTaxRegistrationNumberType string + +// Enum values for SaudiArabiaTaxRegistrationNumberType +const ( + SaudiArabiaTaxRegistrationNumberTypeTaxRegistrationNumber SaudiArabiaTaxRegistrationNumberType = "TaxRegistrationNumber" + SaudiArabiaTaxRegistrationNumberTypeTaxIdentificationNumber SaudiArabiaTaxRegistrationNumberType = "TaxIdentificationNumber" + SaudiArabiaTaxRegistrationNumberTypeCommercialRegistrationNumber SaudiArabiaTaxRegistrationNumberType = "CommercialRegistrationNumber" +) + +// Values returns all known values for SaudiArabiaTaxRegistrationNumberType. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SaudiArabiaTaxRegistrationNumberType) Values() []SaudiArabiaTaxRegistrationNumberType { + return []SaudiArabiaTaxRegistrationNumberType{ + "TaxRegistrationNumber", + "TaxIdentificationNumber", + "CommercialRegistrationNumber", + } +} + +type Sector string + +// Enum values for Sector +const ( + SectorBusiness Sector = "Business" + SectorIndividual Sector = "Individual" + SectorPublicInstitutions Sector = "Government" +) + +// Values returns all known values for Sector. Note that this can be expanded in +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (Sector) Values() []Sector { + return []Sector{ + "Business", + "Individual", + "Government", + } +} + +type TaxRegistrationNumberType string + +// Enum values for TaxRegistrationNumberType +const ( + TaxRegistrationNumberTypeTaxRegistrationNumber TaxRegistrationNumberType = "TaxRegistrationNumber" + TaxRegistrationNumberTypeLocalRegistrationNumber TaxRegistrationNumberType = "LocalRegistrationNumber" +) + +// Values returns all known values for TaxRegistrationNumberType. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TaxRegistrationNumberType) Values() []TaxRegistrationNumberType { + return []TaxRegistrationNumberType{ + "TaxRegistrationNumber", + "LocalRegistrationNumber", + } +} + +type TaxRegistrationStatus string + +// Enum values for TaxRegistrationStatus +const ( + TaxRegistrationStatusVerified TaxRegistrationStatus = "Verified" + TaxRegistrationStatusPending TaxRegistrationStatus = "Pending" + TaxRegistrationStatusDeleted TaxRegistrationStatus = "Deleted" + TaxRegistrationStatusRejected TaxRegistrationStatus = "Rejected" +) + +// Values returns all known values for TaxRegistrationStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TaxRegistrationStatus) Values() []TaxRegistrationStatus { + return []TaxRegistrationStatus{ + "Verified", + "Pending", + "Deleted", + "Rejected", + } +} + +type TaxRegistrationType string + +// Enum values for TaxRegistrationType +const ( + TaxRegistrationTypeVat TaxRegistrationType = "VAT" + TaxRegistrationTypeGst TaxRegistrationType = "GST" + TaxRegistrationTypeCpf TaxRegistrationType = "CPF" + TaxRegistrationTypeCnpj TaxRegistrationType = "CNPJ" + TaxRegistrationTypeSst TaxRegistrationType = "SST" +) + +// Values returns all known values for TaxRegistrationType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TaxRegistrationType) Values() []TaxRegistrationType { + return []TaxRegistrationType{ + "VAT", + "GST", + "CPF", + "CNPJ", + "SST", + } +} + +type UkraineTrnType string + +// Enum values for UkraineTrnType +const ( + UkraineTrnTypeBusiness UkraineTrnType = "Business" + UkraineTrnTypeIndividual UkraineTrnType = "Individual" +) + +// Values returns all known values for UkraineTrnType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (UkraineTrnType) Values() []UkraineTrnType { + return []UkraineTrnType{ + "Business", + "Individual", + } +} + +type ValidationExceptionErrorCode string + +// Enum values for ValidationExceptionErrorCode +const ( + ValidationExceptionErrorCodeMalformedToken ValidationExceptionErrorCode = "MalformedToken" + ValidationExceptionErrorCodeExpiredToken ValidationExceptionErrorCode = "ExpiredToken" + ValidationExceptionErrorCodeInvalidToken ValidationExceptionErrorCode = "InvalidToken" + ValidationExceptionErrorCodeFieldValidationFailed ValidationExceptionErrorCode = "FieldValidationFailed" + ValidationExceptionErrorCodeMissingInput ValidationExceptionErrorCode = "MissingInput" +) + +// Values returns all known values for ValidationExceptionErrorCode. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ValidationExceptionErrorCode) Values() []ValidationExceptionErrorCode { + return []ValidationExceptionErrorCode{ + "MalformedToken", + "ExpiredToken", + "InvalidToken", + "FieldValidationFailed", + "MissingInput", + } +} diff --git a/service/taxsettings/types/errors.go b/service/taxsettings/types/errors.go new file mode 100644 index 00000000000..5146cdacb3f --- /dev/null +++ b/service/taxsettings/types/errors.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The exception when the input is creating conflict with the given state. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The exception thrown when an unexpected error occurs when processing a request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The exception thrown when the input doesn't have a resource associated to it. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The exception when the input doesn't pass validation for at least one of the +// input parameters. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + ErrorCode_ ValidationExceptionErrorCode + FieldList []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/taxsettings/types/types.go b/service/taxsettings/types/types.go new file mode 100644 index 00000000000..6e1e49fcc59 --- /dev/null +++ b/service/taxsettings/types/types.go @@ -0,0 +1,788 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// An object with your accountId and TRN information. +type AccountDetails struct { + + // List of unique account identifiers. + AccountId *string + + // The meta data information associated with the account. + AccountMetaData *AccountMetaData + + // Tax inheritance information associated with the account. + TaxInheritanceDetails *TaxInheritanceDetails + + // Your TRN information. Instead of having full legal address, here TRN + // information will have jurisdiction details (for example, country code and + // state/region/province if applicable). + TaxRegistration *TaxRegistrationWithJurisdiction + + noSmithyDocumentSerde +} + +// The meta data information associated with the account. +type AccountMetaData struct { + + // The Amazon Web Services accounts name. + AccountName *string + + // The details of the address associated with the TRN information. + Address *Address + + // Address roles associated with the account containing country code information. + AddressRoleMap map[string]Jurisdiction + + // The type of address associated with the legal profile. + AddressType AddressRoleType + + // Seller information associated with the account. + Seller *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your tax registration number (TRN). +// Depending on the TRN for a specific country, you might need to specify this +// information when you set your TRN. +// +// You can only specify one of the following parameters and the value can't be +// empty. +// +// The parameter that you specify must match the country for the TRN, if +// available. For example, if you set a TRN in Canada for specific provinces, you +// must also specify the canadaAdditionalInfo parameter. +type AdditionalInfoRequest struct { + + // Additional tax information associated with your TRN in Canada. + CanadaAdditionalInfo *CanadaAdditionalInfo + + // Additional tax information to specify for a TRN in Estonia. + EstoniaAdditionalInfo *EstoniaAdditionalInfo + + // Additional tax information to specify for a TRN in Georgia. + GeorgiaAdditionalInfo *GeorgiaAdditionalInfo + + // Additional tax information to specify for a TRN in Israel. + IsraelAdditionalInfo *IsraelAdditionalInfo + + // Additional tax information to specify for a TRN in Italy. + ItalyAdditionalInfo *ItalyAdditionalInfo + + // Additional tax information to specify for a TRN in Kenya. + KenyaAdditionalInfo *KenyaAdditionalInfo + + // Additional tax information to specify for a TRN in Malaysia. + MalaysiaAdditionalInfo *MalaysiaAdditionalInfo + + // Additional tax information associated with your TRN in Poland. + PolandAdditionalInfo *PolandAdditionalInfo + + // Additional tax information to specify for a TRN in Romania. + RomaniaAdditionalInfo *RomaniaAdditionalInfo + + // Additional tax information associated with your TRN in Saudi Arabia. + SaudiArabiaAdditionalInfo *SaudiArabiaAdditionalInfo + + // Additional tax information to specify for a TRN in South Korea. + SouthKoreaAdditionalInfo *SouthKoreaAdditionalInfo + + // Additional tax information to specify for a TRN in Spain. + SpainAdditionalInfo *SpainAdditionalInfo + + // Additional tax information to specify for a TRN in Turkey. + TurkeyAdditionalInfo *TurkeyAdditionalInfo + + // Additional tax information associated with your TRN in Ukraine. + UkraineAdditionalInfo *UkraineAdditionalInfo + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN. The Tax Settings API +// +// returns country-specific information in the response when any additional +// information is present with your TRN for the following countries. +type AdditionalInfoResponse struct { + + // Additional tax information associated with your TRN in Brazil. The Tax Settings + // API returns this information in your response when any additional information is + // present with your TRN in Brazil. + BrazilAdditionalInfo *BrazilAdditionalInfo + + // Additional tax information associated with your TRN in Canada. + CanadaAdditionalInfo *CanadaAdditionalInfo + + // Additional tax information associated with your TRN in Estonia. + EstoniaAdditionalInfo *EstoniaAdditionalInfo + + // Additional tax information associated with your TRN in Georgia. + GeorgiaAdditionalInfo *GeorgiaAdditionalInfo + + // Additional tax information in India. + IndiaAdditionalInfo *IndiaAdditionalInfo + + // Additional tax information associated with your TRN in Israel. + IsraelAdditionalInfo *IsraelAdditionalInfo + + // Additional tax information associated with your TRN in Italy. + ItalyAdditionalInfo *ItalyAdditionalInfo + + // Additional tax information associated with your TRN in Kenya. + KenyaAdditionalInfo *KenyaAdditionalInfo + + // Additional tax information associated with your TRN in Malaysia. + MalaysiaAdditionalInfo *MalaysiaAdditionalInfo + + // Additional tax information associated with your TRN in Poland. + PolandAdditionalInfo *PolandAdditionalInfo + + // Additional tax information to specify for a TRN in Romania. + RomaniaAdditionalInfo *RomaniaAdditionalInfo + + // Additional tax information associated with your TRN in Saudi Arabia. + SaudiArabiaAdditionalInfo *SaudiArabiaAdditionalInfo + + // Additional tax information associated with your TRN in South Korea. + SouthKoreaAdditionalInfo *SouthKoreaAdditionalInfo + + // Additional tax information associated with your TRN in Spain. + SpainAdditionalInfo *SpainAdditionalInfo + + // Additional tax information associated with your TRN in Turkey. + TurkeyAdditionalInfo *TurkeyAdditionalInfo + + // Additional tax information associated with your TRN in Ukraine. + UkraineAdditionalInfo *UkraineAdditionalInfo + + noSmithyDocumentSerde +} + +// The details of the address associated with the TRN information. +type Address struct { + + // The first line of the address. + // + // This member is required. + AddressLine1 *string + + // The city that the address is in. + // + // This member is required. + City *string + + // The country code for the country that the address is in. + // + // This member is required. + CountryCode *string + + // The postal code associated with the address. + // + // This member is required. + PostalCode *string + + // The second line of the address, if applicable. + AddressLine2 *string + + // The third line of the address, if applicable. Currently, the Tax Settings API + // accepts the addressLine3 parameter only for Saudi Arabia. When you specify a + // TRN in Saudi Arabia, you must enter the addressLine3 and specify the building + // number for the address. For example, you might enter 1234 . + AddressLine3 *string + + // The district or county the address is located. + // + // For addresses in Brazil, this parameter uses the name of the neighborhood. When + // you set a TRN in Brazil, use districtOrCounty for the neighborhood name. + DistrictOrCounty *string + + // The state, region, or province that the address is located. + // + // If this is required for tax settings, use the same name as shown on the Tax + // Settings page. + StateOrRegion *string + + noSmithyDocumentSerde +} + +// The error object for representing failures in the BatchDeleteTaxRegistration +// +// operation. +type BatchDeleteTaxRegistrationError struct { + + // The unique account identifier for the account whose tax registration couldn't + // be deleted during the BatchDeleteTaxRegistration operation. + // + // This member is required. + AccountId *string + + // The error message for an individual failure in the BatchDeleteTaxRegistration + // operation. + // + // This member is required. + Message *string + + // The error code for an individual failure in BatchDeleteTaxRegistration + // operation. + Code *string + + noSmithyDocumentSerde +} + +// The error object for representing failures in the BatchPutTaxRegistration +// +// operation. +type BatchPutTaxRegistrationError struct { + + // The unique account identifier for the account that the tax registration + // couldn't be added, or updated during the BatchPutTaxRegistration operation. + // + // This member is required. + AccountId *string + + // The error message for an individual failure in the BatchPutTaxRegistration + // operation. + // + // This member is required. + Message *string + + // The error code for an individual failure in the BatchPutTaxRegistration + // operation. + Code *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Brazil. +type BrazilAdditionalInfo struct { + + // The Cadastro de Contribuintes Mobiliários (CCM) code for your TRN in Brazil. + // This only applies for a CNPJ tax type for the São Paulo municipality. + CcmCode *string + + // Legal nature of business, based on your TRN in Brazil. This only applies for a + // CNPJ tax type. + LegalNatureCode *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Canada . +type CanadaAdditionalInfo struct { + + // The Quebec Sales Tax ID number. Leave blank if you do not have a Quebec Sales + // Tax ID number. + CanadaQuebecSalesTaxNumber *string + + // Manitoba Retail Sales Tax ID number. Customers purchasing Amazon Web Services + // for resale in Manitoba must provide a valid Retail Sales Tax ID number for + // Manitoba. Leave this blank if you do not have a Retail Sales Tax ID number in + // Manitoba or are not purchasing Amazon Web Services for resale. + CanadaRetailSalesTaxNumber *string + + // The value for this parameter must be true if the provincialSalesTaxId value is + // provided for a TRN in British Columbia, Saskatchewan, or Manitoba provinces. + // + // To claim a provincial sales tax (PST) and retail sales tax (RST) reseller + // exemption, you must confirm that purchases from this account were made for + // resale. Otherwise, remove the PST or RST number from the provincialSalesTaxId + // parameter from your request. + IsResellerAccount *bool + + // The provincial sales tax ID for your TRN in Canada. This parameter can + // represent the following: + // + // - Provincial sales tax ID number for British Columbia and Saskatchewan + // provinces + // + // - Manitoba retail sales tax ID number for Manitoba province + // + // - Quebec sales tax ID number for Quebec province + // + // The Tax Setting API only accepts this parameter if the TRN is specified for the + // previous provinces. For other provinces, the Tax Settings API doesn't accept + // this parameter. + ProvincialSalesTaxId *string + + noSmithyDocumentSerde +} + +// The location of the Amazon S3 bucket that you specify to download your tax +// documents to. +type DestinationS3Location struct { + + // The name of your Amazon S3 bucket that you specify to download your tax + // documents to. + // + // This member is required. + Bucket *string + + // The Amazon S3 object prefix that you specify for your tax document file. + Prefix *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Estonia. +type EstoniaAdditionalInfo struct { + + // Registry commercial code (RCC) for your TRN in Estonia. This value is an + // eight-numeric string, such as 12345678 . + // + // This member is required. + RegistryCommercialCode *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Georgia. +type GeorgiaAdditionalInfo struct { + + // The legal person or physical person assigned to this TRN in Georgia. + // + // This member is required. + PersonType PersonType + + noSmithyDocumentSerde +} + +// Additional tax information in India. +type IndiaAdditionalInfo struct { + + // India pan information associated with the account. + Pan *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Israel. +type IsraelAdditionalInfo struct { + + // Customer type for your TRN in Israel. The value can be Business or Individual . + // Use Business for entities such as not-for-profit and financial institutions. + // + // This member is required. + CustomerType IsraelCustomerType + + // Dealer type for your TRN in Israel. If you're not a local authorized dealer + // with an Israeli VAT ID, specify your tax identification number so that Amazon + // Web Services can send you a compliant tax invoice. + // + // This member is required. + DealerType IsraelDealerType + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Italy. +type ItalyAdditionalInfo struct { + + // The tender procedure identification code. + CigNumber *string + + // Additional tax information to specify for a TRN in Italy. This is managed by + // the Interministerial Committee for Economic Planning (CIPE) which characterizes + // every public investment project (Individual Project Code). + CupNumber *string + + // Additional tax information to specify for a TRN in Italy. Use + // CodiceDestinatario to receive your invoices via web service (API) or FTP. + SdiAccountId *string + + // List of service tax codes for your TRN in Italy. You can use your customer tax + // code as part of a VAT Group. + TaxCode *string + + noSmithyDocumentSerde +} + +// The jurisdiction details of the TRN information of the customers. This doesn't +// contain full legal address, and contains only country code and +// state/region/province. +type Jurisdiction struct { + + // The country code of the jurisdiction. + // + // This member is required. + CountryCode *string + + // The state, region, or province associated with the country of the + // jurisdiction, if applicable. + StateOrRegion *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Kenya. +type KenyaAdditionalInfo struct { + + // The legal person or physical person assigned to this TRN in Kenya. + // + // This member is required. + PersonType PersonType + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Malaysia. +type MalaysiaAdditionalInfo struct { + + // List of service tax codes for your TRN in Malaysia. + // + // This member is required. + ServiceTaxCodes []MalaysiaServiceTaxCode + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Poland. +type PolandAdditionalInfo struct { + + // The individual tax registration number (NIP). Individual NIP is valid for + // other taxes excluding VAT purposes. + IndividualRegistrationNumber *string + + // True if your business is a member of a VAT group with a NIP active for VAT + // purposes. Otherwise, this is false. + IsGroupVatEnabled *bool + + noSmithyDocumentSerde +} + +// Additional tax information to specify for a TRN in Romania. +type RomaniaAdditionalInfo struct { + + // The tax registration number type. The value can be TaxRegistrationNumber or + // LocalRegistrationNumber . + // + // This member is required. + TaxRegistrationNumberType TaxRegistrationNumberType + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Saudi Arabia. +type SaudiArabiaAdditionalInfo struct { + + // The tax registration number type. + TaxRegistrationNumberType SaudiArabiaTaxRegistrationNumberType + + noSmithyDocumentSerde +} + +// The Amazon S3 bucket in your account where your tax document is located. +type SourceS3Location struct { + + // The name of your Amazon S3 bucket that your tax document is located. + // + // This member is required. + Bucket *string + + // The object key of your tax document object in Amazon S3. + // + // This member is required. + Key *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in South Korea. +type SouthKoreaAdditionalInfo struct { + + // The business legal name based on the most recently uploaded tax registration + // certificate. + // + // This member is required. + BusinessRepresentativeName *string + + // Item of business based on the most recently uploaded tax registration + // certificate. + // + // This member is required. + ItemOfBusiness *string + + // Line of business based on the most recently uploaded tax registration + // certificate. + // + // This member is required. + LineOfBusiness *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Spain. +type SpainAdditionalInfo struct { + + // The registration type in Spain. + // + // This member is required. + RegistrationType RegistrationType + + noSmithyDocumentSerde +} + +// The metadata for your tax document. +type TaxDocumentMetadata struct { + + // The tax document access token, which contains information that the Tax Settings + // API uses to locate the tax document. + // + // If you update your tax registration, the existing taxDocumentAccessToken won't + // be valid. To get the latest token, call the GetTaxRegistration or + // ListTaxRegistrations API operation. This token is valid for 24 hours. + // + // This member is required. + TaxDocumentAccessToken *string + + // The name of your tax document. + // + // This member is required. + TaxDocumentName *string + + noSmithyDocumentSerde +} + +// Tax inheritance information associated with the account. +type TaxInheritanceDetails struct { + + // Tax inheritance reason information associated with the account. + InheritanceObtainedReason *string + + // Tax inheritance parent account information associated with the account. + ParentEntityId *string + + noSmithyDocumentSerde +} + +// Your TRN information. +type TaxRegistration struct { + + // The legal address associated with your TRN registration. + // + // This member is required. + LegalAddress *Address + + // The legal name associated with your TRN registration. + // + // This member is required. + LegalName *string + + // Your tax registration unique identifier. + // + // This member is required. + RegistrationId *string + + // Type of your tax registration. This can be either VAT or GST . + // + // This member is required. + RegistrationType TaxRegistrationType + + // The status of your TRN. This can be either Verified , Pending , Deleted , or + // Rejected . + // + // This member is required. + Status TaxRegistrationStatus + + // Additional tax information associated with your TRN. + AdditionalTaxInformation *AdditionalInfoResponse + + // The email address to receive VAT invoices. + CertifiedEmailId *string + + // The industry that describes your business. For business-to-business (B2B) + // customers, specify Business. For business-to-consumer (B2C) customers, specify + // Individual. For business-to-government (B2G), specify Government. Note that + // certain values may not applicable for the request country. Please refer to + // country specific information in API document. + Sector Sector + + // The metadata for your tax document. + TaxDocumentMetadatas []TaxDocumentMetadata + + noSmithyDocumentSerde +} + +// Tax registration document information. +type TaxRegistrationDocument struct { + + // The Amazon S3 location where your tax registration document is stored. + // + // This member is required. + S3Location *SourceS3Location + + noSmithyDocumentSerde +} + +// The TRN information you provide when you add a new TRN, or update. +type TaxRegistrationEntry struct { + + // Your tax registration unique identifier. + // + // This member is required. + RegistrationId *string + + // Your tax registration type. This can be either VAT or GST . + // + // This member is required. + RegistrationType TaxRegistrationType + + // Additional tax information associated with your TRN. You only need to specify + // this parameter if Amazon Web Services collects any additional information for + // your country within AdditionalInfoRequest. + AdditionalTaxInformation *AdditionalInfoRequest + + // The email address to receive VAT invoices. + CertifiedEmailId *string + + // The legal address associated with your TRN. + // + // If you're setting a TRN in Brazil for the CNPJ tax type, you don't need to + // specify the legal address. + // + // For TRNs in other countries and for CPF tax types Brazil, you must specify the + // legal address. + LegalAddress *Address + + // The legal name associated with your TRN. + // + // If you're setting a TRN in Brazil, you don't need to specify the legal name. + // For TRNs in other countries, you must specify the legal name. + LegalName *string + + // The industry that describes your business. For business-to-business (B2B) + // customers, specify Business. For business-to-consumer (B2C) customers, specify + // Individual. For business-to-government (B2G), specify Government.Note that + // certain values may not applicable for the request country. Please refer to + // country specific information in API document. + Sector Sector + + // Additional details needed to verify your TRN information in Brazil. You only + // need to specify this parameter when you set a TRN in Brazil that is the CPF tax + // type. + // + // Don't specify this parameter to set a TRN in Brazil of the CNPJ tax type or to + // set a TRN for another country. + VerificationDetails *VerificationDetails + + noSmithyDocumentSerde +} + +// Your TRN information with jurisdiction details. This doesn't contain the full +// legal address associated with the TRN information. +type TaxRegistrationWithJurisdiction struct { + + // The jurisdiction associated with your TRN information. + // + // This member is required. + Jurisdiction *Jurisdiction + + // The legal name associated with your TRN information. + // + // This member is required. + LegalName *string + + // Your tax registration unique identifier. + // + // This member is required. + RegistrationId *string + + // The type of your tax registration. This can be either VAT or GST . + // + // This member is required. + RegistrationType TaxRegistrationType + + // The status of your TRN. This can be either Verified , Pending , Deleted , or + // Rejected . + // + // This member is required. + Status TaxRegistrationStatus + + // Additional tax information associated with your TRN. + AdditionalTaxInformation *AdditionalInfoResponse + + // The email address to receive VAT invoices. + CertifiedEmailId *string + + // The industry that describes your business. For business-to-business (B2B) + // customers, specify Business. For business-to-consumer (B2C) customers, specify + // Individual. For business-to-government (B2G), specify Government.Note that + // certain values may not applicable for the request country. Please refer to + // country specific information in API document. + Sector Sector + + // The metadata for your tax document. + TaxDocumentMetadatas []TaxDocumentMetadata + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Turkey. +type TurkeyAdditionalInfo struct { + + // The industry information that tells the Tax Settings API if you're subject to + // additional withholding taxes. This information required for business-to-business + // (B2B) customers. This information is conditionally mandatory for B2B customers + // who are subject to KDV tax. + Industries Industries + + // The Registered Electronic Mail (REM) that is used to send notarized + // communication. This parameter is optional for business-to-business (B2B) and + // business-to-government (B2G) customers. It's not required for + // business-to-consumer (B2C) customers. + KepEmailId *string + + // Secondary tax ID (“harcama birimi VKN”si”). If one isn't provided, we will use + // your VKN as the secondary ID. + SecondaryTaxId *string + + // The tax office where you're registered. You can enter this information as a + // string. The Tax Settings API will add this information to your invoice. This + // parameter is required for business-to-business (B2B) and business-to-government + // customers. It's not required for business-to-consumer (B2C) customers. + TaxOffice *string + + noSmithyDocumentSerde +} + +// Additional tax information associated with your TRN in Ukraine. +type UkraineAdditionalInfo struct { + + // The tax registration type. + // + // This member is required. + UkraineTrnType UkraineTrnType + + noSmithyDocumentSerde +} + +// The information about the specified parameter in the request that caused an +// error. +type ValidationExceptionField struct { + + // The name of the parameter that caused a ValidationException error. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Required information to verify your TRN. +type VerificationDetails struct { + + // Date of birth to verify your submitted TRN. Use the YYYY-MM-DD format. + DateOfBirth *string + + // The tax registration document, which is required for specific countries such as + // Bangladesh, Kenya, South Korea and Spain. + TaxRegistrationDocuments []TaxRegistrationDocument + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/taxsettings/validators.go b/service/taxsettings/validators.go new file mode 100644 index 00000000000..da65ad34e14 --- /dev/null +++ b/service/taxsettings/validators.go @@ -0,0 +1,551 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpBatchDeleteTaxRegistration struct { +} + +func (*validateOpBatchDeleteTaxRegistration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDeleteTaxRegistration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDeleteTaxRegistrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDeleteTaxRegistrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchPutTaxRegistration struct { +} + +func (*validateOpBatchPutTaxRegistration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchPutTaxRegistration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchPutTaxRegistrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchPutTaxRegistrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTaxRegistrationDocument struct { +} + +func (*validateOpGetTaxRegistrationDocument) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTaxRegistrationDocument) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTaxRegistrationDocumentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTaxRegistrationDocumentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutTaxRegistration struct { +} + +func (*validateOpPutTaxRegistration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutTaxRegistration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutTaxRegistrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutTaxRegistrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpBatchDeleteTaxRegistrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDeleteTaxRegistration{}, middleware.After) +} + +func addOpBatchPutTaxRegistrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchPutTaxRegistration{}, middleware.After) +} + +func addOpGetTaxRegistrationDocumentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTaxRegistrationDocument{}, middleware.After) +} + +func addOpPutTaxRegistrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutTaxRegistration{}, middleware.After) +} + +func validateAdditionalInfoRequest(v *types.AdditionalInfoRequest) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AdditionalInfoRequest"} + if v.MalaysiaAdditionalInfo != nil { + if err := validateMalaysiaAdditionalInfo(v.MalaysiaAdditionalInfo); err != nil { + invalidParams.AddNested("MalaysiaAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.IsraelAdditionalInfo != nil { + if err := validateIsraelAdditionalInfo(v.IsraelAdditionalInfo); err != nil { + invalidParams.AddNested("IsraelAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.EstoniaAdditionalInfo != nil { + if err := validateEstoniaAdditionalInfo(v.EstoniaAdditionalInfo); err != nil { + invalidParams.AddNested("EstoniaAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.SpainAdditionalInfo != nil { + if err := validateSpainAdditionalInfo(v.SpainAdditionalInfo); err != nil { + invalidParams.AddNested("SpainAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.KenyaAdditionalInfo != nil { + if err := validateKenyaAdditionalInfo(v.KenyaAdditionalInfo); err != nil { + invalidParams.AddNested("KenyaAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.SouthKoreaAdditionalInfo != nil { + if err := validateSouthKoreaAdditionalInfo(v.SouthKoreaAdditionalInfo); err != nil { + invalidParams.AddNested("SouthKoreaAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.GeorgiaAdditionalInfo != nil { + if err := validateGeorgiaAdditionalInfo(v.GeorgiaAdditionalInfo); err != nil { + invalidParams.AddNested("GeorgiaAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.RomaniaAdditionalInfo != nil { + if err := validateRomaniaAdditionalInfo(v.RomaniaAdditionalInfo); err != nil { + invalidParams.AddNested("RomaniaAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if v.UkraineAdditionalInfo != nil { + if err := validateUkraineAdditionalInfo(v.UkraineAdditionalInfo); err != nil { + invalidParams.AddNested("UkraineAdditionalInfo", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAddress(v *types.Address) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Address"} + if v.AddressLine1 == nil { + invalidParams.Add(smithy.NewErrParamRequired("AddressLine1")) + } + if v.City == nil { + invalidParams.Add(smithy.NewErrParamRequired("City")) + } + if v.PostalCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("PostalCode")) + } + if v.CountryCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("CountryCode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDestinationS3Location(v *types.DestinationS3Location) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DestinationS3Location"} + if v.Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEstoniaAdditionalInfo(v *types.EstoniaAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EstoniaAdditionalInfo"} + if v.RegistryCommercialCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("RegistryCommercialCode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGeorgiaAdditionalInfo(v *types.GeorgiaAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GeorgiaAdditionalInfo"} + if len(v.PersonType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PersonType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsraelAdditionalInfo(v *types.IsraelAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsraelAdditionalInfo"} + if len(v.DealerType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DealerType")) + } + if len(v.CustomerType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("CustomerType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateKenyaAdditionalInfo(v *types.KenyaAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "KenyaAdditionalInfo"} + if len(v.PersonType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PersonType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMalaysiaAdditionalInfo(v *types.MalaysiaAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MalaysiaAdditionalInfo"} + if v.ServiceTaxCodes == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceTaxCodes")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRomaniaAdditionalInfo(v *types.RomaniaAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RomaniaAdditionalInfo"} + if len(v.TaxRegistrationNumberType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TaxRegistrationNumberType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSourceS3Location(v *types.SourceS3Location) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceS3Location"} + if v.Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("Bucket")) + } + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSouthKoreaAdditionalInfo(v *types.SouthKoreaAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SouthKoreaAdditionalInfo"} + if v.BusinessRepresentativeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BusinessRepresentativeName")) + } + if v.LineOfBusiness == nil { + invalidParams.Add(smithy.NewErrParamRequired("LineOfBusiness")) + } + if v.ItemOfBusiness == nil { + invalidParams.Add(smithy.NewErrParamRequired("ItemOfBusiness")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSpainAdditionalInfo(v *types.SpainAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SpainAdditionalInfo"} + if len(v.RegistrationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTaxDocumentMetadata(v *types.TaxDocumentMetadata) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TaxDocumentMetadata"} + if v.TaxDocumentAccessToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaxDocumentAccessToken")) + } + if v.TaxDocumentName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaxDocumentName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTaxRegistrationDocument(v *types.TaxRegistrationDocument) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TaxRegistrationDocument"} + if v.S3Location == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Location")) + } else if v.S3Location != nil { + if err := validateSourceS3Location(v.S3Location); err != nil { + invalidParams.AddNested("S3Location", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTaxRegistrationDocuments(v []types.TaxRegistrationDocument) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TaxRegistrationDocuments"} + for i := range v { + if err := validateTaxRegistrationDocument(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTaxRegistrationEntry(v *types.TaxRegistrationEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TaxRegistrationEntry"} + if v.RegistrationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationId")) + } + if len(v.RegistrationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationType")) + } + if v.LegalAddress != nil { + if err := validateAddress(v.LegalAddress); err != nil { + invalidParams.AddNested("LegalAddress", err.(smithy.InvalidParamsError)) + } + } + if v.AdditionalTaxInformation != nil { + if err := validateAdditionalInfoRequest(v.AdditionalTaxInformation); err != nil { + invalidParams.AddNested("AdditionalTaxInformation", err.(smithy.InvalidParamsError)) + } + } + if v.VerificationDetails != nil { + if err := validateVerificationDetails(v.VerificationDetails); err != nil { + invalidParams.AddNested("VerificationDetails", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUkraineAdditionalInfo(v *types.UkraineAdditionalInfo) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UkraineAdditionalInfo"} + if len(v.UkraineTrnType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("UkraineTrnType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVerificationDetails(v *types.VerificationDetails) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VerificationDetails"} + if v.TaxRegistrationDocuments != nil { + if err := validateTaxRegistrationDocuments(v.TaxRegistrationDocuments); err != nil { + invalidParams.AddNested("TaxRegistrationDocuments", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchDeleteTaxRegistrationInput(v *BatchDeleteTaxRegistrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteTaxRegistrationInput"} + if v.AccountIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchPutTaxRegistrationInput(v *BatchPutTaxRegistrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchPutTaxRegistrationInput"} + if v.AccountIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountIds")) + } + if v.TaxRegistrationEntry == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaxRegistrationEntry")) + } else if v.TaxRegistrationEntry != nil { + if err := validateTaxRegistrationEntry(v.TaxRegistrationEntry); err != nil { + invalidParams.AddNested("TaxRegistrationEntry", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTaxRegistrationDocumentInput(v *GetTaxRegistrationDocumentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTaxRegistrationDocumentInput"} + if v.DestinationS3Location == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationS3Location")) + } else if v.DestinationS3Location != nil { + if err := validateDestinationS3Location(v.DestinationS3Location); err != nil { + invalidParams.AddNested("DestinationS3Location", err.(smithy.InvalidParamsError)) + } + } + if v.TaxDocumentMetadata == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaxDocumentMetadata")) + } else if v.TaxDocumentMetadata != nil { + if err := validateTaxDocumentMetadata(v.TaxDocumentMetadata); err != nil { + invalidParams.AddNested("TaxDocumentMetadata", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutTaxRegistrationInput(v *PutTaxRegistrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutTaxRegistrationInput"} + if v.TaxRegistrationEntry == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaxRegistrationEntry")) + } else if v.TaxRegistrationEntry != nil { + if err := validateTaxRegistrationEntry(v.TaxRegistrationEntry); err != nil { + invalidParams.AddNested("TaxRegistrationEntry", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/vpclattice/internal/endpoints/endpoints.go b/service/vpclattice/internal/endpoints/endpoints.go index 83b3bee1939..d0eb57a7a55 100644 --- a/service/vpclattice/internal/endpoints/endpoints.go +++ b/service/vpclattice/internal/endpoints/endpoints.go @@ -169,6 +169,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, @@ -178,6 +181,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{},