diff --git a/.changelog/025f0cf08a3143318f2b930659f7185a.json b/.changelog/025f0cf08a3143318f2b930659f7185a.json new file mode 100644 index 00000000000..e0003f498b7 --- /dev/null +++ b/.changelog/025f0cf08a3143318f2b930659f7185a.json @@ -0,0 +1,8 @@ +{ + "id": "025f0cf0-8a31-4331-8f2b-930659f7185a", + "type": "feature", + "description": "Amazon Route 53 now supports the Europe (Zurich) Region (eu-central-2) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region.", + "modules": [ + "service/route53" + ] +} \ No newline at end of file diff --git a/.changelog/1d93634a07a84b2b9a033d1694717be5.json b/.changelog/1d93634a07a84b2b9a033d1694717be5.json new file mode 100644 index 00000000000..a56c9df67ca --- /dev/null +++ b/.changelog/1d93634a07a84b2b9a033d1694717be5.json @@ -0,0 +1,8 @@ +{ + "id": "1d93634a-07a8-4b2b-9a03-3d1694717be5", + "type": "feature", + "description": "Amazon Polly adds new voices: Elin (sv-SE), Ida (nb-NO), Laura (nl-NL) and Suvi (fi-FI). They are available as neural voices only.", + "modules": [ + "service/polly" + ] +} \ No newline at end of file diff --git a/.changelog/283ef0bdb2644f7aa3f19c4d086fd327.json b/.changelog/283ef0bdb2644f7aa3f19c4d086fd327.json new file mode 100644 index 00000000000..02363a2e741 --- /dev/null +++ b/.changelog/283ef0bdb2644f7aa3f19c4d086fd327.json @@ -0,0 +1,8 @@ +{ + "id": "283ef0bd-b264-4f7a-a3f1-9c4d086fd327", + "type": "feature", + "description": "Amazon OpenSearch Service now offers managed VPC endpoints to connect to your Amazon OpenSearch Service VPC-enabled domain in a Virtual Private Cloud (VPC). This feature allows you to privately access OpenSearch Service domain without using public IPs or requiring traffic to traverse the Internet.", + "modules": [ + "service/opensearch" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..fe4d3a4c652 --- /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/resourceexplorer2" + ] +} \ No newline at end of file diff --git a/.changelog/9e3b911a8d6042c989928a86d21a0050.json b/.changelog/9e3b911a8d6042c989928a86d21a0050.json new file mode 100644 index 00000000000..f23aa8a7538 --- /dev/null +++ b/.changelog/9e3b911a8d6042c989928a86d21a0050.json @@ -0,0 +1,8 @@ +{ + "id": "9e3b911a-8d60-42c9-8992-8a86d21a0050", + "type": "feature", + "description": "Support added for requesting elliptic curve certificate key algorithm types P-256 (EC_prime256v1) and P-384 (EC_secp384r1).", + "modules": [ + "service/acm" + ] +} \ No newline at end of file diff --git a/.changelog/ab7375f227bb4ac69dfc6a6e9942ba9c.json b/.changelog/ab7375f227bb4ac69dfc6a6e9942ba9c.json new file mode 100644 index 00000000000..96ce6e2ab8b --- /dev/null +++ b/.changelog/ab7375f227bb4ac69dfc6a6e9942ba9c.json @@ -0,0 +1,8 @@ +{ + "id": "ab7375f2-27bb-4ac6-9dfc-6a6e9942ba9c", + "type": "feature", + "description": "AWS Firewall Manager now supports importing existing AWS Network Firewall firewalls into Firewall Manager policies.", + "modules": [ + "service/fms" + ] +} \ No newline at end of file diff --git a/.changelog/b5172f2cb35242748dc2649600cabde4.json b/.changelog/b5172f2cb35242748dc2649600cabde4.json new file mode 100644 index 00000000000..867be86628f --- /dev/null +++ b/.changelog/b5172f2cb35242748dc2649600cabde4.json @@ -0,0 +1,8 @@ +{ + "id": "b5172f2c-b352-4274-8dc2-649600cabde4", + "type": "feature", + "description": "This release adds support for Amazon Lightsail to automate the delegation of domains registered through Amazon Route 53 to Lightsail DNS management and to automate record creation for DNS validation of Lightsail SSL/TLS certificates.", + "modules": [ + "service/lightsail" + ] +} \ No newline at end of file diff --git a/.changelog/e46b1dd2724447ec84a711dad3555d00.json b/.changelog/e46b1dd2724447ec84a711dad3555d00.json new file mode 100644 index 00000000000..b1bfa02f64a --- /dev/null +++ b/.changelog/e46b1dd2724447ec84a711dad3555d00.json @@ -0,0 +1,8 @@ +{ + "id": "e46b1dd2-7244-47ec-84a7-11dad3555d00", + "type": "feature", + "description": "This release adds the Recurring Custom Line Item feature along with a new API ListCustomLineItemVersions.", + "modules": [ + "service/billingconductor" + ] +} \ No newline at end of file diff --git a/.changelog/e4ef0d14704844348220383911cda1c3.json b/.changelog/e4ef0d14704844348220383911cda1c3.json new file mode 100644 index 00000000000..c0896552a01 --- /dev/null +++ b/.changelog/e4ef0d14704844348220383911cda1c3.json @@ -0,0 +1,8 @@ +{ + "id": "e4ef0d14-7048-4434-8220-383911cda1c3", + "type": "feature", + "description": "This release enables sharing of EC2 Placement Groups across accounts and within AWS Organizations using Resource Access Manager", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/e98ae24842f9406d98e80e87d29c407f.json b/.changelog/e98ae24842f9406d98e80e87d29c407f.json new file mode 100644 index 00000000000..b47b66e67aa --- /dev/null +++ b/.changelog/e98ae24842f9406d98e80e87d29c407f.json @@ -0,0 +1,8 @@ +{ + "id": "e98ae248-42f9-406d-98e8-0e87d29c407f", + "type": "feature", + "description": "This is the initial SDK release for AWS Resource Explorer. AWS Resource Explorer lets your users search for and discover your AWS resources across the AWS Regions in your account.", + "modules": [ + "service/resourceexplorer2" + ] +} \ No newline at end of file diff --git a/service/acm/api_op_RenewCertificate.go b/service/acm/api_op_RenewCertificate.go index c0bc9218cce..f273b7b3afa 100644 --- a/service/acm/api_op_RenewCertificate.go +++ b/service/acm/api_op_RenewCertificate.go @@ -11,11 +11,11 @@ import ( ) // Renews an eligible ACM certificate. At this time, only exported private -// certificates can be renewed with this operation. In order to renew your ACM -// Private CA certificates with ACM, you must first grant the ACM service principal -// permission to do so -// (https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaPermissions.html). For -// more information, see Testing Managed Renewal +// certificates can be renewed with this operation. In order to renew your Amazon +// Web Services Private CA certificates with ACM, you must first grant the ACM +// service principal permission to do so +// (https://docs.aws.amazon.com/privateca/latest/userguide/PcaPermissions.html). +// For more information, see Testing Managed Renewal // (https://docs.aws.amazon.com/acm/latest/userguide/manual-renewal.html) in the // ACM User Guide. func (c *Client) RenewCertificate(ctx context.Context, params *RenewCertificateInput, optFns ...func(*Options)) (*RenewCertificateOutput, error) { diff --git a/service/acm/api_op_RequestCertificate.go b/service/acm/api_op_RequestCertificate.go index 1bcac224de6..64c2d580586 100644 --- a/service/acm/api_op_RequestCertificate.go +++ b/service/acm/api_op_RequestCertificate.go @@ -61,9 +61,9 @@ type RequestCertificateInput struct { // The Amazon Resource Name (ARN) of the private certificate authority (CA) that // will be used to issue the certificate. If you do not provide an ARN and you are // trying to request a private certificate, ACM will attempt to issue a public - // certificate. For more information about private CAs, see the Certificate Manager + // certificate. For more information about private CAs, see the Amazon Web Services // Private Certificate Authority - // (https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaWelcome.html) user + // (https://docs.aws.amazon.com/privateca/latest/userguide/PcaWelcome.html) user // guide. The ARN must have the following form: // arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 CertificateAuthorityArn *string @@ -80,6 +80,17 @@ type RequestCertificateInput struct { // recognizes that you are requesting multiple certificates. IdempotencyToken *string + // Specifies the algorithm of the public and private key pair that your certificate + // uses to encrypt data. RSA is the default key algorithm for ACM certificates. + // Elliptic Curve Digital Signature Algorithm (ECDSA) keys are smaller, offering + // security comparable to RSA keys but with greater computing efficiency. However, + // ECDSA is not supported by all network clients. Some AWS services may require RSA + // keys, or only support ECDSA keys of a particular size, while others allow the + // use of either RSA and ECDSA keys to ensure that compatibility is not broken. + // Check the requirements for the AWS service where you plan to deploy your + // certificate. Default: RSA_2048 + KeyAlgorithm types.KeyAlgorithm + // Currently, you can use this parameter to specify whether to add the certificate // to a certificate transparency log. Certificate transparency makes it possible to // detect SSL/TLS certificates that have been mistakenly or maliciously issued. diff --git a/service/acm/deserializers.go b/service/acm/deserializers.go index f6f84f22f87..28d11f61edc 100644 --- a/service/acm/deserializers.go +++ b/service/acm/deserializers.go @@ -203,6 +203,12 @@ func awsAwsjson11_deserializeOpErrorDeleteCertificate(response *smithyhttp.Respo } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InvalidArnException", errorCode): return awsAwsjson11_deserializeErrorInvalidArnException(response, errorBody) @@ -212,6 +218,9 @@ func awsAwsjson11_deserializeOpErrorDeleteCertificate(response *smithyhttp.Respo case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -914,6 +923,9 @@ func awsAwsjson11_deserializeOpErrorListCertificates(response *smithyhttp.Respon case strings.EqualFold("InvalidArgsException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgsException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, diff --git a/service/acm/serializers.go b/service/acm/serializers.go index 683f2a219ce..2716c8659fc 100644 --- a/service/acm/serializers.go +++ b/service/acm/serializers.go @@ -1237,6 +1237,11 @@ func awsAwsjson11_serializeOpDocumentRequestCertificateInput(v *RequestCertifica ok.String(*v.IdempotencyToken) } + if len(v.KeyAlgorithm) > 0 { + ok := object.Key("KeyAlgorithm") + ok.String(string(v.KeyAlgorithm)) + } + if v.Options != nil { ok := object.Key("Options") if err := awsAwsjson11_serializeDocumentCertificateOptions(v.Options, ok); err != nil { diff --git a/service/athena/internal/endpoints/endpoints.go b/service/athena/internal/endpoints/endpoints.go index a44ac33372a..90950b36a83 100644 --- a/service/athena/internal/endpoints/endpoints.go +++ b/service/athena/internal/endpoints/endpoints.go @@ -138,51 +138,147 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.af-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-northeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-northeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-northeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-southeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-southeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ap-southeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.eu-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.eu-north-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.eu-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.eu-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.eu-west-3.api.aws", + }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ @@ -222,9 +318,21 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.me-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.sa-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, @@ -234,6 +342,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "athena-fips.us-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, @@ -243,6 +357,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "athena-fips.us-east-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -252,6 +372,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "athena-fips.us-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, @@ -261,6 +387,12 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "athena-fips.us-west-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "athena.us-west-2.api.aws", + }, }, }, { diff --git a/service/billingconductor/api_op_CreateBillingGroup.go b/service/billingconductor/api_op_CreateBillingGroup.go index 561da7ccedd..e377d08e5c0 100644 --- a/service/billingconductor/api_op_CreateBillingGroup.go +++ b/service/billingconductor/api_op_CreateBillingGroup.go @@ -52,7 +52,7 @@ type CreateBillingGroupInput struct { // supported, but will be implemented in a future update. ClientToken *string - // The billing group description. + // The description of the billing group. Description *string // The account ID that serves as the main account in a billing group. diff --git a/service/billingconductor/api_op_CreatePricingPlan.go b/service/billingconductor/api_op_CreatePricingPlan.go index 1fbe434847c..bc6d9a4804e 100644 --- a/service/billingconductor/api_op_CreatePricingPlan.go +++ b/service/billingconductor/api_op_CreatePricingPlan.go @@ -30,7 +30,7 @@ func (c *Client) CreatePricingPlan(ctx context.Context, params *CreatePricingPla type CreatePricingPlanInput struct { - // The pricing plan name. The names must be unique to each pricing plan. + // The name of the pricing plan. The names must be unique to each pricing plan. // // This member is required. Name *string @@ -39,7 +39,7 @@ type CreatePricingPlanInput struct { // supported, but will be implemented in a future update. ClientToken *string - // The pricing plan description. + // The description of the pricing plan. Description *string // A list of Amazon Resource Names (ARNs) that define the pricing plan parameters. diff --git a/service/billingconductor/api_op_CreatePricingRule.go b/service/billingconductor/api_op_CreatePricingRule.go index bff3a5d4046..96e15d4d4e8 100644 --- a/service/billingconductor/api_op_CreatePricingRule.go +++ b/service/billingconductor/api_op_CreatePricingRule.go @@ -31,7 +31,7 @@ func (c *Client) CreatePricingRule(ctx context.Context, params *CreatePricingRul type CreatePricingRuleInput struct { - // A percentage modifier applied on the public pricing rates. + // A percentage modifier that's applied on the public pricing rates. // // This member is required. ModifierPercentage *float64 @@ -41,7 +41,7 @@ type CreatePricingRuleInput struct { // This member is required. Name *string - // The scope of pricing rule that indicates if it is globally applicable, or is + // The scope of pricing rule that indicates if it's globally applicable, or it's // service-specific. // // This member is required. @@ -52,7 +52,7 @@ type CreatePricingRuleInput struct { // This member is required. Type types.PricingRuleType - // The token that is needed to support idempotency. Idempotency isn't currently + // The token that's needed to support idempotency. Idempotency isn't currently // supported, but will be implemented in a future update. ClientToken *string diff --git a/service/billingconductor/api_op_DeleteBillingGroup.go b/service/billingconductor/api_op_DeleteBillingGroup.go index 786dbd574e0..a02b514ef10 100644 --- a/service/billingconductor/api_op_DeleteBillingGroup.go +++ b/service/billingconductor/api_op_DeleteBillingGroup.go @@ -28,7 +28,7 @@ func (c *Client) DeleteBillingGroup(ctx context.Context, params *DeleteBillingGr type DeleteBillingGroupInput struct { - // The Amazon Resource Name (ARN) of the billing group you're deleting. + // The Amazon Resource Name (ARN) of the billing group that you're deleting. // // This member is required. Arn *string diff --git a/service/billingconductor/api_op_DeletePricingPlan.go b/service/billingconductor/api_op_DeletePricingPlan.go index a3a0397295a..738dac04c69 100644 --- a/service/billingconductor/api_op_DeletePricingPlan.go +++ b/service/billingconductor/api_op_DeletePricingPlan.go @@ -29,7 +29,7 @@ func (c *Client) DeletePricingPlan(ctx context.Context, params *DeletePricingPla type DeletePricingPlanInput struct { - // The Amazon Resource Name (ARN) of the pricing plan you're deleting. + // The Amazon Resource Name (ARN) of the pricing plan that you're deleting. // // This member is required. Arn *string diff --git a/service/billingconductor/api_op_DeletePricingRule.go b/service/billingconductor/api_op_DeletePricingRule.go index 4531bac1f8f..3c6d9126c81 100644 --- a/service/billingconductor/api_op_DeletePricingRule.go +++ b/service/billingconductor/api_op_DeletePricingRule.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the pricing rule identified by the input Amazon Resource Name (ARN). +// Deletes the pricing rule that's identified by the input Amazon Resource Name +// (ARN). func (c *Client) DeletePricingRule(ctx context.Context, params *DeletePricingRuleInput, optFns ...func(*Options)) (*DeletePricingRuleOutput, error) { if params == nil { params = &DeletePricingRuleInput{} @@ -28,7 +29,7 @@ func (c *Client) DeletePricingRule(ctx context.Context, params *DeletePricingRul type DeletePricingRuleInput struct { - // The Amazon Resource Name (ARN) of the pricing rule you are deleting. + // The Amazon Resource Name (ARN) of the pricing rule that you are deleting. // // This member is required. Arn *string diff --git a/service/billingconductor/api_op_ListAccountAssociations.go b/service/billingconductor/api_op_ListAccountAssociations.go index bf2e6df4a2f..e4760c0ea0f 100644 --- a/service/billingconductor/api_op_ListAccountAssociations.go +++ b/service/billingconductor/api_op_ListAccountAssociations.go @@ -12,14 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Amazon Web Services Billing Conductor is in beta release and is subject to -// change. Your use of Amazon Web Services Billing Conductor is subject to the Beta -// Service Participation terms of the Amazon Web Services Service Terms -// (https://aws.amazon.com/service-terms/) (Section 1.10). This is a paginated call -// to list linked accounts that are linked to the payer account for the specified -// time period. If no information is provided, the current billing period is used. -// The response will optionally include the billing group associated with the -// linked account. +// This is a paginated call to list linked accounts that are linked to the payer +// account for the specified time period. If no information is provided, the +// current billing period is used. The response will optionally include the billing +// group that's associated with the linked account. func (c *Client) ListAccountAssociations(ctx context.Context, params *ListAccountAssociationsInput, optFns ...func(*Options)) (*ListAccountAssociationsOutput, error) { if params == nil { params = &ListAccountAssociationsInput{} @@ -42,11 +38,11 @@ type ListAccountAssociationsInput struct { // The filter on the account ID of the linked account, or any of the following: // MONITORED: linked accounts that are associated to billing groups. UNMONITORED: - // linked accounts that are not associated to billing groups. Billing Group Arn: + // linked accounts that aren't associated to billing groups. Billing Group Arn: // linked accounts that are associated to the provided billing group Arn. Filters *types.ListAccountAssociationsFilter - // The pagination token used on subsequent calls to retrieve accounts. + // The pagination token that's used on subsequent calls to retrieve accounts. NextToken *string noSmithyDocumentSerde @@ -57,7 +53,7 @@ type ListAccountAssociationsOutput struct { // The list of linked accounts in the payer account. LinkedAccounts []types.AccountAssociationsListElement - // The pagination token used on subsequent calls to get accounts. + // The pagination token that's used on subsequent calls to get accounts. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/billingconductor/api_op_ListBillingGroupCostReports.go b/service/billingconductor/api_op_ListBillingGroupCostReports.go index c202272fe8a..44dd66d7997 100644 --- a/service/billingconductor/api_op_ListBillingGroupCostReports.go +++ b/service/billingconductor/api_op_ListBillingGroupCostReports.go @@ -42,7 +42,7 @@ type ListBillingGroupCostReportsInput struct { // The maximum number of reports to retrieve. MaxResults *int32 - // The pagination token used on subsequent calls to get reports. + // The pagination token that's used on subsequent calls to get reports. NextToken *string noSmithyDocumentSerde @@ -53,7 +53,7 @@ type ListBillingGroupCostReportsOutput struct { // A list of BillingGroupCostReportElement retrieved. BillingGroupCostReports []types.BillingGroupCostReportElement - // The pagination token used on subsequent calls to get reports. + // The pagination token that's used on subsequent calls to get reports. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/billingconductor/api_op_ListBillingGroups.go b/service/billingconductor/api_op_ListBillingGroups.go index 0a82a431909..8935b1c1265 100644 --- a/service/billingconductor/api_op_ListBillingGroups.go +++ b/service/billingconductor/api_op_ListBillingGroups.go @@ -42,7 +42,7 @@ type ListBillingGroupsInput struct { // The maximum number of billing groups to retrieve. MaxResults *int32 - // The pagination token used on subsequent calls to get billing groups. + // The pagination token that's used on subsequent calls to get billing groups. NextToken *string noSmithyDocumentSerde @@ -53,7 +53,7 @@ type ListBillingGroupsOutput struct { // A list of BillingGroupListElement retrieved. BillingGroups []types.BillingGroupListElement - // The pagination token used on subsequent calls to get billing groups. + // The pagination token that's used on subsequent calls to get billing groups. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/billingconductor/api_op_ListCustomLineItemVersions.go b/service/billingconductor/api_op_ListCustomLineItemVersions.go new file mode 100644 index 00000000000..060474312a0 --- /dev/null +++ b/service/billingconductor/api_op_ListCustomLineItemVersions.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package billingconductor + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/billingconductor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// A paginated call to get a list of all custom line item versions. +func (c *Client) ListCustomLineItemVersions(ctx context.Context, params *ListCustomLineItemVersionsInput, optFns ...func(*Options)) (*ListCustomLineItemVersionsOutput, error) { + if params == nil { + params = &ListCustomLineItemVersionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCustomLineItemVersions", params, optFns, c.addOperationListCustomLineItemVersionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCustomLineItemVersionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCustomLineItemVersionsInput struct { + + // The Amazon Resource Name (ARN) for the custom line item. + // + // This member is required. + Arn *string + + // A ListCustomLineItemVersionsFilter that specifies the billing period range in + // which the custom line item versions are applied. + Filters *types.ListCustomLineItemVersionsFilter + + // The maximum number of custom line item versions to retrieve. + MaxResults *int32 + + // The pagination token that's used on subsequent calls to retrieve custom line + // item versions. + NextToken *string + + noSmithyDocumentSerde +} + +type ListCustomLineItemVersionsOutput struct { + + // A list of CustomLineItemVersionListElements that are received. + CustomLineItemVersions []types.CustomLineItemVersionListElement + + // The pagination token that's used on subsequent calls to retrieve custom line + // item versions. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCustomLineItemVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCustomLineItemVersions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCustomLineItemVersions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListCustomLineItemVersionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCustomLineItemVersions(options.Region), middleware.Before); 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 + } + return nil +} + +// ListCustomLineItemVersionsAPIClient is a client that implements the +// ListCustomLineItemVersions operation. +type ListCustomLineItemVersionsAPIClient interface { + ListCustomLineItemVersions(context.Context, *ListCustomLineItemVersionsInput, ...func(*Options)) (*ListCustomLineItemVersionsOutput, error) +} + +var _ ListCustomLineItemVersionsAPIClient = (*Client)(nil) + +// ListCustomLineItemVersionsPaginatorOptions is the paginator options for +// ListCustomLineItemVersions +type ListCustomLineItemVersionsPaginatorOptions struct { + // The maximum number of custom line item versions to retrieve. + 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 +} + +// ListCustomLineItemVersionsPaginator is a paginator for +// ListCustomLineItemVersions +type ListCustomLineItemVersionsPaginator struct { + options ListCustomLineItemVersionsPaginatorOptions + client ListCustomLineItemVersionsAPIClient + params *ListCustomLineItemVersionsInput + nextToken *string + firstPage bool +} + +// NewListCustomLineItemVersionsPaginator returns a new +// ListCustomLineItemVersionsPaginator +func NewListCustomLineItemVersionsPaginator(client ListCustomLineItemVersionsAPIClient, params *ListCustomLineItemVersionsInput, optFns ...func(*ListCustomLineItemVersionsPaginatorOptions)) *ListCustomLineItemVersionsPaginator { + if params == nil { + params = &ListCustomLineItemVersionsInput{} + } + + options := ListCustomLineItemVersionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCustomLineItemVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomLineItemVersionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCustomLineItemVersions page. +func (p *ListCustomLineItemVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomLineItemVersionsOutput, 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.ListCustomLineItemVersions(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_opListCustomLineItemVersions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "billingconductor", + OperationName: "ListCustomLineItemVersions", + } +} diff --git a/service/billingconductor/api_op_ListCustomLineItems.go b/service/billingconductor/api_op_ListCustomLineItems.go index 56150125ae8..8ba110dc642 100644 --- a/service/billingconductor/api_op_ListCustomLineItems.go +++ b/service/billingconductor/api_op_ListCustomLineItems.go @@ -42,7 +42,8 @@ type ListCustomLineItemsInput struct { // The maximum number of billing groups to retrieve. MaxResults *int32 - // The pagination token used on subsequent calls to get custom line items (FFLIs). + // The pagination token that's used on subsequent calls to get custom line items + // (FFLIs). NextToken *string noSmithyDocumentSerde @@ -53,7 +54,8 @@ type ListCustomLineItemsOutput struct { // A list of FreeFormLineItemListElements received. CustomLineItems []types.CustomLineItemListElement - // The pagination token used on subsequent calls to get custom line items (FFLIs). + // The pagination token that's used on subsequent calls to get custom line items + // (FFLIs). NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/billingconductor/api_op_ListPricingPlans.go b/service/billingconductor/api_op_ListPricingPlans.go index 99b8c2378df..15cb4880f6e 100644 --- a/service/billingconductor/api_op_ListPricingPlans.go +++ b/service/billingconductor/api_op_ListPricingPlans.go @@ -41,7 +41,7 @@ type ListPricingPlansInput struct { // The maximum number of pricing plans to retrieve. MaxResults *int32 - // The pagination token used on subsequent call to get pricing plans. + // The pagination token that's used on subsequent call to get pricing plans. NextToken *string noSmithyDocumentSerde @@ -52,7 +52,7 @@ type ListPricingPlansOutput struct { // The billing period for which the described pricing plans are applicable. BillingPeriod *string - // The pagination token used on subsequent calls to get pricing plans. + // The pagination token that's used on subsequent calls to get pricing plans. NextToken *string // A list of PricingPlanListElement retrieved. diff --git a/service/billingconductor/api_op_ListPricingPlansAssociatedWithPricingRule.go b/service/billingconductor/api_op_ListPricingPlansAssociatedWithPricingRule.go index 7dc5d0c3616..abf32f2ea9c 100644 --- a/service/billingconductor/api_op_ListPricingPlansAssociatedWithPricingRule.go +++ b/service/billingconductor/api_op_ListPricingPlansAssociatedWithPricingRule.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// A list of the pricing plans associated with a pricing rule. +// A list of the pricing plans that are associated with a pricing rule. func (c *Client) ListPricingPlansAssociatedWithPricingRule(ctx context.Context, params *ListPricingPlansAssociatedWithPricingRuleInput, optFns ...func(*Options)) (*ListPricingPlansAssociatedWithPricingRuleOutput, error) { if params == nil { params = &ListPricingPlansAssociatedWithPricingRuleInput{} @@ -55,7 +55,8 @@ type ListPricingPlansAssociatedWithPricingRuleOutput struct { // The pagination token to be used on subsequent calls. NextToken *string - // The list containing pricing plans associated with the requested pricing rule. + // The list containing pricing plans that are associated with the requested pricing + // rule. PricingPlanArns []string // The pricing rule Amazon Resource Name (ARN) for which associations will be diff --git a/service/billingconductor/api_op_ListPricingRules.go b/service/billingconductor/api_op_ListPricingRules.go index 8fd82b73805..c300cb4e342 100644 --- a/service/billingconductor/api_op_ListPricingRules.go +++ b/service/billingconductor/api_op_ListPricingRules.go @@ -41,7 +41,7 @@ type ListPricingRulesInput struct { // The maximum number of pricing rules to retrieve. MaxResults *int32 - // The pagination token used on subsequent call to get pricing rules. + // The pagination token that's used on subsequent call to get pricing rules. NextToken *string noSmithyDocumentSerde @@ -52,7 +52,7 @@ type ListPricingRulesOutput struct { // The billing period for which the described pricing rules are applicable. BillingPeriod *string - // The pagination token used on subsequent calls to get pricing rules. + // The pagination token that's used on subsequent calls to get pricing rules. NextToken *string // A list containing the described pricing rules. diff --git a/service/billingconductor/api_op_ListPricingRulesAssociatedToPricingPlan.go b/service/billingconductor/api_op_ListPricingRulesAssociatedToPricingPlan.go index 05d2b28ce9b..c979ec4ad58 100644 --- a/service/billingconductor/api_op_ListPricingRulesAssociatedToPricingPlan.go +++ b/service/billingconductor/api_op_ListPricingRulesAssociatedToPricingPlan.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the pricing rules associated with a pricing plan. +// Lists the pricing rules that are associated with a pricing plan. func (c *Client) ListPricingRulesAssociatedToPricingPlan(ctx context.Context, params *ListPricingRulesAssociatedToPricingPlanInput, optFns ...func(*Options)) (*ListPricingRulesAssociatedToPricingPlanOutput, error) { if params == nil { params = &ListPricingRulesAssociatedToPricingPlanInput{} @@ -59,7 +59,8 @@ type ListPricingRulesAssociatedToPricingPlanOutput struct { // listed. PricingPlanArn *string - // A list containing pricing rules associated with the requested pricing plan. + // A list containing pricing rules that are associated with the requested pricing + // plan. PricingRuleArns []string // Metadata pertaining to the operation's result. diff --git a/service/billingconductor/api_op_ListResourcesAssociatedToCustomLineItem.go b/service/billingconductor/api_op_ListResourcesAssociatedToCustomLineItem.go index 1f2d628f3c2..3ff426080e2 100644 --- a/service/billingconductor/api_op_ListResourcesAssociatedToCustomLineItem.go +++ b/service/billingconductor/api_op_ListResourcesAssociatedToCustomLineItem.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List the resources associated to a custom line item. +// List the resources that are associated to a custom line item. func (c *Client) ListResourcesAssociatedToCustomLineItem(ctx context.Context, params *ListResourcesAssociatedToCustomLineItemInput, optFns ...func(*Options)) (*ListResourcesAssociatedToCustomLineItemOutput, error) { if params == nil { params = &ListResourcesAssociatedToCustomLineItemInput{} @@ -46,7 +46,7 @@ type ListResourcesAssociatedToCustomLineItemInput struct { // (Optional) The maximum number of resource associations to be retrieved. MaxResults *int32 - // (Optional) The pagination token returned by a previous request. + // (Optional) The pagination token that's returned by a previous request. NextToken *string noSmithyDocumentSerde diff --git a/service/billingconductor/api_op_UpdateBillingGroup.go b/service/billingconductor/api_op_UpdateBillingGroup.go index 9505088a885..d7f4dc342ad 100644 --- a/service/billingconductor/api_op_UpdateBillingGroup.go +++ b/service/billingconductor/api_op_UpdateBillingGroup.go @@ -58,7 +58,7 @@ type UpdateBillingGroupOutput struct { // A description of the billing group. Description *string - // The most recent time the billing group was modified. + // The most recent time when the billing group was modified. LastModifiedTime int64 // The name of the billing group. The names must be unique to each billing group. diff --git a/service/billingconductor/api_op_UpdateCustomLineItem.go b/service/billingconductor/api_op_UpdateCustomLineItem.go index c570396f910..35b6cc0c4f8 100644 --- a/service/billingconductor/api_op_UpdateCustomLineItem.go +++ b/service/billingconductor/api_op_UpdateCustomLineItem.go @@ -68,7 +68,7 @@ type UpdateCustomLineItemOutput struct { // The description of the successfully updated custom line item. Description *string - // The most recent time the custom line item was modified. + // The most recent time when the custom line item was modified. LastModifiedTime int64 // The name of the successfully updated custom line item. diff --git a/service/billingconductor/api_op_UpdatePricingPlan.go b/service/billingconductor/api_op_UpdatePricingPlan.go index 9f0c86dd3e0..2ae378b2538 100644 --- a/service/billingconductor/api_op_UpdatePricingPlan.go +++ b/service/billingconductor/api_op_UpdatePricingPlan.go @@ -28,12 +28,12 @@ func (c *Client) UpdatePricingPlan(ctx context.Context, params *UpdatePricingPla type UpdatePricingPlanInput struct { - // The Amazon Resource Name (ARN) of the pricing plan you're updating. + // The Amazon Resource Name (ARN) of the pricing plan that you're updating. // // This member is required. Arn *string - // The pricing plan description. + // The description of the pricing plan. Description *string // The name of the pricing plan. The name must be unique to each pricing plan. @@ -50,13 +50,13 @@ type UpdatePricingPlanOutput struct { // The new description for the pricing rule. Description *string - // The most recent time the pricing plan was modified. + // The most recent time when the pricing plan was modified. LastModifiedTime int64 // The name of the pricing plan. The name must be unique to each pricing plan. Name *string - // The pricing rules count currently associated with this pricing plan list. + // The pricing rules count that's currently associated with this pricing plan list. Size int64 // Metadata pertaining to the operation's result. diff --git a/service/billingconductor/api_op_UpdatePricingRule.go b/service/billingconductor/api_op_UpdatePricingRule.go index eb377f0f637..c2389c34654 100644 --- a/service/billingconductor/api_op_UpdatePricingRule.go +++ b/service/billingconductor/api_op_UpdatePricingRule.go @@ -69,7 +69,7 @@ type UpdatePricingRuleOutput struct { // The new name of the pricing rule. The name must be unique to each pricing rule. Name *string - // The scope of pricing rule that indicates if it is globally applicable, or is + // The scope of pricing rule that indicates if it's globally applicable, or it's // service-specific. Scope types.PricingRuleScope diff --git a/service/billingconductor/deserializers.go b/service/billingconductor/deserializers.go index f86de505244..03bd615901d 100644 --- a/service/billingconductor/deserializers.go +++ b/service/billingconductor/deserializers.go @@ -3015,6 +3015,171 @@ func awsRestjson1_deserializeOpDocumentListCustomLineItemsOutput(v **ListCustomL return nil } +type awsRestjson1_deserializeOpListCustomLineItemVersions struct { +} + +func (*awsRestjson1_deserializeOpListCustomLineItemVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCustomLineItemVersions) 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_deserializeOpErrorListCustomLineItemVersions(response, &metadata) + } + output := &ListCustomLineItemVersionsOutput{} + 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_deserializeOpDocumentListCustomLineItemVersionsOutput(&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_deserializeOpErrorListCustomLineItemVersions(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListCustomLineItemVersionsOutput(v **ListCustomLineItemVersionsOutput, 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 *ListCustomLineItemVersionsOutput + if *v == nil { + sv = &ListCustomLineItemVersionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CustomLineItemVersions": + if err := awsRestjson1_deserializeDocumentCustomLineItemVersionList(&sv.CustomLineItemVersions, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListPricingPlans struct { } @@ -5717,7 +5882,7 @@ func awsRestjson1_deserializeDocumentAssociateResourceResponseElement(v **types. if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CustomLineItemArn to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomLineItemAssociationElement to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } @@ -6123,6 +6288,15 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti sv.Message = ptr.String(jtv) } + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConflictExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ConflictExceptionReason(jtv) + } + case "ResourceId": if value != nil { jtv, ok := value.(string) @@ -6313,6 +6487,178 @@ func awsRestjson1_deserializeDocumentCustomLineItemListElement(v **types.CustomL return nil } +func awsRestjson1_deserializeDocumentCustomLineItemVersionList(v *[]types.CustomLineItemVersionListElement, 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.CustomLineItemVersionListElement + if *v == nil { + cv = []types.CustomLineItemVersionListElement{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CustomLineItemVersionListElement + destAddr := &col + if err := awsRestjson1_deserializeDocumentCustomLineItemVersionListElement(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCustomLineItemVersionListElement(v **types.CustomLineItemVersionListElement, 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.CustomLineItemVersionListElement + if *v == nil { + sv = &types.CustomLineItemVersionListElement{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssociationSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NumberOfAssociations to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AssociationSize = i64 + } + + case "BillingGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BillingGroupArn to be of type string, got %T instead", value) + } + sv.BillingGroupArn = ptr.String(jtv) + } + + case "ChargeDetails": + if err := awsRestjson1_deserializeDocumentListCustomLineItemChargeDetails(&sv.ChargeDetails, value); err != nil { + return err + } + + case "CreationTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Instant to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CreationTime = i64 + } + + case "CurrencyCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CurrencyCode to be of type string, got %T instead", value) + } + sv.CurrencyCode = types.CurrencyCode(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomLineItemDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EndBillingPeriod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BillingPeriod to be of type string, got %T instead", value) + } + sv.EndBillingPeriod = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Instant to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastModifiedTime = i64 + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomLineItemName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ProductCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomLineItemProductCode to be of type string, got %T instead", value) + } + sv.ProductCode = ptr.String(jtv) + } + + case "StartBillingPeriod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BillingPeriod to be of type string, got %T instead", value) + } + sv.StartBillingPeriod = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDisassociateResourceResponseElement(v **types.DisassociateResourceResponseElement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6339,7 +6685,7 @@ func awsRestjson1_deserializeDocumentDisassociateResourceResponseElement(v **typ if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CustomLineItemArn to be of type string, got %T instead", value) + return fmt.Errorf("expected CustomLineItemAssociationElement to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } @@ -6656,6 +7002,15 @@ func awsRestjson1_deserializeDocumentListResourcesAssociatedToCustomLineItemResp sv.Arn = ptr.String(jtv) } + case "EndBillingPeriod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BillingPeriod to be of type string, got %T instead", value) + } + sv.EndBillingPeriod = ptr.String(jtv) + } + case "Relationship": if value != nil { jtv, ok := value.(string) diff --git a/service/billingconductor/doc.go b/service/billingconductor/doc.go index 1eb20bbde5c..410db36dc62 100644 --- a/service/billingconductor/doc.go +++ b/service/billingconductor/doc.go @@ -5,7 +5,7 @@ // // Amazon Web Services Billing Conductor is a fully managed service that you can // use to customize a pro forma -// (https://docs.aws.amazon.com/enterprisebilling/6b7c01c5-b592-467e-9769-90052eaf359c/userguide/understanding-eb.html#eb-other-definitions) +// (https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions) // version of your billing data each month, to accurately show or chargeback your // end customers. Amazon Web Services Billing Conductor doesn't change the way // you're billed by Amazon Web Services each month by design. Instead, it provides @@ -19,7 +19,7 @@ // per billing group. This documentation shows how you can configure Amazon Web // Services Billing Conductor using its API. For more information about using the // Amazon Web Services Billing Conductor -// (https://console.aws.amazon.com/enterprisebilling/) user interface, see the -// Amazon Web Services Enterprise Billing Console User Guide -// (https://docs.aws.amazon.com/enterprisebilling/6b7c01c5-b592-467e-9769-90052eaf359c/userguide/what-is-enterprisebilling.html). +// (https://console.aws.amazon.com/billingconductor/) user interface, see the +// Amazon Web Services Billing Conductor User Guide +// (https://docs.aws.amazon.com/billingconductor/latest/userguide/what-is-billingconductor.html). package billingconductor diff --git a/service/billingconductor/generated.json b/service/billingconductor/generated.json index f52d66cc088..ff7824d34de 100644 --- a/service/billingconductor/generated.json +++ b/service/billingconductor/generated.json @@ -25,6 +25,7 @@ "api_op_ListAccountAssociations.go", "api_op_ListBillingGroupCostReports.go", "api_op_ListBillingGroups.go", + "api_op_ListCustomLineItemVersions.go", "api_op_ListCustomLineItems.go", "api_op_ListPricingPlans.go", "api_op_ListPricingPlansAssociatedWithPricingRule.go", diff --git a/service/billingconductor/serializers.go b/service/billingconductor/serializers.go index ccea2d8c713..302f8b66994 100644 --- a/service/billingconductor/serializers.go +++ b/service/billingconductor/serializers.go @@ -1527,6 +1527,91 @@ func awsRestjson1_serializeOpDocumentListCustomLineItemsInput(v *ListCustomLineI return nil } +type awsRestjson1_serializeOpListCustomLineItemVersions struct { +} + +func (*awsRestjson1_serializeOpListCustomLineItemVersions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCustomLineItemVersions) 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.(*ListCustomLineItemVersionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-custom-line-item-versions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentListCustomLineItemVersionsInput(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_serializeOpHttpBindingsListCustomLineItemVersionsInput(v *ListCustomLineItemVersionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListCustomLineItemVersionsInput(v *ListCustomLineItemVersionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentListCustomLineItemVersionsFilter(v.Filters, ok); err != nil { + return err + } + } + + 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_serializeOpListPricingPlans struct { } @@ -2800,6 +2885,37 @@ func awsRestjson1_serializeDocumentListCustomLineItemsFilter(v *types.ListCustom return nil } +func awsRestjson1_serializeDocumentListCustomLineItemVersionsBillingPeriodRangeFilter(v *types.ListCustomLineItemVersionsBillingPeriodRangeFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndBillingPeriod != nil { + ok := object.Key("EndBillingPeriod") + ok.String(*v.EndBillingPeriod) + } + + if v.StartBillingPeriod != nil { + ok := object.Key("StartBillingPeriod") + ok.String(*v.StartBillingPeriod) + } + + return nil +} + +func awsRestjson1_serializeDocumentListCustomLineItemVersionsFilter(v *types.ListCustomLineItemVersionsFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BillingPeriodRange != nil { + ok := object.Key("BillingPeriodRange") + if err := awsRestjson1_serializeDocumentListCustomLineItemVersionsBillingPeriodRangeFilter(v.BillingPeriodRange, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentListPricingPlansFilter(v *types.ListPricingPlansFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/billingconductor/types/enums.go b/service/billingconductor/types/enums.go index 934d7143a38..f6a92630429 100644 --- a/service/billingconductor/types/enums.go +++ b/service/billingconductor/types/enums.go @@ -6,10 +6,11 @@ type AssociateResourceErrorReason string // Enum values for AssociateResourceErrorReason const ( - AssociateResourceErrorReasonInvalidArn AssociateResourceErrorReason = "INVALID_ARN" - AssociateResourceErrorReasonServiceLimitExceeded AssociateResourceErrorReason = "SERVICE_LIMIT_EXCEEDED" - AssociateResourceErrorReasonIllegalCustomlineitem AssociateResourceErrorReason = "ILLEGAL_CUSTOMLINEITEM" - AssociateResourceErrorReasonInternalServerException AssociateResourceErrorReason = "INTERNAL_SERVER_EXCEPTION" + AssociateResourceErrorReasonInvalidArn AssociateResourceErrorReason = "INVALID_ARN" + AssociateResourceErrorReasonServiceLimitExceeded AssociateResourceErrorReason = "SERVICE_LIMIT_EXCEEDED" + AssociateResourceErrorReasonIllegalCustomlineitem AssociateResourceErrorReason = "ILLEGAL_CUSTOMLINEITEM" + AssociateResourceErrorReasonInternalServerException AssociateResourceErrorReason = "INTERNAL_SERVER_EXCEPTION" + AssociateResourceErrorReasonInvalidBillingPeriodRange AssociateResourceErrorReason = "INVALID_BILLING_PERIOD_RANGE" ) // Values returns all known values for AssociateResourceErrorReason. Note that this @@ -21,6 +22,7 @@ func (AssociateResourceErrorReason) Values() []AssociateResourceErrorReason { "SERVICE_LIMIT_EXCEEDED", "ILLEGAL_CUSTOMLINEITEM", "INTERNAL_SERVER_EXCEPTION", + "INVALID_BILLING_PERIOD_RANGE", } } @@ -42,6 +44,30 @@ func (BillingGroupStatus) Values() []BillingGroupStatus { } } +type ConflictExceptionReason string + +// Enum values for ConflictExceptionReason +const ( + ConflictExceptionReasonResourceNameConflict ConflictExceptionReason = "RESOURCE_NAME_CONFLICT" + ConflictExceptionReasonPricingRuleInPricingPlanConflict ConflictExceptionReason = "PRICING_RULE_IN_PRICING_PLAN_CONFLICT" + ConflictExceptionReasonPricingPlanAttachedToBillingGroupDeleteConflict ConflictExceptionReason = "PRICING_PLAN_ATTACHED_TO_BILLING_GROUP_DELETE_CONFLICT" + ConflictExceptionReasonPricingRuleAttachedToPricingPlanDeleteConflict ConflictExceptionReason = "PRICING_RULE_ATTACHED_TO_PRICING_PLAN_DELETE_CONFLICT" + ConflictExceptionReasonWriteConflictRetry ConflictExceptionReason = "WRITE_CONFLICT_RETRY" +) + +// Values returns all known values for ConflictExceptionReason. 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 (ConflictExceptionReason) Values() []ConflictExceptionReason { + return []ConflictExceptionReason{ + "RESOURCE_NAME_CONFLICT", + "PRICING_RULE_IN_PRICING_PLAN_CONFLICT", + "PRICING_PLAN_ATTACHED_TO_BILLING_GROUP_DELETE_CONFLICT", + "PRICING_RULE_ATTACHED_TO_PRICING_PLAN_DELETE_CONFLICT", + "WRITE_CONFLICT_RETRY", + } +} + type CurrencyCode string // Enum values for CurrencyCode @@ -180,6 +206,10 @@ const ( ValidationExceptionReasonMultipleLinkedAccountIds ValidationExceptionReason = "MULTIPLE_LINKED_ACCOUNT_IDS" ValidationExceptionReasonMissingPricingPlanArn ValidationExceptionReason = "MISSING_PRICING_PLAN_ARN" ValidationExceptionReasonMultiplePricingPlanArn ValidationExceptionReason = "MULTIPLE_PRICING_PLAN_ARN" + ValidationExceptionReasonIllegalChildAssociateResource ValidationExceptionReason = "ILLEGAL_CHILD_ASSOCIATE_RESOURCE" + ValidationExceptionReasonCustomLineItemAssociationExists ValidationExceptionReason = "CUSTOM_LINE_ITEM_ASSOCIATION_EXISTS" + ValidationExceptionReasonInvalidBillingPeriodForOperation ValidationExceptionReason = "INVALID_BILLING_PERIOD_FOR_OPERATION" + ValidationExceptionReasonInvalidBillingGroup ValidationExceptionReason = "INVALID_BILLING_GROUP" ) // Values returns all known values for ValidationExceptionReason. Note that this @@ -231,5 +261,9 @@ func (ValidationExceptionReason) Values() []ValidationExceptionReason { "MULTIPLE_LINKED_ACCOUNT_IDS", "MISSING_PRICING_PLAN_ARN", "MULTIPLE_PRICING_PLAN_ARN", + "ILLEGAL_CHILD_ASSOCIATE_RESOURCE", + "CUSTOM_LINE_ITEM_ASSOCIATION_EXISTS", + "INVALID_BILLING_PERIOD_FOR_OPERATION", + "INVALID_BILLING_GROUP", } } diff --git a/service/billingconductor/types/errors.go b/service/billingconductor/types/errors.go index d9e8a714a4b..fe4a5c92f6a 100644 --- a/service/billingconductor/types/errors.go +++ b/service/billingconductor/types/errors.go @@ -32,6 +32,7 @@ type ConflictException struct { ResourceId *string ResourceType *string + Reason ConflictExceptionReason noSmithyDocumentSerde } diff --git a/service/billingconductor/types/types.go b/service/billingconductor/types/types.go index 0e0eb36014c..2d5b54374d8 100644 --- a/service/billingconductor/types/types.go +++ b/service/billingconductor/types/types.go @@ -6,11 +6,7 @@ import ( smithydocument "github.com/aws/smithy-go/document" ) -// Amazon Web Services Billing Conductor is in beta release and is subject to -// change. Your use of Amazon Web Services Billing Conductor is subject to the Beta -// Service Participation terms of the Amazon Web Services Service Terms -// (https://aws.amazon.com/service-terms/) (Section 1.10). A representation of a -// linked account. +// A representation of a linked account. type AccountAssociationsListElement struct { // The Amazon Web Services account email. @@ -44,10 +40,10 @@ type AccountGrouping struct { // A representation of a resource association error. type AssociateResourceError struct { - // The reason the resource association failed. + // The reason why the resource association failed. Message *string - // A static error code that used to classify the type of failure. + // A static error code that's used to classify the type of failure. Reason AssociateResourceErrorReason noSmithyDocumentSerde @@ -102,16 +98,16 @@ type BillingGroupListElement struct { // Services charges for a billing group. ComputationPreference *ComputationPreference - // The time the billing group was created. + // The time when the billing group was created. CreationTime int64 - // The billing group description. + // The description of the billing group. Description *string - // The most recent time the billing group was modified. + // The most recent time when the billing group was modified. LastModifiedTime int64 - // The billing group's name. + // The name of the billing group. Name *string // The account ID that serves as the main account in a billing group. @@ -133,8 +129,8 @@ type BillingGroupListElement struct { // Services charges for a billing group. type ComputationPreference struct { - // The Amazon Resource Name (ARN) of the pricing plan used to compute the Amazon - // Web Services charges for a billing group. + // The Amazon Resource Name (ARN) of the pricing plan that's used to compute the + // Amazon Web Services charges for a billing group. // // This member is required. PricingPlanArn *string @@ -145,18 +141,16 @@ type ComputationPreference struct { // The billing period range in which the custom line item request will be applied. type CustomLineItemBillingPeriodRange struct { - // The inclusive end billing period that defines a billing period range where a - // custom line is applied. - // - // This member is required. - ExclusiveEndBillingPeriod *string - // The inclusive start billing period that defines a billing period range where a // custom line is applied. // // This member is required. InclusiveStartBillingPeriod *string + // The inclusive end billing period that defines a billing period range where a + // custom line is applied. + ExclusiveEndBillingPeriod *string + noSmithyDocumentSerde } @@ -181,7 +175,8 @@ type CustomLineItemChargeDetails struct { noSmithyDocumentSerde } -// A representation of the charge details associated with a flat custom line item. +// A representation of the charge details that are associated with a flat custom +// line item. type CustomLineItemFlatChargeDetails struct { // The custom line item's fixed charge value in USD. @@ -220,20 +215,20 @@ type CustomLineItemListElement struct { // association with the charge value. Description *string - // The most recent time the custom line item was modified. + // The most recent time when the custom line item was modified. LastModifiedTime int64 // The custom line item's name. Name *string - // The product code associated with the custom line item. + // The product code that's associated with the custom line item. ProductCode *string noSmithyDocumentSerde } -// A representation of the charge details associated with a percentage custom line -// item. +// A representation of the charge details that are associated with a percentage +// custom line item. type CustomLineItemPercentageChargeDetails struct { // The custom line item's percentage value. This will be multiplied against the @@ -248,13 +243,53 @@ type CustomLineItemPercentageChargeDetails struct { noSmithyDocumentSerde } +// A representation of a custom line item version. +type CustomLineItemVersionListElement struct { + + // The number of resources that are associated with the custom line item. + AssociationSize int64 + + // The Amazon Resource Name (ARN) of the billing group that the custom line item + // applies to. + BillingGroupArn *string + + // A representation of the charge details of a custom line item. + ChargeDetails *ListCustomLineItemChargeDetails + + // The time when the custom line item version was created. + CreationTime int64 + + // The charge value currency of the custom line item. + CurrencyCode CurrencyCode + + // The description of the custom line item. + Description *string + + // The end billing period of the custom line item version. + EndBillingPeriod *string + + // The most recent time that the custom line item version was modified. + LastModifiedTime int64 + + // The name of the custom line item. + Name *string + + // The product code that’s associated with the custom line item. + ProductCode *string + + // The start billing period of the custom line item version. + StartBillingPeriod *string + + noSmithyDocumentSerde +} + // A resource disassociation result for a percentage custom line item. type DisassociateResourceResponseElement struct { // The resource ARN that was disassociated from the custom line item. Arn *string - // An AssociateResourceError shown if the resource disassociation fails. + // An AssociateResourceError that's shown if the resource disassociation fails. Error *AssociateResourceError noSmithyDocumentSerde @@ -320,7 +355,8 @@ type ListCustomLineItemChargeDetails struct { noSmithyDocumentSerde } -// A representation of the charge details associated with a flat custom line item. +// A representation of the charge details that are associated with a flat custom +// line item. type ListCustomLineItemFlatChargeDetails struct { // The custom line item's fixed charge value in USD. @@ -331,8 +367,8 @@ type ListCustomLineItemFlatChargeDetails struct { noSmithyDocumentSerde } -// A representation of the charge details associated with a percentage custom line -// item. +// A representation of the charge details that are associated with a percentage +// custom line item. type ListCustomLineItemPercentageChargeDetails struct { // The custom line item's percentage value. This will be multiplied against the @@ -360,6 +396,31 @@ type ListCustomLineItemsFilter struct { noSmithyDocumentSerde } +// A billing period filter that specifies the custom line item versions to +// retrieve. +type ListCustomLineItemVersionsBillingPeriodRangeFilter struct { + + // The exclusive end billing period that defines a billing period range where a + // custom line item version is applied. + EndBillingPeriod *string + + // The inclusive start billing period that defines a billing period range where a + // custom line item version is applied. + StartBillingPeriod *string + + noSmithyDocumentSerde +} + +// A filter that specifies the billing period range where the custom line item +// versions reside. +type ListCustomLineItemVersionsFilter struct { + + // The billing period range in which the custom line item version is applied. + BillingPeriodRange *ListCustomLineItemVersionsBillingPeriodRangeFilter + + noSmithyDocumentSerde +} + // The filter that specifies the Amazon Resource Names (ARNs) of pricing plans, to // retrieve pricing plan information. type ListPricingPlansFilter struct { @@ -398,6 +459,9 @@ type ListResourcesAssociatedToCustomLineItemResponseElement struct { // The ARN of the associated resource. Arn *string + // The end billing period of the associated resource. + EndBillingPeriod *string + // The type of relationship between the custom line item and the associated // resource. Relationship CustomLineItemRelationship @@ -412,19 +476,19 @@ type PricingPlanListElement struct { // identify a pricing plan. Arn *string - // The time the pricing plan was created. + // The time when the pricing plan was created. CreationTime int64 // The pricing plan description. Description *string - // The most recent time the pricing plan was modified. + // The most recent time when the pricing plan was modified. LastModifiedTime int64 // The name of a pricing plan. Name *string - // The pricing rules count currently associated with this pricing plan list + // The pricing rules count that's currently associated with this pricing plan list // element. Size int64 @@ -440,13 +504,13 @@ type PricingRuleListElement struct { // The pricing plans count that this pricing rule is associated with. AssociatedPricingPlanCount int64 - // The time the pricing rule was created. + // The time when the pricing rule was created. CreationTime int64 // The pricing rule description. Description *string - // The most recent time the pricing rule was modified. + // The most recent time when the pricing rule was modified. LastModifiedTime int64 // A percentage modifier applied on the public pricing rates. @@ -484,8 +548,8 @@ type UpdateCustomLineItemChargeDetails struct { noSmithyDocumentSerde } -// A representation of the new charge details associated with a flat custom line -// item. +// A representation of the new charge details that are associated with a flat +// custom line item. type UpdateCustomLineItemFlatChargeDetails struct { // The custom line item's new fixed charge value in USD. @@ -496,8 +560,8 @@ type UpdateCustomLineItemFlatChargeDetails struct { noSmithyDocumentSerde } -// A representation of the new charge details associated with a percentage custom -// line item. +// A representation of the new charge details that are associated with a percentage +// custom line item. type UpdateCustomLineItemPercentageChargeDetails struct { // The custom line item's new percentage value. This will be multiplied against the diff --git a/service/billingconductor/validators.go b/service/billingconductor/validators.go index a3c415a9817..a0a1ebd7b43 100644 --- a/service/billingconductor/validators.go +++ b/service/billingconductor/validators.go @@ -290,6 +290,26 @@ func (m *validateOpDisassociatePricingRules) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpListCustomLineItemVersions struct { +} + +func (*validateOpListCustomLineItemVersions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCustomLineItemVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCustomLineItemVersionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCustomLineItemVersionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListPricingPlansAssociatedWithPricingRule struct { } @@ -546,6 +566,10 @@ func addOpDisassociatePricingRulesValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDisassociatePricingRules{}, middleware.After) } +func addOpListCustomLineItemVersionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCustomLineItemVersions{}, middleware.After) +} + func addOpListPricingPlansAssociatedWithPricingRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPricingPlansAssociatedWithPricingRule{}, middleware.After) } @@ -624,9 +648,6 @@ func validateCustomLineItemBillingPeriodRange(v *types.CustomLineItemBillingPeri if v.InclusiveStartBillingPeriod == nil { invalidParams.Add(smithy.NewErrParamRequired("InclusiveStartBillingPeriod")) } - if v.ExclusiveEndBillingPeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("ExclusiveEndBillingPeriod")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1025,6 +1046,21 @@ func validateOpDisassociatePricingRulesInput(v *DisassociatePricingRulesInput) e } } +func validateOpListCustomLineItemVersionsInput(v *ListCustomLineItemVersionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCustomLineItemVersionsInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListPricingPlansAssociatedWithPricingRuleInput(v *ListPricingPlansAssociatedWithPricingRuleInput) error { if v == nil { return nil diff --git a/service/ec2/api_op_ModifyInstancePlacement.go b/service/ec2/api_op_ModifyInstancePlacement.go index b078e9c7395..1b083ea0ff3 100644 --- a/service/ec2/api_op_ModifyInstancePlacement.go +++ b/service/ec2/api_op_ModifyInstancePlacement.go @@ -60,6 +60,10 @@ type ModifyInstancePlacementInput struct { // The affinity setting for the instance. Affinity types.Affinity + // The Group Id of a placement group. You must specify the Placement Group Group Id + // to launch an instance in a shared placement group. + GroupId *string + // The name of the placement group in which to place the instance. For spread // placement groups, the instance must have a tenancy of default. For cluster and // partition placement groups, the instance must have a tenancy of default or diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index dd0281e3699..66a0eb094d5 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -85461,6 +85461,19 @@ func awsEc2query_deserializeDocumentLaunchTemplatePlacement(v **types.LaunchTemp sv.AvailabilityZone = ptr.String(xtv) } + case strings.EqualFold("groupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GroupId = ptr.String(xtv) + } + case strings.EqualFold("groupName", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -93855,6 +93868,19 @@ func awsEc2query_deserializeDocumentPlacement(v **types.Placement, decoder smith sv.AvailabilityZone = ptr.String(xtv) } + case strings.EqualFold("groupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GroupId = ptr.String(xtv) + } + case strings.EqualFold("groupName", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 94538369c6f..1d45ca5a59f 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -39126,6 +39126,11 @@ func awsEc2query_serializeDocumentLaunchTemplatePlacementRequest(v *types.Launch objectKey.String(*v.AvailabilityZone) } + if v.GroupId != nil { + objectKey := object.Key("GroupId") + objectKey.String(*v.GroupId) + } + if v.GroupName != nil { objectKey := object.Key("GroupName") objectKey.String(*v.GroupName) @@ -40435,6 +40440,11 @@ func awsEc2query_serializeDocumentPlacement(v *types.Placement, value query.Valu objectKey.String(*v.AvailabilityZone) } + if v.GroupId != nil { + objectKey := object.Key("GroupId") + objectKey.String(*v.GroupId) + } + if v.GroupName != nil { objectKey := object.Key("GroupName") objectKey.String(*v.GroupName) @@ -57862,6 +57872,11 @@ func awsEc2query_serializeOpDocumentModifyInstancePlacementInput(v *ModifyInstan objectKey.String(string(v.Affinity)) } + if v.GroupId != nil { + objectKey := object.Key("GroupId") + objectKey.String(*v.GroupId) + } + if v.GroupName != nil { objectKey := object.Key("GroupName") objectKey.String(*v.GroupName) diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index b38787ab3db..6c6d5423331 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -8387,6 +8387,10 @@ type LaunchTemplatePlacement struct { // The Availability Zone of the instance. AvailabilityZone *string + // The Group ID of the placement group. You must specify the Placement Group Group + // ID to launch an instance in a shared placement group. + GroupId *string + // The name of the placement group for the instance. GroupName *string @@ -8419,6 +8423,10 @@ type LaunchTemplatePlacementRequest struct { // The Availability Zone for the instance. AvailabilityZone *string + // The Group Id of a placement group. You must specify the Placement Group Group Id + // to launch an instance in a shared placement group. + GroupId *string + // The name of the placement group for the instance. GroupName *string @@ -10370,6 +10378,9 @@ type Placement struct { // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet). AvailabilityZone *string + // The Group Id of the placement group. + GroupId *string + // The name of the placement group the instance is in. GroupName *string diff --git a/service/fms/api_op_BatchAssociateResource.go b/service/fms/api_op_BatchAssociateResource.go new file mode 100644 index 00000000000..b77aa92c4b6 --- /dev/null +++ b/service/fms/api_op_BatchAssociateResource.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associate resources to a Firewall Manager resource set. +func (c *Client) BatchAssociateResource(ctx context.Context, params *BatchAssociateResourceInput, optFns ...func(*Options)) (*BatchAssociateResourceOutput, error) { + if params == nil { + params = &BatchAssociateResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchAssociateResource", params, optFns, c.addOperationBatchAssociateResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchAssociateResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchAssociateResourceInput struct { + + // The uniform resource identifiers (URIs) of resources that should be associated + // to the resource set. The URIs must be Amazon Resource Names (ARNs). + // + // This member is required. + Items []string + + // A unique identifier for the resource set, used in a TODO to refer to the + // resource set. + // + // This member is required. + ResourceSetIdentifier *string + + noSmithyDocumentSerde +} + +type BatchAssociateResourceOutput struct { + + // The resources that failed to associate to the resource set. + // + // This member is required. + FailedItems []types.FailedItem + + // A unique identifier for the resource set, used in a TODO to refer to the + // resource set. + // + // This member is required. + ResourceSetIdentifier *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchAssociateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchAssociateResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchAssociateResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchAssociateResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchAssociateResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opBatchAssociateResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "BatchAssociateResource", + } +} diff --git a/service/fms/api_op_BatchDisassociateResource.go b/service/fms/api_op_BatchDisassociateResource.go new file mode 100644 index 00000000000..7d9f06662e9 --- /dev/null +++ b/service/fms/api_op_BatchDisassociateResource.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates resources from a Firewall Manager resource set. +func (c *Client) BatchDisassociateResource(ctx context.Context, params *BatchDisassociateResourceInput, optFns ...func(*Options)) (*BatchDisassociateResourceOutput, error) { + if params == nil { + params = &BatchDisassociateResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDisassociateResource", params, optFns, c.addOperationBatchDisassociateResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDisassociateResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDisassociateResourceInput struct { + + // The uniform resource identifiers (URI) of resources that should be disassociated + // from the resource set. The URIs must be Amazon Resource Names (ARNs). + // + // This member is required. + Items []string + + // A unique identifier for the resource set, used in a TODO to refer to the + // resource set. + // + // This member is required. + ResourceSetIdentifier *string + + noSmithyDocumentSerde +} + +type BatchDisassociateResourceOutput struct { + + // The resources that failed to disassociate from the resource set. + // + // This member is required. + FailedItems []types.FailedItem + + // A unique identifier for the resource set, used in a TODO to refer to the + // resource set. + // + // This member is required. + ResourceSetIdentifier *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDisassociateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDisassociateResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDisassociateResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchDisassociateResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDisassociateResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opBatchDisassociateResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "BatchDisassociateResource", + } +} diff --git a/service/fms/api_op_DeleteResourceSet.go b/service/fms/api_op_DeleteResourceSet.go new file mode 100644 index 00000000000..e6e033719b2 --- /dev/null +++ b/service/fms/api_op_DeleteResourceSet.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified ResourceSet. +func (c *Client) DeleteResourceSet(ctx context.Context, params *DeleteResourceSetInput, optFns ...func(*Options)) (*DeleteResourceSetOutput, error) { + if params == nil { + params = &DeleteResourceSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteResourceSet", params, optFns, c.addOperationDeleteResourceSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteResourceSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteResourceSetInput struct { + + // A unique identifier for the resource set, used in a TODO to refer to the + // resource set. + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + +type DeleteResourceSetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourceSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourceSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourceSet{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteResourceSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourceSet(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteResourceSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "DeleteResourceSet", + } +} diff --git a/service/fms/api_op_GetResourceSet.go b/service/fms/api_op_GetResourceSet.go new file mode 100644 index 00000000000..e9b313d4dd2 --- /dev/null +++ b/service/fms/api_op_GetResourceSet.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a specific resource set. +func (c *Client) GetResourceSet(ctx context.Context, params *GetResourceSetInput, optFns ...func(*Options)) (*GetResourceSetOutput, error) { + if params == nil { + params = &GetResourceSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourceSet", params, optFns, c.addOperationGetResourceSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourceSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourceSetInput struct { + + // A unique identifier for the resource set, used in a TODO to refer to the + // resource set. + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + +type GetResourceSetOutput struct { + + // Information about the specified resource set. + // + // This member is required. + ResourceSet *types.ResourceSet + + // The Amazon Resource Name (ARN) of the resource set. + // + // This member is required. + ResourceSetArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourceSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetResourceSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetResourceSet{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetResourceSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourceSet(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetResourceSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "GetResourceSet", + } +} diff --git a/service/fms/api_op_ListDiscoveredResources.go b/service/fms/api_op_ListDiscoveredResources.go new file mode 100644 index 00000000000..427626bd288 --- /dev/null +++ b/service/fms/api_op_ListDiscoveredResources.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns an array of resources in the organization's accounts that are available +// to be associated with a resource set. +func (c *Client) ListDiscoveredResources(ctx context.Context, params *ListDiscoveredResourcesInput, optFns ...func(*Options)) (*ListDiscoveredResourcesOutput, error) { + if params == nil { + params = &ListDiscoveredResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDiscoveredResources", params, optFns, c.addOperationListDiscoveredResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDiscoveredResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDiscoveredResourcesInput struct { + + // The Amazon Web Services account IDs to discover resources in. Only one account + // is supported per request. The account must be a member of your organization. + // + // This member is required. + MemberAccountIds []string + + // The type of resources to discover. + // + // This member is required. + ResourceType *string + + // The maximum number of objects that you want Firewall Manager to return for this + // request. If more objects are available, in the response, Firewall Manager + // provides a NextToken value that you can use in a subsequent call to get the next + // batch of objects. + MaxResults *int32 + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Firewall Manager returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDiscoveredResourcesOutput struct { + + // Details of the resources that were discovered. + Items []types.DiscoveredResource + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Firewall Manager returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDiscoveredResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDiscoveredResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDiscoveredResources{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListDiscoveredResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDiscoveredResources(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListDiscoveredResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "ListDiscoveredResources", + } +} diff --git a/service/fms/api_op_ListResourceSetResources.go b/service/fms/api_op_ListResourceSetResources.go new file mode 100644 index 00000000000..f4adbc023a1 --- /dev/null +++ b/service/fms/api_op_ListResourceSetResources.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns an array of resources that are currently associated to a resource set. +func (c *Client) ListResourceSetResources(ctx context.Context, params *ListResourceSetResourcesInput, optFns ...func(*Options)) (*ListResourceSetResourcesOutput, error) { + if params == nil { + params = &ListResourceSetResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListResourceSetResources", params, optFns, c.addOperationListResourceSetResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListResourceSetResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListResourceSetResourcesInput struct { + + // A unique identifier for the resource set, used in a TODO to refer to the + // resource set. + // + // This member is required. + Identifier *string + + // The maximum number of objects that you want Firewall Manager to return for this + // request. If more objects are available, in the response, Firewall Manager + // provides a NextToken value that you can use in a subsequent call to get the next + // batch of objects. + MaxResults *int32 + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Firewall Manager returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + noSmithyDocumentSerde +} + +type ListResourceSetResourcesOutput struct { + + // An array of the associated resources' uniform resource identifiers (URI). + // + // This member is required. + Items []types.Resource + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Firewall Manager returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListResourceSetResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourceSetResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListResourceSetResources{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListResourceSetResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceSetResources(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListResourceSetResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "ListResourceSetResources", + } +} diff --git a/service/fms/api_op_ListResourceSets.go b/service/fms/api_op_ListResourceSets.go new file mode 100644 index 00000000000..b658ca9cc47 --- /dev/null +++ b/service/fms/api_op_ListResourceSets.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns an array of ResourceSetSummary objects. +func (c *Client) ListResourceSets(ctx context.Context, params *ListResourceSetsInput, optFns ...func(*Options)) (*ListResourceSetsOutput, error) { + if params == nil { + params = &ListResourceSetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListResourceSets", params, optFns, c.addOperationListResourceSetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListResourceSetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListResourceSetsInput struct { + + // The maximum number of objects that you want Firewall Manager to return for this + // request. If more objects are available, in the response, Firewall Manager + // provides a NextToken value that you can use in a subsequent call to get the next + // batch of objects. + MaxResults *int32 + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Firewall Manager returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + noSmithyDocumentSerde +} + +type ListResourceSetsOutput struct { + + // When you request a list of objects with a MaxResults setting, if the number of + // objects that are still available for retrieval exceeds the maximum you + // requested, Firewall Manager returns a NextToken value in the response. To + // retrieve the next batch of objects, use the token returned from the prior + // request in your next request. + NextToken *string + + // An array of ResourceSetSummary objects. + ResourceSets []types.ResourceSetSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListResourceSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourceSets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListResourceSets{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceSets(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListResourceSets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "ListResourceSets", + } +} diff --git a/service/fms/api_op_PutResourceSet.go b/service/fms/api_op_PutResourceSet.go new file mode 100644 index 00000000000..dbd52f80506 --- /dev/null +++ b/service/fms/api_op_PutResourceSet.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates the resource set. An Firewall Manager resource set defines the resources +// to import into an Firewall Manager policy from another Amazon Web Services +// service. +func (c *Client) PutResourceSet(ctx context.Context, params *PutResourceSetInput, optFns ...func(*Options)) (*PutResourceSetOutput, error) { + if params == nil { + params = &PutResourceSetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutResourceSet", params, optFns, c.addOperationPutResourceSetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutResourceSetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutResourceSetInput struct { + + // Details about the resource set to be created or updated.> + // + // This member is required. + ResourceSet *types.ResourceSet + + // Retrieves the tags associated with the specified resource set. Tags are + // key:value pairs that you can use to categorize and manage your resources, for + // purposes like billing. For example, you might set the tag key to "customer" and + // the value to the customer name or ID. You can specify one or more tags to add to + // each Amazon Web Services resource, up to 50 tags for a resource. + TagList []types.Tag + + noSmithyDocumentSerde +} + +type PutResourceSetOutput struct { + + // Details about the resource set. + // + // This member is required. + ResourceSet *types.ResourceSet + + // The Amazon Resource Name (ARN) of the resource set. + // + // This member is required. + ResourceSetArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutResourceSetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourceSet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourceSet{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutResourceSetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourceSet(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opPutResourceSet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "fms", + OperationName: "PutResourceSet", + } +} diff --git a/service/fms/deserializers.go b/service/fms/deserializers.go index 7da9c0709be..56cc2cecaf9 100644 --- a/service/fms/deserializers.go +++ b/service/fms/deserializers.go @@ -241,6 +241,249 @@ func awsAwsjson11_deserializeOpErrorAssociateThirdPartyFirewall(response *smithy } } +type awsAwsjson11_deserializeOpBatchAssociateResource struct { +} + +func (*awsAwsjson11_deserializeOpBatchAssociateResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchAssociateResource) 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, awsAwsjson11_deserializeOpErrorBatchAssociateResource(response, &metadata) + } + output := &BatchAssociateResourceOutput{} + 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 = awsAwsjson11_deserializeOpDocumentBatchAssociateResourceOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorBatchAssociateResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpBatchDisassociateResource struct { +} + +func (*awsAwsjson11_deserializeOpBatchDisassociateResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchDisassociateResource) 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, awsAwsjson11_deserializeOpErrorBatchDisassociateResource(response, &metadata) + } + output := &BatchDisassociateResourceOutput{} + 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 = awsAwsjson11_deserializeOpDocumentBatchDisassociateResourceOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorBatchDisassociateResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteAppsList struct { } @@ -343,7 +586,611 @@ func (*awsAwsjson11_deserializeOpDeleteNotificationChannel) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteNotificationChannel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteNotificationChannel) 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, awsAwsjson11_deserializeOpErrorDeleteNotificationChannel(response, &metadata) + } + output := &DeleteNotificationChannelOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteNotificationChannel(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeletePolicy struct { +} + +func (*awsAwsjson11_deserializeOpDeletePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeletePolicy) 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, awsAwsjson11_deserializeOpErrorDeletePolicy(response, &metadata) + } + output := &DeletePolicyOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeletePolicy(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteProtocolsList struct { +} + +func (*awsAwsjson11_deserializeOpDeleteProtocolsList) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteProtocolsList) 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, awsAwsjson11_deserializeOpErrorDeleteProtocolsList(response, &metadata) + } + output := &DeleteProtocolsListOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteProtocolsList(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteResourceSet struct { +} + +func (*awsAwsjson11_deserializeOpDeleteResourceSet) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteResourceSet) 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, awsAwsjson11_deserializeOpErrorDeleteResourceSet(response, &metadata) + } + output := &DeleteResourceSetOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteResourceSet(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDisassociateAdminAccount struct { +} + +func (*awsAwsjson11_deserializeOpDisassociateAdminAccount) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDisassociateAdminAccount) 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, awsAwsjson11_deserializeOpErrorDisassociateAdminAccount(response, &metadata) + } + output := &DisassociateAdminAccountOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDisassociateAdminAccount(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall struct { +} + +func (*awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall) 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, awsAwsjson11_deserializeOpErrorDisassociateThirdPartyFirewall(response, &metadata) + } + output := &DisassociateThirdPartyFirewallOutput{} + 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 = awsAwsjson11_deserializeOpDocumentDisassociateThirdPartyFirewallOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDisassociateThirdPartyFirewall(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetAdminAccount struct { +} + +func (*awsAwsjson11_deserializeOpGetAdminAccount) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetAdminAccount) 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) @@ -357,21 +1204,43 @@ func (m *awsAwsjson11_deserializeOpDeleteNotificationChannel) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteNotificationChannel(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetAdminAccount(response, &metadata) } - output := &DeleteNotificationChannelOutput{} + output := &GetAdminAccountOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + 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 = awsAwsjson11_deserializeOpDocumentGetAdminAccountOutput(&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 out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteNotificationChannel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetAdminAccount(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)} @@ -431,14 +1300,14 @@ func awsAwsjson11_deserializeOpErrorDeleteNotificationChannel(response *smithyht } } -type awsAwsjson11_deserializeOpDeletePolicy struct { +type awsAwsjson11_deserializeOpGetAppsList struct { } -func (*awsAwsjson11_deserializeOpDeletePolicy) ID() string { +func (*awsAwsjson11_deserializeOpGetAppsList) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeletePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetAppsList) 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) @@ -452,21 +1321,43 @@ func (m *awsAwsjson11_deserializeOpDeletePolicy) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeletePolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetAppsList(response, &metadata) } - output := &DeletePolicyOutput{} + output := &GetAppsListOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + 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 = awsAwsjson11_deserializeOpDocumentGetAppsListOutput(&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 out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetAppsList(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)} @@ -510,15 +1401,9 @@ func awsAwsjson11_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -532,14 +1417,14 @@ func awsAwsjson11_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpDeleteProtocolsList struct { +type awsAwsjson11_deserializeOpGetComplianceDetail struct { } -func (*awsAwsjson11_deserializeOpDeleteProtocolsList) ID() string { +func (*awsAwsjson11_deserializeOpGetComplianceDetail) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteProtocolsList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetComplianceDetail) 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) @@ -553,21 +1438,43 @@ func (m *awsAwsjson11_deserializeOpDeleteProtocolsList) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteProtocolsList(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetComplianceDetail(response, &metadata) } - output := &DeleteProtocolsListOutput{} + output := &GetComplianceDetailOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + 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 = awsAwsjson11_deserializeOpDocumentGetComplianceDetailOutput(&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 out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteProtocolsList(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetComplianceDetail(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)} @@ -611,6 +1518,9 @@ func awsAwsjson11_deserializeOpErrorDeleteProtocolsList(response *smithyhttp.Res case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) @@ -627,14 +1537,14 @@ func awsAwsjson11_deserializeOpErrorDeleteProtocolsList(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpDisassociateAdminAccount struct { +type awsAwsjson11_deserializeOpGetNotificationChannel struct { } -func (*awsAwsjson11_deserializeOpDisassociateAdminAccount) ID() string { +func (*awsAwsjson11_deserializeOpGetNotificationChannel) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDisassociateAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetNotificationChannel) 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) @@ -648,21 +1558,43 @@ func (m *awsAwsjson11_deserializeOpDisassociateAdminAccount) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateAdminAccount(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetNotificationChannel(response, &metadata) } - output := &DisassociateAdminAccountOutput{} + output := &GetNotificationChannelOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + 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 = awsAwsjson11_deserializeOpDocumentGetNotificationChannelOutput(&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 out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDisassociateAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetNotificationChannel(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)} @@ -722,14 +1654,14 @@ func awsAwsjson11_deserializeOpErrorDisassociateAdminAccount(response *smithyhtt } } -type awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall struct { +type awsAwsjson11_deserializeOpGetPolicy struct { } -func (*awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall) ID() string { +func (*awsAwsjson11_deserializeOpGetPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetPolicy) 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) @@ -743,9 +1675,9 @@ func (m *awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateThirdPartyFirewall(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetPolicy(response, &metadata) } - output := &DisassociateThirdPartyFirewallOutput{} + output := &GetPolicyOutput{} out.Result = output var buff [1024]byte @@ -765,7 +1697,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall) HandleDeseria return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDisassociateThirdPartyFirewallOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -779,7 +1711,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateThirdPartyFirewall) HandleDeseria return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDisassociateThirdPartyFirewall(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetPolicy(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)} @@ -823,12 +1755,12 @@ func awsAwsjson11_deserializeOpErrorDisassociateThirdPartyFirewall(response *smi case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidTypeException", errorCode): + return awsAwsjson11_deserializeErrorInvalidTypeException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -842,14 +1774,14 @@ func awsAwsjson11_deserializeOpErrorDisassociateThirdPartyFirewall(response *smi } } -type awsAwsjson11_deserializeOpGetAdminAccount struct { +type awsAwsjson11_deserializeOpGetProtectionStatus struct { } -func (*awsAwsjson11_deserializeOpGetAdminAccount) ID() string { +func (*awsAwsjson11_deserializeOpGetProtectionStatus) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetProtectionStatus) 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) @@ -863,9 +1795,9 @@ func (m *awsAwsjson11_deserializeOpGetAdminAccount) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetAdminAccount(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetProtectionStatus(response, &metadata) } - output := &GetAdminAccountOutput{} + output := &GetProtectionStatusOutput{} out.Result = output var buff [1024]byte @@ -885,7 +1817,7 @@ func (m *awsAwsjson11_deserializeOpGetAdminAccount) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetAdminAccountOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetProtectionStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -899,7 +1831,7 @@ func (m *awsAwsjson11_deserializeOpGetAdminAccount) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetProtectionStatus(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)} @@ -943,8 +1875,8 @@ func awsAwsjson11_deserializeOpErrorGetAdminAccount(response *smithyhttp.Respons case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): - return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -959,14 +1891,14 @@ func awsAwsjson11_deserializeOpErrorGetAdminAccount(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpGetAppsList struct { +type awsAwsjson11_deserializeOpGetProtocolsList struct { } -func (*awsAwsjson11_deserializeOpGetAppsList) ID() string { +func (*awsAwsjson11_deserializeOpGetProtocolsList) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetAppsList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetProtocolsList) 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) @@ -980,9 +1912,9 @@ func (m *awsAwsjson11_deserializeOpGetAppsList) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetAppsList(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetProtocolsList(response, &metadata) } - output := &GetAppsListOutput{} + output := &GetProtocolsListOutput{} out.Result = output var buff [1024]byte @@ -1002,7 +1934,7 @@ func (m *awsAwsjson11_deserializeOpGetAppsList) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetAppsListOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetProtocolsListOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1016,7 +1948,7 @@ func (m *awsAwsjson11_deserializeOpGetAppsList) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetAppsList(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetProtocolsList(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)} @@ -1076,14 +2008,14 @@ func awsAwsjson11_deserializeOpErrorGetAppsList(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpGetComplianceDetail struct { +type awsAwsjson11_deserializeOpGetResourceSet struct { } -func (*awsAwsjson11_deserializeOpGetComplianceDetail) ID() string { +func (*awsAwsjson11_deserializeOpGetResourceSet) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetComplianceDetail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetResourceSet) 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) @@ -1097,9 +2029,9 @@ func (m *awsAwsjson11_deserializeOpGetComplianceDetail) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetComplianceDetail(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetResourceSet(response, &metadata) } - output := &GetComplianceDetailOutput{} + output := &GetResourceSetOutput{} out.Result = output var buff [1024]byte @@ -1119,7 +2051,7 @@ func (m *awsAwsjson11_deserializeOpGetComplianceDetail) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetComplianceDetailOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetResourceSetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1133,7 +2065,7 @@ func (m *awsAwsjson11_deserializeOpGetComplianceDetail) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetComplianceDetail(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetResourceSet(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)} @@ -1196,14 +2128,14 @@ func awsAwsjson11_deserializeOpErrorGetComplianceDetail(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpGetNotificationChannel struct { +type awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus struct { } -func (*awsAwsjson11_deserializeOpGetNotificationChannel) ID() string { +func (*awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetNotificationChannel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus) 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) @@ -1217,9 +2149,9 @@ func (m *awsAwsjson11_deserializeOpGetNotificationChannel) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetNotificationChannel(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetThirdPartyFirewallAssociationStatus(response, &metadata) } - output := &GetNotificationChannelOutput{} + output := &GetThirdPartyFirewallAssociationStatusOutput{} out.Result = output var buff [1024]byte @@ -1239,7 +2171,7 @@ func (m *awsAwsjson11_deserializeOpGetNotificationChannel) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetNotificationChannelOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetThirdPartyFirewallAssociationStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1253,7 +2185,7 @@ func (m *awsAwsjson11_deserializeOpGetNotificationChannel) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetNotificationChannel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetThirdPartyFirewallAssociationStatus(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)} @@ -1297,6 +2229,9 @@ func awsAwsjson11_deserializeOpErrorGetNotificationChannel(response *smithyhttp. case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) @@ -1313,14 +2248,14 @@ func awsAwsjson11_deserializeOpErrorGetNotificationChannel(response *smithyhttp. } } -type awsAwsjson11_deserializeOpGetPolicy struct { +type awsAwsjson11_deserializeOpGetViolationDetails struct { } -func (*awsAwsjson11_deserializeOpGetPolicy) ID() string { +func (*awsAwsjson11_deserializeOpGetViolationDetails) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetViolationDetails) 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) @@ -1334,9 +2269,9 @@ func (m *awsAwsjson11_deserializeOpGetPolicy) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetViolationDetails(response, &metadata) } - output := &GetPolicyOutput{} + output := &GetViolationDetailsOutput{} out.Result = output var buff [1024]byte @@ -1356,7 +2291,7 @@ func (m *awsAwsjson11_deserializeOpGetPolicy) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetViolationDetailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1370,7 +2305,7 @@ func (m *awsAwsjson11_deserializeOpGetPolicy) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetViolationDetails(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)} @@ -1414,11 +2349,8 @@ func awsAwsjson11_deserializeOpErrorGetPolicy(response *smithyhttp.Response, met case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): - return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) - - case strings.EqualFold("InvalidTypeException", errorCode): - return awsAwsjson11_deserializeErrorInvalidTypeException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1433,14 +2365,14 @@ func awsAwsjson11_deserializeOpErrorGetPolicy(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpGetProtectionStatus struct { +type awsAwsjson11_deserializeOpListAppsLists struct { } -func (*awsAwsjson11_deserializeOpGetProtectionStatus) ID() string { +func (*awsAwsjson11_deserializeOpListAppsLists) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetProtectionStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAppsLists) 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) @@ -1454,9 +2386,9 @@ func (m *awsAwsjson11_deserializeOpGetProtectionStatus) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetProtectionStatus(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAppsLists(response, &metadata) } - output := &GetProtectionStatusOutput{} + output := &ListAppsListsOutput{} out.Result = output var buff [1024]byte @@ -1476,7 +2408,7 @@ func (m *awsAwsjson11_deserializeOpGetProtectionStatus) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetProtectionStatusOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAppsListsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1490,7 +2422,7 @@ func (m *awsAwsjson11_deserializeOpGetProtectionStatus) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetProtectionStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAppsLists(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)} @@ -1534,8 +2466,11 @@ func awsAwsjson11_deserializeOpErrorGetProtectionStatus(response *smithyhttp.Res case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1550,14 +2485,14 @@ func awsAwsjson11_deserializeOpErrorGetProtectionStatus(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpGetProtocolsList struct { +type awsAwsjson11_deserializeOpListComplianceStatus struct { } -func (*awsAwsjson11_deserializeOpGetProtocolsList) ID() string { +func (*awsAwsjson11_deserializeOpListComplianceStatus) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetProtocolsList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListComplianceStatus) 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) @@ -1571,9 +2506,9 @@ func (m *awsAwsjson11_deserializeOpGetProtocolsList) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetProtocolsList(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListComplianceStatus(response, &metadata) } - output := &GetProtocolsListOutput{} + output := &ListComplianceStatusOutput{} out.Result = output var buff [1024]byte @@ -1593,7 +2528,7 @@ func (m *awsAwsjson11_deserializeOpGetProtocolsList) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetProtocolsListOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListComplianceStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1607,7 +2542,7 @@ func (m *awsAwsjson11_deserializeOpGetProtocolsList) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetProtocolsList(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListComplianceStatus(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)} @@ -1651,9 +2586,6 @@ func awsAwsjson11_deserializeOpErrorGetProtocolsList(response *smithyhttp.Respon case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): - return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1667,14 +2599,14 @@ func awsAwsjson11_deserializeOpErrorGetProtocolsList(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus struct { +type awsAwsjson11_deserializeOpListDiscoveredResources struct { } -func (*awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus) ID() string { +func (*awsAwsjson11_deserializeOpListDiscoveredResources) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListDiscoveredResources) 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) @@ -1688,9 +2620,9 @@ func (m *awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetThirdPartyFirewallAssociationStatus(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListDiscoveredResources(response, &metadata) } - output := &GetThirdPartyFirewallAssociationStatusOutput{} + output := &ListDiscoveredResourcesOutput{} out.Result = output var buff [1024]byte @@ -1710,7 +2642,7 @@ func (m *awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus) Handl return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetThirdPartyFirewallAssociationStatusOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListDiscoveredResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1724,7 +2656,7 @@ func (m *awsAwsjson11_deserializeOpGetThirdPartyFirewallAssociationStatus) Handl return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetThirdPartyFirewallAssociationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListDiscoveredResources(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)} @@ -1774,9 +2706,6 @@ func awsAwsjson11_deserializeOpErrorGetThirdPartyFirewallAssociationStatus(respo case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1787,14 +2716,14 @@ func awsAwsjson11_deserializeOpErrorGetThirdPartyFirewallAssociationStatus(respo } } -type awsAwsjson11_deserializeOpGetViolationDetails struct { +type awsAwsjson11_deserializeOpListMemberAccounts struct { } -func (*awsAwsjson11_deserializeOpGetViolationDetails) ID() string { +func (*awsAwsjson11_deserializeOpListMemberAccounts) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetViolationDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMemberAccounts) 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) @@ -1808,9 +2737,9 @@ func (m *awsAwsjson11_deserializeOpGetViolationDetails) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetViolationDetails(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMemberAccounts(response, &metadata) } - output := &GetViolationDetailsOutput{} + output := &ListMemberAccountsOutput{} out.Result = output var buff [1024]byte @@ -1830,7 +2759,7 @@ func (m *awsAwsjson11_deserializeOpGetViolationDetails) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetViolationDetailsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMemberAccountsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1844,7 +2773,7 @@ func (m *awsAwsjson11_deserializeOpGetViolationDetails) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetViolationDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMemberAccounts(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)} @@ -1888,9 +2817,6 @@ func awsAwsjson11_deserializeOpErrorGetViolationDetails(response *smithyhttp.Res case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1904,14 +2830,14 @@ func awsAwsjson11_deserializeOpErrorGetViolationDetails(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpListAppsLists struct { +type awsAwsjson11_deserializeOpListPolicies struct { } -func (*awsAwsjson11_deserializeOpListAppsLists) ID() string { +func (*awsAwsjson11_deserializeOpListPolicies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAppsLists) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListPolicies) 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) @@ -1925,9 +2851,9 @@ func (m *awsAwsjson11_deserializeOpListAppsLists) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAppsLists(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListPolicies(response, &metadata) } - output := &ListAppsListsOutput{} + output := &ListPoliciesOutput{} out.Result = output var buff [1024]byte @@ -1947,7 +2873,7 @@ func (m *awsAwsjson11_deserializeOpListAppsLists) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAppsListsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1961,7 +2887,7 @@ func (m *awsAwsjson11_deserializeOpListAppsLists) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAppsLists(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListPolicies(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)} @@ -2024,14 +2950,14 @@ func awsAwsjson11_deserializeOpErrorListAppsLists(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListComplianceStatus struct { +type awsAwsjson11_deserializeOpListProtocolsLists struct { } -func (*awsAwsjson11_deserializeOpListComplianceStatus) ID() string { +func (*awsAwsjson11_deserializeOpListProtocolsLists) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListComplianceStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListProtocolsLists) 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) @@ -2045,9 +2971,9 @@ func (m *awsAwsjson11_deserializeOpListComplianceStatus) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListComplianceStatus(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListProtocolsLists(response, &metadata) } - output := &ListComplianceStatusOutput{} + output := &ListProtocolsListsOutput{} out.Result = output var buff [1024]byte @@ -2067,7 +2993,7 @@ func (m *awsAwsjson11_deserializeOpListComplianceStatus) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListComplianceStatusOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListProtocolsListsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2081,7 +3007,7 @@ func (m *awsAwsjson11_deserializeOpListComplianceStatus) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListComplianceStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListProtocolsLists(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)} @@ -2125,6 +3051,9 @@ func awsAwsjson11_deserializeOpErrorListComplianceStatus(response *smithyhttp.Re case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2138,14 +3067,14 @@ func awsAwsjson11_deserializeOpErrorListComplianceStatus(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpListMemberAccounts struct { +type awsAwsjson11_deserializeOpListResourceSetResources struct { } -func (*awsAwsjson11_deserializeOpListMemberAccounts) ID() string { +func (*awsAwsjson11_deserializeOpListResourceSetResources) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMemberAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResourceSetResources) 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) @@ -2159,9 +3088,9 @@ func (m *awsAwsjson11_deserializeOpListMemberAccounts) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMemberAccounts(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceSetResources(response, &metadata) } - output := &ListMemberAccountsOutput{} + output := &ListResourceSetResourcesOutput{} out.Result = output var buff [1024]byte @@ -2181,7 +3110,7 @@ func (m *awsAwsjson11_deserializeOpListMemberAccounts) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMemberAccountsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourceSetResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2195,7 +3124,7 @@ func (m *awsAwsjson11_deserializeOpListMemberAccounts) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMemberAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResourceSetResources(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)} @@ -2239,6 +3168,12 @@ func awsAwsjson11_deserializeOpErrorListMemberAccounts(response *smithyhttp.Resp case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2252,14 +3187,14 @@ func awsAwsjson11_deserializeOpErrorListMemberAccounts(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpListPolicies struct { +type awsAwsjson11_deserializeOpListResourceSets struct { } -func (*awsAwsjson11_deserializeOpListPolicies) ID() string { +func (*awsAwsjson11_deserializeOpListResourceSets) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResourceSets) 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) @@ -2273,9 +3208,9 @@ func (m *awsAwsjson11_deserializeOpListPolicies) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListPolicies(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceSets(response, &metadata) } - output := &ListPoliciesOutput{} + output := &ListResourceSetsOutput{} out.Result = output var buff [1024]byte @@ -2295,7 +3230,7 @@ func (m *awsAwsjson11_deserializeOpListPolicies) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListPoliciesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourceSetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2309,7 +3244,7 @@ func (m *awsAwsjson11_deserializeOpListPolicies) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResourceSets(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)} @@ -2353,15 +3288,12 @@ func awsAwsjson11_deserializeOpErrorListPolicies(response *smithyhttp.Response, case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2372,14 +3304,14 @@ func awsAwsjson11_deserializeOpErrorListPolicies(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListProtocolsLists struct { +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func (*awsAwsjson11_deserializeOpListProtocolsLists) ID() string { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListProtocolsLists) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsForResource) 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) @@ -2393,9 +3325,9 @@ func (m *awsAwsjson11_deserializeOpListProtocolsLists) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListProtocolsLists(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ListProtocolsListsOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -2415,7 +3347,7 @@ func (m *awsAwsjson11_deserializeOpListProtocolsLists) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListProtocolsListsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2429,7 +3361,7 @@ func (m *awsAwsjson11_deserializeOpListProtocolsLists) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListProtocolsLists(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(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)} @@ -2473,6 +3405,9 @@ func awsAwsjson11_deserializeOpErrorListProtocolsLists(response *smithyhttp.Resp case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) @@ -2489,14 +3424,14 @@ func awsAwsjson11_deserializeOpErrorListProtocolsLists(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies) 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) @@ -2510,9 +3445,9 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListThirdPartyFirewallFirewallPolicies(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListThirdPartyFirewallFirewallPoliciesOutput{} out.Result = output var buff [1024]byte @@ -2532,7 +3467,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListThirdPartyFirewallFirewallPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2546,7 +3481,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListThirdPartyFirewallFirewallPolicies(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)} @@ -2609,14 +3544,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies struct { +type awsAwsjson11_deserializeOpPutAppsList struct { } -func (*awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies) ID() string { +func (*awsAwsjson11_deserializeOpPutAppsList) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutAppsList) 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) @@ -2630,9 +3565,9 @@ func (m *awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListThirdPartyFirewallFirewallPolicies(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutAppsList(response, &metadata) } - output := &ListThirdPartyFirewallFirewallPoliciesOutput{} + output := &PutAppsListOutput{} out.Result = output var buff [1024]byte @@ -2652,7 +3587,7 @@ func (m *awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies) Handl return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListThirdPartyFirewallFirewallPoliciesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutAppsListOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2666,7 +3601,7 @@ func (m *awsAwsjson11_deserializeOpListThirdPartyFirewallFirewallPolicies) Handl return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListThirdPartyFirewallFirewallPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutAppsList(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)} @@ -2716,6 +3651,9 @@ func awsAwsjson11_deserializeOpErrorListThirdPartyFirewallFirewallPolicies(respo case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2729,14 +3667,14 @@ func awsAwsjson11_deserializeOpErrorListThirdPartyFirewallFirewallPolicies(respo } } -type awsAwsjson11_deserializeOpPutAppsList struct { +type awsAwsjson11_deserializeOpPutNotificationChannel struct { } -func (*awsAwsjson11_deserializeOpPutAppsList) ID() string { +func (*awsAwsjson11_deserializeOpPutNotificationChannel) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutAppsList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutNotificationChannel) 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) @@ -2750,43 +3688,21 @@ func (m *awsAwsjson11_deserializeOpPutAppsList) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutAppsList(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutNotificationChannel(response, &metadata) } - output := &PutAppsListOutput{} + output := &PutNotificationChannelOutput{} 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 = awsAwsjson11_deserializeOpDocumentPutAppsListOutput(&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(), + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutAppsList(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutNotificationChannel(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)} @@ -2830,15 +3746,9 @@ func awsAwsjson11_deserializeOpErrorPutAppsList(response *smithyhttp.Response, m case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2852,14 +3762,14 @@ func awsAwsjson11_deserializeOpErrorPutAppsList(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpPutNotificationChannel struct { +type awsAwsjson11_deserializeOpPutPolicy struct { } -func (*awsAwsjson11_deserializeOpPutNotificationChannel) ID() string { +func (*awsAwsjson11_deserializeOpPutPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutNotificationChannel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutPolicy) 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) @@ -2867,27 +3777,49 @@ func (m *awsAwsjson11_deserializeOpPutNotificationChannel) HandleDeserialize(ctx 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, awsAwsjson11_deserializeOpErrorPutNotificationChannel(response, &metadata) - } - output := &PutNotificationChannelOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", 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, awsAwsjson11_deserializeOpErrorPutPolicy(response, &metadata) + } + output := &PutPolicyOutput{} + 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 = awsAwsjson11_deserializeOpDocumentPutPolicyOutput(&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 out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutNotificationChannel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutPolicy(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)} @@ -2931,9 +3863,18 @@ func awsAwsjson11_deserializeOpErrorPutNotificationChannel(response *smithyhttp. case strings.EqualFold("InternalErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalErrorException(response, errorBody) + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidTypeException", errorCode): + return awsAwsjson11_deserializeErrorInvalidTypeException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2947,14 +3888,14 @@ func awsAwsjson11_deserializeOpErrorPutNotificationChannel(response *smithyhttp. } } -type awsAwsjson11_deserializeOpPutPolicy struct { +type awsAwsjson11_deserializeOpPutProtocolsList struct { } -func (*awsAwsjson11_deserializeOpPutPolicy) ID() string { +func (*awsAwsjson11_deserializeOpPutProtocolsList) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutProtocolsList) 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) @@ -2968,9 +3909,9 @@ func (m *awsAwsjson11_deserializeOpPutPolicy) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutProtocolsList(response, &metadata) } - output := &PutPolicyOutput{} + output := &PutProtocolsListOutput{} out.Result = output var buff [1024]byte @@ -2990,7 +3931,7 @@ func (m *awsAwsjson11_deserializeOpPutPolicy) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutProtocolsListOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3004,7 +3945,7 @@ func (m *awsAwsjson11_deserializeOpPutPolicy) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutProtocolsList(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)} @@ -3054,9 +3995,6 @@ func awsAwsjson11_deserializeOpErrorPutPolicy(response *smithyhttp.Response, met case strings.EqualFold("InvalidOperationException", errorCode): return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) - case strings.EqualFold("InvalidTypeException", errorCode): - return awsAwsjson11_deserializeErrorInvalidTypeException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) @@ -3073,14 +4011,14 @@ func awsAwsjson11_deserializeOpErrorPutPolicy(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpPutProtocolsList struct { +type awsAwsjson11_deserializeOpPutResourceSet struct { } -func (*awsAwsjson11_deserializeOpPutProtocolsList) ID() string { +func (*awsAwsjson11_deserializeOpPutResourceSet) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutProtocolsList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutResourceSet) 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) @@ -3094,9 +4032,9 @@ func (m *awsAwsjson11_deserializeOpPutProtocolsList) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutProtocolsList(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutResourceSet(response, &metadata) } - output := &PutProtocolsListOutput{} + output := &PutResourceSetOutput{} out.Result = output var buff [1024]byte @@ -3116,7 +4054,7 @@ func (m *awsAwsjson11_deserializeOpPutProtocolsList) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutProtocolsListOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutResourceSetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3130,7 +4068,7 @@ func (m *awsAwsjson11_deserializeOpPutProtocolsList) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutProtocolsList(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutResourceSet(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)} @@ -3183,9 +4121,6 @@ func awsAwsjson11_deserializeOpErrorPutProtocolsList(response *smithyhttp.Respon case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4377,6 +5312,107 @@ func awsAwsjson11_deserializeDocumentCustomerPolicyScopeMap(v *map[string][]stri return nil } +func awsAwsjson11_deserializeDocumentDiscoveredResource(v **types.DiscoveredResource, 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.DiscoveredResource + if *v == nil { + sv = &types.DiscoveredResource{} + } 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 AWSAccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "URI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) + } + sv.URI = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDiscoveredResourceList(v *[]types.DiscoveredResource, 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.DiscoveredResource + if *v == nil { + cv = []types.DiscoveredResource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DiscoveredResource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDiscoveredResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentDnsDuplicateRuleGroupViolation(v **types.DnsDuplicateRuleGroupViolation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5085,7 +6121,118 @@ func awsAwsjson11_deserializeDocumentEvaluationResult(v **types.EvaluationResult if err != nil { return err } - sv.ViolatorCount = i64 + sv.ViolatorCount = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEvaluationResults(v *[]types.EvaluationResult, 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.EvaluationResult + if *v == nil { + cv = []types.EvaluationResult{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EvaluationResult + destAddr := &col + if err := awsAwsjson11_deserializeDocumentEvaluationResult(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentExpectedRoute(v **types.ExpectedRoute, 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.ExpectedRoute + if *v == nil { + sv = &types.ExpectedRoute{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowedTargets": + if err := awsAwsjson11_deserializeDocumentLengthBoundedStringList(&sv.AllowedTargets, value); err != nil { + return err + } + + case "ContributingSubnets": + if err := awsAwsjson11_deserializeDocumentResourceIdList(&sv.ContributingSubnets, value); err != nil { + return err + } + + case "IpV4Cidr": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CIDR to be of type string, got %T instead", value) + } + sv.IpV4Cidr = ptr.String(jtv) + } + + case "IpV6Cidr": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CIDR to be of type string, got %T instead", value) + } + sv.IpV6Cidr = ptr.String(jtv) + } + + case "PrefixListId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CIDR to be of type string, got %T instead", value) + } + sv.PrefixListId = ptr.String(jtv) + } + + case "RouteTableId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.RouteTableId = ptr.String(jtv) } default: @@ -5097,7 +6244,7 @@ func awsAwsjson11_deserializeDocumentEvaluationResult(v **types.EvaluationResult return nil } -func awsAwsjson11_deserializeDocumentEvaluationResults(v *[]types.EvaluationResult, value interface{}) error { +func awsAwsjson11_deserializeDocumentExpectedRoutes(v *[]types.ExpectedRoute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5110,17 +6257,17 @@ func awsAwsjson11_deserializeDocumentEvaluationResults(v *[]types.EvaluationResu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.EvaluationResult + var cv []types.ExpectedRoute if *v == nil { - cv = []types.EvaluationResult{} + cv = []types.ExpectedRoute{} } else { cv = *v } for _, value := range shape { - var col types.EvaluationResult + var col types.ExpectedRoute destAddr := &col - if err := awsAwsjson11_deserializeDocumentEvaluationResult(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentExpectedRoute(&destAddr, value); err != nil { return err } col = *destAddr @@ -5131,7 +6278,7 @@ func awsAwsjson11_deserializeDocumentEvaluationResults(v *[]types.EvaluationResu return nil } -func awsAwsjson11_deserializeDocumentExpectedRoute(v **types.ExpectedRoute, value interface{}) error { +func awsAwsjson11_deserializeDocumentFailedItem(v **types.FailedItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5144,59 +6291,31 @@ func awsAwsjson11_deserializeDocumentExpectedRoute(v **types.ExpectedRoute, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ExpectedRoute + var sv *types.FailedItem if *v == nil { - sv = &types.ExpectedRoute{} + sv = &types.FailedItem{} } else { sv = *v } for key, value := range shape { switch key { - case "AllowedTargets": - if err := awsAwsjson11_deserializeDocumentLengthBoundedStringList(&sv.AllowedTargets, value); err != nil { - return err - } - - case "ContributingSubnets": - if err := awsAwsjson11_deserializeDocumentResourceIdList(&sv.ContributingSubnets, value); err != nil { - return err - } - - case "IpV4Cidr": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CIDR to be of type string, got %T instead", value) - } - sv.IpV4Cidr = ptr.String(jtv) - } - - case "IpV6Cidr": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CIDR to be of type string, got %T instead", value) - } - sv.IpV6Cidr = ptr.String(jtv) - } - - case "PrefixListId": + case "Reason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CIDR to be of type string, got %T instead", value) + return fmt.Errorf("expected FailedItemReason to be of type string, got %T instead", value) } - sv.PrefixListId = ptr.String(jtv) + sv.Reason = types.FailedItemReason(jtv) } - case "RouteTableId": + case "URI": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } - sv.RouteTableId = ptr.String(jtv) + sv.URI = ptr.String(jtv) } default: @@ -5208,7 +6327,7 @@ func awsAwsjson11_deserializeDocumentExpectedRoute(v **types.ExpectedRoute, valu return nil } -func awsAwsjson11_deserializeDocumentExpectedRoutes(v *[]types.ExpectedRoute, value interface{}) error { +func awsAwsjson11_deserializeDocumentFailedItemList(v *[]types.FailedItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5221,17 +6340,17 @@ func awsAwsjson11_deserializeDocumentExpectedRoutes(v *[]types.ExpectedRoute, va return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ExpectedRoute + var cv []types.FailedItem if *v == nil { - cv = []types.ExpectedRoute{} + cv = []types.FailedItem{} } else { cv = *v } for _, value := range shape { - var col types.ExpectedRoute + var col types.FailedItem destAddr := &col - if err := awsAwsjson11_deserializeDocumentExpectedRoute(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentFailedItem(&destAddr, value); err != nil { return err } col = *destAddr @@ -6896,6 +8015,15 @@ func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) return err } + case "PolicyDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value) + } + sv.PolicyDescription = ptr.String(jtv) + } + case "PolicyId": if value != nil { jtv, ok := value.(string) @@ -6932,6 +8060,11 @@ func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) sv.RemediationEnabled = jtv } + case "ResourceSetIds": + if err := awsAwsjson11_deserializeDocumentResourceSetIds(&sv.ResourceSetIds, value); err != nil { + return err + } + case "ResourceTags": if err := awsAwsjson11_deserializeDocumentResourceTags(&sv.ResourceTags, value); err != nil { return err @@ -7854,9 +8987,217 @@ func awsAwsjson11_deserializeDocumentRemediationAction(v **types.RemediationActi return err } - case "FMSPolicyUpdateFirewallCreationConfigAction": - if err := awsAwsjson11_deserializeDocumentFMSPolicyUpdateFirewallCreationConfigAction(&sv.FMSPolicyUpdateFirewallCreationConfigAction, value); err != nil { - return err + case "FMSPolicyUpdateFirewallCreationConfigAction": + if err := awsAwsjson11_deserializeDocumentFMSPolicyUpdateFirewallCreationConfigAction(&sv.FMSPolicyUpdateFirewallCreationConfigAction, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRemediationActionWithOrder(v **types.RemediationActionWithOrder, 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.RemediationActionWithOrder + if *v == nil { + sv = &types.RemediationActionWithOrder{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Order": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BasicInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Order = int32(i64) + } + + case "RemediationAction": + if err := awsAwsjson11_deserializeDocumentRemediationAction(&sv.RemediationAction, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResource(v **types.Resource, 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.Resource + if *v == nil { + sv = &types.Resource{} + } 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 AWSAccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "URI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) + } + sv.URI = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceIdList(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceList(v *[]types.Resource, 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.Resource + if *v == nil { + cv = []types.Resource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Resource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_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 "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: @@ -7868,7 +9209,7 @@ func awsAwsjson11_deserializeDocumentRemediationAction(v **types.RemediationActi return nil } -func awsAwsjson11_deserializeDocumentRemediationActionWithOrder(v **types.RemediationActionWithOrder, value interface{}) error { +func awsAwsjson11_deserializeDocumentResourceSet(v **types.ResourceSet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7881,33 +9222,72 @@ func awsAwsjson11_deserializeDocumentRemediationActionWithOrder(v **types.Remedi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RemediationActionWithOrder + var sv *types.ResourceSet if *v == nil { - sv = &types.RemediationActionWithOrder{} + sv = &types.ResourceSet{} } else { sv = *v } for key, value := range shape { switch key { - case "Order": + case "Description": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BasicInteger to be json.Number, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.Description = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Base62Id to be of type string, got %T instead", value) } - sv.Order = int32(i64) + sv.Id = ptr.String(jtv) } - case "RemediationAction": - if err := awsAwsjson11_deserializeDocumentRemediationAction(&sv.RemediationAction, value); err != nil { + case "LastUpdateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ResourceTypeList": + if err := awsAwsjson11_deserializeDocumentResourceTypeList(&sv.ResourceTypeList, value); err != nil { return err } + case "UpdateToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateToken to be of type string, got %T instead", value) + } + sv.UpdateToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -7917,7 +9297,7 @@ func awsAwsjson11_deserializeDocumentRemediationActionWithOrder(v **types.Remedi return nil } -func awsAwsjson11_deserializeDocumentResourceIdList(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentResourceSetIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7942,7 +9322,7 @@ func awsAwsjson11_deserializeDocumentResourceIdList(v *[]string, value interface if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + return fmt.Errorf("expected Base62Id to be of type string, got %T instead", value) } col = jtv } @@ -7953,7 +9333,7 @@ func awsAwsjson11_deserializeDocumentResourceIdList(v *[]string, value interface return nil } -func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentResourceSetSummary(v **types.ResourceSetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7966,22 +9346,56 @@ func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException + var sv *types.ResourceSetSummary if *v == nil { - sv = &types.ResourceNotFoundException{} + sv = &types.ResourceSetSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Description = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Base62Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastUpdateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimeStamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } default: @@ -7993,6 +9407,40 @@ func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsAwsjson11_deserializeDocumentResourceSetSummaryList(v *[]types.ResourceSetSummary, 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.ResourceSetSummary + if *v == nil { + cv = []types.ResourceSetSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceSetSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResourceSetSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentResourceTag(v **types.ResourceTag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9441,7 +10889,133 @@ func awsAwsjson11_deserializeDocumentThirdPartyFirewallPolicy(v **types.ThirdPar if !ok { return fmt.Errorf("expected FirewallDeploymentModel to be of type string, got %T instead", value) } - sv.FirewallDeploymentModel = types.FirewallDeploymentModel(jtv) + sv.FirewallDeploymentModel = types.FirewallDeploymentModel(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentViolationDetail(v **types.ViolationDetail, 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.ViolationDetail + if *v == nil { + sv = &types.ViolationDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MemberAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AWSAccountId to be of type string, got %T instead", value) + } + sv.MemberAccount = ptr.String(jtv) + } + + case "PolicyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + case "ResourceDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LengthBoundedString to be of type string, got %T instead", value) + } + sv.ResourceDescription = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceTags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.ResourceTags, value); err != nil { + return err + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "ResourceViolations": + if err := awsAwsjson11_deserializeDocumentResourceViolations(&sv.ResourceViolations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentAssociateThirdPartyFirewallOutput(v **AssociateThirdPartyFirewallOutput, 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 *AssociateThirdPartyFirewallOutput + if *v == nil { + sv = &AssociateThirdPartyFirewallOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ThirdPartyFirewallStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThirdPartyFirewallAssociationStatus to be of type string, got %T instead", value) + } + sv.ThirdPartyFirewallStatus = types.ThirdPartyFirewallAssociationStatus(jtv) } default: @@ -9453,7 +11027,7 @@ func awsAwsjson11_deserializeDocumentThirdPartyFirewallPolicy(v **types.ThirdPar return nil } -func awsAwsjson11_deserializeDocumentViolationDetail(v **types.ViolationDetail, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentBatchAssociateResourceOutput(v **BatchAssociateResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9466,68 +11040,27 @@ func awsAwsjson11_deserializeDocumentViolationDetail(v **types.ViolationDetail, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ViolationDetail + var sv *BatchAssociateResourceOutput if *v == nil { - sv = &types.ViolationDetail{} + sv = &BatchAssociateResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "MemberAccount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AWSAccountId to be of type string, got %T instead", value) - } - sv.MemberAccount = ptr.String(jtv) - } - - case "PolicyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) - } - sv.PolicyId = ptr.String(jtv) - } - - case "ResourceDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LengthBoundedString to be of type string, got %T instead", value) - } - sv.ResourceDescription = ptr.String(jtv) - } - - case "ResourceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) - } - sv.ResourceId = ptr.String(jtv) - } - - case "ResourceTags": - if err := awsAwsjson11_deserializeDocumentTagList(&sv.ResourceTags, value); err != nil { + case "FailedItems": + if err := awsAwsjson11_deserializeDocumentFailedItemList(&sv.FailedItems, value); err != nil { return err } - case "ResourceType": + case "ResourceSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } - sv.ResourceType = ptr.String(jtv) - } - - case "ResourceViolations": - if err := awsAwsjson11_deserializeDocumentResourceViolations(&sv.ResourceViolations, value); err != nil { - return err + sv.ResourceSetIdentifier = ptr.String(jtv) } default: @@ -9539,7 +11072,7 @@ func awsAwsjson11_deserializeDocumentViolationDetail(v **types.ViolationDetail, return nil } -func awsAwsjson11_deserializeOpDocumentAssociateThirdPartyFirewallOutput(v **AssociateThirdPartyFirewallOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentBatchDisassociateResourceOutput(v **BatchDisassociateResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9552,22 +11085,27 @@ func awsAwsjson11_deserializeOpDocumentAssociateThirdPartyFirewallOutput(v **Ass return fmt.Errorf("unexpected JSON type %v", value) } - var sv *AssociateThirdPartyFirewallOutput + var sv *BatchDisassociateResourceOutput if *v == nil { - sv = &AssociateThirdPartyFirewallOutput{} + sv = &BatchDisassociateResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ThirdPartyFirewallStatus": + case "FailedItems": + if err := awsAwsjson11_deserializeDocumentFailedItemList(&sv.FailedItems, value); err != nil { + return err + } + + case "ResourceSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ThirdPartyFirewallAssociationStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } - sv.ThirdPartyFirewallStatus = types.ThirdPartyFirewallAssociationStatus(jtv) + sv.ResourceSetIdentifier = ptr.String(jtv) } default: @@ -9955,6 +11493,51 @@ func awsAwsjson11_deserializeOpDocumentGetProtocolsListOutput(v **GetProtocolsLi return nil } +func awsAwsjson11_deserializeOpDocumentGetResourceSetOutput(v **GetResourceSetOutput, 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 *GetResourceSetOutput + if *v == nil { + sv = &GetResourceSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceSet": + if err := awsAwsjson11_deserializeDocumentResourceSet(&sv.ResourceSet, value); err != nil { + return err + } + + case "ResourceSetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceSetArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetThirdPartyFirewallAssociationStatusOutput(v **GetThirdPartyFirewallAssociationStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10130,6 +11713,51 @@ func awsAwsjson11_deserializeOpDocumentListComplianceStatusOutput(v **ListCompli return nil } +func awsAwsjson11_deserializeOpDocumentListDiscoveredResourcesOutput(v **ListDiscoveredResourcesOutput, 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 *ListDiscoveredResourcesOutput + if *v == nil { + sv = &ListDiscoveredResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsAwsjson11_deserializeDocumentDiscoveredResourceList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListMemberAccountsOutput(v **ListMemberAccountsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10265,6 +11893,96 @@ func awsAwsjson11_deserializeOpDocumentListProtocolsListsOutput(v **ListProtocol return nil } +func awsAwsjson11_deserializeOpDocumentListResourceSetResourcesOutput(v **ListResourceSetResourcesOutput, 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 *ListResourceSetResourcesOutput + if *v == nil { + sv = &ListResourceSetResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsAwsjson11_deserializeDocumentResourceList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListResourceSetsOutput(v **ListResourceSetsOutput, 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 *ListResourceSetsOutput + if *v == nil { + sv = &ListResourceSetsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ResourceSets": + if err := awsAwsjson11_deserializeDocumentResourceSetSummaryList(&sv.ResourceSets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10481,6 +12199,51 @@ func awsAwsjson11_deserializeOpDocumentPutProtocolsListOutput(v **PutProtocolsLi return nil } +func awsAwsjson11_deserializeOpDocumentPutResourceSetOutput(v **PutResourceSetOutput, 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 *PutResourceSetOutput + if *v == nil { + sv = &PutResourceSetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceSet": + if err := awsAwsjson11_deserializeDocumentResourceSet(&sv.ResourceSet, value); err != nil { + return err + } + + case "ResourceSetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value) + } + sv.ResourceSetArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/fms/generated.json b/service/fms/generated.json index df90a455131..61a3fb45b59 100644 --- a/service/fms/generated.json +++ b/service/fms/generated.json @@ -10,10 +10,13 @@ "api_client_test.go", "api_op_AssociateAdminAccount.go", "api_op_AssociateThirdPartyFirewall.go", + "api_op_BatchAssociateResource.go", + "api_op_BatchDisassociateResource.go", "api_op_DeleteAppsList.go", "api_op_DeleteNotificationChannel.go", "api_op_DeletePolicy.go", "api_op_DeleteProtocolsList.go", + "api_op_DeleteResourceSet.go", "api_op_DisassociateAdminAccount.go", "api_op_DisassociateThirdPartyFirewall.go", "api_op_GetAdminAccount.go", @@ -23,19 +26,24 @@ "api_op_GetPolicy.go", "api_op_GetProtectionStatus.go", "api_op_GetProtocolsList.go", + "api_op_GetResourceSet.go", "api_op_GetThirdPartyFirewallAssociationStatus.go", "api_op_GetViolationDetails.go", "api_op_ListAppsLists.go", "api_op_ListComplianceStatus.go", + "api_op_ListDiscoveredResources.go", "api_op_ListMemberAccounts.go", "api_op_ListPolicies.go", "api_op_ListProtocolsLists.go", + "api_op_ListResourceSetResources.go", + "api_op_ListResourceSets.go", "api_op_ListTagsForResource.go", "api_op_ListThirdPartyFirewallFirewallPolicies.go", "api_op_PutAppsList.go", "api_op_PutNotificationChannel.go", "api_op_PutPolicy.go", "api_op_PutProtocolsList.go", + "api_op_PutResourceSet.go", "api_op_TagResource.go", "api_op_UntagResource.go", "deserializers.go", diff --git a/service/fms/serializers.go b/service/fms/serializers.go index ce4eb2fc004..c3f31c6ff15 100644 --- a/service/fms/serializers.go +++ b/service/fms/serializers.go @@ -126,6 +126,116 @@ func (m *awsAwsjson11_serializeOpAssociateThirdPartyFirewall) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpBatchAssociateResource struct { +} + +func (*awsAwsjson11_serializeOpBatchAssociateResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchAssociateResource) 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.(*BatchAssociateResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.BatchAssociateResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchAssociateResourceInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpBatchDisassociateResource struct { +} + +func (*awsAwsjson11_serializeOpBatchDisassociateResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchDisassociateResource) 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.(*BatchDisassociateResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.BatchDisassociateResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchDisassociateResourceInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteAppsList struct { } @@ -346,6 +456,61 @@ func (m *awsAwsjson11_serializeOpDeleteProtocolsList) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteResourceSet struct { +} + +func (*awsAwsjson11_serializeOpDeleteResourceSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteResourceSet) 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.(*DeleteResourceSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.DeleteResourceSet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteResourceSetInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDisassociateAdminAccount struct { } @@ -841,6 +1006,61 @@ func (m *awsAwsjson11_serializeOpGetProtocolsList) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetResourceSet struct { +} + +func (*awsAwsjson11_serializeOpGetResourceSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetResourceSet) 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.(*GetResourceSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.GetResourceSet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetResourceSetInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetThirdPartyFirewallAssociationStatus struct { } @@ -1042,10 +1262,175 @@ func (m *awsAwsjson11_serializeOpListComplianceStatus) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListComplianceStatus") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListComplianceStatus") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListComplianceStatusInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListDiscoveredResources struct { +} + +func (*awsAwsjson11_serializeOpListDiscoveredResources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListDiscoveredResources) 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.(*ListDiscoveredResourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListDiscoveredResources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListDiscoveredResourcesInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListMemberAccounts struct { +} + +func (*awsAwsjson11_serializeOpListMemberAccounts) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListMemberAccounts) 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.(*ListMemberAccountsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListMemberAccounts") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListMemberAccountsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListPolicies struct { +} + +func (*awsAwsjson11_serializeOpListPolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListPolicies) 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.(*ListPoliciesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListPolicies") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListComplianceStatusInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListPoliciesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1061,14 +1446,14 @@ func (m *awsAwsjson11_serializeOpListComplianceStatus) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListMemberAccounts struct { +type awsAwsjson11_serializeOpListProtocolsLists struct { } -func (*awsAwsjson11_serializeOpListMemberAccounts) ID() string { +func (*awsAwsjson11_serializeOpListProtocolsLists) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMemberAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListProtocolsLists) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1076,7 +1461,7 @@ func (m *awsAwsjson11_serializeOpListMemberAccounts) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMemberAccountsInput) + input, ok := in.Parameters.(*ListProtocolsListsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1097,10 +1482,10 @@ func (m *awsAwsjson11_serializeOpListMemberAccounts) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListMemberAccounts") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListProtocolsLists") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMemberAccountsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListProtocolsListsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1116,14 +1501,14 @@ func (m *awsAwsjson11_serializeOpListMemberAccounts) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListPolicies struct { +type awsAwsjson11_serializeOpListResourceSetResources struct { } -func (*awsAwsjson11_serializeOpListPolicies) ID() string { +func (*awsAwsjson11_serializeOpListResourceSetResources) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListResourceSetResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1131,7 +1516,7 @@ func (m *awsAwsjson11_serializeOpListPolicies) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListPoliciesInput) + input, ok := in.Parameters.(*ListResourceSetResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1152,10 +1537,10 @@ func (m *awsAwsjson11_serializeOpListPolicies) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListPolicies") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListResourceSetResources") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListPoliciesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListResourceSetResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1171,14 +1556,14 @@ func (m *awsAwsjson11_serializeOpListPolicies) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListProtocolsLists struct { +type awsAwsjson11_serializeOpListResourceSets struct { } -func (*awsAwsjson11_serializeOpListProtocolsLists) ID() string { +func (*awsAwsjson11_serializeOpListResourceSets) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListProtocolsLists) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListResourceSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1186,7 +1571,7 @@ func (m *awsAwsjson11_serializeOpListProtocolsLists) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListProtocolsListsInput) + input, ok := in.Parameters.(*ListResourceSetsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1207,10 +1592,10 @@ func (m *awsAwsjson11_serializeOpListProtocolsLists) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListProtocolsLists") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.ListResourceSets") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListProtocolsListsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListResourceSetsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1556,6 +1941,61 @@ func (m *awsAwsjson11_serializeOpPutProtocolsList) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpPutResourceSet struct { +} + +func (*awsAwsjson11_serializeOpPutResourceSet) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutResourceSet) 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.(*PutResourceSetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSFMS_20180101.PutResourceSet") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutResourceSetInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpTagResource struct { } @@ -1746,6 +2186,17 @@ func awsAwsjson11_serializeDocumentAppsListData(v *types.AppsListData, value smi return nil } +func awsAwsjson11_serializeDocumentAWSAccountIdList(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 awsAwsjson11_serializeDocumentCustomerPolicyScopeIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1773,6 +2224,17 @@ func awsAwsjson11_serializeDocumentCustomerPolicyScopeMap(v map[string][]string, return nil } +func awsAwsjson11_serializeDocumentIdentifierList(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 awsAwsjson11_serializeDocumentNetworkFirewallPolicy(v *types.NetworkFirewallPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1813,6 +2275,11 @@ func awsAwsjson11_serializeDocumentPolicy(v *types.Policy, value smithyjson.Valu } } + if v.PolicyDescription != nil { + ok := object.Key("PolicyDescription") + ok.String(*v.PolicyDescription) + } + if v.PolicyId != nil { ok := object.Key("PolicyId") ok.String(*v.PolicyId) @@ -1833,6 +2300,13 @@ func awsAwsjson11_serializeDocumentPolicy(v *types.Policy, value smithyjson.Valu ok.Boolean(v.RemediationEnabled) } + if v.ResourceSetIds != nil { + ok := object.Key("ResourceSetIds") + if err := awsAwsjson11_serializeDocumentResourceSetIds(v.ResourceSetIds, ok); err != nil { + return err + } + } + if v.ResourceTags != nil { ok := object.Key("ResourceTags") if err := awsAwsjson11_serializeDocumentResourceTags(v.ResourceTags, ok); err != nil { @@ -1972,6 +2446,56 @@ func awsAwsjson11_serializeDocumentProtocolsListData(v *types.ProtocolsListData, return nil } +func awsAwsjson11_serializeDocumentResourceSet(v *types.ResourceSet, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.LastUpdateTime != nil { + ok := object.Key("LastUpdateTime") + ok.Double(smithytime.FormatEpochSeconds(*v.LastUpdateTime)) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.ResourceTypeList != nil { + ok := object.Key("ResourceTypeList") + if err := awsAwsjson11_serializeDocumentResourceTypeList(v.ResourceTypeList, ok); err != nil { + return err + } + } + + if v.UpdateToken != nil { + ok := object.Key("UpdateToken") + ok.String(*v.UpdateToken) + } + + return nil +} + +func awsAwsjson11_serializeDocumentResourceSetIds(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 awsAwsjson11_serializeDocumentResourceTag(v *types.ResourceTag, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2114,6 +2638,44 @@ func awsAwsjson11_serializeOpDocumentAssociateThirdPartyFirewallInput(v *Associa return nil } +func awsAwsjson11_serializeOpDocumentBatchAssociateResourceInput(v *BatchAssociateResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Items != nil { + ok := object.Key("Items") + if err := awsAwsjson11_serializeDocumentIdentifierList(v.Items, ok); err != nil { + return err + } + } + + if v.ResourceSetIdentifier != nil { + ok := object.Key("ResourceSetIdentifier") + ok.String(*v.ResourceSetIdentifier) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentBatchDisassociateResourceInput(v *BatchDisassociateResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Items != nil { + ok := object.Key("Items") + if err := awsAwsjson11_serializeDocumentIdentifierList(v.Items, ok); err != nil { + return err + } + } + + if v.ResourceSetIdentifier != nil { + ok := object.Key("ResourceSetIdentifier") + ok.String(*v.ResourceSetIdentifier) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteAppsListInput(v *DeleteAppsListInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2162,6 +2724,18 @@ func awsAwsjson11_serializeOpDocumentDeleteProtocolsListInput(v *DeleteProtocols return nil } +func awsAwsjson11_serializeOpDocumentDeleteResourceSetInput(v *DeleteResourceSetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDisassociateAdminAccountInput(v *DisassociateAdminAccountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2295,6 +2869,18 @@ func awsAwsjson11_serializeOpDocumentGetProtocolsListInput(v *GetProtocolsListIn return nil } +func awsAwsjson11_serializeOpDocumentGetResourceSetInput(v *GetResourceSetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetThirdPartyFirewallAssociationStatusInput(v *GetThirdPartyFirewallAssociationStatusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2378,6 +2964,35 @@ func awsAwsjson11_serializeOpDocumentListComplianceStatusInput(v *ListCompliance return nil } +func awsAwsjson11_serializeOpDocumentListDiscoveredResourcesInput(v *ListDiscoveredResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.MemberAccountIds != nil { + ok := object.Key("MemberAccountIds") + if err := awsAwsjson11_serializeDocumentAWSAccountIdList(v.MemberAccountIds, ok); err != nil { + return err + } + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.ResourceType != nil { + ok := object.Key("ResourceType") + ok.String(*v.ResourceType) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListMemberAccountsInput(v *ListMemberAccountsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2434,6 +3049,45 @@ func awsAwsjson11_serializeOpDocumentListProtocolsListsInput(v *ListProtocolsLis return nil } +func awsAwsjson11_serializeOpDocumentListResourceSetResourcesInput(v *ListResourceSetResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + 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 +} + +func awsAwsjson11_serializeOpDocumentListResourceSetsInput(v *ListResourceSetsInput, 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 +} + func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2548,6 +3202,27 @@ func awsAwsjson11_serializeOpDocumentPutProtocolsListInput(v *PutProtocolsListIn return nil } +func awsAwsjson11_serializeOpDocumentPutResourceSetInput(v *PutResourceSetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceSet != nil { + ok := object.Key("ResourceSet") + if err := awsAwsjson11_serializeDocumentResourceSet(v.ResourceSet, ok); err != nil { + return err + } + } + + if v.TagList != nil { + ok := object.Key("TagList") + if err := awsAwsjson11_serializeDocumentTagList(v.TagList, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/fms/types/enums.go b/service/fms/types/enums.go index 132b6e776c4..40566aecf2c 100644 --- a/service/fms/types/enums.go +++ b/service/fms/types/enums.go @@ -86,6 +86,32 @@ func (DestinationType) Values() []DestinationType { } } +type FailedItemReason string + +// Enum values for FailedItemReason +const ( + FailedItemReasonNotValidArn FailedItemReason = "NOT_VALID_ARN" + FailedItemReasonNotValidPartition FailedItemReason = "NOT_VALID_PARTITION" + FailedItemReasonNotValidRegion FailedItemReason = "NOT_VALID_REGION" + FailedItemReasonNotValidService FailedItemReason = "NOT_VALID_SERVICE" + FailedItemReasonNotValidResourceType FailedItemReason = "NOT_VALID_RESOURCE_TYPE" + FailedItemReasonNotValidAccountId FailedItemReason = "NOT_VALID_ACCOUNT_ID" +) + +// Values returns all known values for FailedItemReason. 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 (FailedItemReason) Values() []FailedItemReason { + return []FailedItemReason{ + "NOT_VALID_ARN", + "NOT_VALID_PARTITION", + "NOT_VALID_REGION", + "NOT_VALID_SERVICE", + "NOT_VALID_RESOURCE_TYPE", + "NOT_VALID_ACCOUNT_ID", + } +} + type FirewallDeploymentModel string // Enum values for FirewallDeploymentModel @@ -209,6 +235,7 @@ const ( SecurityServiceTypeNetworkFirewall SecurityServiceType = "NETWORK_FIREWALL" SecurityServiceTypeDnsFirewall SecurityServiceType = "DNS_FIREWALL" SecurityServiceTypeThirdPartyFirewall SecurityServiceType = "THIRD_PARTY_FIREWALL" + SecurityServiceTypeImportNetworkFirewall SecurityServiceType = "IMPORT_NETWORK_FIREWALL" ) // Values returns all known values for SecurityServiceType. Note that this can be @@ -225,6 +252,7 @@ func (SecurityServiceType) Values() []SecurityServiceType { "NETWORK_FIREWALL", "DNS_FIREWALL", "THIRD_PARTY_FIREWALL", + "IMPORT_NETWORK_FIREWALL", } } diff --git a/service/fms/types/types.go b/service/fms/types/types.go index f37f292b5bf..307bfd18bb0 100644 --- a/service/fms/types/types.go +++ b/service/fms/types/types.go @@ -160,6 +160,25 @@ type ComplianceViolator struct { noSmithyDocumentSerde } +// A resource in the organization that's available to be associated with a Firewall +// Manager resource set. +type DiscoveredResource struct { + + // The Amazon Web Services account ID associated with the discovered resource. + AccountId *string + + // The name of the discovered resource. + Name *string + + // The type of the discovered resource. + Type *string + + // The universal resource identifier (URI) of the discovered resource. + URI *string + + noSmithyDocumentSerde +} + // A DNS Firewall rule group that Firewall Manager tried to associate with a VPC is // already associated with the VPC and can't be associated again. type DnsDuplicateRuleGroupViolation struct { @@ -429,6 +448,19 @@ type ExpectedRoute struct { noSmithyDocumentSerde } +// Details of a resource that failed when trying to update it's association to a +// resource set. +type FailedItem struct { + + // The reason the resource's association could not be updated. + Reason FailedItemReason + + // The univeral resource indicator (URI) of the resource that failed. + URI *string + + noSmithyDocumentSerde +} + // Contains details about the firewall subnet that violates the policy scope. type FirewallSubnetIsOutOfScopeViolation struct { @@ -933,6 +965,9 @@ type Policy struct { // “ouid112”]}. IncludeMap map[string][]string + // The definition of the Network Firewall firewall policy. + PolicyDescription *string + // The ID of the Firewall Manager policy. PolicyId *string @@ -942,6 +977,9 @@ type Policy struct { // policy version, use a GetPolicy request. PolicyUpdateToken *string + // The unique identifiers of the resource sets used by the policy. + ResourceSetIds []string + // An array of ResourceTag objects. ResourceTags []ResourceTag @@ -1200,6 +1238,87 @@ type RemediationActionWithOrder struct { noSmithyDocumentSerde } +// Details of a resource that is associated to an Firewall Manager resource set. +type Resource struct { + + // The resource's universal resource indicator (URI). + // + // This member is required. + URI *string + + // The Amazon Web Services account ID that the associated resource belongs to. + AccountId *string + + noSmithyDocumentSerde +} + +// A set of resources to include in a policy. +type ResourceSet struct { + + // The descriptive name of the resource set. You can't change the name of a + // resource set after you create it. + // + // This member is required. + Name *string + + // Determines the resources that can be associated to the resource set. Depending + // on your setting for max results and the number of resource sets, a single call + // might not return the full list. + // + // This member is required. + ResourceTypeList []string + + // A description of the resource set. + Description *string + + // A unique identifier for the resource set. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + Id *string + + // The last time that the resource set was changed. + LastUpdateTime *time.Time + + // An optional token that you can use for optimistic locking. Firewall Manager + // returns a token to your requests that access the resource set. The token marks + // the state of the resource set resource at the time of the request. Update tokens + // are not allowed when creating a resource set. After creation, each subsequent + // update call to the resource set requires the update token. To make an + // unconditional change to the resource set, omit the token in your update request. + // Without the token, Firewall Manager performs your updates regardless of whether + // the resource set has changed since you last retrieved it. To make a conditional + // change to the resource set, provide the token in your update request. Firewall + // Manager uses the token to ensure that the resource set hasn't changed since you + // last retrieved it. If it has changed, the operation fails with an + // InvalidTokenException. If this happens, retrieve the resource set again to get a + // current copy of it with a new token. Reapply your changes as needed, then try + // the operation again using the new token. + UpdateToken *string + + noSmithyDocumentSerde +} + +// Summarizes the resource sets used in a policy. +type ResourceSetSummary struct { + + // A description of the resource set. + Description *string + + // A unique identifier for the resource set. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + Id *string + + // The last time that the resource set was changed. + LastUpdateTime *time.Time + + // The descriptive name of the resource set. You can't change the name of a + // resource set after you create it. + Name *string + + noSmithyDocumentSerde +} + // The resource tags that Firewall Manager uses to determine if a particular // resource should be included or excluded from the Firewall Manager policy. Tags // enable you to categorize your Amazon Web Services resources in different ways, diff --git a/service/fms/validators.go b/service/fms/validators.go index d63b65d56dc..5e48e397402 100644 --- a/service/fms/validators.go +++ b/service/fms/validators.go @@ -50,6 +50,46 @@ func (m *validateOpAssociateThirdPartyFirewall) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpBatchAssociateResource struct { +} + +func (*validateOpBatchAssociateResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchAssociateResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchAssociateResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchAssociateResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchDisassociateResource struct { +} + +func (*validateOpBatchDisassociateResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDisassociateResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDisassociateResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDisassociateResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAppsList struct { } @@ -110,6 +150,26 @@ func (m *validateOpDeleteProtocolsList) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDeleteResourceSet struct { +} + +func (*validateOpDeleteResourceSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteResourceSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteResourceSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteResourceSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisassociateThirdPartyFirewall struct { } @@ -230,6 +290,26 @@ func (m *validateOpGetProtocolsList) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetResourceSet struct { +} + +func (*validateOpGetResourceSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourceSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourceSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourceSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetThirdPartyFirewallAssociationStatus struct { } @@ -310,6 +390,26 @@ func (m *validateOpListComplianceStatus) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpListDiscoveredResources struct { +} + +func (*validateOpListDiscoveredResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListDiscoveredResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListDiscoveredResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListDiscoveredResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListProtocolsLists struct { } @@ -330,6 +430,26 @@ func (m *validateOpListProtocolsLists) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListResourceSetResources struct { +} + +func (*validateOpListResourceSetResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListResourceSetResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListResourceSetResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListResourceSetResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -450,6 +570,26 @@ func (m *validateOpPutProtocolsList) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpPutResourceSet struct { +} + +func (*validateOpPutResourceSet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutResourceSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutResourceSetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutResourceSetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -498,6 +638,14 @@ func addOpAssociateThirdPartyFirewallValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpAssociateThirdPartyFirewall{}, middleware.After) } +func addOpBatchAssociateResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchAssociateResource{}, middleware.After) +} + +func addOpBatchDisassociateResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDisassociateResource{}, middleware.After) +} + func addOpDeleteAppsListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAppsList{}, middleware.After) } @@ -510,6 +658,10 @@ func addOpDeleteProtocolsListValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDeleteProtocolsList{}, middleware.After) } +func addOpDeleteResourceSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResourceSet{}, middleware.After) +} + func addOpDisassociateThirdPartyFirewallValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateThirdPartyFirewall{}, middleware.After) } @@ -534,6 +686,10 @@ func addOpGetProtocolsListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetProtocolsList{}, middleware.After) } +func addOpGetResourceSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourceSet{}, middleware.After) +} + func addOpGetThirdPartyFirewallAssociationStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetThirdPartyFirewallAssociationStatus{}, middleware.After) } @@ -550,10 +706,18 @@ func addOpListComplianceStatusValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpListComplianceStatus{}, middleware.After) } +func addOpListDiscoveredResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListDiscoveredResources{}, middleware.After) +} + func addOpListProtocolsListsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListProtocolsLists{}, middleware.After) } +func addOpListResourceSetResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListResourceSetResources{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -578,6 +742,10 @@ func addOpPutProtocolsListValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutProtocolsList{}, middleware.After) } +func addOpPutResourceSetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutResourceSet{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -716,6 +884,24 @@ func validateProtocolsListData(v *types.ProtocolsListData) error { } } +func validateResourceSet(v *types.ResourceSet) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResourceSet"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ResourceTypeList == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceTypeList")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateResourceTag(v *types.ResourceTag) error { if v == nil { return nil @@ -828,6 +1014,42 @@ func validateOpAssociateThirdPartyFirewallInput(v *AssociateThirdPartyFirewallIn } } +func validateOpBatchAssociateResourceInput(v *BatchAssociateResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchAssociateResourceInput"} + if v.ResourceSetIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceSetIdentifier")) + } + if v.Items == nil { + invalidParams.Add(smithy.NewErrParamRequired("Items")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchDisassociateResourceInput(v *BatchDisassociateResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDisassociateResourceInput"} + if v.ResourceSetIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceSetIdentifier")) + } + if v.Items == nil { + invalidParams.Add(smithy.NewErrParamRequired("Items")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAppsListInput(v *DeleteAppsListInput) error { if v == nil { return nil @@ -873,6 +1095,21 @@ func validateOpDeleteProtocolsListInput(v *DeleteProtocolsListInput) error { } } +func validateOpDeleteResourceSetInput(v *DeleteResourceSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteResourceSetInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisassociateThirdPartyFirewallInput(v *DisassociateThirdPartyFirewallInput) error { if v == nil { return nil @@ -966,6 +1203,21 @@ func validateOpGetProtocolsListInput(v *GetProtocolsListInput) error { } } +func validateOpGetResourceSetInput(v *GetResourceSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourceSetInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetThirdPartyFirewallAssociationStatusInput(v *GetThirdPartyFirewallAssociationStatusInput) error { if v == nil { return nil @@ -1035,6 +1287,24 @@ func validateOpListComplianceStatusInput(v *ListComplianceStatusInput) error { } } +func validateOpListDiscoveredResourcesInput(v *ListDiscoveredResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListDiscoveredResourcesInput"} + if v.MemberAccountIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("MemberAccountIds")) + } + if v.ResourceType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListProtocolsListsInput(v *ListProtocolsListsInput) error { if v == nil { return nil @@ -1050,6 +1320,21 @@ func validateOpListProtocolsListsInput(v *ListProtocolsListsInput) error { } } +func validateOpListResourceSetResourcesInput(v *ListResourceSetResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListResourceSetResourcesInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -1173,6 +1458,30 @@ func validateOpPutProtocolsListInput(v *PutProtocolsListInput) error { } } +func validateOpPutResourceSetInput(v *PutResourceSetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutResourceSetInput"} + if v.ResourceSet == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceSet")) + } else if v.ResourceSet != nil { + if err := validateResourceSet(v.ResourceSet); err != nil { + invalidParams.AddNested("ResourceSet", err.(smithy.InvalidParamsError)) + } + } + if v.TagList != nil { + if err := validateTagList(v.TagList); err != nil { + invalidParams.AddNested("TagList", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/lightsail/api_op_CreateContainerService.go b/service/lightsail/api_op_CreateContainerService.go index 5ef48d667ee..c733e9bbcba 100644 --- a/service/lightsail/api_op_CreateContainerService.go +++ b/service/lightsail/api_op_CreateContainerService.go @@ -57,8 +57,8 @@ type CreateContainerServiceInput struct { // service will make up part of its default domain. The default domain of a // container service is typically https://...cs.amazonlightsail.com. If the name of // your container service is container-service-1, and it's located in the US East - // (Ohio) AWS region (us-east-2), then the domain for your container service will - // be like the following example: + // (Ohio) Amazon Web Services Region (us-east-2), then the domain for your + // container service will be like the following example: // https://container-service-1.ur4EXAMPLE2uq.us-east-2.cs.amazonlightsail.com The // following are the requirements for container service names: // diff --git a/service/lightsail/api_op_CreateRelationalDatabase.go b/service/lightsail/api_op_CreateRelationalDatabase.go index 14057f8f3e1..4b8f7a7a9a0 100644 --- a/service/lightsail/api_op_CreateRelationalDatabase.go +++ b/service/lightsail/api_op_CreateRelationalDatabase.go @@ -154,16 +154,16 @@ type CreateRelationalDatabaseInput struct { // information about the preferred backup window time blocks for each region, see // the Working With Backups // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow) - // guide in the Amazon Relational Database Service (Amazon RDS) documentation. - // Constraints: - // - // * Must be in the hh24:mi-hh24:mi format. Example: 16:00-16:30 + // guide in the Amazon Relational Database Service documentation. Constraints: // // * - // Specified in Coordinated Universal Time (UTC). + // Must be in the hh24:mi-hh24:mi format. Example: 16:00-16:30 + // + // * Specified in + // Coordinated Universal Time (UTC). // - // * Must not conflict with the - // preferred maintenance window. + // * Must not conflict with the preferred + // maintenance window. // // * Must be at least 30 minutes. PreferredBackupWindow *string diff --git a/service/lightsail/api_op_GetContainerLog.go b/service/lightsail/api_op_GetContainerLog.go index b668c1f8fda..b9ff51f1d7c 100644 --- a/service/lightsail/api_op_GetContainerLog.go +++ b/service/lightsail/api_op_GetContainerLog.go @@ -18,7 +18,7 @@ import ( // merged from all nodes on your container service. Container logs are retained for // a certain amount of time. For more information, see Amazon Lightsail endpoints // and quotas (https://docs.aws.amazon.com/general/latest/gr/lightsail.html) in the -// AWS General Reference. +// Amazon Web Services General Reference. func (c *Client) GetContainerLog(ctx context.Context, params *GetContainerLogInput, optFns ...func(*Options)) (*GetContainerLogOutput, error) { if params == nil { params = &GetContainerLogInput{} diff --git a/service/lightsail/api_op_GetContainerServiceDeployments.go b/service/lightsail/api_op_GetContainerServiceDeployments.go index 1041e8cc3af..85d52eafcce 100644 --- a/service/lightsail/api_op_GetContainerServiceDeployments.go +++ b/service/lightsail/api_op_GetContainerServiceDeployments.go @@ -17,8 +17,8 @@ import ( // in ascending order. The newest version is listed at the top of the response. A // set number of deployments are kept before the oldest one is replaced with the // newest one. For more information, see Amazon Lightsail endpoints and quotas -// (https://docs.aws.amazon.com/general/latest/gr/lightsail.html) in the AWS -// General Reference. +// (https://docs.aws.amazon.com/general/latest/gr/lightsail.html) in the Amazon Web +// Services General Reference. func (c *Client) GetContainerServiceDeployments(ctx context.Context, params *GetContainerServiceDeploymentsInput, optFns ...func(*Options)) (*GetContainerServiceDeploymentsOutput, error) { if params == nil { params = &GetContainerServiceDeploymentsInput{} diff --git a/service/lightsail/api_op_UpdateBucketBundle.go b/service/lightsail/api_op_UpdateBucketBundle.go index 1505ceb3396..83d3ae865af 100644 --- a/service/lightsail/api_op_UpdateBucketBundle.go +++ b/service/lightsail/api_op_UpdateBucketBundle.go @@ -14,8 +14,8 @@ import ( // Updates the bundle, or storage plan, of an existing Amazon Lightsail bucket. A // bucket bundle specifies the monthly cost, storage space, and data transfer quota // for a bucket. You can update a bucket's bundle only one time within a monthly -// AWS billing cycle. To determine if you can update a bucket's bundle, use the -// GetBuckets +// Amazon Web Services billing cycle. To determine if you can update a bucket's +// bundle, use the GetBuckets // (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetBuckets.html) // action. The ableToUpdateBundle parameter in the response will indicate whether // you can currently update a bucket's bundle. Update a bucket's bundle if it's diff --git a/service/lightsail/api_op_UpdateDistributionBundle.go b/service/lightsail/api_op_UpdateDistributionBundle.go index 572fccd37e1..235391dadbb 100644 --- a/service/lightsail/api_op_UpdateDistributionBundle.go +++ b/service/lightsail/api_op_UpdateDistributionBundle.go @@ -16,10 +16,10 @@ import ( // and monthly cost of your distribution. Update your distribution's bundle if your // distribution is going over its monthly network transfer quota and is incurring // an overage fee. You can update your distribution's bundle only one time within -// your monthly AWS billing cycle. To determine if you can update your -// distribution's bundle, use the GetDistributions action. The ableToUpdateBundle -// parameter in the result will indicate whether you can currently update your -// distribution's bundle. +// your monthly Amazon Web Services billing cycle. To determine if you can update +// your distribution's bundle, use the GetDistributions action. The +// ableToUpdateBundle parameter in the result will indicate whether you can +// currently update your distribution's bundle. func (c *Client) UpdateDistributionBundle(ctx context.Context, params *UpdateDistributionBundleInput, optFns ...func(*Options)) (*UpdateDistributionBundleOutput, error) { if params == nil { params = &UpdateDistributionBundleInput{} diff --git a/service/lightsail/api_op_UpdateRelationalDatabase.go b/service/lightsail/api_op_UpdateRelationalDatabase.go index 1297bc8d1a6..653863e0ecf 100644 --- a/service/lightsail/api_op_UpdateRelationalDatabase.go +++ b/service/lightsail/api_op_UpdateRelationalDatabase.go @@ -80,20 +80,21 @@ type UpdateRelationalDatabaseInput struct { // The weekly time range during which system maintenance can occur on your // database. The default is a 30-minute window selected at random from an 8-hour - // block of time for each AWS Region, occurring on a random day of the week. - // Constraints: + // block of time for each Amazon Web Services Region, occurring on a random day of + // the week. Constraints: // // * Must be in the ddd:hh24:mi-ddd:hh24:mi format. // - // * Valid days: - // Mon, Tue, Wed, Thu, Fri, Sat, Sun. + // * + // Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. // - // * Must be at least 30 minutes. + // * Must be at least 30 + // minutes. // - // * Specified - // in Coordinated Universal Time (UTC). + // * Specified in Coordinated Universal Time (UTC). // - // * Example: Tue:17:00-Tue:17:30 + // * Example: + // Tue:17:00-Tue:17:30 PreferredMaintenanceWindow *string // Specifies the accessibility options for your database. A value of true specifies diff --git a/service/lightsail/deserializers.go b/service/lightsail/deserializers.go index 052fa10a454..fb7a450eb49 100644 --- a/service/lightsail/deserializers.go +++ b/service/lightsail/deserializers.go @@ -25070,6 +25070,55 @@ func awsAwsjson11_deserializeDocumentDistributionList(v *[]types.LightsailDistri return nil } +func awsAwsjson11_deserializeDocumentDnsRecordCreationState(v **types.DnsRecordCreationState, 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.DnsRecordCreationState + if *v == nil { + sv = &types.DnsRecordCreationState{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DnsRecordCreationStateCode to be of type string, got %T instead", value) + } + sv.Code = types.DnsRecordCreationStateCode(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDomain(v **types.Domain, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -25136,6 +25185,11 @@ func awsAwsjson11_deserializeDocumentDomain(v **types.Domain, value interface{}) sv.Name = ptr.String(jtv) } + case "registeredDomainDelegationInfo": + if err := awsAwsjson11_deserializeDocumentRegisteredDomainDelegationInfo(&sv.RegisteredDomainDelegationInfo, value); err != nil { + return err + } + case "resourceType": if value != nil { jtv, ok := value.(string) @@ -25375,6 +25429,11 @@ func awsAwsjson11_deserializeDocumentDomainValidationRecord(v **types.DomainVali for key, value := range shape { switch key { + case "dnsRecordCreationState": + if err := awsAwsjson11_deserializeDocumentDnsRecordCreationState(&sv.DnsRecordCreationState, value); err != nil { + return err + } + case "domainName": if value != nil { jtv, ok := value.(string) @@ -25389,6 +25448,15 @@ func awsAwsjson11_deserializeDocumentDomainValidationRecord(v **types.DomainVali return err } + case "validationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateDomainValidationStatus to be of type string, got %T instead", value) + } + sv.ValidationStatus = types.CertificateDomainValidationStatus(jtv) + } + default: _, _ = key, value @@ -28171,6 +28239,55 @@ func awsAwsjson11_deserializeDocumentLoadBalancerTlsCertificate(v **types.LoadBa return nil } +func awsAwsjson11_deserializeDocumentLoadBalancerTlsCertificateDnsRecordCreationState(v **types.LoadBalancerTlsCertificateDnsRecordCreationState, 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.LoadBalancerTlsCertificateDnsRecordCreationState + if *v == nil { + sv = &types.LoadBalancerTlsCertificateDnsRecordCreationState{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LoadBalancerTlsCertificateDnsRecordCreationStateCode to be of type string, got %T instead", value) + } + sv.Code = types.LoadBalancerTlsCertificateDnsRecordCreationStateCode(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentLoadBalancerTlsCertificateDomainValidationOption(v **types.LoadBalancerTlsCertificateDomainValidationOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -28276,6 +28393,11 @@ func awsAwsjson11_deserializeDocumentLoadBalancerTlsCertificateDomainValidationR for key, value := range shape { switch key { + case "dnsRecordCreationState": + if err := awsAwsjson11_deserializeDocumentLoadBalancerTlsCertificateDnsRecordCreationState(&sv.DnsRecordCreationState, value); err != nil { + return err + } + case "domainName": if value != nil { jtv, ok := value.(string) @@ -29080,6 +29202,55 @@ func awsAwsjson11_deserializeDocumentMonthlyTransfer(v **types.MonthlyTransfer, return nil } +func awsAwsjson11_deserializeDocumentNameServersUpdateState(v **types.NameServersUpdateState, 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.NameServersUpdateState + if *v == nil { + sv = &types.NameServersUpdateState{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameServersUpdateStateCode to be of type string, got %T instead", value) + } + sv.Code = types.NameServersUpdateStateCode(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -29899,6 +30070,55 @@ func awsAwsjson11_deserializeDocumentQueryStringObject(v **types.QueryStringObje return nil } +func awsAwsjson11_deserializeDocumentR53HostedZoneDeletionState(v **types.R53HostedZoneDeletionState, 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.R53HostedZoneDeletionState + if *v == nil { + sv = &types.R53HostedZoneDeletionState{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected R53HostedZoneDeletionStateCode to be of type string, got %T instead", value) + } + sv.Code = types.R53HostedZoneDeletionStateCode(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentRegion(v **types.Region, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -30010,6 +30230,47 @@ func awsAwsjson11_deserializeDocumentRegionList(v *[]types.Region, value interfa return nil } +func awsAwsjson11_deserializeDocumentRegisteredDomainDelegationInfo(v **types.RegisteredDomainDelegationInfo, 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.RegisteredDomainDelegationInfo + if *v == nil { + sv = &types.RegisteredDomainDelegationInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nameServersUpdateState": + if err := awsAwsjson11_deserializeDocumentNameServersUpdateState(&sv.NameServersUpdateState, value); err != nil { + return err + } + + case "r53HostedZoneDeletionState": + if err := awsAwsjson11_deserializeDocumentR53HostedZoneDeletionState(&sv.R53HostedZoneDeletionState, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentRelationalDatabase(v **types.RelationalDatabase, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/lightsail/doc.go b/service/lightsail/doc.go index aa653f53048..4110643de89 100644 --- a/service/lightsail/doc.go +++ b/service/lightsail/doc.go @@ -11,9 +11,8 @@ // content delivery network (CDN) distributions, DNS management of registered // domains, and resource snapshots (backups) - for a low, predictable monthly // price. You can manage your Lightsail resources using the Lightsail console, -// Lightsail API, AWS Command Line Interface (AWS CLI), or SDKs. For more -// information about Lightsail concepts and tasks, see the Amazon Lightsail -// Developer Guide +// Lightsail API, Command Line Interface (CLI), or SDKs. For more information about +// Lightsail concepts and tasks, see the Amazon Lightsail Developer Guide // (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-set-up-access-keys-to-use-sdk-api-cli). // This API Reference provides detailed information about the actions, data types, // parameters, and errors of the Lightsail service. For more information about the diff --git a/service/lightsail/types/enums.go b/service/lightsail/types/enums.go index cf2cd5eb3ac..d475135d8e8 100644 --- a/service/lightsail/types/enums.go +++ b/service/lightsail/types/enums.go @@ -194,6 +194,27 @@ func (BucketMetricName) Values() []BucketMetricName { } } +type CertificateDomainValidationStatus string + +// Enum values for CertificateDomainValidationStatus +const ( + CertificateDomainValidationStatusPendingValidation CertificateDomainValidationStatus = "PENDING_VALIDATION" + CertificateDomainValidationStatusFailed CertificateDomainValidationStatus = "FAILED" + CertificateDomainValidationStatusSuccess CertificateDomainValidationStatus = "SUCCESS" +) + +// Values returns all known values for CertificateDomainValidationStatus. 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 (CertificateDomainValidationStatus) Values() []CertificateDomainValidationStatus { + return []CertificateDomainValidationStatus{ + "PENDING_VALIDATION", + "FAILED", + "SUCCESS", + } +} + type CertificateStatus string // Enum values for CertificateStatus @@ -538,6 +559,26 @@ func (DistributionMetricName) Values() []DistributionMetricName { } } +type DnsRecordCreationStateCode string + +// Enum values for DnsRecordCreationStateCode +const ( + DnsRecordCreationStateCodeSucceeded DnsRecordCreationStateCode = "SUCCEEDED" + DnsRecordCreationStateCodeStarted DnsRecordCreationStateCode = "STARTED" + DnsRecordCreationStateCodeFailed DnsRecordCreationStateCode = "FAILED" +) + +// Values returns all known values for DnsRecordCreationStateCode. 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 (DnsRecordCreationStateCode) Values() []DnsRecordCreationStateCode { + return []DnsRecordCreationStateCode{ + "SUCCEEDED", + "STARTED", + "FAILED", + } +} + type ExportSnapshotRecordSourceType string // Enum values for ExportSnapshotRecordSourceType @@ -965,6 +1006,27 @@ func (LoadBalancerState) Values() []LoadBalancerState { } } +type LoadBalancerTlsCertificateDnsRecordCreationStateCode string + +// Enum values for LoadBalancerTlsCertificateDnsRecordCreationStateCode +const ( + LoadBalancerTlsCertificateDnsRecordCreationStateCodeSucceeded LoadBalancerTlsCertificateDnsRecordCreationStateCode = "SUCCEEDED" + LoadBalancerTlsCertificateDnsRecordCreationStateCodeStarted LoadBalancerTlsCertificateDnsRecordCreationStateCode = "STARTED" + LoadBalancerTlsCertificateDnsRecordCreationStateCodeFailed LoadBalancerTlsCertificateDnsRecordCreationStateCode = "FAILED" +) + +// Values returns all known values for +// LoadBalancerTlsCertificateDnsRecordCreationStateCode. 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 (LoadBalancerTlsCertificateDnsRecordCreationStateCode) Values() []LoadBalancerTlsCertificateDnsRecordCreationStateCode { + return []LoadBalancerTlsCertificateDnsRecordCreationStateCode{ + "SUCCEEDED", + "STARTED", + "FAILED", + } +} + type LoadBalancerTlsCertificateDomainStatus string // Enum values for LoadBalancerTlsCertificateDomainStatus @@ -1256,6 +1318,28 @@ func (MetricUnit) Values() []MetricUnit { } } +type NameServersUpdateStateCode string + +// Enum values for NameServersUpdateStateCode +const ( + NameServersUpdateStateCodeSucceeded NameServersUpdateStateCode = "SUCCEEDED" + NameServersUpdateStateCodePending NameServersUpdateStateCode = "PENDING" + NameServersUpdateStateCodeFailed NameServersUpdateStateCode = "FAILED" + NameServersUpdateStateCodeStarted NameServersUpdateStateCode = "STARTED" +) + +// Values returns all known values for NameServersUpdateStateCode. 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 (NameServersUpdateStateCode) Values() []NameServersUpdateStateCode { + return []NameServersUpdateStateCode{ + "SUCCEEDED", + "PENDING", + "FAILED", + "STARTED", + } +} + type NetworkProtocol string // Enum values for NetworkProtocol @@ -1552,6 +1636,29 @@ func (PortState) Values() []PortState { } } +type R53HostedZoneDeletionStateCode string + +// Enum values for R53HostedZoneDeletionStateCode +const ( + R53HostedZoneDeletionStateCodeSucceeded R53HostedZoneDeletionStateCode = "SUCCEEDED" + R53HostedZoneDeletionStateCodePending R53HostedZoneDeletionStateCode = "PENDING" + R53HostedZoneDeletionStateCodeFailed R53HostedZoneDeletionStateCode = "FAILED" + R53HostedZoneDeletionStateCodeStarted R53HostedZoneDeletionStateCode = "STARTED" +) + +// Values returns all known values for R53HostedZoneDeletionStateCode. 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 (R53HostedZoneDeletionStateCode) Values() []R53HostedZoneDeletionStateCode { + return []R53HostedZoneDeletionStateCode{ + "SUCCEEDED", + "PENDING", + "FAILED", + "STARTED", + } +} + type RecordState string // Enum values for RecordState diff --git a/service/lightsail/types/types.go b/service/lightsail/types/types.go index 194c4522313..c13cff85483 100644 --- a/service/lightsail/types/types.go +++ b/service/lightsail/types/types.go @@ -56,12 +56,12 @@ type AccessKeyLastUsed struct { // if the access key has not been used. LastUsedDate *time.Time - // The AWS Region where this access key was most recently used. This value is N/A - // if the access key has not been used. + // The Amazon Web Services Region where this access key was most recently used. + // This value is N/A if the access key has not been used. Region *string - // The name of the AWS service with which this access key was most recently used. - // This value is N/A if the access key has not been used. + // The name of the Amazon Web Services service with which this access key was most + // recently used. This value is N/A if the access key has not been used. ServiceName *string noSmithyDocumentSerde @@ -889,24 +889,24 @@ type Certificate struct { // ADDITIONAL_VERIFICATION_REQUIRED - Lightsail requires additional information to // process this certificate request. This can happen as a fraud-protection measure, // such as when the domain ranks within the Alexa top 1000 websites. To provide the - // required information, use the AWS Support Center - // (https://console.aws.amazon.com/support/home) to contact AWS Support. You cannot - // request a certificate for Amazon-owned domain names such as those ending in - // amazonaws.com, cloudfront.net, or elasticbeanstalk.com. + // required information, use the Amazon Web Services Support Center + // (https://console.aws.amazon.com/support/home) to contact Amazon Web Services + // Support. You cannot request a certificate for Amazon-owned domain names such as + // those ending in amazonaws.com, cloudfront.net, or elasticbeanstalk.com. // - // * DOMAIN_NOT_ALLOWED - - // One or more of the domain names in the certificate request was reported as an - // unsafe domain by VirusTotal (https://www.virustotal.com/gui/home/url). To - // correct the problem, search for your domain name on the VirusTotal - // (https://www.virustotal.com/gui/home/url) website. If your domain is reported as - // suspicious, see Google Help for Hacked Websites - // (https://developers.google.com/web/fundamentals/security/hacked) to learn what - // you can do. If you believe that the result is a false positive, notify the - // organization that is reporting the domain. VirusTotal is an aggregate of several - // antivirus and URL scanners and cannot remove your domain from a block list - // itself. After you correct the problem and the VirusTotal registry has been + // * + // DOMAIN_NOT_ALLOWED - One or more of the domain names in the certificate request + // was reported as an unsafe domain by VirusTotal + // (https://www.virustotal.com/gui/home/url). To correct the problem, search for + // your domain name on the VirusTotal (https://www.virustotal.com/gui/home/url) + // website. If your domain is reported as suspicious, see Google Help for Hacked + // Websites (https://developers.google.com/web/fundamentals/security/hacked) to + // learn what you can do. If you believe that the result is a false positive, + // notify the organization that is reporting the domain. VirusTotal is an aggregate + // of several antivirus and URL scanners and cannot remove your domain from a block + // list itself. After you correct the problem and the VirusTotal registry has been // updated, request a new certificate. If you see this error and your domain is not - // included in the VirusTotal list, visit the AWS Support Center + // included in the VirusTotal list, visit the Amazon Web Services Support Center // (https://console.aws.amazon.com/support/home) and create a case. // // * @@ -1718,6 +1718,39 @@ type DistributionBundle struct { noSmithyDocumentSerde } +// Describes the creation state of the canonical name (CNAME) records that are +// automatically added by Amazon Lightsail to the DNS of a domain to validate +// domain ownership for an SSL/TLS certificate. When you create an SSL/TLS +// certificate for a Lightsail resource, you must add a set of CNAME records to the +// DNS of the domains for the certificate to validate that you own the domains. +// Lightsail can automatically add the CNAME records to the DNS of the domain if +// the DNS zone for the domain exists within your Lightsail account. If automatic +// record addition fails, or if you manage the DNS of your domain using a +// third-party service, then you must manually add the CNAME records to the DNS of +// your domain. For more information, see Verify an SSL/TLS certificate in Amazon +// Lightsail +// (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/verify-tls-ssl-certificate-using-dns-cname-https) +// in the Amazon Lightsail Developer Guide. +type DnsRecordCreationState struct { + + // The status code for the automated DNS record creation. Following are the + // possible values: + // + // * SUCCEEDED - The validation records were successfully added + // to the domain. + // + // * STARTED - The automatic DNS record creation has started. + // + // * + // FAILED - The validation records failed to be added to the domain. + Code DnsRecordCreationStateCode + + // The message that describes the reason for the status code. + Message *string + + noSmithyDocumentSerde +} + // Describes a domain where you are storing recordsets. type Domain struct { @@ -1737,6 +1770,10 @@ type Domain struct { // The name of the domain. Name *string + // An object that describes the state of the Route 53 domain delegation to a + // Lightsail DNS zone. + RegisteredDomainDelegationInfo *RegisteredDomainDelegationInfo + // The resource type. ResourceType ResourceType @@ -1808,10 +1845,16 @@ type DomainEntry struct { noSmithyDocumentSerde } -// Describes the domain validation records of an Amazon Lightsail SSL/TLS +// Describes the domain name system (DNS) records that you must add to the DNS of +// your registered domain to validate ownership for an Amazon Lightsail SSL/TLS // certificate. type DomainValidationRecord struct { + // An object that describes the state of the canonical name (CNAME) records that + // are automatically added by Lightsail to the DNS of the domain to validate domain + // ownership. + DnsRecordCreationState *DnsRecordCreationState + // The domain name of the certificate validation record. For example, example.com // or www.example.com. DomainName *string @@ -1820,6 +1863,9 @@ type DomainValidationRecord struct { // it for the certificate. ResourceRecord *ResourceRecord + // The validation status of the record. + ValidationStatus CertificateDomainValidationStatus + noSmithyDocumentSerde } @@ -2904,7 +2950,8 @@ type LoadBalancerTlsCertificate struct { // The load balancer name where your SSL/TLS certificate is attached. LoadBalancerName *string - // The AWS Region and Availability Zone where you created your certificate. + // The Amazon Web Services Region and Availability Zone where you created your + // certificate. Location *ResourceLocation // The name of the SSL/TLS certificate (e.g., my-certificate). @@ -2987,6 +3034,29 @@ type LoadBalancerTlsCertificate struct { noSmithyDocumentSerde } +// An object that describes the state of the canonical name (CNAME) records that +// are automatically added by Lightsail to the DNS of the domain to validate domain +// ownership. +type LoadBalancerTlsCertificateDnsRecordCreationState struct { + + // The status code for the automated DNS record creation. Following are the + // possible values: + // + // * SUCCEEDED - The validation records were successfully + // added. + // + // * STARTED - The automatic DNS record creation has started. + // + // * FAILED - + // The validation record addition failed. + Code LoadBalancerTlsCertificateDnsRecordCreationStateCode + + // The message that describes the reason for the status code. + Message *string + + noSmithyDocumentSerde +} + // Contains information about the domain names on an SSL/TLS certificate that you // will use to validate domain ownership. type LoadBalancerTlsCertificateDomainValidationOption struct { @@ -3003,6 +3073,11 @@ type LoadBalancerTlsCertificateDomainValidationOption struct { // Describes the validation record of each domain name in the SSL/TLS certificate. type LoadBalancerTlsCertificateDomainValidationRecord struct { + // An object that describes the state of the canonical name (CNAME) records that + // are automatically added by Lightsail to the DNS of a domain to validate domain + // ownership. + DnsRecordCreationState *LoadBalancerTlsCertificateDnsRecordCreationState + // The domain name against which your SSL/TLS certificate was validated. DomainName *string @@ -3182,6 +3257,34 @@ type MonthlyTransfer struct { noSmithyDocumentSerde } +// Describes the state of the name server records update made by Amazon Lightsail +// to an Amazon Route 53 registered domain. For more information, see DNS in Amazon +// Lightsail +// (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/understanding-dns-in-amazon-lightsail) +// in the Amazon Lightsail Developer Guide. +type NameServersUpdateState struct { + + // The status code for the name servers update. Following are the possible + // values: + // + // * SUCCEEDED - The name server records were successfully updated. + // + // * + // PENDING - The name server record update is in progress. + // + // * FAILED - The name + // server record update failed. + // + // * STARTED - The automatic name server record + // update started. + Code NameServersUpdateStateCode + + // The message that describes the reason for the status code. + Message *string + + noSmithyDocumentSerde +} + // Describes the API operation. type Operation struct { @@ -3455,7 +3558,31 @@ type QueryStringObject struct { noSmithyDocumentSerde } -// Describes the AWS Region. +// Describes the deletion state of an Amazon Route 53 hosted zone for a domain that +// is being automatically delegated to an Amazon Lightsail DNS zone. +type R53HostedZoneDeletionState struct { + + // The status code for the deletion state. Following are the possible values: + // + // * + // SUCCEEDED - The hosted zone was successfully deleted. + // + // * PENDING - The hosted + // zone deletion is in progress. + // + // * FAILED - The hosted zone deletion failed. + // + // * + // STARTED - The hosted zone deletion started. + Code R53HostedZoneDeletionStateCode + + // The message that describes the reason for the status code. + Message *string + + noSmithyDocumentSerde +} + +// Describes the Amazon Web Services Region. type Region struct { // The Availability Zones. Follows the format us-east-2a (case-sensitive). @@ -3464,8 +3591,8 @@ type Region struct { // The continent code (e.g., NA, meaning North America). ContinentCode *string - // The description of the AWS Region (e.g., This region is recommended to serve - // users in the eastern United States and eastern Canada). + // The description of the Amazon Web Services Region (e.g., This region is + // recommended to serve users in the eastern United States and eastern Canada). Description *string // The display name (e.g., Ohio). @@ -3481,6 +3608,46 @@ type Region struct { noSmithyDocumentSerde } +// Describes the delegation state of an Amazon Route 53 registered domain to Amazon +// Lightsail. When you delegate an Amazon Route 53 registered domain to Lightsail, +// you can manage the DNS of the domain using a Lightsail DNS zone. You no longer +// use the Route 53 hosted zone to manage the DNS of the domain. To delegate the +// domain, Lightsail automatically updates the domain's name servers in Route 53 to +// the name servers of the Lightsail DNS zone. Then, Lightsail automatically +// deletes the Route 53 hosted zone for the domain. All of the following conditions +// must be true for automatic domain delegation to be successful: +// +// * The registered +// domain must be in the same Amazon Web Services account as the Lightsail account +// making the request. +// +// * The user or entity making the request must have +// permission to manage domains in Route 53. +// +// * The Route 53 hosted zone for the +// domain must be empty. It cannot contain DNS records other than start of +// authority (SOA) and name server records. +// +// If automatic domain delegation fails, +// or if you manage the DNS of your domain using a service other than Route 53, +// then you must manually add the Lightsail DNS zone name servers to your domain in +// order to delegate management of its DNS to Lightsail. For more information, see +// Creating a DNS zone to manage your domain’s records in Amazon Lightsail +// (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-create-dns-entry) +// in the Amazon Lightsail Developer Guide. +type RegisteredDomainDelegationInfo struct { + + // An object that describes the state of the name server records that are + // automatically added to the Route 53 domain by Lightsail. + NameServersUpdateState *NameServersUpdateState + + // Describes the deletion state of an Amazon Route 53 hosted zone for a domain that + // is being automatically delegated to an Amazon Lightsail DNS zone. + R53HostedZoneDeletionState *R53HostedZoneDeletionState + + noSmithyDocumentSerde +} + // Describes a database. type RelationalDatabase struct { @@ -3815,7 +3982,7 @@ type ResourceLocation struct { // The Availability Zone. Follows the format us-east-2a (case-sensitive). AvailabilityZone *string - // The AWS Region name. + // The Amazon Web Services Region name. RegionName RegionName noSmithyDocumentSerde diff --git a/service/opensearch/api_op_AcceptInboundConnection.go b/service/opensearch/api_op_AcceptInboundConnection.go index 6341d63ac01..121d8ae4e24 100644 --- a/service/opensearch/api_op_AcceptInboundConnection.go +++ b/service/opensearch/api_op_AcceptInboundConnection.go @@ -11,8 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allows the remote domain owner to accept an inbound cross-cluster connection -// request. +// Allows the destination Amazon OpenSearch Service domain owner to accept an +// inbound cross-cluster search connection request. For more information, see +// Cross-cluster search for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html). func (c *Client) AcceptInboundConnection(ctx context.Context, params *AcceptInboundConnectionInput, optFns ...func(*Options)) (*AcceptInboundConnectionOutput, error) { if params == nil { params = &AcceptInboundConnectionInput{} @@ -31,7 +33,7 @@ func (c *Client) AcceptInboundConnection(ctx context.Context, params *AcceptInbo // Container for the parameters to the AcceptInboundConnection operation. type AcceptInboundConnectionInput struct { - // The ID of the inbound connection you want to accept. + // The ID of the inbound connection to accept. // // This member is required. ConnectionId *string @@ -39,11 +41,10 @@ type AcceptInboundConnectionInput struct { noSmithyDocumentSerde } -// The result of an AcceptInboundConnection operation. Contains details about the -// accepted inbound connection. +// Contains details about the accepted inbound connection. type AcceptInboundConnectionOutput struct { - // The InboundConnection of the accepted inbound connection. + // Information about the accepted inbound connection. Connection *types.InboundConnection // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_AddTags.go b/service/opensearch/api_op_AddTags.go index 08a4da019d8..f49d36b7a38 100644 --- a/service/opensearch/api_op_AddTags.go +++ b/service/opensearch/api_op_AddTags.go @@ -11,11 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Attaches tags to an existing domain. Tags are a set of case-sensitive key value -// pairs. An domain can have up to 10 tags. See Tagging Amazon OpenSearch Service -// domains -// (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains.html#managedomains-awsresorcetagging) -// for more information. +// Attaches tags to an existing Amazon OpenSearch Service domain. Tags are a set of +// case-sensitive key-value pairs. An domain can have up to 10 tags. For more +// information, see Tagging Amazon OpenSearch Service domains +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains.html#managedomains-awsresorcetagging). func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...func(*Options)) (*AddTagsOutput, error) { if params == nil { params = &AddTagsInput{} @@ -35,12 +34,13 @@ func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...fu // attach to the domain. type AddTagsInput struct { - // Specify the ARN of the domain you want to add tags to. + // Amazon Resource Name (ARN) for the OpenSearch Service domain to which you want + // to attach resource tags. // // This member is required. ARN *string - // List of Tag to add to the domain. + // List of resource tags. // // This member is required. TagList []types.Tag diff --git a/service/opensearch/api_op_AssociatePackage.go b/service/opensearch/api_op_AssociatePackage.go index 4939d46710c..ecf07ba975a 100644 --- a/service/opensearch/api_op_AssociatePackage.go +++ b/service/opensearch/api_op_AssociatePackage.go @@ -11,7 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Associates a package with an Amazon OpenSearch Service domain. +// Associates a package with an Amazon OpenSearch Service domain. For more +// information, see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) AssociatePackage(ctx context.Context, params *AssociatePackageInput, optFns ...func(*Options)) (*AssociatePackageOutput, error) { if params == nil { params = &AssociatePackageInput{} @@ -30,7 +32,7 @@ func (c *Client) AssociatePackage(ctx context.Context, params *AssociatePackageI // Container for the request parameters to the AssociatePackage operation. type AssociatePackageInput struct { - // The name of the domain to associate the package with. + // Name of the domain to associate the package with. // // This member is required. DomainName *string @@ -44,10 +46,10 @@ type AssociatePackageInput struct { noSmithyDocumentSerde } -// Container for the response returned by AssociatePackage operation. +// Container for the response returned by the AssociatePackage operation. type AssociatePackageOutput struct { - // DomainPackageDetails + // Information about a package that is associated with a domain. DomainPackageDetails *types.DomainPackageDetails // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_AuthorizeVpcEndpointAccess.go b/service/opensearch/api_op_AuthorizeVpcEndpointAccess.go new file mode 100644 index 00000000000..6a52b0bcdd8 --- /dev/null +++ b/service/opensearch/api_op_AuthorizeVpcEndpointAccess.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides access to an Amazon OpenSearch Service domain through the use of an +// interface VPC endpoint. +func (c *Client) AuthorizeVpcEndpointAccess(ctx context.Context, params *AuthorizeVpcEndpointAccessInput, optFns ...func(*Options)) (*AuthorizeVpcEndpointAccessOutput, error) { + if params == nil { + params = &AuthorizeVpcEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AuthorizeVpcEndpointAccess", params, optFns, c.addOperationAuthorizeVpcEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AuthorizeVpcEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AuthorizeVpcEndpointAccessInput struct { + + // The Amazon Web Services account ID to grant access to. + // + // This member is required. + Account *string + + // The name of the OpenSearch Service domain to provide access to. + // + // This member is required. + DomainName *string + + noSmithyDocumentSerde +} + +type AuthorizeVpcEndpointAccessOutput struct { + + // Information about the Amazon Web Services account or service that was provided + // access to the domain. + // + // This member is required. + AuthorizedPrincipal *types.AuthorizedPrincipal + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAuthorizeVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAuthorizeVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAuthorizeVpcEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAuthorizeVpcEndpointAccess(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opAuthorizeVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "AuthorizeVpcEndpointAccess", + } +} diff --git a/service/opensearch/api_op_CancelServiceSoftwareUpdate.go b/service/opensearch/api_op_CancelServiceSoftwareUpdate.go index bd60db64a7a..d72ea1ac282 100644 --- a/service/opensearch/api_op_CancelServiceSoftwareUpdate.go +++ b/service/opensearch/api_op_CancelServiceSoftwareUpdate.go @@ -13,7 +13,9 @@ import ( // Cancels a scheduled service software update for an Amazon OpenSearch Service // domain. You can only perform this operation before the AutomatedUpdateDate and -// when the UpdateStatus is in the PENDING_UPDATE state. +// when the domain's UpdateStatus is PENDING_UPDATE. For more information, see +// Service software updates in Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html). func (c *Client) CancelServiceSoftwareUpdate(ctx context.Context, params *CancelServiceSoftwareUpdateInput, optFns ...func(*Options)) (*CancelServiceSoftwareUpdateOutput, error) { if params == nil { params = &CancelServiceSoftwareUpdateInput{} @@ -29,13 +31,11 @@ func (c *Client) CancelServiceSoftwareUpdate(ctx context.Context, params *Cancel return out, nil } -// Container for the parameters to the CancelServiceSoftwareUpdate operation. -// Specifies the name of the domain that you wish to cancel a service software -// update on. +// Container for the request parameters to cancel a service software update. type CancelServiceSoftwareUpdateInput struct { - // The name of the domain that you want to stop the latest service software update - // on. + // Name of the OpenSearch Service domain that you want to cancel the service + // software update on. // // This member is required. DomainName *string @@ -43,11 +43,11 @@ type CancelServiceSoftwareUpdateInput struct { noSmithyDocumentSerde } -// The result of a CancelServiceSoftwareUpdate operation. Contains the status of -// the update. +// Container for the response to a CancelServiceSoftwareUpdate operation. Contains +// the status of the update. type CancelServiceSoftwareUpdateOutput struct { - // The current status of the OpenSearch service software update. + // Container for the state of your domain relative to the latest service software. ServiceSoftwareOptions *types.ServiceSoftwareOptions // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_CreateDomain.go b/service/opensearch/api_op_CreateDomain.go index 4425b099e86..1c836ec4042 100644 --- a/service/opensearch/api_op_CreateDomain.go +++ b/service/opensearch/api_op_CreateDomain.go @@ -11,10 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new Amazon OpenSearch Service domain. For more information, see -// Creating and managing Amazon OpenSearch Service domains -// (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html) -// in the Amazon OpenSearch Service Developer Guide. +// Creates an Amazon OpenSearch Service domain. For more information, see Creating +// and managing Amazon OpenSearch Service domains +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html). func (c *Client) CreateDomain(ctx context.Context, params *CreateDomainInput, optFns ...func(*Options)) (*CreateDomainOutput, error) { if params == nil { params = &CreateDomainInput{} @@ -32,81 +31,104 @@ func (c *Client) CreateDomain(ctx context.Context, params *CreateDomainInput, op type CreateDomainInput struct { - // The name of the Amazon OpenSearch Service domain you're creating. Domain names - // are unique across the domains owned by an account within an AWS region. Domain - // names must start with a lowercase letter and can contain the following - // characters: a-z (lowercase), 0-9, and - (hyphen). + // Name of the OpenSearch Service domain to create. Domain names are unique across + // the domains owned by an account within an Amazon Web Services Region. // // This member is required. DomainName *string - // IAM access policy as a JSON-formatted string. + // Identity and Access Management (IAM) policy document specifying the access + // policies for the new domain. AccessPolicies *string - // Option to allow references to indices in an HTTP request body. Must be false - // when configuring access to individual sub-resources. By default, the value is - // true. See Advanced cluster parameters - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) - // for more information. + // Key-value pairs to specify advanced configuration options. The following + // key-value pairs are supported: + // + // * "rest.action.multi.allow_explicit_index": + // "true" | "false" - Note the use of a string rather than a boolean. Specifies + // whether explicit references to indexes are allowed inside the body of HTTP + // requests. If you want to configure access policies for domain sub-resources, + // such as specific indexes and domain APIs, you must disable this property. + // Default is true. + // + // * "indices.fielddata.cache.size": "80" - Note the use of a + // string rather than a boolean. Specifies the percentage of heap space allocated + // to field data. Default is unbounded. + // + // * "indices.query.bool.max_clause_count": + // "1024" - Note the use of a string rather than a boolean. Specifies the maximum + // number of clauses allowed in a Lucene boolean query. Default is 1,024. Queries + // with more than the permitted number of clauses result in a TooManyClauses + // error. + // + // * "override_main_response_version": "true" | "false" - Note the use of a + // string rather than a boolean. Specifies whether the domain reports its version + // as 7.10 to allow Elasticsearch OSS clients and plugins to continue working with + // it. Default is false when creating a domain and true when upgrading a + // domain. + // + // For more information, see Advanced cluster parameters + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options). AdvancedOptions map[string]string - // Specifies advanced security options. + // Options for fine-grained access control. AdvancedSecurityOptions *types.AdvancedSecurityOptionsInput - // Specifies Auto-Tune options. + // Options for Auto-Tune. AutoTuneOptions *types.AutoTuneOptionsInput - // Configuration options for a domain. Specifies the instance type and number of - // instances in the domain. + // Container for the cluster configuration of a domain. ClusterConfig *types.ClusterConfig - // Options to specify the Cognito user and identity pools for OpenSearch Dashboards - // authentication. For more information, see Configuring Amazon Cognito - // authentication for OpenSearch Dashboards - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html). + // Key-value pairs to configure Amazon Cognito authentication. For more + // information, see Configuring Amazon Cognito authentication for OpenSearch + // Dashboards + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html). CognitoOptions *types.CognitoOptions - // Options to specify configurations that will be applied to the domain endpoint. + // Additional options for the domain endpoint, such as whether to require HTTPS for + // all traffic. DomainEndpointOptions *types.DomainEndpointOptions - // Options to enable, disable, and specify the type and size of EBS storage - // volumes. + // Container for the parameters required to enable EBS-based storage for an + // OpenSearch Service domain. EBSOptions *types.EBSOptions - // Options for encryption of data at rest. + // Key-value pairs to enable encryption at rest. EncryptionAtRestOptions *types.EncryptionAtRestOptions // String of format Elasticsearch_X.Y or OpenSearch_X.Y to specify the engine - // version for the Amazon OpenSearch Service domain. For example, "OpenSearch_1.0" - // or "Elasticsearch_7.9". For more information, see Creating and managing Amazon + // version for the OpenSearch Service domain. For example, OpenSearch_1.0 or + // Elasticsearch_7.9. For more information, see Creating and managing Amazon // OpenSearch Service domains - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomains). + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomains). EngineVersion *string - // Map of LogType and LogPublishingOption, each containing options to publish a - // given type of OpenSearch log. + // Key-value pairs to configure slow log publishing. LogPublishingOptions map[string]types.LogPublishingOption - // Node-to-node encryption options. + // Enables node-to-node encryption. NodeToNodeEncryptionOptions *types.NodeToNodeEncryptionOptions - // Option to set time, in UTC format, of the daily automated snapshot. Default - // value is 0 hours. + // DEPRECATED. Container for the parameters required to configure automated + // snapshots of domain indexes. SnapshotOptions *types.SnapshotOptions - // A list of Tag added during domain creation. + // List of tags to add to the domain upon creation. TagList []types.Tag - // Options to specify the subnets and security groups for a VPC endpoint. For more - // information, see Launching your Amazon OpenSearch Service domains using a VPC - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). + // Container for the values required to configure VPC access domains. If you don't + // specify these values, OpenSearch Service creates the domain with a public + // endpoint. For more information, see Launching your Amazon OpenSearch Service + // domains using a VPC + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). VPCOptions *types.VPCOptions noSmithyDocumentSerde } // The result of a CreateDomain operation. Contains the status of the newly created -// Amazon OpenSearch Service domain. +// domain. type CreateDomainOutput struct { // The status of the newly created domain. diff --git a/service/opensearch/api_op_CreateOutboundConnection.go b/service/opensearch/api_op_CreateOutboundConnection.go index fc4fbaa1a48..4f1280c1d3b 100644 --- a/service/opensearch/api_op_CreateOutboundConnection.go +++ b/service/opensearch/api_op_CreateOutboundConnection.go @@ -11,8 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new cross-cluster connection from a local OpenSearch domain to a -// remote OpenSearch domain. +// Creates a new cross-cluster search connection from a source Amazon OpenSearch +// Service domain to a destination domain. For more information, see Cross-cluster +// search for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html). func (c *Client) CreateOutboundConnection(ctx context.Context, params *CreateOutboundConnectionInput, optFns ...func(*Options)) (*CreateOutboundConnectionOutput, error) { if params == nil { params = &CreateOutboundConnectionInput{} @@ -31,18 +33,17 @@ func (c *Client) CreateOutboundConnection(ctx context.Context, params *CreateOut // Container for the parameters to the CreateOutboundConnection operation. type CreateOutboundConnectionInput struct { - // The connection alias used used by the customer for this cross-cluster - // connection. + // Name of the connection. // // This member is required. ConnectionAlias *string - // The AWSDomainInformation for the local OpenSearch domain. + // Name and Region of the source (local) domain. // // This member is required. LocalDomainInfo *types.DomainInformationContainer - // The AWSDomainInformation for the remote OpenSearch domain. + // Name and Region of the destination (remote) domain. // // This member is required. RemoteDomainInfo *types.DomainInformationContainer @@ -50,24 +51,24 @@ type CreateOutboundConnectionInput struct { noSmithyDocumentSerde } -// The result of a CreateOutboundConnection request. Contains the details about the +// The result of a CreateOutboundConnection request. Contains details about the // newly created cross-cluster connection. type CreateOutboundConnectionOutput struct { - // The connection alias provided during the create connection request. + // Name of the connection. ConnectionAlias *string - // The unique ID for the created outbound connection, which is used for subsequent - // operations on the connection. + // The unique identifier for the created outbound connection, which is used for + // subsequent operations on the connection. ConnectionId *string - // The OutboundConnectionStatus for the newly created connection. + // The status of the connection. ConnectionStatus *types.OutboundConnectionStatus - // The AWSDomainInformation for the local OpenSearch domain. + // Information about the source (local) domain. LocalDomainInfo *types.DomainInformationContainer - // The AWSDomainInformation for the remote OpenSearch domain. + // Information about the destination (remote) domain. RemoteDomainInfo *types.DomainInformationContainer // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_CreatePackage.go b/service/opensearch/api_op_CreatePackage.go index 16b4086b835..81da072975d 100644 --- a/service/opensearch/api_op_CreatePackage.go +++ b/service/opensearch/api_op_CreatePackage.go @@ -11,7 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Create a package for use with Amazon OpenSearch Service domains. +// Creates a package for use with Amazon OpenSearch Service domains. For more +// information, see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) CreatePackage(ctx context.Context, params *CreatePackageInput, optFns ...func(*Options)) (*CreatePackageOutput, error) { if params == nil { params = &CreatePackageInput{} @@ -30,7 +32,7 @@ func (c *Client) CreatePackage(ctx context.Context, params *CreatePackageInput, // Container for request parameters to the CreatePackage operation. type CreatePackageInput struct { - // Unique identifier for the package. + // Unique name for the package. // // This member is required. PackageName *string @@ -40,7 +42,7 @@ type CreatePackageInput struct { // This member is required. PackageSource *types.PackageSource - // Type of package. Currently supports only TXT-DICTIONARY. + // Type of package. // // This member is required. PackageType types.PackageType @@ -54,7 +56,7 @@ type CreatePackageInput struct { // Container for the response returned by the CreatePackage operation. type CreatePackageOutput struct { - // Information about the package. + // Basic information about an OpenSearch Service package. PackageDetails *types.PackageDetails // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_CreateVpcEndpoint.go b/service/opensearch/api_op_CreateVpcEndpoint.go new file mode 100644 index 00000000000..08d0e31bf33 --- /dev/null +++ b/service/opensearch/api_op_CreateVpcEndpoint.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon OpenSearch Service-managed VPC endpoint. +func (c *Client) CreateVpcEndpoint(ctx context.Context, params *CreateVpcEndpointInput, optFns ...func(*Options)) (*CreateVpcEndpointOutput, error) { + if params == nil { + params = &CreateVpcEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateVpcEndpoint", params, optFns, c.addOperationCreateVpcEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateVpcEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateVpcEndpointInput struct { + + // The Amazon Resource Name (ARN) of the domain to grant access to. + // + // This member is required. + DomainArn *string + + // Options to specify the subnets and security groups for the endpoint. + // + // This member is required. + VpcOptions *types.VPCOptions + + // Unique, case-sensitive identifier to ensure idempotency of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreateVpcEndpointOutput struct { + + // Information about the newly created VPC endpoint. + // + // This member is required. + VpcEndpoint *types.VpcEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateVpcEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVpcEndpoint(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "CreateVpcEndpoint", + } +} diff --git a/service/opensearch/api_op_DeleteDomain.go b/service/opensearch/api_op_DeleteDomain.go index 4679e28fd14..7fb9c8c72e2 100644 --- a/service/opensearch/api_op_DeleteDomain.go +++ b/service/opensearch/api_op_DeleteDomain.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Permanently deletes the specified domain and all of its data. Once a domain is -// deleted, it cannot be recovered. +// Deletes an Amazon OpenSearch Service domain and all of its data. You can't +// recover a domain after you delete it. func (c *Client) DeleteDomain(ctx context.Context, params *DeleteDomainInput, optFns ...func(*Options)) (*DeleteDomainOutput, error) { if params == nil { params = &DeleteDomainInput{} @@ -28,8 +28,7 @@ func (c *Client) DeleteDomain(ctx context.Context, params *DeleteDomainInput, op return out, nil } -// Container for the parameters to the DeleteDomain operation. Specifies the name -// of the domain you want to delete. +// Container for the parameters to the DeleteDomain operation. type DeleteDomainInput struct { // The name of the domain you want to permanently delete. @@ -40,7 +39,7 @@ type DeleteDomainInput struct { noSmithyDocumentSerde } -// The result of a DeleteDomain request. Contains the status of the pending +// The results of a DeleteDomain request. Contains the status of the pending // deletion, or a "domain not found" error if the domain and all of its resources // have been deleted. type DeleteDomainOutput struct { diff --git a/service/opensearch/api_op_DeleteInboundConnection.go b/service/opensearch/api_op_DeleteInboundConnection.go index 01ae3228a7b..647a1bd9bff 100644 --- a/service/opensearch/api_op_DeleteInboundConnection.go +++ b/service/opensearch/api_op_DeleteInboundConnection.go @@ -11,8 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allows the remote domain owner to delete an existing inbound cross-cluster -// connection. +// Allows the destination Amazon OpenSearch Service domain owner to delete an +// existing inbound cross-cluster search connection. For more information, see +// Cross-cluster search for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html). func (c *Client) DeleteInboundConnection(ctx context.Context, params *DeleteInboundConnectionInput, optFns ...func(*Options)) (*DeleteInboundConnectionOutput, error) { if params == nil { params = &DeleteInboundConnectionInput{} @@ -39,11 +41,11 @@ type DeleteInboundConnectionInput struct { noSmithyDocumentSerde } -// The result of a DeleteInboundConnection operation. Contains details about the +// The results of a DeleteInboundConnection operation. Contains details about the // deleted inbound connection. type DeleteInboundConnectionOutput struct { - // The InboundConnection of the deleted inbound connection. + // The deleted inbound connection. Connection *types.InboundConnection // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_DeleteOutboundConnection.go b/service/opensearch/api_op_DeleteOutboundConnection.go index 08de2a84f0f..ebfd82ec690 100644 --- a/service/opensearch/api_op_DeleteOutboundConnection.go +++ b/service/opensearch/api_op_DeleteOutboundConnection.go @@ -11,8 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allows the local domain owner to delete an existing outbound cross-cluster -// connection. +// Allows the source Amazon OpenSearch Service domain owner to delete an existing +// outbound cross-cluster search connection. For more information, see +// Cross-cluster search for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html). func (c *Client) DeleteOutboundConnection(ctx context.Context, params *DeleteOutboundConnectionInput, optFns ...func(*Options)) (*DeleteOutboundConnectionOutput, error) { if params == nil { params = &DeleteOutboundConnectionInput{} @@ -39,11 +41,10 @@ type DeleteOutboundConnectionInput struct { noSmithyDocumentSerde } -// The result of a DeleteOutboundConnection operation. Contains details about the -// deleted outbound connection. +// Details about the deleted outbound connection. type DeleteOutboundConnectionOutput struct { - // The OutboundConnection of the deleted outbound connection. + // The deleted inbound connection. Connection *types.OutboundConnection // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_DeletePackage.go b/service/opensearch/api_op_DeletePackage.go index cf5be29d525..71c56c2296e 100644 --- a/service/opensearch/api_op_DeletePackage.go +++ b/service/opensearch/api_op_DeletePackage.go @@ -11,7 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the package. +// Deletes an Amazon OpenSearch Service package. For more information, see Custom +// packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) DeletePackage(ctx context.Context, params *DeletePackageInput, optFns ...func(*Options)) (*DeletePackageOutput, error) { if params == nil { params = &DeletePackageInput{} @@ -27,7 +29,8 @@ func (c *Client) DeletePackage(ctx context.Context, params *DeletePackageInput, return out, nil } -// Container for the request parameters to the DeletePackage operation. +// Deletes a package from OpenSearch Service. The package can't be associated with +// any OpenSearch Service domain. type DeletePackageInput struct { // The internal ID of the package you want to delete. Use DescribePackages to find @@ -42,7 +45,7 @@ type DeletePackageInput struct { // Container for the response parameters to the DeletePackage operation. type DeletePackageOutput struct { - // PackageDetails + // Information about the deleted package. PackageDetails *types.PackageDetails // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_DeleteVpcEndpoint.go b/service/opensearch/api_op_DeleteVpcEndpoint.go new file mode 100644 index 00000000000..6f182270d02 --- /dev/null +++ b/service/opensearch/api_op_DeleteVpcEndpoint.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Amazon OpenSearch Service-managed interface VPC endpoint. +func (c *Client) DeleteVpcEndpoint(ctx context.Context, params *DeleteVpcEndpointInput, optFns ...func(*Options)) (*DeleteVpcEndpointOutput, error) { + if params == nil { + params = &DeleteVpcEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVpcEndpoint", params, optFns, c.addOperationDeleteVpcEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVpcEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVpcEndpointInput struct { + + // The unique identifier of the endpoint. + // + // This member is required. + VpcEndpointId *string + + noSmithyDocumentSerde +} + +type DeleteVpcEndpointOutput struct { + + // Information about the deleted endpoint, including its current status (DELETING + // or DELETE_FAILED). + // + // This member is required. + VpcEndpointSummary *types.VpcEndpointSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVpcEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVpcEndpoint(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "DeleteVpcEndpoint", + } +} diff --git a/service/opensearch/api_op_DescribeDomain.go b/service/opensearch/api_op_DescribeDomain.go index 79ea32dc0fa..798fc6871c8 100644 --- a/service/opensearch/api_op_DescribeDomain.go +++ b/service/opensearch/api_op_DescribeDomain.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns domain configuration information about the specified domain, including -// the domain ID, domain endpoint, and domain ARN. +// Describes the domain configuration for the specified Amazon OpenSearch Service +// domain, including the domain ID, domain service endpoint, and domain ARN. func (c *Client) DescribeDomain(ctx context.Context, params *DescribeDomainInput, optFns ...func(*Options)) (*DescribeDomainOutput, error) { if params == nil { params = &DescribeDomainInput{} @@ -31,7 +31,7 @@ func (c *Client) DescribeDomain(ctx context.Context, params *DescribeDomainInput // Container for the parameters to the DescribeDomain operation. type DescribeDomainInput struct { - // The name of the domain for which you want information. + // The name of the domain that you want information about. // // This member is required. DomainName *string @@ -39,11 +39,10 @@ type DescribeDomainInput struct { noSmithyDocumentSerde } -// The result of a DescribeDomain request. Contains the status of the domain -// specified in the request. +// Contains the status of the domain specified in the request. type DescribeDomainOutput struct { - // The current status of the domain. + // List that contains the status of each specified OpenSearch Service domain. // // This member is required. DomainStatus *types.DomainStatus diff --git a/service/opensearch/api_op_DescribeDomainAutoTunes.go b/service/opensearch/api_op_DescribeDomainAutoTunes.go index b27c3eeb31a..795110508c1 100644 --- a/service/opensearch/api_op_DescribeDomainAutoTunes.go +++ b/service/opensearch/api_op_DescribeDomainAutoTunes.go @@ -12,8 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Provides scheduled Auto-Tune action details for the domain, such as Auto-Tune -// action type, description, severity, and scheduled date. +// Returns the list of optimizations that Auto-Tune has made to an Amazon +// OpenSearch Service domain. For more information, see Auto-Tune for Amazon +// OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). func (c *Client) DescribeDomainAutoTunes(ctx context.Context, params *DescribeDomainAutoTunesInput, optFns ...func(*Options)) (*DescribeDomainAutoTunesOutput, error) { if params == nil { params = &DescribeDomainAutoTunesInput{} @@ -32,35 +34,32 @@ func (c *Client) DescribeDomainAutoTunes(ctx context.Context, params *DescribeDo // Container for the parameters to the DescribeDomainAutoTunes operation. type DescribeDomainAutoTunesInput struct { - // The domain name for which you want Auto-Tune action details. + // Name of the domain that you want Auto-Tune details about. // // This member is required. DomainName *string - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // NextToken is sent in case the earlier API call results contain the NextToken. - // Used for pagination. + // If your initial DescribeDomainAutoTunes operation returns a nextToken, you can + // include the returned nextToken in subsequent DescribeDomainAutoTunes operations, + // which returns results in the next page. NextToken *string noSmithyDocumentSerde } -// The result of a DescribeDomainAutoTunes request. See Auto-Tune for Amazon -// OpenSearch Service -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) -// for more information. +// The result of a DescribeDomainAutoTunes request. type DescribeDomainAutoTunesOutput struct { - // The list of setting adjustments that Auto-Tune has made to the domain. See - // Auto-Tune for Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // The list of setting adjustments that Auto-Tune has made to the domain. AutoTunes []types.AutoTune - // An identifier to allow retrieval of paginated results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. @@ -143,8 +142,8 @@ var _ DescribeDomainAutoTunesAPIClient = (*Client)(nil) // DescribeDomainAutoTunesPaginatorOptions is the paginator options for // DescribeDomainAutoTunes type DescribeDomainAutoTunesPaginatorOptions struct { - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_DescribeDomainChangeProgress.go b/service/opensearch/api_op_DescribeDomainChangeProgress.go index 505cd33fed1..66722c0cd65 100644 --- a/service/opensearch/api_op_DescribeDomainChangeProgress.go +++ b/service/opensearch/api_op_DescribeDomainChangeProgress.go @@ -11,8 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns information about the current blue/green deployment happening on a -// domain, including a change ID, status, and progress stages. +// Returns information about the current blue/green deployment happening on an +// Amazon OpenSearch Service domain. For more information, see Making configuration +// changes in Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-configuration-changes.html). func (c *Client) DescribeDomainChangeProgress(ctx context.Context, params *DescribeDomainChangeProgressInput, optFns ...func(*Options)) (*DescribeDomainChangeProgressOutput, error) { if params == nil { params = &DescribeDomainChangeProgressInput{} @@ -29,29 +31,27 @@ func (c *Client) DescribeDomainChangeProgress(ctx context.Context, params *Descr } // Container for the parameters to the DescribeDomainChangeProgress operation. -// Specifies the domain name and optional change specific identity for which you -// want progress information. type DescribeDomainChangeProgressInput struct { - // The domain you want to get the progress information about. + // The name of the domain to get progress information for. // // This member is required. DomainName *string - // The specific change ID for which you want to get progress information. This is - // an optional parameter. If omitted, the service returns information about the - // most recent configuration change. + // The specific change ID for which you want to get progress information. If + // omitted, the request returns information about the most recent configuration + // change. ChangeId *string noSmithyDocumentSerde } -// The result of a DescribeDomainChangeProgress request. Contains the progress -// information of the requested domain change. +// The result of a DescribeDomainChangeProgress request. Contains progress +// information for the requested domain change. type DescribeDomainChangeProgressOutput struct { - // Progress information for the configuration change that is requested in the - // DescribeDomainChangeProgress request. + // Container for information about the stages of a configuration change happening + // on a domain. ChangeProgressStatus *types.ChangeProgressStatusDetails // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_DescribeDomainConfig.go b/service/opensearch/api_op_DescribeDomainConfig.go index da46c468a0d..b8e958465dd 100644 --- a/service/opensearch/api_op_DescribeDomainConfig.go +++ b/service/opensearch/api_op_DescribeDomainConfig.go @@ -11,8 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Provides cluster configuration information about the specified domain, such as -// the state, creation date, update version, and update date for cluster options. +// Returns the configuration of an Amazon OpenSearch Service domain. func (c *Client) DescribeDomainConfig(ctx context.Context, params *DescribeDomainConfigInput, optFns ...func(*Options)) (*DescribeDomainConfigOutput, error) { if params == nil { params = &DescribeDomainConfigInput{} @@ -28,11 +27,10 @@ func (c *Client) DescribeDomainConfig(ctx context.Context, params *DescribeDomai return out, nil } -// Container for the parameters to the DescribeDomainConfig operation. Specifies -// the domain name for which you want configuration information. +// Container for the parameters to the DescribeDomainConfig operation. type DescribeDomainConfigInput struct { - // The domain you want to get information about. + // Name of the OpenSearch Service domain configuration that you want to describe. // // This member is required. DomainName *string @@ -40,12 +38,10 @@ type DescribeDomainConfigInput struct { noSmithyDocumentSerde } -// The result of a DescribeDomainConfig request. Contains the configuration -// information of the requested domain. +// Contains the configuration information of the requested domain. type DescribeDomainConfigOutput struct { - // The configuration information of the domain requested in the - // DescribeDomainConfig request. + // Container for the configuration of the OpenSearch Service domain. // // This member is required. DomainConfig *types.DomainConfig diff --git a/service/opensearch/api_op_DescribeDomains.go b/service/opensearch/api_op_DescribeDomains.go index 5eb23db8527..5527dc766f0 100644 --- a/service/opensearch/api_op_DescribeDomains.go +++ b/service/opensearch/api_op_DescribeDomains.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns domain configuration information about the specified domains, including -// the domain ID, domain endpoint, and domain ARN. +// Returns domain configuration information about the specified Amazon OpenSearch +// Service domains. func (c *Client) DescribeDomains(ctx context.Context, params *DescribeDomainsInput, optFns ...func(*Options)) (*DescribeDomainsOutput, error) { if params == nil { params = &DescribeDomainsInput{} @@ -28,11 +28,12 @@ func (c *Client) DescribeDomains(ctx context.Context, params *DescribeDomainsInp return out, nil } -// Container for the parameters to the DescribeDomains operation. By default, the -// API returns the status of all domains. +// Container for the parameters to the DescribeDomains operation. type DescribeDomainsInput struct { - // The domains for which you want information. + // Array of OpenSearch Service domain names that you want information about. If you + // don't specify any domains, OpenSearch Service returns information about all + // domains owned by the account. // // This member is required. DomainNames []string @@ -40,11 +41,11 @@ type DescribeDomainsInput struct { noSmithyDocumentSerde } -// The result of a DescribeDomains request. Contains the status of the specified -// domains or all domains owned by the account. +// Contains the status of the specified domains or all domains owned by the +// account. type DescribeDomainsOutput struct { - // The status of the domains requested in the DescribeDomains request. + // The status of the requested domains. // // This member is required. DomainStatusList []types.DomainStatus diff --git a/service/opensearch/api_op_DescribeInboundConnections.go b/service/opensearch/api_op_DescribeInboundConnections.go index ddf9a238f7c..6d70c27705d 100644 --- a/service/opensearch/api_op_DescribeInboundConnections.go +++ b/service/opensearch/api_op_DescribeInboundConnections.go @@ -12,7 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all the inbound cross-cluster connections for a remote domain. +// Lists all the inbound cross-cluster search connections for a destination +// (remote) Amazon OpenSearch Service domain. For more information, see +// Cross-cluster search for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html). func (c *Client) DescribeInboundConnections(ctx context.Context, params *DescribeInboundConnectionsInput, optFns ...func(*Options)) (*DescribeInboundConnectionsOutput, error) { if params == nil { params = &DescribeInboundConnectionsInput{} @@ -32,41 +35,30 @@ func (c *Client) DescribeInboundConnections(ctx context.Context, params *Describ type DescribeInboundConnectionsInput struct { // A list of filters used to match properties for inbound cross-cluster - // connections. Available Filter values are: - // - // * connection-id - // - // * - // local-domain-info.domain-name - // - // * local-domain-info.owner-id - // - // * - // local-domain-info.region - // - // * remote-domain-info.domain-name + // connections. Filters []types.Filter - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // If more results are available and NextToken is present, make the next request to - // the same API with the received NextToken to paginate the remaining results. + // If your initial DescribeInboundConnections operation returns a nextToken, you + // can include the returned nextToken in subsequent DescribeInboundConnections + // operations, which returns results in the next page. NextToken *string noSmithyDocumentSerde } -// The result of a DescribeInboundConnections request. Contains a list of -// connections matching the filter criteria. +// Contains a list of connections matching the filter criteria. type DescribeInboundConnectionsOutput struct { - // A list of InboundConnection matching the specified filter criteria. + // List of inbound connections. Connections []types.InboundConnection - // If more results are available and NextToken is present, make the next request to - // the same API with the received NextToken to paginate the remaining results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. @@ -146,8 +138,8 @@ var _ DescribeInboundConnectionsAPIClient = (*Client)(nil) // DescribeInboundConnectionsPaginatorOptions is the paginator options for // DescribeInboundConnections type DescribeInboundConnectionsPaginatorOptions struct { - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_DescribeInstanceTypeLimits.go b/service/opensearch/api_op_DescribeInstanceTypeLimits.go index 71643f2e6a2..c1d0344c99e 100644 --- a/service/opensearch/api_op_DescribeInstanceTypeLimits.go +++ b/service/opensearch/api_op_DescribeInstanceTypeLimits.go @@ -11,9 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describe the limits for a given instance type and OpenSearch or Elasticsearch -// version. When modifying an existing domain, specify the DomainName to see which -// limits you can modify. +// Describes the instance count, storage, and master node limits for a given +// OpenSearch or Elasticsearch version and instance type. func (c *Client) DescribeInstanceTypeLimits(ctx context.Context, params *DescribeInstanceTypeLimitsInput, optFns ...func(*Options)) (*DescribeInstanceTypeLimitsOutput, error) { if params == nil { params = &DescribeInstanceTypeLimitsInput{} @@ -32,19 +31,19 @@ func (c *Client) DescribeInstanceTypeLimits(ctx context.Context, params *Describ // Container for the parameters to the DescribeInstanceTypeLimits operation. type DescribeInstanceTypeLimitsInput struct { - // Version of OpenSearch for which Limits are needed. + // Version of OpenSearch or Elasticsearch, in the format Elasticsearch_X.Y or + // OpenSearch_X.Y. Defaults to the latest version of OpenSearch. // // This member is required. EngineVersion *string - // The instance type for an OpenSearch cluster for which OpenSearch Limits are - // needed. + // The OpenSearch Service instance type for which you need limit information. // // This member is required. InstanceType types.OpenSearchPartitionInstanceType - // The name of the domain you want to modify. Only include this value if you're - // querying OpenSearch Limits for an existing domain. + // The name of the domain. Only specify if you need the limits for an existing + // domain. DomainName *string noSmithyDocumentSerde @@ -54,16 +53,8 @@ type DescribeInstanceTypeLimitsInput struct { // operation. type DescribeInstanceTypeLimitsOutput struct { - // The role of a given instance and all applicable limits. The role performed by a - // given OpenSearch instance can be one of the following: - // - // * data: If the given - // InstanceType is used as a data node - // - // * master: If the given InstanceType is used - // as a master node - // - // * ultra_warm: If the given InstanceType is used as a warm node + // Map that contains all applicable instance type limits.data refers to data + // nodes.master refers to dedicated master nodes. LimitsByRole map[string]types.Limits // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_DescribeOutboundConnections.go b/service/opensearch/api_op_DescribeOutboundConnections.go index d5863170d17..ad918c4d4d4 100644 --- a/service/opensearch/api_op_DescribeOutboundConnections.go +++ b/service/opensearch/api_op_DescribeOutboundConnections.go @@ -12,7 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all the outbound cross-cluster connections for a local domain. +// Lists all the outbound cross-cluster connections for a local (source) Amazon +// OpenSearch Service domain. For more information, see Cross-cluster search for +// Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html). func (c *Client) DescribeOutboundConnections(ctx context.Context, params *DescribeOutboundConnectionsInput, optFns ...func(*Options)) (*DescribeOutboundConnectionsOutput, error) { if params == nil { params = &DescribeOutboundConnectionsInput{} @@ -31,42 +34,30 @@ func (c *Client) DescribeOutboundConnections(ctx context.Context, params *Descri // Container for the parameters to the DescribeOutboundConnections operation. type DescribeOutboundConnectionsInput struct { - // A list of filters used to match properties for outbound cross-cluster - // connections. Available Filter names for this operation are: - // - // * connection-id - // - // * - // remote-domain-info.domain-name - // - // * remote-domain-info.owner-id - // - // * - // remote-domain-info.region - // - // * local-domain-info.domain-name + // List of filter names and values that you can use for requests. Filters []types.Filter - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // NextToken is sent in case the earlier API call results contain the NextToken - // parameter. Used for pagination. + // If your initial DescribeOutboundConnections operation returns a nextToken, you + // can include the returned nextToken in subsequent DescribeOutboundConnections + // operations, which returns results in the next page. NextToken *string noSmithyDocumentSerde } -// The result of a DescribeOutboundConnections request. Contains the list of -// connections matching the filter criteria. +// Contains a list of connections matching the filter criteria. type DescribeOutboundConnectionsOutput struct { - // A list of OutboundConnection matching the specified filter criteria. + // List of outbound connections that match the filter criteria. Connections []types.OutboundConnection - // If more results are available and NextToken is present, make the next request to - // the same API with the received NextToken to paginate the remaining results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. @@ -146,8 +137,8 @@ var _ DescribeOutboundConnectionsAPIClient = (*Client)(nil) // DescribeOutboundConnectionsPaginatorOptions is the paginator options for // DescribeOutboundConnections type DescribeOutboundConnectionsPaginatorOptions struct { - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_DescribePackages.go b/service/opensearch/api_op_DescribePackages.go index 25f4381ed50..05b17a5ff41 100644 --- a/service/opensearch/api_op_DescribePackages.go +++ b/service/opensearch/api_op_DescribePackages.go @@ -12,8 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes all packages available to Amazon OpenSearch Service domains. Includes -// options for filtering, limiting the number of results, and pagination. +// Describes all packages available to OpenSearch Service. For more information, +// see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) DescribePackages(ctx context.Context, params *DescribePackagesInput, optFns ...func(*Options)) (*DescribePackagesOutput, error) { if params == nil { params = &DescribePackagesInput{} @@ -35,11 +36,13 @@ type DescribePackagesInput struct { // Only returns packages that match the DescribePackagesFilterList values. Filters []types.DescribePackagesFilter - // Limits results to a maximum number of packages. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Used for pagination. Only necessary if a previous API call includes a non-null - // NextToken value. If provided, returns results for the next page. + // If your initial DescribePackageFilters operation returns a nextToken, you can + // include the returned nextToken in subsequent DescribePackageFilters operations, + // which returns results in the next page. NextToken *string noSmithyDocumentSerde @@ -47,9 +50,13 @@ type DescribePackagesInput struct { // Container for the response returned by the DescribePackages operation. type DescribePackagesOutput struct { + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string - // List of PackageDetails objects. + // Basic information about a package. PackageDetailsList []types.PackageDetails // Metadata pertaining to the operation's result. @@ -128,7 +135,8 @@ var _ DescribePackagesAPIClient = (*Client)(nil) // DescribePackagesPaginatorOptions is the paginator options for DescribePackages type DescribePackagesPaginatorOptions struct { - // Limits results to a maximum number of packages. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_DescribeReservedInstanceOfferings.go b/service/opensearch/api_op_DescribeReservedInstanceOfferings.go index 72b6c82c391..6e6218a9b71 100644 --- a/service/opensearch/api_op_DescribeReservedInstanceOfferings.go +++ b/service/opensearch/api_op_DescribeReservedInstanceOfferings.go @@ -12,7 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists available reserved OpenSearch instance offerings. +// Describes the available Amazon OpenSearch Service Reserved Instance offerings +// for a given Region. For more information, see Reserved Instances in Amazon +// OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ri.html). func (c *Client) DescribeReservedInstanceOfferings(ctx context.Context, params *DescribeReservedInstanceOfferingsInput, optFns ...func(*Options)) (*DescribeReservedInstanceOfferingsOutput, error) { if params == nil { params = &DescribeReservedInstanceOfferingsInput{} @@ -28,30 +31,36 @@ func (c *Client) DescribeReservedInstanceOfferings(ctx context.Context, params * return out, nil } -// Container for parameters to DescribeReservedInstanceOfferings +// Container for the request parameters to a DescribeReservedInstanceOfferings +// operation. type DescribeReservedInstanceOfferingsInput struct { - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Provides an identifier to allow retrieval of paginated results. + // If your initial DescribeReservedInstanceOfferings operation returns a nextToken, + // you can include the returned nextToken in subsequent + // DescribeReservedInstanceOfferings operations, which returns results in the next + // page. NextToken *string - // The offering identifier filter value. Use this parameter to show only the - // available offering that matches the specified reservation identifier. + // The Reserved Instance identifier filter value. Use this parameter to show only + // the available instance types that match the specified reservation identifier. ReservedInstanceOfferingId *string noSmithyDocumentSerde } -// Container for results from DescribeReservedInstanceOfferings +// Container for results of a DescribeReservedInstanceOfferings request. type DescribeReservedInstanceOfferingsOutput struct { - // Provides an identifier to allow retrieval of paginated results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string - // List of reserved OpenSearch instance offerings + // List of Reserved Instance offerings. ReservedInstanceOfferings []types.ReservedInstanceOffering // Metadata pertaining to the operation's result. @@ -131,8 +140,8 @@ var _ DescribeReservedInstanceOfferingsAPIClient = (*Client)(nil) // DescribeReservedInstanceOfferingsPaginatorOptions is the paginator options for // DescribeReservedInstanceOfferings type DescribeReservedInstanceOfferingsPaginatorOptions struct { - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_DescribeReservedInstances.go b/service/opensearch/api_op_DescribeReservedInstances.go index 86085f221c1..af7ad5cf332 100644 --- a/service/opensearch/api_op_DescribeReservedInstances.go +++ b/service/opensearch/api_op_DescribeReservedInstances.go @@ -12,7 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns information about reserved OpenSearch instances for this account. +// Describes the Amazon OpenSearch Service instances that you have reserved in a +// given Region. For more information, see Reserved Instances in Amazon OpenSearch +// Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ri.html). func (c *Client) DescribeReservedInstances(ctx context.Context, params *DescribeReservedInstancesInput, optFns ...func(*Options)) (*DescribeReservedInstancesOutput, error) { if params == nil { params = &DescribeReservedInstancesInput{} @@ -28,14 +31,16 @@ func (c *Client) DescribeReservedInstances(ctx context.Context, params *Describe return out, nil } -// Container for parameters to DescribeReservedInstances +// Container for the request parameters to the DescribeReservedInstances operation. type DescribeReservedInstancesInput struct { - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Provides an identifier to allow retrieval of paginated results. + // If your initial DescribeReservedInstances operation returns a nextToken, you can + // include the returned nextToken in subsequent DescribeReservedInstances + // operations, which returns results in the next page. NextToken *string // The reserved instance identifier filter value. Use this parameter to show only @@ -48,10 +53,12 @@ type DescribeReservedInstancesInput struct { // Container for results from DescribeReservedInstances type DescribeReservedInstancesOutput struct { - // Provides an identifier to allow retrieval of paginated results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string - // List of reserved OpenSearch instances. + // List of Reserved Instances in the current Region. ReservedInstances []types.ReservedInstance // Metadata pertaining to the operation's result. @@ -131,8 +138,8 @@ var _ DescribeReservedInstancesAPIClient = (*Client)(nil) // DescribeReservedInstancesPaginatorOptions is the paginator options for // DescribeReservedInstances type DescribeReservedInstancesPaginatorOptions struct { - // Set this value to limit the number of results returned. If not specified, - // defaults to 100. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_DescribeVpcEndpoints.go b/service/opensearch/api_op_DescribeVpcEndpoints.go new file mode 100644 index 00000000000..243c479df47 --- /dev/null +++ b/service/opensearch/api_op_DescribeVpcEndpoints.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes one or more Amazon OpenSearch Service-managed VPC endpoints. +func (c *Client) DescribeVpcEndpoints(ctx context.Context, params *DescribeVpcEndpointsInput, optFns ...func(*Options)) (*DescribeVpcEndpointsOutput, error) { + if params == nil { + params = &DescribeVpcEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpoints", params, optFns, c.addOperationDescribeVpcEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeVpcEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeVpcEndpointsInput struct { + + // The unique identifiers of the endpoints to get information about. + // + // This member is required. + VpcEndpointIds []string + + noSmithyDocumentSerde +} + +type DescribeVpcEndpointsOutput struct { + + // Any errors associated with the request. + // + // This member is required. + VpcEndpointErrors []types.VpcEndpointError + + // Information about each requested VPC endpoint. + // + // This member is required. + VpcEndpoints []types.VpcEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeVpcEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeVpcEndpoints{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeVpcEndpointsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpoints(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "DescribeVpcEndpoints", + } +} diff --git a/service/opensearch/api_op_DissociatePackage.go b/service/opensearch/api_op_DissociatePackage.go index 47b72126e59..072c8c37487 100644 --- a/service/opensearch/api_op_DissociatePackage.go +++ b/service/opensearch/api_op_DissociatePackage.go @@ -11,7 +11,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Dissociates a package from the Amazon OpenSearch Service domain. +// Removes a package from the specified Amazon OpenSearch Service domain. The +// package can't be in use with any OpenSearch index for the dissociation to +// succeed. The package is still available in OpenSearch Service for association +// later. For more information, see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) DissociatePackage(ctx context.Context, params *DissociatePackageInput, optFns ...func(*Options)) (*DissociatePackageOutput, error) { if params == nil { params = &DissociatePackageInput{} @@ -30,13 +34,13 @@ func (c *Client) DissociatePackage(ctx context.Context, params *DissociatePackag // Container for the request parameters to the DissociatePackage operation. type DissociatePackageInput struct { - // The name of the domain to associate the package with. + // Name of the domain to dissociate the package from. // // This member is required. DomainName *string - // The internal ID of the package to associate with a domain. Use DescribePackages - // to find this value. + // Internal ID of the package to dissociate from the domain. Use + // ListPackagesForDomain to find this value. // // This member is required. PackageID *string @@ -44,10 +48,10 @@ type DissociatePackageInput struct { noSmithyDocumentSerde } -// Container for the response returned by DissociatePackage operation. +// Container for the response returned by an DissociatePackage operation. type DissociatePackageOutput struct { - // DomainPackageDetails + // Information about a package that has been dissociated from the domain. DomainPackageDetails *types.DomainPackageDetails // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_GetCompatibleVersions.go b/service/opensearch/api_op_GetCompatibleVersions.go index bf815e4088a..c52ad7d355e 100644 --- a/service/opensearch/api_op_GetCompatibleVersions.go +++ b/service/opensearch/api_op_GetCompatibleVersions.go @@ -11,9 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of upgrade-compatible versions of OpenSearch/Elasticsearch. You -// can optionally pass a DomainName to get all upgrade-compatible versions of -// OpenSearch/Elasticsearch for that specific domain. +// Returns a map of OpenSearch or Elasticsearch versions and the versions you can +// upgrade them to. func (c *Client) GetCompatibleVersions(ctx context.Context, params *GetCompatibleVersionsInput, optFns ...func(*Options)) (*GetCompatibleVersionsOutput, error) { if params == nil { params = &GetCompatibleVersionsInput{} @@ -32,9 +31,8 @@ func (c *Client) GetCompatibleVersions(ctx context.Context, params *GetCompatibl // Container for the request parameters to GetCompatibleVersions operation. type GetCompatibleVersionsInput struct { - // The name of an domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // The name of an existing domain. Provide this parameter to limit the results to a + // single domain. DomainName *string noSmithyDocumentSerde @@ -43,8 +41,8 @@ type GetCompatibleVersionsInput struct { // Container for the response returned by the GetCompatibleVersions operation. type GetCompatibleVersionsOutput struct { - // A map of compatible OpenSearch versions returned as part of the - // GetCompatibleVersions operation. + // A map of OpenSearch or Elasticsearch versions and the versions you can upgrade + // them to. CompatibleVersions []types.CompatibleVersionsMap // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_GetPackageVersionHistory.go b/service/opensearch/api_op_GetPackageVersionHistory.go index fdb983da302..73d25715ab5 100644 --- a/service/opensearch/api_op_GetPackageVersionHistory.go +++ b/service/opensearch/api_op_GetPackageVersionHistory.go @@ -12,8 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of package versions, along with their creation time and commit -// message. +// Returns a list of Amazon OpenSearch Service package versions, along with their +// creation time and commit message. For more information, see Custom packages for +// Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) GetPackageVersionHistory(ctx context.Context, params *GetPackageVersionHistoryInput, optFns ...func(*Options)) (*GetPackageVersionHistoryOutput, error) { if params == nil { params = &GetPackageVersionHistoryInput{} @@ -32,16 +34,18 @@ func (c *Client) GetPackageVersionHistory(ctx context.Context, params *GetPackag // Container for the request parameters to the GetPackageVersionHistory operation. type GetPackageVersionHistoryInput struct { - // Returns an audit history of package versions. + // The unique identifier of the package. // // This member is required. PackageID *string - // Limits results to a maximum number of package versions. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Used for pagination. Only necessary if a previous API call includes a non-null - // NextToken value. If provided, returns results for the next page. + // If your initial GetPackageVersionHistory operation returns a nextToken, you can + // include the returned nextToken in subsequent GetPackageVersionHistory + // operations, which returns results in the next page. NextToken *string noSmithyDocumentSerde @@ -49,11 +53,16 @@ type GetPackageVersionHistoryInput struct { // Container for response returned by GetPackageVersionHistory operation. type GetPackageVersionHistoryOutput struct { + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string + // The unique identifier of the package. PackageID *string - // List of PackageVersionHistory objects. + // A list of package versions, along with their creation time and commit message. PackageVersionHistoryList []types.PackageVersionHistory // Metadata pertaining to the operation's result. @@ -136,7 +145,8 @@ var _ GetPackageVersionHistoryAPIClient = (*Client)(nil) // GetPackageVersionHistoryPaginatorOptions is the paginator options for // GetPackageVersionHistory type GetPackageVersionHistoryPaginatorOptions struct { - // Limits results to a maximum number of package versions. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_GetUpgradeHistory.go b/service/opensearch/api_op_GetUpgradeHistory.go index 1ebfa2a64f7..10aba6e6544 100644 --- a/service/opensearch/api_op_GetUpgradeHistory.go +++ b/service/opensearch/api_op_GetUpgradeHistory.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the complete history of the last 10 upgrades performed on the domain. +// Retrieves the complete history of the last 10 upgrades performed on an Amazon +// OpenSearch Service domain. func (c *Client) GetUpgradeHistory(ctx context.Context, params *GetUpgradeHistoryInput, optFns ...func(*Options)) (*GetUpgradeHistoryOutput, error) { if params == nil { params = &GetUpgradeHistoryInput{} @@ -31,19 +32,18 @@ func (c *Client) GetUpgradeHistory(ctx context.Context, params *GetUpgradeHistor // Container for the request parameters to the GetUpgradeHistory operation. type GetUpgradeHistoryInput struct { - // The name of an domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // The name of an existing domain. // // This member is required. DomainName *string - // Set this value to limit the number of results returned. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Paginated APIs accept the NextToken input to return the next page of results and - // provide a NextToken output in the response, which you can use to retrieve more - // results. + // If your initial GetUpgradeHistory operation returns a nextToken, you can include + // the returned nextToken in subsequent GetUpgradeHistory operations, which returns + // results in the next page. NextToken *string noSmithyDocumentSerde @@ -52,13 +52,13 @@ type GetUpgradeHistoryInput struct { // Container for the response returned by the GetUpgradeHistory operation. type GetUpgradeHistoryOutput struct { - // Pagination token that needs to be supplied to the next call to get the next page - // of results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string - // A list of UpgradeHistory objects corresponding to each upgrade or upgrade - // eligibility check performed on a domain returned as part of the - // GetUpgradeHistoryResponse object. + // A list of objects corresponding to each upgrade or upgrade eligibility check + // performed on a domain. UpgradeHistories []types.UpgradeHistory // Metadata pertaining to the operation's result. @@ -140,7 +140,8 @@ var _ GetUpgradeHistoryAPIClient = (*Client)(nil) // GetUpgradeHistoryPaginatorOptions is the paginator options for GetUpgradeHistory type GetUpgradeHistoryPaginatorOptions struct { - // Set this value to limit the number of results returned. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_GetUpgradeStatus.go b/service/opensearch/api_op_GetUpgradeStatus.go index bc0878adc0f..dce0685d40d 100644 --- a/service/opensearch/api_op_GetUpgradeStatus.go +++ b/service/opensearch/api_op_GetUpgradeStatus.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the latest status of the last upgrade or upgrade eligibility check -// performed on the domain. +// Returns the most recent status of the last upgrade or upgrade eligibility check +// performed on an Amazon OpenSearch Service domain. func (c *Client) GetUpgradeStatus(ctx context.Context, params *GetUpgradeStatusInput, optFns ...func(*Options)) (*GetUpgradeStatusOutput, error) { if params == nil { params = &GetUpgradeStatusInput{} @@ -31,9 +31,7 @@ func (c *Client) GetUpgradeStatus(ctx context.Context, params *GetUpgradeStatusI // Container for the request parameters to the GetUpgradeStatus operation. type GetUpgradeStatusInput struct { - // The name of an domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // The domain of the domain to get upgrade status information for. // // This member is required. DomainName *string @@ -44,30 +42,13 @@ type GetUpgradeStatusInput struct { // Container for the response returned by the GetUpgradeStatus operation. type GetUpgradeStatusOutput struct { - // One of four statuses an upgrade have, returned as part of the - // GetUpgradeStatusResponse object. The status can take one of the following - // values: - // - // * In Progress - // - // * Succeeded - // - // * Succeeded with Issues - // - // * Failed + // The status of the current step that an upgrade is on. StepStatus types.UpgradeStatus - // A string that briefly describes the update. + // A string that describes the update. UpgradeName *string - // One of three steps an upgrade or upgrade eligibility check goes through: - // - // * - // PreUpgradeCheck - // - // * Snapshot - // - // * Upgrade + // One of three steps that an upgrade or upgrade eligibility check goes through. UpgradeStep types.UpgradeStep // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_ListDomainNames.go b/service/opensearch/api_op_ListDomainNames.go index 1b8cb3e3664..88a36e74740 100644 --- a/service/opensearch/api_op_ListDomainNames.go +++ b/service/opensearch/api_op_ListDomainNames.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the names of all domains owned by the current user's account. +// Returns the names of all Amazon OpenSearch Service domains owned by the current +// user in the active Region. func (c *Client) ListDomainNames(ctx context.Context, params *ListDomainNamesInput, optFns ...func(*Options)) (*ListDomainNamesOutput, error) { if params == nil { params = &ListDomainNamesInput{} @@ -30,18 +31,18 @@ func (c *Client) ListDomainNames(ctx context.Context, params *ListDomainNamesInp // Container for the parameters to the ListDomainNames operation. type ListDomainNamesInput struct { - // Optional parameter to filter the output by domain engine type. Acceptable values - // are 'Elasticsearch' and 'OpenSearch'. + // Filters the output by domain engine type. EngineType types.EngineType noSmithyDocumentSerde } -// The result of a ListDomainNames operation. Contains the names of all domains +// The results of a ListDomainNames operation. Contains the names of all domains // owned by this account and their respective engine types. type ListDomainNamesOutput struct { - // List of domain names and respective engine types. + // The names of all OpenSearch Service domains owned by the current user and their + // respective engine types. DomainNames []types.DomainInfo // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_ListDomainsForPackage.go b/service/opensearch/api_op_ListDomainsForPackage.go index ac2f9636b3a..9bee0e58568 100644 --- a/service/opensearch/api_op_ListDomainsForPackage.go +++ b/service/opensearch/api_op_ListDomainsForPackage.go @@ -12,7 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all Amazon OpenSearch Service domains associated with the package. +// Lists all Amazon OpenSearch Service domains associated with a given package. For +// more information, see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) ListDomainsForPackage(ctx context.Context, params *ListDomainsForPackageInput, optFns ...func(*Options)) (*ListDomainsForPackageOutput, error) { if params == nil { params = &ListDomainsForPackageInput{} @@ -31,16 +33,18 @@ func (c *Client) ListDomainsForPackage(ctx context.Context, params *ListDomainsF // Container for the request parameters to the ListDomainsForPackage operation. type ListDomainsForPackageInput struct { - // The package for which to list associated domains. + // The unique identifier of the package for which to list associated domains. // // This member is required. PackageID *string - // Limits the results to a maximum number of domains. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Used for pagination. Only necessary if a previous API call includes a non-null - // NextToken value. If provided, returns results for the next page. + // If your initial ListDomainsForPackage operation returns a nextToken, you can + // include the returned nextToken in subsequent ListDomainsForPackage operations, + // which returns results in the next page. NextToken *string noSmithyDocumentSerde @@ -49,9 +53,12 @@ type ListDomainsForPackageInput struct { // Container for the response parameters to the ListDomainsForPackage operation. type ListDomainsForPackageOutput struct { - // List of DomainPackageDetails objects. + // Information about all domains associated with a package. DomainPackageDetailsList []types.DomainPackageDetails + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. @@ -134,7 +141,8 @@ var _ ListDomainsForPackageAPIClient = (*Client)(nil) // ListDomainsForPackagePaginatorOptions is the paginator options for // ListDomainsForPackage type ListDomainsForPackagePaginatorOptions struct { - // Limits the results to a maximum number of domains. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_ListInstanceTypeDetails.go b/service/opensearch/api_op_ListInstanceTypeDetails.go index 0f72c79fe16..143cb18b9dc 100644 --- a/service/opensearch/api_op_ListInstanceTypeDetails.go +++ b/service/opensearch/api_op_ListInstanceTypeDetails.go @@ -12,6 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Lists all instance types and available features for a given OpenSearch or +// Elasticsearch version. func (c *Client) ListInstanceTypeDetails(ctx context.Context, params *ListInstanceTypeDetailsInput, optFns ...func(*Options)) (*ListInstanceTypeDetailsOutput, error) { if params == nil { params = &ListInstanceTypeDetailsInput{} @@ -29,31 +31,36 @@ func (c *Client) ListInstanceTypeDetails(ctx context.Context, params *ListInstan type ListInstanceTypeDetailsInput struct { + // Version of OpenSearch or Elasticsearch, in the format Elasticsearch_X.Y or + // OpenSearch_X.Y. Defaults to the latest version of OpenSearch. + // // This member is required. EngineVersion *string - // The name of an domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // Name of the domain to list instance type details for. DomainName *string - // Set this value to limit the number of results returned. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Paginated APIs accept the NextToken input to return the next page of results and - // provide a NextToken output in the response, which you can use to retrieve more - // results. + // If your initial ListInstanceTypeDetails operation returns a nextToken, you can + // include the returned nextToken in subsequent ListInstanceTypeDetails operations, + // which returns results in the next page. NextToken *string noSmithyDocumentSerde } type ListInstanceTypeDetailsOutput struct { + + // Lists all supported instance types and features for the given OpenSearch or + // Elasticsearch version. InstanceTypeDetails []types.InstanceTypeDetails - // Paginated APIs accept the NextToken input to return the next page of results and - // provide a NextToken output in the response, which you can use to retrieve more - // results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. @@ -136,7 +143,8 @@ var _ ListInstanceTypeDetailsAPIClient = (*Client)(nil) // ListInstanceTypeDetailsPaginatorOptions is the paginator options for // ListInstanceTypeDetails type ListInstanceTypeDetailsPaginatorOptions struct { - // Set this value to limit the number of results returned. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_ListPackagesForDomain.go b/service/opensearch/api_op_ListPackagesForDomain.go index 41e58bbecf7..5b9cad80c5a 100644 --- a/service/opensearch/api_op_ListPackagesForDomain.go +++ b/service/opensearch/api_op_ListPackagesForDomain.go @@ -12,7 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all packages associated with the Amazon OpenSearch Service domain. +// Lists all packages associated with an Amazon OpenSearch Service domain. For more +// information, see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) ListPackagesForDomain(ctx context.Context, params *ListPackagesForDomainInput, optFns ...func(*Options)) (*ListPackagesForDomainOutput, error) { if params == nil { params = &ListPackagesForDomainInput{} @@ -36,11 +38,13 @@ type ListPackagesForDomainInput struct { // This member is required. DomainName *string - // Limits results to a maximum number of packages. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Used for pagination. Only necessary if a previous API call includes a non-null - // NextToken value. If provided, returns results for the next page. + // If your initial ListPackagesForDomain operation returns a nextToken, you can + // include the returned nextToken in subsequent ListPackagesForDomain operations, + // which returns results in the next page. NextToken *string noSmithyDocumentSerde @@ -49,10 +53,12 @@ type ListPackagesForDomainInput struct { // Container for the response parameters to the ListPackagesForDomain operation. type ListPackagesForDomainOutput struct { - // List of DomainPackageDetails objects. + // List of all packages associated with a domain. DomainPackageDetailsList []types.DomainPackageDetails - // Pagination token to supply to the next call to get the next page of results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string // Metadata pertaining to the operation's result. @@ -135,7 +141,8 @@ var _ ListPackagesForDomainAPIClient = (*Client)(nil) // ListPackagesForDomainPaginatorOptions is the paginator options for // ListPackagesForDomain type ListPackagesForDomainPaginatorOptions struct { - // Limits results to a maximum number of packages. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_ListTags.go b/service/opensearch/api_op_ListTags.go index e3f04405539..5ade71b6635 100644 --- a/service/opensearch/api_op_ListTags.go +++ b/service/opensearch/api_op_ListTags.go @@ -11,7 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns all tags for the given domain. +// Returns all resource tags for an Amazon OpenSearch Service domain. For more +// information, see Tagging Amazon OpenSearch Service domains +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-awsresourcetagging.html). func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ...func(*Options)) (*ListTagsOutput, error) { if params == nil { params = &ListTagsInput{} @@ -27,11 +29,10 @@ func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ... return out, nil } -// Container for the parameters to the ListTags operation. Specify the ARN of the -// domain that the tags you want to view are attached to. +// Container for the parameters to the ListTags operation. type ListTagsInput struct { - // Specify the ARN of the domain that the tags you want to view are attached to. + // Amazon Resource Name (ARN) for the domain to view tags for. // // This member is required. ARN *string @@ -39,10 +40,10 @@ type ListTagsInput struct { noSmithyDocumentSerde } -// The result of a ListTags operation. Contains tags for all requested domains. +// The results of a ListTags operation. type ListTagsOutput struct { - // List of Tag for the requested domain. + // List of resource tags associated with the specified domain. TagList []types.Tag // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_ListVersions.go b/service/opensearch/api_op_ListVersions.go index fda8f1a3299..da9389d8070 100644 --- a/service/opensearch/api_op_ListVersions.go +++ b/service/opensearch/api_op_ListVersions.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// List all supported versions of OpenSearch and Elasticsearch. +// Lists all versions of OpenSearch and Elasticsearch that Amazon OpenSearch +// Service supports. func (c *Client) ListVersions(ctx context.Context, params *ListVersionsInput, optFns ...func(*Options)) (*ListVersionsOutput, error) { if params == nil { params = &ListVersionsInput{} @@ -27,19 +28,16 @@ func (c *Client) ListVersions(ctx context.Context, params *ListVersionsInput, op return out, nil } -// Container for the parameters to the ListVersions operation. Use MaxResults to -// control the maximum number of results to retrieve in a single call. Use -// NextToken in response to retrieve more results. If the received response does -// not contain a NextToken, there are no more results to retrieve. +// Container for the request parameters to the ListVersions operation. type ListVersionsInput struct { - // Set this value to limit the number of results returned. Value must be greater - // than 10 or it won't be honored. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. MaxResults int32 - // Paginated APIs accept the NextToken input to return the next page of results and - // provide a NextToken output in the response, which you can use to retrieve more - // results. + // If your initial ListVersions operation returns a nextToken, you can include the + // returned nextToken in subsequent ListVersions operations, which returns results + // in the next page. NextToken *string noSmithyDocumentSerde @@ -49,12 +47,13 @@ type ListVersionsInput struct { // operation. type ListVersionsOutput struct { - // Paginated APIs accept the NextToken input to return the next page of results and - // provide a NextToken output in the response, which you can use to retrieve more - // results. + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. NextToken *string - // List of supported OpenSearch versions. + // A list of all versions of OpenSearch and Elasticsearch that Amazon OpenSearch + // Service supports. Versions []string // Metadata pertaining to the operation's result. @@ -132,8 +131,8 @@ var _ ListVersionsAPIClient = (*Client)(nil) // ListVersionsPaginatorOptions is the paginator options for ListVersions type ListVersionsPaginatorOptions struct { - // Set this value to limit the number of results returned. Value must be greater - // than 10 or it won't be honored. + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/opensearch/api_op_ListVpcEndpointAccess.go b/service/opensearch/api_op_ListVpcEndpointAccess.go new file mode 100644 index 00000000000..eb8b1c2922e --- /dev/null +++ b/service/opensearch/api_op_ListVpcEndpointAccess.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about each Amazon Web Services principal that is allowed +// to access a given Amazon OpenSearch Service domain through the use of an +// interface VPC endpoint. +func (c *Client) ListVpcEndpointAccess(ctx context.Context, params *ListVpcEndpointAccessInput, optFns ...func(*Options)) (*ListVpcEndpointAccessOutput, error) { + if params == nil { + params = &ListVpcEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpointAccess", params, optFns, c.addOperationListVpcEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVpcEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListVpcEndpointAccessInput struct { + + // The name of the OpenSearch Service domain to retrieve access information for. + // + // This member is required. + DomainName *string + + // If your initial ListVpcEndpointAccess operation returns a nextToken, you can + // include the returned nextToken in subsequent ListVpcEndpointAccess operations, + // which returns results in the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListVpcEndpointAccessOutput struct { + + // A list of IAM principals + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) + // that can currently access the domain. + // + // This member is required. + AuthorizedPrincipalList []types.AuthorizedPrincipal + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + // + // This member is required. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListVpcEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpointAccess(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "ListVpcEndpointAccess", + } +} diff --git a/service/opensearch/api_op_ListVpcEndpoints.go b/service/opensearch/api_op_ListVpcEndpoints.go new file mode 100644 index 00000000000..f6a62dd2fbd --- /dev/null +++ b/service/opensearch/api_op_ListVpcEndpoints.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves all Amazon OpenSearch Service-managed VPC endpoints in the current +// Amazon Web Services account and Region. +func (c *Client) ListVpcEndpoints(ctx context.Context, params *ListVpcEndpointsInput, optFns ...func(*Options)) (*ListVpcEndpointsOutput, error) { + if params == nil { + params = &ListVpcEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpoints", params, optFns, c.addOperationListVpcEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVpcEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListVpcEndpointsInput struct { + + // If your initial ListVpcEndpoints operation returns a nextToken, you can include + // the returned nextToken in subsequent ListVpcEndpoints operations, which returns + // results in the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListVpcEndpointsOutput struct { + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + // + // This member is required. + NextToken *string + + // Information about each endpoint. + // + // This member is required. + VpcEndpointSummaryList []types.VpcEndpointSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVpcEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpoints{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpoints(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "ListVpcEndpoints", + } +} diff --git a/service/opensearch/api_op_ListVpcEndpointsForDomain.go b/service/opensearch/api_op_ListVpcEndpointsForDomain.go new file mode 100644 index 00000000000..c0046db80f2 --- /dev/null +++ b/service/opensearch/api_op_ListVpcEndpointsForDomain.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves all Amazon OpenSearch Service-managed VPC endpoints associated with a +// particular domain. +func (c *Client) ListVpcEndpointsForDomain(ctx context.Context, params *ListVpcEndpointsForDomainInput, optFns ...func(*Options)) (*ListVpcEndpointsForDomainOutput, error) { + if params == nil { + params = &ListVpcEndpointsForDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVpcEndpointsForDomain", params, optFns, c.addOperationListVpcEndpointsForDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVpcEndpointsForDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListVpcEndpointsForDomainInput struct { + + // The name of the domain to list associated VPC endpoints for. + // + // This member is required. + DomainName *string + + // If your initial ListEndpointsForDomain operation returns a nextToken, you can + // include the returned nextToken in subsequent ListEndpointsForDomain operations, + // which returns results in the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListVpcEndpointsForDomainOutput struct { + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + // + // This member is required. + NextToken *string + + // Information about each endpoint associated with the domain. + // + // This member is required. + VpcEndpointSummaryList []types.VpcEndpointSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVpcEndpointsForDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcEndpointsForDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcEndpointsForDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListVpcEndpointsForDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVpcEndpointsForDomain(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListVpcEndpointsForDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "ListVpcEndpointsForDomain", + } +} diff --git a/service/opensearch/api_op_PurchaseReservedInstanceOffering.go b/service/opensearch/api_op_PurchaseReservedInstanceOffering.go index 0c26517ef80..4d30e6eae5e 100644 --- a/service/opensearch/api_op_PurchaseReservedInstanceOffering.go +++ b/service/opensearch/api_op_PurchaseReservedInstanceOffering.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allows you to purchase reserved OpenSearch instances. +// Allows you to purchase Amazon OpenSearch Service Reserved Instances. func (c *Client) PurchaseReservedInstanceOffering(ctx context.Context, params *PurchaseReservedInstanceOfferingInput, optFns ...func(*Options)) (*PurchaseReservedInstanceOfferingOutput, error) { if params == nil { params = &PurchaseReservedInstanceOfferingInput{} @@ -26,7 +26,8 @@ func (c *Client) PurchaseReservedInstanceOffering(ctx context.Context, params *P return out, nil } -// Container for parameters to PurchaseReservedInstanceOffering +// Container for request parameters to the PurchaseReservedInstanceOffering +// operation. type PurchaseReservedInstanceOfferingInput struct { // A customer-specified identifier to track this reservation. @@ -34,7 +35,7 @@ type PurchaseReservedInstanceOfferingInput struct { // This member is required. ReservationName *string - // The ID of the reserved OpenSearch instance offering to purchase. + // The ID of the Reserved Instance offering to purchase. // // This member is required. ReservedInstanceOfferingId *string @@ -51,7 +52,7 @@ type PurchaseReservedInstanceOfferingOutput struct { // The customer-specified identifier used to track this reservation. ReservationName *string - // Details of the reserved OpenSearch instance which was purchased. + // The ID of the Reserved Instance offering that was purchased. ReservedInstanceId *string // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_RejectInboundConnection.go b/service/opensearch/api_op_RejectInboundConnection.go index 128cf443b3a..23fcffdf4a4 100644 --- a/service/opensearch/api_op_RejectInboundConnection.go +++ b/service/opensearch/api_op_RejectInboundConnection.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allows the remote domain owner to reject an inbound cross-cluster connection -// request. +// Allows the remote Amazon OpenSearch Service domain owner to reject an inbound +// cross-cluster connection request. func (c *Client) RejectInboundConnection(ctx context.Context, params *RejectInboundConnectionInput, optFns ...func(*Options)) (*RejectInboundConnectionOutput, error) { if params == nil { params = &RejectInboundConnectionInput{} @@ -28,10 +28,10 @@ func (c *Client) RejectInboundConnection(ctx context.Context, params *RejectInbo return out, nil } -// Container for the parameters to the RejectInboundConnection operation. +// Container for the request parameters to the RejectInboundConnection operation. type RejectInboundConnectionInput struct { - // The ID of the inbound connection to reject. + // The unique identifier of the inbound connection to reject. // // This member is required. ConnectionId *string @@ -39,11 +39,10 @@ type RejectInboundConnectionInput struct { noSmithyDocumentSerde } -// The result of a RejectInboundConnection operation. Contains details about the -// rejected inbound connection. +// Represents the output of a RejectInboundConnection operation. type RejectInboundConnectionOutput struct { - // The InboundConnection of the rejected inbound connection. + // Contains details about the rejected inbound connection. Connection *types.InboundConnection // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_RemoveTags.go b/service/opensearch/api_op_RemoveTags.go index 31624b43627..6c93b9838ab 100644 --- a/service/opensearch/api_op_RemoveTags.go +++ b/service/opensearch/api_op_RemoveTags.go @@ -10,7 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes the specified set of tags from the given domain. +// Removes the specified set of tags from an Amazon OpenSearch Service domain. For +// more information, see Tagging Amazon OpenSearch Service domains +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains.html#managedomains-awsresorcetagging). func (c *Client) RemoveTags(ctx context.Context, params *RemoveTagsInput, optFns ...func(*Options)) (*RemoveTagsOutput, error) { if params == nil { params = &RemoveTagsInput{} @@ -26,16 +28,16 @@ func (c *Client) RemoveTags(ctx context.Context, params *RemoveTagsInput, optFns return out, nil } -// Container for the parameters to the RemoveTags operation. Specify the ARN for -// the domain from which you want to remove the specified TagKey. +// Container for the request parameters to the RemoveTags operation. type RemoveTagsInput struct { - // The ARN of the domain from which you want to delete the specified tags. + // The Amazon Resource Name (ARN) of the domain from which you want to delete the + // specified tags. // // This member is required. ARN *string - // The TagKey list you want to remove from the domain. + // The list of tag keys to remove from the domain. // // This member is required. TagKeys []string diff --git a/service/opensearch/api_op_RevokeVpcEndpointAccess.go b/service/opensearch/api_op_RevokeVpcEndpointAccess.go new file mode 100644 index 00000000000..7e69bb63748 --- /dev/null +++ b/service/opensearch/api_op_RevokeVpcEndpointAccess.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Revokes access to an Amazon OpenSearch Service domain that was provided through +// an interface VPC endpoint. +func (c *Client) RevokeVpcEndpointAccess(ctx context.Context, params *RevokeVpcEndpointAccessInput, optFns ...func(*Options)) (*RevokeVpcEndpointAccessOutput, error) { + if params == nil { + params = &RevokeVpcEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RevokeVpcEndpointAccess", params, optFns, c.addOperationRevokeVpcEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RevokeVpcEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RevokeVpcEndpointAccessInput struct { + + // The account ID to revoke access from. + // + // This member is required. + Account *string + + // The name of the OpenSearch Service domain. + // + // This member is required. + DomainName *string + + noSmithyDocumentSerde +} + +type RevokeVpcEndpointAccessOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRevokeVpcEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRevokeVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRevokeVpcEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRevokeVpcEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeVpcEndpointAccess(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opRevokeVpcEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "RevokeVpcEndpointAccess", + } +} diff --git a/service/opensearch/api_op_StartServiceSoftwareUpdate.go b/service/opensearch/api_op_StartServiceSoftwareUpdate.go index ef72917aec2..2d0fa775e94 100644 --- a/service/opensearch/api_op_StartServiceSoftwareUpdate.go +++ b/service/opensearch/api_op_StartServiceSoftwareUpdate.go @@ -11,7 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Schedules a service software update for an Amazon OpenSearch Service domain. +// Schedules a service software update for an Amazon OpenSearch Service domain. For +// more information, see Service software updates in Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html). func (c *Client) StartServiceSoftwareUpdate(ctx context.Context, params *StartServiceSoftwareUpdateInput, optFns ...func(*Options)) (*StartServiceSoftwareUpdateOutput, error) { if params == nil { params = &StartServiceSoftwareUpdateInput{} @@ -27,8 +29,8 @@ func (c *Client) StartServiceSoftwareUpdate(ctx context.Context, params *StartSe return out, nil } -// Container for the parameters to the StartServiceSoftwareUpdate operation. -// Specifies the name of the domain to schedule a service software update for. +// Container for the request parameters to the StartServiceSoftwareUpdate +// operation. type StartServiceSoftwareUpdateInput struct { // The name of the domain that you want to update to the latest service software. @@ -39,11 +41,11 @@ type StartServiceSoftwareUpdateInput struct { noSmithyDocumentSerde } -// The result of a StartServiceSoftwareUpdate operation. Contains the status of the -// update. +// Represents the output of a StartServiceSoftwareUpdate operation. Contains the +// status of the update. type StartServiceSoftwareUpdateOutput struct { - // The current status of the OpenSearch service software update. + // The current status of the OpenSearch Service software update. ServiceSoftwareOptions *types.ServiceSoftwareOptions // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_UpdateDomainConfig.go b/service/opensearch/api_op_UpdateDomainConfig.go index 2e5a6e16458..fe96086ea7c 100644 --- a/service/opensearch/api_op_UpdateDomainConfig.go +++ b/service/opensearch/api_op_UpdateDomainConfig.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Modifies the cluster configuration of the specified domain, such as setting the -// instance type and the number of instances. +// Modifies the cluster configuration of the specified Amazon OpenSearch Service +// domain. func (c *Client) UpdateDomainConfig(ctx context.Context, params *UpdateDomainConfigInput, optFns ...func(*Options)) (*UpdateDomainConfigOutput, error) { if params == nil { params = &UpdateDomainConfigInput{} @@ -28,75 +28,94 @@ func (c *Client) UpdateDomainConfig(ctx context.Context, params *UpdateDomainCon return out, nil } -// Container for the parameters to the UpdateDomain operation. Specifies the type -// and number of instances in the domain cluster. +// Container for the request parameters to the UpdateDomain operation. type UpdateDomainConfigInput struct { - // The name of the domain you're updating. + // The name of the domain that you're updating. // // This member is required. DomainName *string - // IAM access policy as a JSON-formatted string. + // Identity and Access Management (IAM) access policy as a JSON-formatted string. AccessPolicies *string - // Modifies the advanced option to allow references to indices in an HTTP request - // body. Must be false when configuring access to individual sub-resources. By - // default, the value is true. See Advanced options - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) - // for more information. + // Key-value pairs to specify advanced configuration options. The following + // key-value pairs are supported: + // + // * "rest.action.multi.allow_explicit_index": + // "true" | "false" - Note the use of a string rather than a boolean. Specifies + // whether explicit references to indexes are allowed inside the body of HTTP + // requests. If you want to configure access policies for domain sub-resources, + // such as specific indexes and domain APIs, you must disable this property. + // Default is true. + // + // * "indices.fielddata.cache.size": "80" - Note the use of a + // string rather than a boolean. Specifies the percentage of heap space allocated + // to field data. Default is unbounded. + // + // * "indices.query.bool.max_clause_count": + // "1024" - Note the use of a string rather than a boolean. Specifies the maximum + // number of clauses allowed in a Lucene boolean query. Default is 1,024. Queries + // with more than the permitted number of clauses result in a TooManyClauses + // error. + // + // * "override_main_response_version": "true" | "false" - Note the use of a + // string rather than a boolean. Specifies whether the domain reports its version + // as 7.10 to allow Elasticsearch OSS clients and plugins to continue working with + // it. Default is false when creating a domain and true when upgrading a + // domain. + // + // For more information, see Advanced cluster parameters + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options). AdvancedOptions map[string]string - // Specifies advanced security options. + // Options for fine-grained access control. AdvancedSecurityOptions *types.AdvancedSecurityOptionsInput - // Specifies Auto-Tune options. + // Options for Auto-Tune. AutoTuneOptions *types.AutoTuneOptions - // The type and number of instances to instantiate for the domain cluster. + // Changes that you want to make to the cluster configuration, such as the instance + // type and number of EC2 instances. ClusterConfig *types.ClusterConfig - // Options to specify the Cognito user and identity pools for OpenSearch Dashboards - // authentication. For more information, see Configuring Amazon Cognito - // authentication for OpenSearch Dashboards - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html). + // Key-value pairs to configure Amazon Cognito authentication for OpenSearch + // Dashboards. CognitoOptions *types.CognitoOptions - // Options to specify configuration that will be applied to the domain endpoint. + // Additional options for the domain endpoint, such as whether to require HTTPS for + // all traffic. DomainEndpointOptions *types.DomainEndpointOptions // This flag, when set to True, specifies whether the UpdateDomain request should - // return the results of validation checks (DryRunResults) without actually - // applying the change. + // return the results of validation check without actually applying the change. DryRun *bool - // Specify the type and size of the EBS volume to use. + // The type and size of the EBS volume to attach to instances in the domain. EBSOptions *types.EBSOptions - // Specifies encryption of data at rest options. + // Encryption at rest options for the domain. EncryptionAtRestOptions *types.EncryptionAtRestOptions - // Map of LogType and LogPublishingOption, each containing options to publish a - // given type of OpenSearch log. + // Options to publish OpenSearch lots to Amazon CloudWatch Logs. LogPublishingOptions map[string]types.LogPublishingOption - // Specifies node-to-node encryption options. + // Node-To-Node Encryption options for the domain. NodeToNodeEncryptionOptions *types.NodeToNodeEncryptionOptions // Option to set the time, in UTC format, for the daily automated snapshot. Default // value is 0 hours. SnapshotOptions *types.SnapshotOptions - // Options to specify the subnets and security groups for the VPC endpoint. For - // more information, see Launching your Amazon OpenSearch Service domains using a - // VPC - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). + // Options to specify the subnets and security groups for a VPC endpoint. For more + // information, see Launching your Amazon OpenSearch Service domains using a VPC + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). VPCOptions *types.VPCOptions noSmithyDocumentSerde } -// The result of an UpdateDomain request. Contains the status of the domain being +// The results of an UpdateDomain request. Contains the status of the domain being // updated. type UpdateDomainConfigOutput struct { @@ -105,7 +124,7 @@ type UpdateDomainConfigOutput struct { // This member is required. DomainConfig *types.DomainConfig - // Contains result of DryRun. + // Results of a dry run performed in an update domain request. DryRunResults *types.DryRunResults // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_UpdatePackage.go b/service/opensearch/api_op_UpdatePackage.go index ef3ef651f6a..e2add7b2883 100644 --- a/service/opensearch/api_op_UpdatePackage.go +++ b/service/opensearch/api_op_UpdatePackage.go @@ -11,7 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates a package for use with Amazon OpenSearch Service domains. +// Updates a package for use with Amazon OpenSearch Service domains. For more +// information, see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). func (c *Client) UpdatePackage(ctx context.Context, params *UpdatePackageInput, optFns ...func(*Options)) (*UpdatePackageOutput, error) { if params == nil { params = &UpdatePackageInput{} @@ -35,13 +37,12 @@ type UpdatePackageInput struct { // This member is required. PackageID *string - // The Amazon S3 location for importing the package specified as S3BucketName and - // S3Key + // Amazon S3 bucket and key for the package. // // This member is required. PackageSource *types.PackageSource - // A commit message for the new version which is shown as part of + // Commit message for the updated file, which is shown as part of // GetPackageVersionHistoryResponse. CommitMessage *string @@ -54,7 +55,7 @@ type UpdatePackageInput struct { // Container for the response returned by the UpdatePackage operation. type UpdatePackageOutput struct { - // Information about the package. + // Information about a package. PackageDetails *types.PackageDetails // Metadata pertaining to the operation's result. diff --git a/service/opensearch/api_op_UpdateVpcEndpoint.go b/service/opensearch/api_op_UpdateVpcEndpoint.go new file mode 100644 index 00000000000..9768ba4162f --- /dev/null +++ b/service/opensearch/api_op_UpdateVpcEndpoint.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an Amazon OpenSearch Service-managed interface VPC endpoint. +func (c *Client) UpdateVpcEndpoint(ctx context.Context, params *UpdateVpcEndpointInput, optFns ...func(*Options)) (*UpdateVpcEndpointOutput, error) { + if params == nil { + params = &UpdateVpcEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateVpcEndpoint", params, optFns, c.addOperationUpdateVpcEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateVpcEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateVpcEndpointInput struct { + + // The unique identifier of the endpoint. + // + // This member is required. + VpcEndpointId *string + + // The security groups and/or subnets to add, remove, or modify. + // + // This member is required. + VpcOptions *types.VPCOptions + + noSmithyDocumentSerde +} + +type UpdateVpcEndpointOutput struct { + + // The endpoint to be updated. + // + // This member is required. + VpcEndpoint *types.VpcEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateVpcEndpoint{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateVpcEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVpcEndpoint(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "es", + OperationName: "UpdateVpcEndpoint", + } +} diff --git a/service/opensearch/api_op_UpgradeDomain.go b/service/opensearch/api_op_UpgradeDomain.go index 18dd7581b8c..1da32926e3a 100644 --- a/service/opensearch/api_op_UpgradeDomain.go +++ b/service/opensearch/api_op_UpgradeDomain.go @@ -11,8 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Allows you to either upgrade your domain or perform an upgrade eligibility check -// to a compatible version of OpenSearch or Elasticsearch. +// Allows you to either upgrade your Amazon OpenSearch Service domain or perform an +// upgrade eligibility check to a compatible version of OpenSearch or +// Elasticsearch. func (c *Client) UpgradeDomain(ctx context.Context, params *UpgradeDomainInput, optFns ...func(*Options)) (*UpgradeDomainOutput, error) { if params == nil { params = &UpgradeDomainInput{} @@ -28,37 +29,24 @@ func (c *Client) UpgradeDomain(ctx context.Context, params *UpgradeDomainInput, return out, nil } -// Container for the request parameters to UpgradeDomain operation. +// Container for the request parameters to the UpgradeDomain operation. type UpgradeDomainInput struct { - // The name of an domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // Name of the OpenSearch Service domain that you want to upgrade. // // This member is required. DomainName *string - // The version of OpenSearch you intend to upgrade the domain to. + // OpenSearch or Elasticsearch version to which you want to upgrade, in the format + // Opensearch_X.Y or Elasticsearch_X.Y. // // This member is required. TargetVersion *string - // Exposes select native OpenSearch configuration values from opensearch.yml. - // Currently, the following advanced options are available: - // - // * Option to allow - // references to indices in an HTTP request body. Must be false when configuring - // access to individual sub-resources. By default, the value is true. See Advanced - // cluster parameters - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) - // for more information. - // - // * Option to specify the percentage of heap space - // allocated to field data. By default, this setting is unbounded. - // - // For more - // information, see Advanced cluster parameters - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options). + // Only supports the override_main_response_version parameter and not other + // advanced options. You can only include this option when upgrading to an + // OpenSearch version. Specifies whether the domain reports its version as 7.10 so + // that it continues to work with Elasticsearch OSS clients and plugins. AdvancedOptions map[string]string // When true, indicates that an upgrade eligibility check needs to be performed. @@ -68,42 +56,25 @@ type UpgradeDomainInput struct { noSmithyDocumentSerde } -// Container for response returned by UpgradeDomain operation. +// Container for the response returned by UpgradeDomain operation. type UpgradeDomainOutput struct { - // Exposes select native OpenSearch configuration values from opensearch.yml. - // Currently, the following advanced options are available: - // - // * Option to allow - // references to indices in an HTTP request body. Must be false when configuring - // access to individual sub-resources. By default, the value is true. See Advanced - // cluster parameters - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) - // for more information. - // - // * Option to specify the percentage of heap space - // allocated to field data. By default, this setting is unbounded. - // - // For more - // information, see Advanced cluster parameters - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options). + // The advanced options configuration for the domain. AdvancedOptions map[string]string - // Specifies change details of the domain configuration change. + // Container for information about a configuration change happening on a domain. ChangeProgressDetails *types.ChangeProgressDetails - // The name of an domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // The name of the domain that was upgraded. DomainName *string - // When true, indicates that an upgrade eligibility check needs to be performed. - // Does not actually perform the upgrade. + // When true, indicates that an upgrade eligibility check was performed. PerformCheckOnly *bool - // The version of OpenSearch that you intend to upgrade the domain to. + // OpenSearch or Elasticsearch version that the domain was upgraded to. TargetVersion *string + // The unique identifier of the domain upgrade. UpgradeId *string // Metadata pertaining to the operation's result. diff --git a/service/opensearch/deserializers.go b/service/opensearch/deserializers.go index 67d0316a9a5..075b1eab41e 100644 --- a/service/opensearch/deserializers.go +++ b/service/opensearch/deserializers.go @@ -434,6 +434,168 @@ func awsRestjson1_deserializeOpDocumentAssociatePackageOutput(v **AssociatePacka return nil } +type awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess struct { +} + +func (*awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAuthorizeVpcEndpointAccess) 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_deserializeOpErrorAuthorizeVpcEndpointAccess(response, &metadata) + } + output := &AuthorizeVpcEndpointAccessOutput{} + 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_deserializeOpDocumentAuthorizeVpcEndpointAccessOutput(&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_deserializeOpErrorAuthorizeVpcEndpointAccess(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(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_deserializeOpDocumentAuthorizeVpcEndpointAccessOutput(v **AuthorizeVpcEndpointAccessOutput, 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 *AuthorizeVpcEndpointAccessOutput + if *v == nil { + sv = &AuthorizeVpcEndpointAccessOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AuthorizedPrincipal": + if err := awsRestjson1_deserializeDocumentAuthorizedPrincipal(&sv.AuthorizedPrincipal, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCancelServiceSoftwareUpdate struct { } @@ -1104,14 +1266,14 @@ func awsRestjson1_deserializeOpDocumentCreatePackageOutput(v **CreatePackageOutp return nil } -type awsRestjson1_deserializeOpDeleteDomain struct { +type awsRestjson1_deserializeOpCreateVpcEndpoint struct { } -func (*awsRestjson1_deserializeOpDeleteDomain) ID() string { +func (*awsRestjson1_deserializeOpCreateVpcEndpoint) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateVpcEndpoint) 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) @@ -1125,9 +1287,9 @@ func (m *awsRestjson1_deserializeOpDeleteDomain) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDomain(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateVpcEndpoint(response, &metadata) } - output := &DeleteDomainOutput{} + output := &CreateVpcEndpointOutput{} out.Result = output var buff [1024]byte @@ -1148,7 +1310,7 @@ func (m *awsRestjson1_deserializeOpDeleteDomain) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteDomainOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1161,7 +1323,7 @@ func (m *awsRestjson1_deserializeOpDeleteDomain) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateVpcEndpoint(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)} @@ -1205,11 +1367,17 @@ func awsRestjson1_deserializeOpErrorDeleteDomain(response *smithyhttp.Response, case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -1224,7 +1392,7 @@ func awsRestjson1_deserializeOpErrorDeleteDomain(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeleteDomainOutput(v **DeleteDomainOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateVpcEndpointOutput(v **CreateVpcEndpointOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1237,17 +1405,17 @@ func awsRestjson1_deserializeOpDocumentDeleteDomainOutput(v **DeleteDomainOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteDomainOutput + var sv *CreateVpcEndpointOutput if *v == nil { - sv = &DeleteDomainOutput{} + sv = &CreateVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainStatus": - if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DomainStatus, value); err != nil { + case "VpcEndpoint": + if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { return err } @@ -1260,14 +1428,14 @@ func awsRestjson1_deserializeOpDocumentDeleteDomainOutput(v **DeleteDomainOutput return nil } -type awsRestjson1_deserializeOpDeleteInboundConnection struct { +type awsRestjson1_deserializeOpDeleteDomain struct { } -func (*awsRestjson1_deserializeOpDeleteInboundConnection) ID() string { +func (*awsRestjson1_deserializeOpDeleteDomain) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteInboundConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDomain) 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) @@ -1281,9 +1449,9 @@ func (m *awsRestjson1_deserializeOpDeleteInboundConnection) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteInboundConnection(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDomain(response, &metadata) } - output := &DeleteInboundConnectionOutput{} + output := &DeleteDomainOutput{} out.Result = output var buff [1024]byte @@ -1304,7 +1472,7 @@ func (m *awsRestjson1_deserializeOpDeleteInboundConnection) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteInboundConnectionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1317,7 +1485,7 @@ func (m *awsRestjson1_deserializeOpDeleteInboundConnection) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteInboundConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDomain(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)} @@ -1358,12 +1526,18 @@ func awsRestjson1_deserializeOpErrorDeleteInboundConnection(response *smithyhttp } switch { - case strings.EqualFold("DisabledOperationException", errorCode): - return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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, @@ -1374,7 +1548,7 @@ func awsRestjson1_deserializeOpErrorDeleteInboundConnection(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentDeleteInboundConnectionOutput(v **DeleteInboundConnectionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteDomainOutput(v **DeleteDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1387,17 +1561,17 @@ func awsRestjson1_deserializeOpDocumentDeleteInboundConnectionOutput(v **DeleteI return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteInboundConnectionOutput + var sv *DeleteDomainOutput if *v == nil { - sv = &DeleteInboundConnectionOutput{} + sv = &DeleteDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Connection": - if err := awsRestjson1_deserializeDocumentInboundConnection(&sv.Connection, value); err != nil { + case "DomainStatus": + if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DomainStatus, value); err != nil { return err } @@ -1410,14 +1584,14 @@ func awsRestjson1_deserializeOpDocumentDeleteInboundConnectionOutput(v **DeleteI return nil } -type awsRestjson1_deserializeOpDeleteOutboundConnection struct { +type awsRestjson1_deserializeOpDeleteInboundConnection struct { } -func (*awsRestjson1_deserializeOpDeleteOutboundConnection) ID() string { +func (*awsRestjson1_deserializeOpDeleteInboundConnection) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteOutboundConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteInboundConnection) 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) @@ -1431,9 +1605,9 @@ func (m *awsRestjson1_deserializeOpDeleteOutboundConnection) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteOutboundConnection(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteInboundConnection(response, &metadata) } - output := &DeleteOutboundConnectionOutput{} + output := &DeleteInboundConnectionOutput{} out.Result = output var buff [1024]byte @@ -1454,7 +1628,7 @@ func (m *awsRestjson1_deserializeOpDeleteOutboundConnection) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteInboundConnectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1467,7 +1641,7 @@ func (m *awsRestjson1_deserializeOpDeleteOutboundConnection) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteOutboundConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteInboundConnection(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)} @@ -1524,7 +1698,7 @@ func awsRestjson1_deserializeOpErrorDeleteOutboundConnection(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(v **DeleteOutboundConnectionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteInboundConnectionOutput(v **DeleteInboundConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1537,9 +1711,9 @@ func awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(v **Delete return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteOutboundConnectionOutput + var sv *DeleteInboundConnectionOutput if *v == nil { - sv = &DeleteOutboundConnectionOutput{} + sv = &DeleteInboundConnectionOutput{} } else { sv = *v } @@ -1547,7 +1721,7 @@ func awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(v **Delete for key, value := range shape { switch key { case "Connection": - if err := awsRestjson1_deserializeDocumentOutboundConnection(&sv.Connection, value); err != nil { + if err := awsRestjson1_deserializeDocumentInboundConnection(&sv.Connection, value); err != nil { return err } @@ -1560,14 +1734,14 @@ func awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(v **Delete return nil } -type awsRestjson1_deserializeOpDeletePackage struct { +type awsRestjson1_deserializeOpDeleteOutboundConnection struct { } -func (*awsRestjson1_deserializeOpDeletePackage) ID() string { +func (*awsRestjson1_deserializeOpDeleteOutboundConnection) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteOutboundConnection) 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) @@ -1581,9 +1755,9 @@ func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteOutboundConnection(response, &metadata) } - output := &DeletePackageOutput{} + output := &DeleteOutboundConnectionOutput{} out.Result = output var buff [1024]byte @@ -1604,7 +1778,7 @@ func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeletePackageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1617,7 +1791,7 @@ func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteOutboundConnection(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)} @@ -1658,24 +1832,12 @@ func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("BaseException", errorCode): - return awsRestjson1_deserializeErrorBaseException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(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, @@ -1686,7 +1848,7 @@ func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeletePackageOutput(v **DeletePackageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteOutboundConnectionOutput(v **DeleteOutboundConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1699,17 +1861,17 @@ func awsRestjson1_deserializeOpDocumentDeletePackageOutput(v **DeletePackageOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeletePackageOutput + var sv *DeleteOutboundConnectionOutput if *v == nil { - sv = &DeletePackageOutput{} + sv = &DeleteOutboundConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "PackageDetails": - if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { + case "Connection": + if err := awsRestjson1_deserializeDocumentOutboundConnection(&sv.Connection, value); err != nil { return err } @@ -1722,14 +1884,14 @@ func awsRestjson1_deserializeOpDocumentDeletePackageOutput(v **DeletePackageOutp return nil } -type awsRestjson1_deserializeOpDescribeDomain struct { +type awsRestjson1_deserializeOpDeletePackage struct { } -func (*awsRestjson1_deserializeOpDescribeDomain) ID() string { +func (*awsRestjson1_deserializeOpDeletePackage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePackage) 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) @@ -1743,9 +1905,9 @@ func (m *awsRestjson1_deserializeOpDescribeDomain) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomain(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePackage(response, &metadata) } - output := &DescribeDomainOutput{} + output := &DeletePackageOutput{} out.Result = output var buff [1024]byte @@ -1766,7 +1928,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomain) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDomainOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeletePackageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1779,7 +1941,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomain) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePackage(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)} @@ -1820,9 +1982,15 @@ func awsRestjson1_deserializeOpErrorDescribeDomain(response *smithyhttp.Response } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -1842,7 +2010,7 @@ func awsRestjson1_deserializeOpErrorDescribeDomain(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentDescribeDomainOutput(v **DescribeDomainOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeletePackageOutput(v **DeletePackageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1855,17 +2023,17 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainOutput(v **DescribeDomainOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDomainOutput + var sv *DeletePackageOutput if *v == nil { - sv = &DescribeDomainOutput{} + sv = &DeletePackageOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainStatus": - if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DomainStatus, value); err != nil { + case "PackageDetails": + if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { return err } @@ -1878,14 +2046,14 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainOutput(v **DescribeDomainOu return nil } -type awsRestjson1_deserializeOpDescribeDomainAutoTunes struct { +type awsRestjson1_deserializeOpDeleteVpcEndpoint struct { } -func (*awsRestjson1_deserializeOpDescribeDomainAutoTunes) ID() string { +func (*awsRestjson1_deserializeOpDeleteVpcEndpoint) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDomainAutoTunes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteVpcEndpoint) 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) @@ -1899,9 +2067,9 @@ func (m *awsRestjson1_deserializeOpDescribeDomainAutoTunes) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVpcEndpoint(response, &metadata) } - output := &DescribeDomainAutoTunesOutput{} + output := &DeleteVpcEndpointOutput{} out.Result = output var buff [1024]byte @@ -1922,7 +2090,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomainAutoTunes) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteVpcEndpointOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1935,7 +2103,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomainAutoTunes) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteVpcEndpoint(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)} @@ -1979,15 +2147,15 @@ func awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(response *smithyhttp case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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, @@ -1998,7 +2166,7 @@ func awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(v **DescribeDomainAutoTunesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteVpcEndpointOutput(v **DeleteVpcEndpointOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2011,29 +2179,20 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(v **Describ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDomainAutoTunesOutput + var sv *DeleteVpcEndpointOutput if *v == nil { - sv = &DescribeDomainAutoTunesOutput{} + sv = &DeleteVpcEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AutoTunes": - if err := awsRestjson1_deserializeDocumentAutoTuneList(&sv.AutoTunes, value); err != nil { + case "VpcEndpointSummary": + if err := awsRestjson1_deserializeDocumentVpcEndpointSummary(&sv.VpcEndpointSummary, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -2043,14 +2202,14 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(v **Describ return nil } -type awsRestjson1_deserializeOpDescribeDomainChangeProgress struct { +type awsRestjson1_deserializeOpDescribeDomain struct { } -func (*awsRestjson1_deserializeOpDescribeDomainChangeProgress) ID() string { +func (*awsRestjson1_deserializeOpDescribeDomain) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDomainChangeProgress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDomain) 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) @@ -2064,9 +2223,9 @@ func (m *awsRestjson1_deserializeOpDescribeDomainChangeProgress) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainChangeProgress(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomain(response, &metadata) } - output := &DescribeDomainChangeProgressOutput{} + output := &DescribeDomainOutput{} out.Result = output var buff [1024]byte @@ -2087,7 +2246,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomainChangeProgress) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDomainChangeProgressOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2100,7 +2259,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomainChangeProgress) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDomainChangeProgress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDomain(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)} @@ -2163,7 +2322,7 @@ func awsRestjson1_deserializeOpErrorDescribeDomainChangeProgress(response *smith } } -func awsRestjson1_deserializeOpDocumentDescribeDomainChangeProgressOutput(v **DescribeDomainChangeProgressOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDomainOutput(v **DescribeDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2176,17 +2335,17 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainChangeProgressOutput(v **De return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDomainChangeProgressOutput + var sv *DescribeDomainOutput if *v == nil { - sv = &DescribeDomainChangeProgressOutput{} + sv = &DescribeDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ChangeProgressStatus": - if err := awsRestjson1_deserializeDocumentChangeProgressStatusDetails(&sv.ChangeProgressStatus, value); err != nil { + case "DomainStatus": + if err := awsRestjson1_deserializeDocumentDomainStatus(&sv.DomainStatus, value); err != nil { return err } @@ -2199,14 +2358,14 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainChangeProgressOutput(v **De return nil } -type awsRestjson1_deserializeOpDescribeDomainConfig struct { +type awsRestjson1_deserializeOpDescribeDomainAutoTunes struct { } -func (*awsRestjson1_deserializeOpDescribeDomainConfig) ID() string { +func (*awsRestjson1_deserializeOpDescribeDomainAutoTunes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDomainConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDomainAutoTunes) 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) @@ -2220,9 +2379,9 @@ func (m *awsRestjson1_deserializeOpDescribeDomainConfig) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainConfig(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(response, &metadata) } - output := &DescribeDomainConfigOutput{} + output := &DescribeDomainAutoTunesOutput{} out.Result = output var buff [1024]byte @@ -2243,7 +2402,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomainConfig) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDomainConfigOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2256,7 +2415,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomainConfig) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDomainConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(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)} @@ -2319,7 +2478,7 @@ func awsRestjson1_deserializeOpErrorDescribeDomainConfig(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentDescribeDomainConfigOutput(v **DescribeDomainConfigOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(v **DescribeDomainAutoTunesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2332,20 +2491,29 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainConfigOutput(v **DescribeDo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDomainConfigOutput + var sv *DescribeDomainAutoTunesOutput if *v == nil { - sv = &DescribeDomainConfigOutput{} + sv = &DescribeDomainAutoTunesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainConfig": - if err := awsRestjson1_deserializeDocumentDomainConfig(&sv.DomainConfig, value); err != nil { + case "AutoTunes": + if err := awsRestjson1_deserializeDocumentAutoTuneList(&sv.AutoTunes, value); err != nil { return err } + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -2355,14 +2523,14 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainConfigOutput(v **DescribeDo return nil } -type awsRestjson1_deserializeOpDescribeDomains struct { +type awsRestjson1_deserializeOpDescribeDomainChangeProgress struct { } -func (*awsRestjson1_deserializeOpDescribeDomains) ID() string { +func (*awsRestjson1_deserializeOpDescribeDomainChangeProgress) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDomainChangeProgress) 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) @@ -2376,9 +2544,9 @@ func (m *awsRestjson1_deserializeOpDescribeDomains) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomains(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainChangeProgress(response, &metadata) } - output := &DescribeDomainsOutput{} + output := &DescribeDomainChangeProgressOutput{} out.Result = output var buff [1024]byte @@ -2399,7 +2567,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomains) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeDomainsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDomainChangeProgressOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2412,7 +2580,7 @@ func (m *awsRestjson1_deserializeOpDescribeDomains) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDomainChangeProgress(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)} @@ -2459,6 +2627,9 @@ func awsRestjson1_deserializeOpErrorDescribeDomains(response *smithyhttp.Respons case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2472,7 +2643,7 @@ func awsRestjson1_deserializeOpErrorDescribeDomains(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentDescribeDomainsOutput(v **DescribeDomainsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDomainChangeProgressOutput(v **DescribeDomainChangeProgressOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2485,17 +2656,17 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainsOutput(v **DescribeDomains return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeDomainsOutput + var sv *DescribeDomainChangeProgressOutput if *v == nil { - sv = &DescribeDomainsOutput{} + sv = &DescribeDomainChangeProgressOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainStatusList": - if err := awsRestjson1_deserializeDocumentDomainStatusList(&sv.DomainStatusList, value); err != nil { + case "ChangeProgressStatus": + if err := awsRestjson1_deserializeDocumentChangeProgressStatusDetails(&sv.ChangeProgressStatus, value); err != nil { return err } @@ -2508,14 +2679,14 @@ func awsRestjson1_deserializeOpDocumentDescribeDomainsOutput(v **DescribeDomains return nil } -type awsRestjson1_deserializeOpDescribeInboundConnections struct { +type awsRestjson1_deserializeOpDescribeDomainConfig struct { } -func (*awsRestjson1_deserializeOpDescribeInboundConnections) ID() string { +func (*awsRestjson1_deserializeOpDescribeDomainConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeInboundConnections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDomainConfig) 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) @@ -2529,9 +2700,9 @@ func (m *awsRestjson1_deserializeOpDescribeInboundConnections) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeInboundConnections(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainConfig(response, &metadata) } - output := &DescribeInboundConnectionsOutput{} + output := &DescribeDomainConfigOutput{} out.Result = output var buff [1024]byte @@ -2552,7 +2723,7 @@ func (m *awsRestjson1_deserializeOpDescribeInboundConnections) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeInboundConnectionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDomainConfigOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2565,7 +2736,7 @@ func (m *awsRestjson1_deserializeOpDescribeInboundConnections) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeInboundConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDomainConfig(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)} @@ -2606,11 +2777,17 @@ func awsRestjson1_deserializeOpErrorDescribeInboundConnections(response *smithyh } switch { - case strings.EqualFold("DisabledOperationException", errorCode): - return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) - case strings.EqualFold("InvalidPaginationTokenException", errorCode): - return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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{ @@ -2622,7 +2799,7 @@ func awsRestjson1_deserializeOpErrorDescribeInboundConnections(response *smithyh } } -func awsRestjson1_deserializeOpDocumentDescribeInboundConnectionsOutput(v **DescribeInboundConnectionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDomainConfigOutput(v **DescribeDomainConfigOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2635,29 +2812,20 @@ func awsRestjson1_deserializeOpDocumentDescribeInboundConnectionsOutput(v **Desc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeInboundConnectionsOutput + var sv *DescribeDomainConfigOutput if *v == nil { - sv = &DescribeInboundConnectionsOutput{} + sv = &DescribeDomainConfigOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Connections": - if err := awsRestjson1_deserializeDocumentInboundConnections(&sv.Connections, value); err != nil { + case "DomainConfig": + if err := awsRestjson1_deserializeDocumentDomainConfig(&sv.DomainConfig, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -2667,14 +2835,14 @@ func awsRestjson1_deserializeOpDocumentDescribeInboundConnectionsOutput(v **Desc return nil } -type awsRestjson1_deserializeOpDescribeInstanceTypeLimits struct { +type awsRestjson1_deserializeOpDescribeDomains struct { } -func (*awsRestjson1_deserializeOpDescribeInstanceTypeLimits) ID() string { +func (*awsRestjson1_deserializeOpDescribeDomains) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeInstanceTypeLimits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeDomains) 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) @@ -2688,9 +2856,9 @@ func (m *awsRestjson1_deserializeOpDescribeInstanceTypeLimits) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeInstanceTypeLimits(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomains(response, &metadata) } - output := &DescribeInstanceTypeLimitsOutput{} + output := &DescribeDomainsOutput{} out.Result = output var buff [1024]byte @@ -2711,7 +2879,7 @@ func (m *awsRestjson1_deserializeOpDescribeInstanceTypeLimits) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeDomainsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2724,7 +2892,7 @@ func (m *awsRestjson1_deserializeOpDescribeInstanceTypeLimits) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeInstanceTypeLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeDomains(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)} @@ -2771,15 +2939,6 @@ func awsRestjson1_deserializeOpErrorDescribeInstanceTypeLimits(response *smithyh case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("InvalidTypeException", errorCode): - return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -2793,7 +2952,7 @@ func awsRestjson1_deserializeOpErrorDescribeInstanceTypeLimits(response *smithyh } } -func awsRestjson1_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(v **DescribeInstanceTypeLimitsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeDomainsOutput(v **DescribeDomainsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2806,17 +2965,17 @@ func awsRestjson1_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(v **Desc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeInstanceTypeLimitsOutput + var sv *DescribeDomainsOutput if *v == nil { - sv = &DescribeInstanceTypeLimitsOutput{} + sv = &DescribeDomainsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LimitsByRole": - if err := awsRestjson1_deserializeDocumentLimitsByRole(&sv.LimitsByRole, value); err != nil { + case "DomainStatusList": + if err := awsRestjson1_deserializeDocumentDomainStatusList(&sv.DomainStatusList, value); err != nil { return err } @@ -2829,14 +2988,14 @@ func awsRestjson1_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(v **Desc return nil } -type awsRestjson1_deserializeOpDescribeOutboundConnections struct { +type awsRestjson1_deserializeOpDescribeInboundConnections struct { } -func (*awsRestjson1_deserializeOpDescribeOutboundConnections) ID() string { +func (*awsRestjson1_deserializeOpDescribeInboundConnections) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeOutboundConnections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeInboundConnections) 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) @@ -2850,9 +3009,9 @@ func (m *awsRestjson1_deserializeOpDescribeOutboundConnections) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeOutboundConnections(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeInboundConnections(response, &metadata) } - output := &DescribeOutboundConnectionsOutput{} + output := &DescribeInboundConnectionsOutput{} out.Result = output var buff [1024]byte @@ -2873,7 +3032,7 @@ func (m *awsRestjson1_deserializeOpDescribeOutboundConnections) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeInboundConnectionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2886,7 +3045,7 @@ func (m *awsRestjson1_deserializeOpDescribeOutboundConnections) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeOutboundConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeInboundConnections(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)} @@ -2943,7 +3102,7 @@ func awsRestjson1_deserializeOpErrorDescribeOutboundConnections(response *smithy } } -func awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(v **DescribeOutboundConnectionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeInboundConnectionsOutput(v **DescribeInboundConnectionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2956,9 +3115,9 @@ func awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(v **Des return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeOutboundConnectionsOutput + var sv *DescribeInboundConnectionsOutput if *v == nil { - sv = &DescribeOutboundConnectionsOutput{} + sv = &DescribeInboundConnectionsOutput{} } else { sv = *v } @@ -2966,7 +3125,7 @@ func awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(v **Des for key, value := range shape { switch key { case "Connections": - if err := awsRestjson1_deserializeDocumentOutboundConnections(&sv.Connections, value); err != nil { + if err := awsRestjson1_deserializeDocumentInboundConnections(&sv.Connections, value); err != nil { return err } @@ -2988,14 +3147,14 @@ func awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(v **Des return nil } -type awsRestjson1_deserializeOpDescribePackages struct { +type awsRestjson1_deserializeOpDescribeInstanceTypeLimits struct { } -func (*awsRestjson1_deserializeOpDescribePackages) ID() string { +func (*awsRestjson1_deserializeOpDescribeInstanceTypeLimits) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeInstanceTypeLimits) 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) @@ -3009,9 +3168,9 @@ func (m *awsRestjson1_deserializeOpDescribePackages) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribePackages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeInstanceTypeLimits(response, &metadata) } - output := &DescribePackagesOutput{} + output := &DescribeInstanceTypeLimitsOutput{} out.Result = output var buff [1024]byte @@ -3032,7 +3191,7 @@ func (m *awsRestjson1_deserializeOpDescribePackages) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribePackagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3045,7 +3204,7 @@ func (m *awsRestjson1_deserializeOpDescribePackages) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeInstanceTypeLimits(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)} @@ -3086,15 +3245,18 @@ func awsRestjson1_deserializeOpErrorDescribePackages(response *smithyhttp.Respon } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InvalidTypeException", errorCode): + return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3111,7 +3273,7 @@ func awsRestjson1_deserializeOpErrorDescribePackages(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentDescribePackagesOutput(v **DescribePackagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeInstanceTypeLimitsOutput(v **DescribeInstanceTypeLimitsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3124,26 +3286,17 @@ func awsRestjson1_deserializeOpDocumentDescribePackagesOutput(v **DescribePackag return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribePackagesOutput + var sv *DescribeInstanceTypeLimitsOutput if *v == nil { - sv = &DescribePackagesOutput{} + sv = &DescribeInstanceTypeLimitsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "PackageDetailsList": - if err := awsRestjson1_deserializeDocumentPackageDetailsList(&sv.PackageDetailsList, value); err != nil { + case "LimitsByRole": + if err := awsRestjson1_deserializeDocumentLimitsByRole(&sv.LimitsByRole, value); err != nil { return err } @@ -3156,14 +3309,14 @@ func awsRestjson1_deserializeOpDocumentDescribePackagesOutput(v **DescribePackag return nil } -type awsRestjson1_deserializeOpDescribeReservedInstanceOfferings struct { +type awsRestjson1_deserializeOpDescribeOutboundConnections struct { } -func (*awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) ID() string { +func (*awsRestjson1_deserializeOpDescribeOutboundConnections) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeOutboundConnections) 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) @@ -3177,9 +3330,9 @@ func (m *awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeReservedInstanceOfferings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeOutboundConnections(response, &metadata) } - output := &DescribeReservedInstanceOfferingsOutput{} + output := &DescribeOutboundConnectionsOutput{} out.Result = output var buff [1024]byte @@ -3200,7 +3353,7 @@ func (m *awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3213,7 +3366,7 @@ func (m *awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeReservedInstanceOfferings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeOutboundConnections(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)} @@ -3257,14 +3410,8 @@ func awsRestjson1_deserializeOpErrorDescribeReservedInstanceOfferings(response * case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3276,7 +3423,7 @@ func awsRestjson1_deserializeOpErrorDescribeReservedInstanceOfferings(response * } } -func awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(v **DescribeReservedInstanceOfferingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeOutboundConnectionsOutput(v **DescribeOutboundConnectionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3289,15 +3436,20 @@ func awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeReservedInstanceOfferingsOutput + var sv *DescribeOutboundConnectionsOutput if *v == nil { - sv = &DescribeReservedInstanceOfferingsOutput{} + sv = &DescribeOutboundConnectionsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "Connections": + if err := awsRestjson1_deserializeDocumentOutboundConnections(&sv.Connections, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -3307,11 +3459,6 @@ func awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(v sv.NextToken = ptr.String(jtv) } - case "ReservedInstanceOfferings": - if err := awsRestjson1_deserializeDocumentReservedInstanceOfferingList(&sv.ReservedInstanceOfferings, value); err != nil { - return err - } - default: _, _ = key, value @@ -3321,14 +3468,14 @@ func awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(v return nil } -type awsRestjson1_deserializeOpDescribeReservedInstances struct { +type awsRestjson1_deserializeOpDescribePackages struct { } -func (*awsRestjson1_deserializeOpDescribeReservedInstances) ID() string { +func (*awsRestjson1_deserializeOpDescribePackages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeReservedInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribePackages) 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) @@ -3342,9 +3489,9 @@ func (m *awsRestjson1_deserializeOpDescribeReservedInstances) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeReservedInstances(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribePackages(response, &metadata) } - output := &DescribeReservedInstancesOutput{} + output := &DescribePackagesOutput{} out.Result = output var buff [1024]byte @@ -3365,7 +3512,7 @@ func (m *awsRestjson1_deserializeOpDescribeReservedInstances) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribePackagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3378,7 +3525,7 @@ func (m *awsRestjson1_deserializeOpDescribeReservedInstances) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeReservedInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribePackages(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)} @@ -3419,8 +3566,11 @@ func awsRestjson1_deserializeOpErrorDescribeReservedInstances(response *smithyht } switch { - case strings.EqualFold("DisabledOperationException", errorCode): - return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -3441,7 +3591,7 @@ func awsRestjson1_deserializeOpErrorDescribeReservedInstances(response *smithyht } } -func awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(v **DescribeReservedInstancesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribePackagesOutput(v **DescribePackagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3454,9 +3604,9 @@ func awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(v **Descr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeReservedInstancesOutput + var sv *DescribePackagesOutput if *v == nil { - sv = &DescribeReservedInstancesOutput{} + sv = &DescribePackagesOutput{} } else { sv = *v } @@ -3472,8 +3622,8 @@ func awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(v **Descr sv.NextToken = ptr.String(jtv) } - case "ReservedInstances": - if err := awsRestjson1_deserializeDocumentReservedInstanceList(&sv.ReservedInstances, value); err != nil { + case "PackageDetailsList": + if err := awsRestjson1_deserializeDocumentPackageDetailsList(&sv.PackageDetailsList, value); err != nil { return err } @@ -3486,14 +3636,14 @@ func awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(v **Descr return nil } -type awsRestjson1_deserializeOpDissociatePackage struct { +type awsRestjson1_deserializeOpDescribeReservedInstanceOfferings struct { } -func (*awsRestjson1_deserializeOpDissociatePackage) ID() string { +func (*awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeReservedInstanceOfferings) 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) @@ -3507,9 +3657,9 @@ func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDissociatePackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeReservedInstanceOfferings(response, &metadata) } - output := &DissociatePackageOutput{} + output := &DescribeReservedInstanceOfferingsOutput{} out.Result = output var buff [1024]byte @@ -3530,7 +3680,7 @@ func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDissociatePackageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3543,7 +3693,7 @@ func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDissociatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeReservedInstanceOfferings(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)} @@ -3584,14 +3734,8 @@ func awsRestjson1_deserializeOpErrorDissociatePackage(response *smithyhttp.Respo } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("BaseException", errorCode): - return awsRestjson1_deserializeErrorBaseException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -3612,7 +3756,7 @@ func awsRestjson1_deserializeOpErrorDissociatePackage(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePackageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeReservedInstanceOfferingsOutput(v **DescribeReservedInstanceOfferingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3625,17 +3769,26 @@ func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DissociatePackageOutput + var sv *DescribeReservedInstanceOfferingsOutput if *v == nil { - sv = &DissociatePackageOutput{} + sv = &DescribeReservedInstanceOfferingsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainPackageDetails": - if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&sv.DomainPackageDetails, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ReservedInstanceOfferings": + if err := awsRestjson1_deserializeDocumentReservedInstanceOfferingList(&sv.ReservedInstanceOfferings, value); err != nil { return err } @@ -3648,14 +3801,14 @@ func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePac return nil } -type awsRestjson1_deserializeOpGetCompatibleVersions struct { +type awsRestjson1_deserializeOpDescribeReservedInstances struct { } -func (*awsRestjson1_deserializeOpGetCompatibleVersions) ID() string { +func (*awsRestjson1_deserializeOpDescribeReservedInstances) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeReservedInstances) 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) @@ -3669,9 +3822,9 @@ func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetCompatibleVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeReservedInstances(response, &metadata) } - output := &GetCompatibleVersionsOutput{} + output := &DescribeReservedInstancesOutput{} out.Result = output var buff [1024]byte @@ -3692,7 +3845,7 @@ func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3705,7 +3858,7 @@ func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeReservedInstances(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)} @@ -3746,9 +3899,6 @@ func awsRestjson1_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.R } switch { - case strings.EqualFold("BaseException", errorCode): - return awsRestjson1_deserializeErrorBaseException(response, errorBody) - case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) @@ -3771,7 +3921,7 @@ func awsRestjson1_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompatibleVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeReservedInstancesOutput(v **DescribeReservedInstancesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3784,17 +3934,26 @@ func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetCompatibleVersionsOutput + var sv *DescribeReservedInstancesOutput if *v == nil { - sv = &GetCompatibleVersionsOutput{} + sv = &DescribeReservedInstancesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CompatibleVersions": - if err := awsRestjson1_deserializeDocumentCompatibleVersionsList(&sv.CompatibleVersions, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ReservedInstances": + if err := awsRestjson1_deserializeDocumentReservedInstanceList(&sv.ReservedInstances, value); err != nil { return err } @@ -3807,14 +3966,14 @@ func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompat return nil } -type awsRestjson1_deserializeOpGetPackageVersionHistory struct { +type awsRestjson1_deserializeOpDescribeVpcEndpoints struct { } -func (*awsRestjson1_deserializeOpGetPackageVersionHistory) ID() string { +func (*awsRestjson1_deserializeOpDescribeVpcEndpoints) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPackageVersionHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeVpcEndpoints) 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) @@ -3828,9 +3987,9 @@ func (m *awsRestjson1_deserializeOpGetPackageVersionHistory) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPackageVersionHistory(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeVpcEndpoints(response, &metadata) } - output := &GetPackageVersionHistoryOutput{} + output := &DescribeVpcEndpointsOutput{} out.Result = output var buff [1024]byte @@ -3851,7 +4010,7 @@ func (m *awsRestjson1_deserializeOpGetPackageVersionHistory) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeVpcEndpointsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3864,7 +4023,7 @@ func (m *awsRestjson1_deserializeOpGetPackageVersionHistory) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPackageVersionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeVpcEndpoints(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)} @@ -3905,18 +4064,15 @@ func awsRestjson1_deserializeOpErrorGetPackageVersionHistory(response *smithyhtt } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -3930,7 +4086,7 @@ func awsRestjson1_deserializeOpErrorGetPackageVersionHistory(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPackageVersionHistoryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeVpcEndpointsOutput(v **DescribeVpcEndpointsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3943,35 +4099,22 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPackageVersionHistoryOutput + var sv *DescribeVpcEndpointsOutput if *v == nil { - sv = &GetPackageVersionHistoryOutput{} + sv = &DescribeVpcEndpointsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "PackageID": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) - } - sv.PackageID = ptr.String(jtv) + case "VpcEndpointErrors": + if err := awsRestjson1_deserializeDocumentVpcEndpointErrorList(&sv.VpcEndpointErrors, value); err != nil { + return err } - case "PackageVersionHistoryList": - if err := awsRestjson1_deserializeDocumentPackageVersionHistoryList(&sv.PackageVersionHistoryList, value); err != nil { + case "VpcEndpoints": + if err := awsRestjson1_deserializeDocumentVpcEndpoints(&sv.VpcEndpoints, value); err != nil { return err } @@ -3984,14 +4127,14 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPac return nil } -type awsRestjson1_deserializeOpGetUpgradeHistory struct { +type awsRestjson1_deserializeOpDissociatePackage struct { } -func (*awsRestjson1_deserializeOpGetUpgradeHistory) ID() string { +func (*awsRestjson1_deserializeOpDissociatePackage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDissociatePackage) 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) @@ -4005,9 +4148,9 @@ func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeHistory(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDissociatePackage(response, &metadata) } - output := &GetUpgradeHistoryOutput{} + output := &DissociatePackageOutput{} out.Result = output var buff [1024]byte @@ -4028,7 +4171,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDissociatePackageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4041,7 +4184,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDissociatePackage(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)} @@ -4082,11 +4225,14 @@ func awsRestjson1_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Respo } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) - case strings.EqualFold("DisabledOperationException", errorCode): - return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -4107,7 +4253,7 @@ func awsRestjson1_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHistoryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePackageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4120,26 +4266,17 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHis return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetUpgradeHistoryOutput + var sv *DissociatePackageOutput if *v == nil { - sv = &GetUpgradeHistoryOutput{} + sv = &DissociatePackageOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "UpgradeHistories": - if err := awsRestjson1_deserializeDocumentUpgradeHistoryList(&sv.UpgradeHistories, value); err != nil { + case "DomainPackageDetails": + if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&sv.DomainPackageDetails, value); err != nil { return err } @@ -4152,14 +4289,14 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHis return nil } -type awsRestjson1_deserializeOpGetUpgradeStatus struct { +type awsRestjson1_deserializeOpGetCompatibleVersions struct { } -func (*awsRestjson1_deserializeOpGetUpgradeStatus) ID() string { +func (*awsRestjson1_deserializeOpGetCompatibleVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetCompatibleVersions) 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) @@ -4173,9 +4310,9 @@ func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetCompatibleVersions(response, &metadata) } - output := &GetUpgradeStatusOutput{} + output := &GetCompatibleVersionsOutput{} out.Result = output var buff [1024]byte @@ -4196,7 +4333,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4209,7 +4346,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetCompatibleVersions(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)} @@ -4275,7 +4412,7 @@ func awsRestjson1_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStatusOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompatibleVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4288,40 +4425,195 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetUpgradeStatusOutput + var sv *GetCompatibleVersionsOutput if *v == nil { - sv = &GetUpgradeStatusOutput{} + sv = &GetCompatibleVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "StepStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) - } - sv.StepStatus = types.UpgradeStatus(jtv) + case "CompatibleVersions": + if err := awsRestjson1_deserializeDocumentCompatibleVersionsList(&sv.CompatibleVersions, value); err != nil { + return err } - case "UpgradeName": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetPackageVersionHistory struct { +} + +func (*awsRestjson1_deserializeOpGetPackageVersionHistory) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetPackageVersionHistory) 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_deserializeOpErrorGetPackageVersionHistory(response, &metadata) + } + output := &GetPackageVersionHistoryOutput{} + 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_deserializeOpDocumentGetPackageVersionHistoryOutput(&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_deserializeOpErrorGetPackageVersionHistory(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPackageVersionHistoryOutput, 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 *GetPackageVersionHistoryOutput + if *v == nil { + sv = &GetPackageVersionHistoryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.UpgradeName = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "UpgradeStep": + case "PackageID": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) } - sv.UpgradeStep = types.UpgradeStep(jtv) + sv.PackageID = ptr.String(jtv) + } + + case "PackageVersionHistoryList": + if err := awsRestjson1_deserializeDocumentPackageVersionHistoryList(&sv.PackageVersionHistoryList, value); err != nil { + return err } default: @@ -4333,14 +4625,14 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStat return nil } -type awsRestjson1_deserializeOpListDomainNames struct { +type awsRestjson1_deserializeOpGetUpgradeHistory struct { } -func (*awsRestjson1_deserializeOpListDomainNames) ID() string { +func (*awsRestjson1_deserializeOpGetUpgradeHistory) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetUpgradeHistory) 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) @@ -4354,9 +4646,841 @@ func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDomainNames(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeHistory(response, &metadata) + } + output := &GetUpgradeHistoryOutput{} + 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_deserializeOpDocumentGetUpgradeHistoryOutput(&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_deserializeOpErrorGetUpgradeHistory(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHistoryOutput, 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 *GetUpgradeHistoryOutput + if *v == nil { + sv = &GetUpgradeHistoryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "UpgradeHistories": + if err := awsRestjson1_deserializeDocumentUpgradeHistoryList(&sv.UpgradeHistories, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetUpgradeStatus struct { +} + +func (*awsRestjson1_deserializeOpGetUpgradeStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetUpgradeStatus) 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_deserializeOpErrorGetUpgradeStatus(response, &metadata) + } + output := &GetUpgradeStatusOutput{} + 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_deserializeOpDocumentGetUpgradeStatusOutput(&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_deserializeOpErrorGetUpgradeStatus(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStatusOutput, 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 *GetUpgradeStatusOutput + if *v == nil { + sv = &GetUpgradeStatusOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "StepStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) + } + sv.StepStatus = types.UpgradeStatus(jtv) + } + + case "UpgradeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) + } + sv.UpgradeName = ptr.String(jtv) + } + + case "UpgradeStep": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) + } + sv.UpgradeStep = types.UpgradeStep(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDomainNames struct { +} + +func (*awsRestjson1_deserializeOpListDomainNames) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDomainNames) 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_deserializeOpErrorListDomainNames(response, &metadata) + } + output := &ListDomainNamesOutput{} + 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_deserializeOpDocumentListDomainNamesOutput(&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_deserializeOpErrorListDomainNames(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNamesOutput, 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 *ListDomainNamesOutput + if *v == nil { + sv = &ListDomainNamesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainNames": + if err := awsRestjson1_deserializeDocumentDomainInfoList(&sv.DomainNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDomainsForPackage struct { +} + +func (*awsRestjson1_deserializeOpListDomainsForPackage) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDomainsForPackage) 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_deserializeOpErrorListDomainsForPackage(response, &metadata) + } + output := &ListDomainsForPackageOutput{} + 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_deserializeOpDocumentListDomainsForPackageOutput(&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_deserializeOpErrorListDomainsForPackage(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomainsForPackageOutput, 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 *ListDomainsForPackageOutput + if *v == nil { + sv = &ListDomainsForPackageOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainPackageDetailsList": + if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListInstanceTypeDetails struct { +} + +func (*awsRestjson1_deserializeOpListInstanceTypeDetails) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListInstanceTypeDetails) 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_deserializeOpErrorListInstanceTypeDetails(response, &metadata) + } + output := &ListInstanceTypeDetailsOutput{} + 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_deserializeOpDocumentListInstanceTypeDetailsOutput(&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_deserializeOpErrorListInstanceTypeDetails(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentListInstanceTypeDetailsOutput(v **ListInstanceTypeDetailsOutput, 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 *ListInstanceTypeDetailsOutput + if *v == nil { + sv = &ListInstanceTypeDetailsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InstanceTypeDetails": + if err := awsRestjson1_deserializeDocumentInstanceTypeDetailsList(&sv.InstanceTypeDetails, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPackagesForDomain struct { +} + +func (*awsRestjson1_deserializeOpListPackagesForDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPackagesForDomain) 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_deserializeOpErrorListPackagesForDomain(response, &metadata) } - output := &ListDomainNamesOutput{} + output := &ListPackagesForDomainOutput{} out.Result = output var buff [1024]byte @@ -4377,7 +5501,7 @@ func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDomainNamesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4390,7 +5514,7 @@ func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDomainNames(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPackagesForDomain(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)} @@ -4431,9 +5555,18 @@ func awsRestjson1_deserializeOpErrorListDomainNames(response *smithyhttp.Respons } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -4447,7 +5580,7 @@ func awsRestjson1_deserializeOpErrorListDomainNames(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNamesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPackagesForDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4460,20 +5593,29 @@ func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNames return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDomainNamesOutput + var sv *ListPackagesForDomainOutput if *v == nil { - sv = &ListDomainNamesOutput{} + sv = &ListPackagesForDomainOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainNames": - if err := awsRestjson1_deserializeDocumentDomainInfoList(&sv.DomainNames, value); err != nil { + case "DomainPackageDetailsList": + if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { return err } + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -4483,14 +5625,14 @@ func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNames return nil } -type awsRestjson1_deserializeOpListDomainsForPackage struct { +type awsRestjson1_deserializeOpListTags struct { } -func (*awsRestjson1_deserializeOpListDomainsForPackage) ID() string { +func (*awsRestjson1_deserializeOpListTags) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTags) 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) @@ -4504,9 +5646,9 @@ func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDomainsForPackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTags(response, &metadata) } - output := &ListDomainsForPackageOutput{} + output := &ListTagsOutput{} out.Result = output var buff [1024]byte @@ -4527,7 +5669,7 @@ func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4540,7 +5682,7 @@ func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDomainsForPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTags(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)} @@ -4581,9 +5723,6 @@ func awsRestjson1_deserializeOpErrorListDomainsForPackage(response *smithyhttp.R } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) @@ -4606,7 +5745,7 @@ func awsRestjson1_deserializeOpErrorListDomainsForPackage(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomainsForPackageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4619,29 +5758,20 @@ func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDomainsForPackageOutput + var sv *ListTagsOutput if *v == nil { - sv = &ListDomainsForPackageOutput{} + sv = &ListTagsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainPackageDetailsList": - if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { + case "TagList": + if err := awsRestjson1_deserializeDocumentTagList(&sv.TagList, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -4651,14 +5781,14 @@ func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomai return nil } -type awsRestjson1_deserializeOpListInstanceTypeDetails struct { +type awsRestjson1_deserializeOpListVersions struct { } -func (*awsRestjson1_deserializeOpListInstanceTypeDetails) ID() string { +func (*awsRestjson1_deserializeOpListVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListInstanceTypeDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListVersions) 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) @@ -4672,9 +5802,9 @@ func (m *awsRestjson1_deserializeOpListInstanceTypeDetails) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListInstanceTypeDetails(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListVersions(response, &metadata) } - output := &ListInstanceTypeDetailsOutput{} + output := &ListVersionsOutput{} out.Result = output var buff [1024]byte @@ -4695,7 +5825,7 @@ func (m *awsRestjson1_deserializeOpListInstanceTypeDetails) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListInstanceTypeDetailsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4708,7 +5838,7 @@ func (m *awsRestjson1_deserializeOpListInstanceTypeDetails) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListInstanceTypeDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListVersions(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)} @@ -4771,7 +5901,7 @@ func awsRestjson1_deserializeOpErrorListInstanceTypeDetails(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListInstanceTypeDetailsOutput(v **ListInstanceTypeDetailsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListVersionsOutput(v **ListVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4784,20 +5914,15 @@ func awsRestjson1_deserializeOpDocumentListInstanceTypeDetailsOutput(v **ListIns return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInstanceTypeDetailsOutput + var sv *ListVersionsOutput if *v == nil { - sv = &ListInstanceTypeDetailsOutput{} + sv = &ListVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "InstanceTypeDetails": - if err := awsRestjson1_deserializeDocumentInstanceTypeDetailsList(&sv.InstanceTypeDetails, value); err != nil { - return err - } - case "NextToken": if value != nil { jtv, ok := value.(string) @@ -4807,6 +5932,11 @@ func awsRestjson1_deserializeOpDocumentListInstanceTypeDetailsOutput(v **ListIns sv.NextToken = ptr.String(jtv) } + case "Versions": + if err := awsRestjson1_deserializeDocumentVersionList(&sv.Versions, value); err != nil { + return err + } + default: _, _ = key, value @@ -4816,14 +5946,14 @@ func awsRestjson1_deserializeOpDocumentListInstanceTypeDetailsOutput(v **ListIns return nil } -type awsRestjson1_deserializeOpListPackagesForDomain struct { +type awsRestjson1_deserializeOpListVpcEndpointAccess struct { } -func (*awsRestjson1_deserializeOpListPackagesForDomain) ID() string { +func (*awsRestjson1_deserializeOpListVpcEndpointAccess) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListVpcEndpointAccess) 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) @@ -4837,9 +5967,9 @@ func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPackagesForDomain(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListVpcEndpointAccess(response, &metadata) } - output := &ListPackagesForDomainOutput{} + output := &ListVpcEndpointAccessOutput{} out.Result = output var buff [1024]byte @@ -4860,7 +5990,7 @@ func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListVpcEndpointAccessOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4873,7 +6003,7 @@ func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListVpcEndpointAccess(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)} @@ -4914,21 +6044,18 @@ func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.R } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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, @@ -4939,7 +6066,7 @@ func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPackagesForDomainOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListVpcEndpointAccessOutput(v **ListVpcEndpointAccessOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4952,17 +6079,17 @@ func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPacka return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPackagesForDomainOutput + var sv *ListVpcEndpointAccessOutput if *v == nil { - sv = &ListPackagesForDomainOutput{} + sv = &ListVpcEndpointAccessOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DomainPackageDetailsList": - if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { + case "AuthorizedPrincipalList": + if err := awsRestjson1_deserializeDocumentAuthorizedPrincipalList(&sv.AuthorizedPrincipalList, value); err != nil { return err } @@ -4970,7 +6097,7 @@ func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPacka if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -4984,14 +6111,14 @@ func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPacka return nil } -type awsRestjson1_deserializeOpListTags struct { +type awsRestjson1_deserializeOpListVpcEndpoints struct { } -func (*awsRestjson1_deserializeOpListTags) ID() string { +func (*awsRestjson1_deserializeOpListVpcEndpoints) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListVpcEndpoints) 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) @@ -5005,9 +6132,9 @@ func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTags(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListVpcEndpoints(response, &metadata) } - output := &ListTagsOutput{} + output := &ListVpcEndpointsOutput{} out.Result = output var buff [1024]byte @@ -5028,7 +6155,7 @@ func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListVpcEndpointsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5041,7 +6168,7 @@ func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListVpcEndpoints(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)} @@ -5085,15 +6212,12 @@ func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, meta case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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, @@ -5104,7 +6228,7 @@ func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListVpcEndpointsOutput(v **ListVpcEndpointsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5117,17 +6241,26 @@ func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsOutput + var sv *ListVpcEndpointsOutput if *v == nil { - sv = &ListTagsOutput{} + sv = &ListVpcEndpointsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "TagList": - if err := awsRestjson1_deserializeDocumentTagList(&sv.TagList, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "VpcEndpointSummaryList": + if err := awsRestjson1_deserializeDocumentVpcEndpointSummaryList(&sv.VpcEndpointSummaryList, value); err != nil { return err } @@ -5140,14 +6273,14 @@ func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value return nil } -type awsRestjson1_deserializeOpListVersions struct { +type awsRestjson1_deserializeOpListVpcEndpointsForDomain struct { } -func (*awsRestjson1_deserializeOpListVersions) ID() string { +func (*awsRestjson1_deserializeOpListVpcEndpointsForDomain) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListVpcEndpointsForDomain) 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) @@ -5161,9 +6294,9 @@ func (m *awsRestjson1_deserializeOpListVersions) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListVpcEndpointsForDomain(response, &metadata) } - output := &ListVersionsOutput{} + output := &ListVpcEndpointsForDomainOutput{} out.Result = output var buff [1024]byte @@ -5184,7 +6317,7 @@ func (m *awsRestjson1_deserializeOpListVersions) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListVpcEndpointsForDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5197,7 +6330,7 @@ func (m *awsRestjson1_deserializeOpListVersions) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListVpcEndpointsForDomain(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)} @@ -5241,15 +6374,15 @@ func awsRestjson1_deserializeOpErrorListVersions(response *smithyhttp.Response, case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(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, @@ -5260,7 +6393,7 @@ func awsRestjson1_deserializeOpErrorListVersions(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListVersionsOutput(v **ListVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListVpcEndpointsForDomainOutput(v **ListVpcEndpointsForDomainOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5273,9 +6406,9 @@ func awsRestjson1_deserializeOpDocumentListVersionsOutput(v **ListVersionsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListVersionsOutput + var sv *ListVpcEndpointsForDomainOutput if *v == nil { - sv = &ListVersionsOutput{} + sv = &ListVpcEndpointsForDomainOutput{} } else { sv = *v } @@ -5291,8 +6424,8 @@ func awsRestjson1_deserializeOpDocumentListVersionsOutput(v **ListVersionsOutput sv.NextToken = ptr.String(jtv) } - case "Versions": - if err := awsRestjson1_deserializeDocumentVersionList(&sv.Versions, value); err != nil { + case "VpcEndpointSummaryList": + if err := awsRestjson1_deserializeDocumentVpcEndpointSummaryList(&sv.VpcEndpointSummaryList, value); err != nil { return err } @@ -5621,23 +6754,118 @@ func awsRestjson1_deserializeOpDocumentRejectInboundConnectionOutput(v **RejectI return err } - default: - _, _ = key, value + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRemoveTags struct { +} + +func (*awsRestjson1_deserializeOpRemoveTags) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRemoveTags) 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_deserializeOpErrorRemoveTags(response, &metadata) + } + output := &RemoveTagsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRemoveTags(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } - *v = sv - return nil } -type awsRestjson1_deserializeOpRemoveTags struct { +type awsRestjson1_deserializeOpRevokeVpcEndpointAccess struct { } -func (*awsRestjson1_deserializeOpRemoveTags) ID() string { +func (*awsRestjson1_deserializeOpRevokeVpcEndpointAccess) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRemoveTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRevokeVpcEndpointAccess) 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) @@ -5651,21 +6879,15 @@ func (m *awsRestjson1_deserializeOpRemoveTags) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRemoveTags(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRevokeVpcEndpointAccess(response, &metadata) } - output := &RemoveTagsOutput{} + output := &RevokeVpcEndpointAccessOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - return out, metadata, err } -func awsRestjson1_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRevokeVpcEndpointAccess(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)} @@ -5709,9 +6931,15 @@ func awsRestjson1_deserializeOpErrorRemoveTags(response *smithyhttp.Response, me case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -6210,6 +7438,168 @@ func awsRestjson1_deserializeOpDocumentUpdatePackageOutput(v **UpdatePackageOutp return nil } +type awsRestjson1_deserializeOpUpdateVpcEndpoint struct { +} + +func (*awsRestjson1_deserializeOpUpdateVpcEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateVpcEndpoint) 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_deserializeOpErrorUpdateVpcEndpoint(response, &metadata) + } + output := &UpdateVpcEndpointOutput{} + 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_deserializeOpDocumentUpdateVpcEndpointOutput(&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_deserializeOpErrorUpdateVpcEndpoint(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(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_deserializeOpDocumentUpdateVpcEndpointOutput(v **UpdateVpcEndpointOutput, 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 *UpdateVpcEndpointOutput + if *v == nil { + sv = &UpdateVpcEndpointOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VpcEndpoint": + if err := awsRestjson1_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpUpgradeDomain struct { } @@ -7166,7 +8556,90 @@ func awsRestjson1_deserializeDocumentAdvancedSecurityOptionsStatus(v **types.Adv } } - *v = sv + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizedPrincipal(v **types.AuthorizedPrincipal, 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.AuthorizedPrincipal + if *v == nil { + sv = &types.AuthorizedPrincipal{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Principal": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Principal = ptr.String(jtv) + } + + case "PrincipalType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PrincipalType to be of type string, got %T instead", value) + } + sv.PrincipalType = types.PrincipalType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizedPrincipalList(v *[]types.AuthorizedPrincipal, 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.AuthorizedPrincipal + if *v == nil { + cv = []types.AuthorizedPrincipal{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuthorizedPrincipal + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuthorizedPrincipal(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } @@ -12744,6 +14217,314 @@ func awsRestjson1_deserializeDocumentVPCDerivedInfoStatus(v **types.VPCDerivedIn return nil } +func awsRestjson1_deserializeDocumentVpcEndpoint(v **types.VpcEndpoint, 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.VpcEndpoint + if *v == nil { + sv = &types.VpcEndpoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "Endpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Endpoint to be of type string, got %T instead", value) + } + sv.Endpoint = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) + } + sv.Status = types.VpcEndpointStatus(jtv) + } + + case "VpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + case "VpcEndpointOwner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AWSAccount to be of type string, got %T instead", value) + } + sv.VpcEndpointOwner = ptr.String(jtv) + } + + case "VpcOptions": + if err := awsRestjson1_deserializeDocumentVPCDerivedInfo(&sv.VpcOptions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointError(v **types.VpcEndpointError, 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.VpcEndpointError + if *v == nil { + sv = &types.VpcEndpointError{} + } 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 VpcEndpointErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.VpcEndpointErrorCode(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "VpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointErrorList(v *[]types.VpcEndpointError, 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.VpcEndpointError + if *v == nil { + cv = []types.VpcEndpointError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcEndpointError + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcEndpointError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpoints(v *[]types.VpcEndpoint, 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.VpcEndpoint + if *v == nil { + cv = []types.VpcEndpoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcEndpoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcEndpoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointSummary(v **types.VpcEndpointSummary, 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.VpcEndpointSummary + if *v == nil { + sv = &types.VpcEndpointSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DomainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointStatus to be of type string, got %T instead", value) + } + sv.Status = types.VpcEndpointStatus(jtv) + } + + case "VpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcEndpointId to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + case "VpcEndpointOwner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VpcEndpointOwner = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcEndpointSummaryList(v *[]types.VpcEndpointSummary, 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.VpcEndpointSummary + if *v == nil { + cv = []types.VpcEndpointSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcEndpointSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcEndpointSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentZoneAwarenessConfig(v **types.ZoneAwarenessConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/opensearch/doc.go b/service/opensearch/doc.go index 558e0262afd..4a054975d4a 100644 --- a/service/opensearch/doc.go +++ b/service/opensearch/doc.go @@ -3,16 +3,15 @@ // Package opensearch provides the API client, operations, and parameter types for // Amazon OpenSearch Service. // -// Amazon OpenSearch Configuration Service Use the Amazon OpenSearch configuration -// API to create, configure, and manage Amazon OpenSearch Service domains. For -// sample code that uses the configuration API, see the Amazon OpenSearch Service -// Developer Guide +// Use the Amazon OpenSearch Service configuration API to create, configure, and +// manage OpenSearch Service domains. For sample code that uses the configuration +// API, see the Amazon OpenSearch Service Developer Guide // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/opensearch-configuration-samples.html). -// The guide also contains sample code for sending signed HTTP requests to the -// OpenSearch APIs -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/request-signing.html). -// The endpoint for configuration service requests is region-specific: -// es.region.amazonaws.com. For example, es.us-east-1.amazonaws.com. For a current -// list of supported regions and endpoints, see Regions and Endpoints -// (http://docs.aws.amazon.com/general/latest/gr/rande.html#service-regions). +// The guide also contains sample code +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/request-signing.html) +// for sending signed HTTP requests to the OpenSearch APIs. The endpoint for +// configuration service requests is Region specific: es.region.amazonaws.com. For +// example, es.us-east-1.amazonaws.com. For a current list of supported Regions and +// endpoints, see Amazon Web Services service endpoints +// (https://docs.aws.amazon.com/general/latest/gr/rande.html#service-regions). package opensearch diff --git a/service/opensearch/generated.json b/service/opensearch/generated.json index 73f62bdffd2..5ef2dd91a53 100644 --- a/service/opensearch/generated.json +++ b/service/opensearch/generated.json @@ -11,14 +11,17 @@ "api_op_AcceptInboundConnection.go", "api_op_AddTags.go", "api_op_AssociatePackage.go", + "api_op_AuthorizeVpcEndpointAccess.go", "api_op_CancelServiceSoftwareUpdate.go", "api_op_CreateDomain.go", "api_op_CreateOutboundConnection.go", "api_op_CreatePackage.go", + "api_op_CreateVpcEndpoint.go", "api_op_DeleteDomain.go", "api_op_DeleteInboundConnection.go", "api_op_DeleteOutboundConnection.go", "api_op_DeletePackage.go", + "api_op_DeleteVpcEndpoint.go", "api_op_DescribeDomain.go", "api_op_DescribeDomainAutoTunes.go", "api_op_DescribeDomainChangeProgress.go", @@ -30,6 +33,7 @@ "api_op_DescribePackages.go", "api_op_DescribeReservedInstanceOfferings.go", "api_op_DescribeReservedInstances.go", + "api_op_DescribeVpcEndpoints.go", "api_op_DissociatePackage.go", "api_op_GetCompatibleVersions.go", "api_op_GetPackageVersionHistory.go", @@ -41,12 +45,17 @@ "api_op_ListPackagesForDomain.go", "api_op_ListTags.go", "api_op_ListVersions.go", + "api_op_ListVpcEndpointAccess.go", + "api_op_ListVpcEndpoints.go", + "api_op_ListVpcEndpointsForDomain.go", "api_op_PurchaseReservedInstanceOffering.go", "api_op_RejectInboundConnection.go", "api_op_RemoveTags.go", + "api_op_RevokeVpcEndpointAccess.go", "api_op_StartServiceSoftwareUpdate.go", "api_op_UpdateDomainConfig.go", "api_op_UpdatePackage.go", + "api_op_UpdateVpcEndpoint.go", "api_op_UpgradeDomain.go", "deserializers.go", "doc.go", diff --git a/service/opensearch/serializers.go b/service/opensearch/serializers.go index e2a5428d8c3..fbfe4d86eeb 100644 --- a/service/opensearch/serializers.go +++ b/service/opensearch/serializers.go @@ -215,6 +215,87 @@ func awsRestjson1_serializeOpHttpBindingsAssociatePackageInput(v *AssociatePacka return nil } +type awsRestjson1_serializeOpAuthorizeVpcEndpointAccess struct { +} + +func (*awsRestjson1_serializeOpAuthorizeVpcEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAuthorizeVpcEndpointAccess) 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.(*AuthorizeVpcEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/authorizeVpcEndpointAccess") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAuthorizeVpcEndpointAccessInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAuthorizeVpcEndpointAccessInput(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_serializeOpHttpBindingsAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Account != nil { + ok := object.Key("Account") + ok.String(*v.Account) + } + + return nil +} + type awsRestjson1_serializeOpCancelServiceSoftwareUpdate struct { } @@ -619,6 +700,86 @@ func awsRestjson1_serializeOpDocumentCreatePackageInput(v *CreatePackageInput, v return nil } +type awsRestjson1_serializeOpCreateVpcEndpoint struct { +} + +func (*awsRestjson1_serializeOpCreateVpcEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateVpcEndpoint) 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.(*CreateVpcEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentCreateVpcEndpointInput(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_serializeOpHttpBindingsCreateVpcEndpointInput(v *CreateVpcEndpointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateVpcEndpointInput(v *CreateVpcEndpointInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DomainArn != nil { + ok := object.Key("DomainArn") + ok.String(*v.DomainArn) + } + + if v.VpcOptions != nil { + ok := object.Key("VpcOptions") + if err := awsRestjson1_serializeDocumentVPCOptions(v.VpcOptions, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteDomain struct { } @@ -851,6 +1012,64 @@ func awsRestjson1_serializeOpHttpBindingsDeletePackageInput(v *DeletePackageInpu return nil } +type awsRestjson1_serializeOpDeleteVpcEndpoint struct { +} + +func (*awsRestjson1_serializeOpDeleteVpcEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVpcEndpoint) 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.(*DeleteVpcEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints/{VpcEndpointId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVpcEndpointInput(input, restEncoder); 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_serializeOpHttpBindingsDeleteVpcEndpointInput(v *DeleteVpcEndpointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VpcEndpointId == nil || len(*v.VpcEndpointId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VpcEndpointId must not be empty")} + } + if v.VpcEndpointId != nil { + if err := encoder.SetURI("VpcEndpointId").String(*v.VpcEndpointId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeDomain struct { } @@ -1618,6 +1837,76 @@ func awsRestjson1_serializeOpHttpBindingsDescribeReservedInstancesInput(v *Descr return nil } +type awsRestjson1_serializeOpDescribeVpcEndpoints struct { +} + +func (*awsRestjson1_serializeOpDescribeVpcEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeVpcEndpoints) 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.(*DescribeVpcEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints/describe") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentDescribeVpcEndpointsInput(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_serializeOpHttpBindingsDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VpcEndpointIds != nil { + ok := object.Key("VpcEndpointIds") + if err := awsRestjson1_serializeDocumentVpcEndpointIdList(v.VpcEndpointIds, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDissociatePackage struct { } @@ -2293,14 +2582,14 @@ func awsRestjson1_serializeOpHttpBindingsListVersionsInput(v *ListVersionsInput, return nil } -type awsRestjson1_serializeOpPurchaseReservedInstanceOffering struct { +type awsRestjson1_serializeOpListVpcEndpointAccess struct { } -func (*awsRestjson1_serializeOpPurchaseReservedInstanceOffering) ID() string { +func (*awsRestjson1_serializeOpListVpcEndpointAccess) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpPurchaseReservedInstanceOffering) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListVpcEndpointAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2308,29 +2597,22 @@ func (m *awsRestjson1_serializeOpPurchaseReservedInstanceOffering) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PurchaseReservedInstanceOfferingInput) + input, ok := in.Parameters.(*ListVpcEndpointAccessInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/purchaseReservedInstanceOffering") + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/listVpcEndpointAccess") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentPurchaseReservedInstanceOfferingInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListVpcEndpointAccessInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2341,13 +2623,197 @@ func (m *awsRestjson1_serializeOpPurchaseReservedInstanceOffering) HandleSeriali return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsPurchaseReservedInstanceOfferingInput(v *PurchaseReservedInstanceOfferingInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListVpcEndpointAccessInput(v *ListVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - return nil -} + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListVpcEndpoints struct { +} + +func (*awsRestjson1_serializeOpListVpcEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListVpcEndpoints) 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.(*ListVpcEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListVpcEndpointsInput(input, restEncoder); 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_serializeOpHttpBindingsListVpcEndpointsInput(v *ListVpcEndpointsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListVpcEndpointsForDomain struct { +} + +func (*awsRestjson1_serializeOpListVpcEndpointsForDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListVpcEndpointsForDomain) 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.(*ListVpcEndpointsForDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/vpcEndpoints") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListVpcEndpointsForDomainInput(input, restEncoder); 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_serializeOpHttpBindingsListVpcEndpointsForDomainInput(v *ListVpcEndpointsForDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpPurchaseReservedInstanceOffering struct { +} + +func (*awsRestjson1_serializeOpPurchaseReservedInstanceOffering) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPurchaseReservedInstanceOffering) 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.(*PurchaseReservedInstanceOfferingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/purchaseReservedInstanceOffering") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentPurchaseReservedInstanceOfferingInput(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_serializeOpHttpBindingsPurchaseReservedInstanceOfferingInput(v *PurchaseReservedInstanceOfferingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} func awsRestjson1_serializeOpDocumentPurchaseReservedInstanceOfferingInput(v *PurchaseReservedInstanceOfferingInput, value smithyjson.Value) error { object := value.Object() @@ -2504,6 +2970,87 @@ func awsRestjson1_serializeOpDocumentRemoveTagsInput(v *RemoveTagsInput, value s return nil } +type awsRestjson1_serializeOpRevokeVpcEndpointAccess struct { +} + +func (*awsRestjson1_serializeOpRevokeVpcEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRevokeVpcEndpointAccess) 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.(*RevokeVpcEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/domain/{DomainName}/revokeVpcEndpointAccess") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsRevokeVpcEndpointAccessInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRevokeVpcEndpointAccessInput(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_serializeOpHttpBindingsRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Account != nil { + ok := object.Key("Account") + ok.String(*v.Account) + } + + return nil +} + type awsRestjson1_serializeOpStartServiceSoftwareUpdate struct { } @@ -2827,6 +3374,81 @@ func awsRestjson1_serializeOpDocumentUpdatePackageInput(v *UpdatePackageInput, v return nil } +type awsRestjson1_serializeOpUpdateVpcEndpoint struct { +} + +func (*awsRestjson1_serializeOpUpdateVpcEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateVpcEndpoint) 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.(*UpdateVpcEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/vpcEndpoints/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentUpdateVpcEndpointInput(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_serializeOpHttpBindingsUpdateVpcEndpointInput(v *UpdateVpcEndpointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateVpcEndpointInput(v *UpdateVpcEndpointInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VpcEndpointId != nil { + ok := object.Key("VpcEndpointId") + ok.String(*v.VpcEndpointId) + } + + if v.VpcOptions != nil { + ok := object.Key("VpcOptions") + if err := awsRestjson1_serializeDocumentVPCOptions(v.VpcOptions, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpgradeDomain struct { } @@ -3571,6 +4193,17 @@ func awsRestjson1_serializeDocumentValueStringList(v []string, value smithyjson. return nil } +func awsRestjson1_serializeDocumentVpcEndpointIdList(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_serializeDocumentVPCOptions(v *types.VPCOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/opensearch/types/enums.go b/service/opensearch/types/enums.go index 249487dc30b..630c87344e1 100644 --- a/service/opensearch/types/enums.go +++ b/service/opensearch/types/enums.go @@ -554,6 +554,24 @@ func (PackageType) Values() []PackageType { } } +type PrincipalType string + +// Enum values for PrincipalType +const ( + PrincipalTypeAwsAccount PrincipalType = "AWS_ACCOUNT" + PrincipalTypeAwsService PrincipalType = "AWS_SERVICE" +) + +// Values returns all known values for PrincipalType. 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 (PrincipalType) Values() []PrincipalType { + return []PrincipalType{ + "AWS_ACCOUNT", + "AWS_SERVICE", + } +} + type ReservedInstancePaymentOption string // Enum values for ReservedInstancePaymentOption @@ -729,3 +747,49 @@ func (VolumeType) Values() []VolumeType { "gp3", } } + +type VpcEndpointErrorCode string + +// Enum values for VpcEndpointErrorCode +const ( + VpcEndpointErrorCodeEndpointNotFound VpcEndpointErrorCode = "ENDPOINT_NOT_FOUND" + VpcEndpointErrorCodeServerError VpcEndpointErrorCode = "SERVER_ERROR" +) + +// Values returns all known values for VpcEndpointErrorCode. 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 (VpcEndpointErrorCode) Values() []VpcEndpointErrorCode { + return []VpcEndpointErrorCode{ + "ENDPOINT_NOT_FOUND", + "SERVER_ERROR", + } +} + +type VpcEndpointStatus string + +// Enum values for VpcEndpointStatus +const ( + VpcEndpointStatusCreating VpcEndpointStatus = "CREATING" + VpcEndpointStatusCreateFailed VpcEndpointStatus = "CREATE_FAILED" + VpcEndpointStatusActive VpcEndpointStatus = "ACTIVE" + VpcEndpointStatusUpdating VpcEndpointStatus = "UPDATING" + VpcEndpointStatusUpdateFailed VpcEndpointStatus = "UPDATE_FAILED" + VpcEndpointStatusDeleting VpcEndpointStatus = "DELETING" + VpcEndpointStatusDeleteFailed VpcEndpointStatus = "DELETE_FAILED" +) + +// Values returns all known values for VpcEndpointStatus. 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 (VpcEndpointStatus) Values() []VpcEndpointStatus { + return []VpcEndpointStatus{ + "CREATING", + "CREATE_FAILED", + "ACTIVE", + "UPDATING", + "UPDATE_FAILED", + "DELETING", + "DELETE_FAILED", + } +} diff --git a/service/opensearch/types/types.go b/service/opensearch/types/types.go index 64534c5a9a0..1ff39347be7 100644 --- a/service/opensearch/types/types.go +++ b/service/opensearch/types/types.go @@ -7,20 +7,19 @@ import ( "time" ) -// The configured access rules for the domain's document and search endpoints, and -// the current status of those rules. +// The configured access rules for the domain's search endpoint, and the current +// status of those rules. type AccessPoliciesStatus struct { // The access policy configured for the domain. Access policies can be - // resource-based, IP-based, or IAM-based. See Configuring access policies - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-access-policies)for - // more information. + // resource-based, IP-based, or IAM-based. For more information, see Configuring + // access policies + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-access-policies). // // This member is required. Options *string - // The status of the access policy for the domain. See OptionStatus for the status - // information that's included. + // The status of the access policy for the domain. // // This member is required. Status *OptionStatus @@ -28,49 +27,52 @@ type AccessPoliciesStatus struct { noSmithyDocumentSerde } -// List of limits that are specific to a given InstanceType and for each of its -// InstanceRole . +// List of limits that are specific to a given instance type. type AdditionalLimit struct { - // Additional limit is specific to a given InstanceType and for each of its - // InstanceRole etc. + // * MaximumNumberOfDataNodesSupported - This attribute only applies to master + // nodes and specifies the maximum number of data nodes of a given instance type a + // master node can support. // - // Attributes and their details: - // - // * - // MaximumNumberOfDataNodesSupported - // This attribute is present on the master node - // only to specify how much data nodes up to which given ESPartitionInstanceType - // can support as master node. - // * MaximumNumberOfDataNodesWithoutMasterNode - // This - // attribute is present on data node only to specify how much data nodes of given - // ESPartitionInstanceType up to which you don't need any master nodes to govern - // them. + // * MaximumNumberOfDataNodesWithoutMasterNode - This + // attribute only applies to data nodes and specifies the maximum number of data + // nodes of a given instance type can exist without a master node governing them. LimitName *string - // Value for a given AdditionalLimit$LimitName . + // The values of the additional instance type limits. LimitValues []string noSmithyDocumentSerde } -// Status of the advanced options for the specified domain. Currently, the -// following advanced options are available: +// Status of the advanced options for the specified domain. The following options +// are available: +// +// * "rest.action.multi.allow_explicit_index": "true" | "false" - +// Note the use of a string rather than a boolean. Specifies whether explicit +// references to indexes are allowed inside the body of HTTP requests. If you want +// to configure access policies for domain sub-resources, such as specific indexes +// and domain APIs, you must disable this property. Default is true. // -// * Option to allow references to -// indices in an HTTP request body. Must be false when configuring access to -// individual sub-resources. By default, the value is true. See Advanced cluster -// parameters -// (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) -// for more information. +// * +// "indices.fielddata.cache.size": "80" - Note the use of a string rather than a +// boolean. Specifies the percentage of heap space allocated to field data. Default +// is unbounded. // -// * Option to specify the percentage of heap space -// allocated to field data. By default, this setting is unbounded. +// * "indices.query.bool.max_clause_count": "1024" - Note the use of +// a string rather than a boolean. Specifies the maximum number of clauses allowed +// in a Lucene boolean query. Default is 1,024. Queries with more than the +// permitted number of clauses result in a TooManyClauses error. // -// For more -// information, see Advanced cluster parameters -// (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options). +// * +// "override_main_response_version": "true" | "false" - Note the use of a string +// rather than a boolean. Specifies whether the domain reports its version as 7.10 +// to allow Elasticsearch OSS clients and plugins to continue working with it. +// Default is false when creating a domain and true when upgrading a domain. +// +// For +// more information, see Advanced cluster parameters +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options). type AdvancedOptionsStatus struct { // The status of advanced options for the specified domain. @@ -78,7 +80,7 @@ type AdvancedOptionsStatus struct { // This member is required. Options map[string]string - // The OptionStatus for advanced options for the specified domain. + // The status of advanced options for the specified domain. // // This member is required. Status *OptionStatus @@ -86,62 +88,69 @@ type AdvancedOptionsStatus struct { noSmithyDocumentSerde } -// The advanced security configuration: whether advanced security is enabled, -// whether the internal database option is enabled. +// Container for fine-grained access control settings. type AdvancedSecurityOptions struct { - // Specifies the Anonymous Auth Disable Date when Anonymous Auth is enabled. + // Date and time when the migration period will be disabled. Only necessary when + // enabling fine-grained access control on an existing domain + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing). AnonymousAuthDisableDate *time.Time - // True if Anonymous auth is enabled. Anonymous auth can be enabled only when - // AdvancedSecurity is enabled on existing domains. + // True if a 30-day migration period is enabled, during which administrators can + // create role mappings. Only necessary when enabling fine-grained access control + // on an existing domain + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing). AnonymousAuthEnabled *bool - // True if advanced security is enabled. + // True if fine-grained access control is enabled. Enabled *bool // True if the internal user database is enabled. InternalUserDatabaseEnabled *bool - // Describes the SAML application configured for a domain. + // Container for information about the SAML configuration for OpenSearch + // Dashboards. SAMLOptions *SAMLOptionsOutput noSmithyDocumentSerde } -// The advanced security configuration: whether advanced security is enabled, -// whether the internal database option is enabled, master username and password -// (if internal database is enabled), and master user ARN (if IAM is enabled). +// Options for enabling and configuring fine-grained access control. For more +// information, see Fine-grained access control in Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html). type AdvancedSecurityOptionsInput struct { - // True if Anonymous auth is enabled. Anonymous auth can be enabled only when - // AdvancedSecurity is enabled on existing domains. + // True to enable a 30-day migration period during which administrators can create + // role mappings. Only necessary when enabling fine-grained access control on an + // existing domain + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing). AnonymousAuthEnabled *bool - // True if advanced security is enabled. + // True to enable fine-grained access control. Enabled *bool - // True if the internal user database is enabled. + // True to enable the internal user database. InternalUserDatabaseEnabled *bool - // Credentials for the master user: username and password, ARN, or both. + // Container for information about the master user. MasterUserOptions *MasterUserOptions - // The SAML application configuration for the domain. + // Container for information about the SAML configuration for OpenSearch + // Dashboards. SAMLOptions *SAMLOptionsInput noSmithyDocumentSerde } -// The status of advanced security options for the specified domain. +// The status of fine-grained access control settings for a domain. type AdvancedSecurityOptionsStatus struct { - // Advanced security options for the specified domain. + // Container for fine-grained access control settings. // // This member is required. Options *AdvancedSecurityOptions - // Status of the advanced security options for the specified domain. + // Status of the fine-grained access control settings for a domain. // // This member is required. Status *OptionStatus @@ -149,102 +158,112 @@ type AdvancedSecurityOptionsStatus struct { noSmithyDocumentSerde } -// Specifies the Auto-Tune type and Auto-Tune action details. +// Information about an Amazon Web Services account or service that has access to +// an Amazon OpenSearch Service domain through the use of an interface VPC +// endpoint. +type AuthorizedPrincipal struct { + + // The IAM principal + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) + // that is allowed access to the domain. + Principal *string + + // The type of principal. + PrincipalType PrincipalType + + noSmithyDocumentSerde +} + +// Information about an Auto-Tune action. For more information, see Auto-Tune for +// Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type AutoTune struct { - // Specifies details about the Auto-Tune action. See Auto-Tune for Amazon - // OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // Details about an Auto-Tune action. AutoTuneDetails *AutoTuneDetails - // Specifies the Auto-Tune type. Valid value is SCHEDULED_ACTION. + // The type of Auto-Tune action. AutoTuneType AutoTuneType noSmithyDocumentSerde } -// Specifies details about the Auto-Tune action. See Auto-Tune for Amazon -// OpenSearch Service -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) -// for more information. +// Specifies details about a scheduled Auto-Tune action. For more information, see +// Auto-Tune for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type AutoTuneDetails struct { - // Specifies details about the scheduled Auto-Tune action. See Auto-Tune for - // Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // Container for details about a scheduled Auto-Tune action. ScheduledAutoTuneDetails *ScheduledAutoTuneDetails noSmithyDocumentSerde } -// Specifies the Auto-Tune maintenance schedule. See Auto-Tune for Amazon -// OpenSearch Service -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) -// for more information. +// The Auto-Tune maintenance schedule. For more information, see Auto-Tune for +// Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type AutoTuneMaintenanceSchedule struct { - // A cron expression for a recurring maintenance schedule. See Auto-Tune for - // Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // A cron expression for a recurring maintenance schedule during which Auto-Tune + // can deploy changes. CronExpressionForRecurrence *string - // Specifies maintenance schedule duration: duration value and duration unit. See - // Auto-Tune for Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // The duration of the maintenance schedule. For example, "Duration": {"Value": 2, + // "Unit": "HOURS"}. Duration *Duration - // The timestamp at which the Auto-Tune maintenance schedule starts. + // The Epoch timestamp at which the Auto-Tune maintenance schedule starts. StartAt *time.Time noSmithyDocumentSerde } -// The Auto-Tune options: the Auto-Tune desired state for the domain, rollback -// state when disabling Auto-Tune options and list of maintenance schedules. +// Auto-Tune settings when updating a domain. For more information, see Auto-Tune +// for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type AutoTuneOptions struct { - // The Auto-Tune desired state. Valid values are ENABLED and DISABLED. + // Whether Auto-Tune is enabled or disabled. DesiredState AutoTuneDesiredState - // A list of maintenance schedules. See Auto-Tune for Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // A list of maintenance schedules during which Auto-Tune can deploy changes. MaintenanceSchedules []AutoTuneMaintenanceSchedule - // The rollback state while disabling Auto-Tune for the domain. Valid values are - // NO_ROLLBACK and DEFAULT_ROLLBACK. + // When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune + // settings or DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If + // you specify DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the + // request. Otherwise, OpenSearch Service is unable to perform the rollback. RollbackOnDisable RollbackOnDisable noSmithyDocumentSerde } -// The Auto-Tune options: the Auto-Tune desired state for the domain and list of -// maintenance schedules. +// Options for configuring Auto-Tune. For more information, see Auto-Tune for +// Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type AutoTuneOptionsInput struct { - // The Auto-Tune desired state. Valid values are ENABLED and DISABLED. + // Whether Auto-Tune is enabled or disabled. DesiredState AutoTuneDesiredState - // A list of maintenance schedules. See Auto-Tune for Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // A list of maintenance schedules during which Auto-Tune can deploy changes. + // Maintenance schedules are overwrite, not append. If your request includes no + // schedules, the request deletes all existing schedules. To preserve existing + // schedules, make a call to DescribeDomainConfig first and use the + // MaintenanceSchedules portion of the response as the basis for this section. MaintenanceSchedules []AutoTuneMaintenanceSchedule noSmithyDocumentSerde } -// The Auto-Tune options: the Auto-Tune desired state for the domain and list of -// maintenance schedules. +// The Auto-Tune settings for a domain, displayed when enabling or disabling +// Auto-Tune. type AutoTuneOptionsOutput struct { - // The error message while enabling or disabling Auto-Tune. + // Any errors that occurred while enabling or disabling Auto-Tune. ErrorMessage *string - // The AutoTuneState for the domain. + // The current state of Auto-Tune on the domain. State AutoTuneState noSmithyDocumentSerde @@ -253,34 +272,36 @@ type AutoTuneOptionsOutput struct { // The Auto-Tune status for the domain. type AutoTuneOptionsStatus struct { - // Specifies Auto-Tune options for the domain. + // Auto-Tune settings for updating a domain. Options *AutoTuneOptions - // The status of the Auto-Tune options for the domain. + // The current status of Auto-Tune for a domain. Status *AutoTuneStatus noSmithyDocumentSerde } -// Provides the current Auto-Tune status for the domain. +// The current status of Auto-Tune for the domain. For more information, see +// Auto-Tune for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type AutoTuneStatus struct { - // The timestamp of the Auto-Tune options creation date. + // Date and time when Auto-Tune was enabled for the domain. // // This member is required. CreationDate *time.Time - // The AutoTuneState for the domain. + // The current state of Auto-Tune on the domain. // // This member is required. State AutoTuneState - // The timestamp of when the Auto-Tune options were last updated. + // Date and time when the Auto-Tune options were last updated for the domain. // // This member is required. UpdateDate *time.Time - // The error message while enabling or disabling Auto-Tune. + // Any errors that occurred while enabling or disabling Auto-Tune. ErrorMessage *string // Indicates whether the domain is being deleted. @@ -292,48 +313,48 @@ type AutoTuneStatus struct { noSmithyDocumentSerde } +// Information about an Amazon OpenSearch Service domain. type AWSDomainInformation struct { - // The name of an domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // Name of the domain. // // This member is required. DomainName *string + // The Amazon Web Services account ID of the domain owner. OwnerId *string + // The Amazon Web Services Region in which the domain is located. Region *string noSmithyDocumentSerde } -// Specifies change details of the domain configuration change. +// Container for information about a configuration change happening on a domain. type ChangeProgressDetails struct { - // The unique change identifier associated with a specific domain configuration - // change. + // The ID of the configuration change. ChangeId *string - // Contains an optional message associated with the domain configuration change. + // A message corresponding to the status of the configuration change. Message *string noSmithyDocumentSerde } -// A progress stage details of a specific domain configuration change. +// Progress details for each stage of a domain update. type ChangeProgressStage struct { - // The description of the progress stage. + // The description of the stage. Description *string - // The last updated timestamp of the progress stage. + // The most recent updated timestamp of the stage. LastUpdated *time.Time - // The name of the specific progress stage. + // The name of the stage. Name *string - // The overall status of a specific progress stage. + // The status of the stage. Status *string noSmithyDocumentSerde @@ -350,19 +371,17 @@ type ChangeProgressStatusDetails struct { // configuration change. ChangeProgressStages []ChangeProgressStage - // The list of properties involved in the domain configuration change that are - // completed. + // The list of properties in the domain configuration change that have completed. CompletedProperties []string - // The list of properties involved in the domain configuration change that are - // still in pending. + // The list of properties in the domain configuration change that are still + // pending. PendingProperties []string // The time at which the configuration change is made on the domain. StartTime *time.Time - // The overall status of the domain configuration change. This field can take the - // following values: PENDING, PROCESSING, COMPLETED and FAILED + // The overall status of the domain configuration change. Status OverallChangeStatus // The total number of stages required for the configuration change. @@ -371,62 +390,62 @@ type ChangeProgressStatusDetails struct { noSmithyDocumentSerde } -// The configuration for the domain cluster, such as the type and number of -// instances. +// Container for the cluster configuration of an OpenSearch Service domain. For +// more information, see Creating and managing Amazon OpenSearch Service domains +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html). type ClusterConfig struct { - // Specifies the ColdStorageOptions config for a Domain + // Container for cold storage configuration options. ColdStorageOptions *ColdStorageOptions - // Total number of dedicated master nodes, active and on standby, for the cluster. + // Number of dedicated master nodes in the cluster. This number must be greater + // than 1, otherwise you receive a validation exception. DedicatedMasterCount *int32 - // A boolean value to indicate whether a dedicated master node is enabled. See - // Dedicated master nodes in Amazon OpenSearch Service - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains.html#managedomains-dedicatedmasternodes) - // for more information. + // Indicates whether dedicated master nodes are enabled for the cluster.True if the + // cluster will use a dedicated master node.False if the cluster will not. DedicatedMasterEnabled *bool - // The instance type for a dedicated master node. + // OpenSearch Service instance type of the dedicated master nodes in the cluster. DedicatedMasterType OpenSearchPartitionInstanceType - // The number of instances in the specified domain cluster. + // Number of dedicated master nodes in the cluster. This number must be greater + // than 1, otherwise you receive a validation exception. InstanceCount *int32 - // The instance type for an OpenSearch cluster. UltraWarm instance types are not - // supported for data instances. + // Instance type of data nodes in the cluster. InstanceType OpenSearchPartitionInstanceType - // The number of UltraWarm nodes in the cluster. + // The number of warm nodes in the cluster. WarmCount *int32 - // True to enable UltraWarm storage. + // Whether to enable warm storage for the cluster. WarmEnabled *bool - // The instance type for the OpenSearch cluster's warm nodes. + // The instance type for the cluster's warm nodes. WarmType OpenSearchWarmPartitionInstanceType - // The zone awareness configuration for a domain when zone awareness is enabled. + // Container for zone awareness configuration options. Only required if + // ZoneAwarenessEnabled is true. ZoneAwarenessConfig *ZoneAwarenessConfig - // A boolean value to indicate whether zone awareness is enabled. See Configuring a - // multi-AZ domain in Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html) - // for more information. + // Indicates whether multiple Availability Zones are enabled. For more information, + // see Configuring a multi-AZ domain in Amazon OpenSearch Service + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html). ZoneAwarenessEnabled *bool noSmithyDocumentSerde } -// The configuration status for the specified domain. +// The cluster configuration status for a domain. type ClusterConfigStatus struct { - // The cluster configuration for the specified domain. + // Cluster configuration options for the specified domain. // // This member is required. Options *ClusterConfig - // The cluster configuration status for the specified domain. + // The status of cluster configuration options for the specified domain. // // This member is required. Status *OptionStatus @@ -434,23 +453,26 @@ type ClusterConfigStatus struct { noSmithyDocumentSerde } -// Options to specify the Cognito user and identity pools for OpenSearch Dashboards -// authentication. For more information, see Configuring Amazon Cognito +// Container for the parameters required to enable Cognito authentication for an +// OpenSearch Service domain. For more information, see Configuring Amazon Cognito // authentication for OpenSearch Dashboards -// (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html). +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html). type CognitoOptions struct { - // The option to enable Cognito for OpenSearch Dashboards authentication. + // Whether to enable or disable Amazon Cognito authentication for OpenSearch + // Dashboards. Enabled *bool - // The Cognito identity pool ID for OpenSearch Dashboards authentication. + // The Amazon Cognito identity pool ID that you want OpenSearch Service to use for + // OpenSearch Dashboards authentication. IdentityPoolId *string - // The role ARN that provides OpenSearch permissions for accessing Cognito - // resources. + // The AmazonOpenSearchServiceCognitoAccess role that allows OpenSearch Service to + // configure your user pool and identity pool. RoleArn *string - // The Cognito user pool ID for OpenSearch Dashboards authentication. + // The Amazon Cognito user pool ID that you want OpenSearch Service to use for + // OpenSearch Dashboards authentication. UserPoolId *string noSmithyDocumentSerde @@ -472,10 +494,13 @@ type CognitoOptionsStatus struct { noSmithyDocumentSerde } -// Specifies the configuration for cold storage options such as enabled +// Container for the parameters required to enable cold storage for an OpenSearch +// Service domain. For more information, see Cold storage for Amazon OpenSearch +// Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cold-storage.html). type ColdStorageOptions struct { - // Enable cold storage option. Accepted values true or false + // Whether to enable or disable cold storage on the domain. // // This member is required. Enabled *bool @@ -483,14 +508,14 @@ type ColdStorageOptions struct { noSmithyDocumentSerde } -// A map from an EngineVersion to a list of compatible EngineVersion s to which the -// domain can be upgraded. +// A map of OpenSearch or Elasticsearch versions and the versions you can upgrade +// them to. type CompatibleVersionsMap struct { - // The current version of OpenSearch a domain is on. + // The current version that the OpenSearch Service domain is running. SourceVersion *string - // List of supported OpenSearch versions. + // The possible versions that you can upgrade the domain to. TargetVersions []string noSmithyDocumentSerde @@ -502,110 +527,107 @@ type DescribePackagesFilter struct { // Any field from PackageDetails. Name DescribePackagesFilterName - // A list of values for the specified field. + // A list of values for the specified filter field. Value []string noSmithyDocumentSerde } -// The configuration of a domain. +// Container for the configuration of an OpenSearch Service domain. type DomainConfig struct { - // IAM access policy as a JSON-formatted string. + // Specifies the access policies for the domain. AccessPolicies *AccessPoliciesStatus - // The AdvancedOptions for the domain. See Advanced options - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) - // for more information. + // Key-value pairs to specify advanced configuration options. For more information, + // see Advanced options + // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options). AdvancedOptions *AdvancedOptionsStatus - // Specifies AdvancedSecurityOptions for the domain. + // Container for fine-grained access control settings for the domain. AdvancedSecurityOptions *AdvancedSecurityOptionsStatus - // Specifies AutoTuneOptions for the domain. + // Container for Auto-Tune settings for the domain. AutoTuneOptions *AutoTuneOptionsStatus - // Specifies change details of the domain configuration change. + // Container for information about the progress of an existing configuration + // change. ChangeProgressDetails *ChangeProgressDetails - // The ClusterConfig for the domain. + // Container for the cluster configuration of a the domain. ClusterConfig *ClusterConfigStatus - // The CognitoOptions for the specified domain. For more information, see - // Configuring Amazon Cognito authentication for OpenSearch Dashboards - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html). + // Container for Amazon Cognito options for the domain. CognitoOptions *CognitoOptionsStatus - // The DomainEndpointOptions for the domain. + // Additional options for the domain endpoint, such as whether to require HTTPS for + // all traffic. DomainEndpointOptions *DomainEndpointOptionsStatus - // The EBSOptions for the domain. + // Container for EBS options configured for an OpenSearch Service domain. EBSOptions *EBSOptionsStatus - // The EncryptionAtRestOptions for the domain. + // Key-value pairs to enable encryption at rest. EncryptionAtRestOptions *EncryptionAtRestOptionsStatus - // String of format Elasticsearch_X.Y or OpenSearch_X.Y to specify the engine - // version for the OpenSearch or Elasticsearch domain. + // The OpenSearch or Elasticsearch version that the domain is running. EngineVersion *VersionStatus - // Log publishing options for the given domain. + // Key-value pairs to configure slow log publishing. LogPublishingOptions *LogPublishingOptionsStatus - // The NodeToNodeEncryptionOptions for the domain. + // Whether node-to-node encryption is enabled or disabled. NodeToNodeEncryptionOptions *NodeToNodeEncryptionOptionsStatus - // The SnapshotOptions for the domain. + // DEPRECATED. Container for parameters required to configure automated snapshots + // of domain indexes. SnapshotOptions *SnapshotOptionsStatus - // The VPCOptions for the specified domain. For more information, see Launching - // your Amazon OpenSearch Service domains using a VPC - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). + // The current VPC options for the domain and the status of any updates to their + // configuration. VPCOptions *VPCDerivedInfoStatus noSmithyDocumentSerde } -// Options to configure the endpoint for the domain. +// Options to configure a custom endpoint for an OpenSearch Service domain. type DomainEndpointOptions struct { - // The fully qualified domain for your custom endpoint. + // The fully qualified URL for the custom endpoint. CustomEndpoint *string - // The ACM certificate ARN for your custom endpoint. + // The ARN for your security certificate, managed in Amazon Web Services + // Certificate Manager (ACM). CustomEndpointCertificateArn *string // Whether to enable a custom endpoint for the domain. CustomEndpointEnabled *bool - // Whether only HTTPS endpoint should be enabled for the domain. + // True to require that all traffic to the domain arrive over HTTPS. EnforceHTTPS *bool - // Specify the TLS security policy to apply to the HTTPS endpoint of the - // domain. - // + // Specify the TLS security policy to apply to the HTTPS endpoint of the domain. // Can be one of the following values: // - // * Policy-Min-TLS-1-0-2019-07: TLS - // security policy which supports TLSv1.0 and higher. + // * Policy-Min-TLS-1-0-2019-07: TLS security + // policy which supports TLS version 1.0 and higher. // - // * - // Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2 + // * Policy-Min-TLS-1-2-2019-07: + // TLS security policy which supports only TLS version 1.2 TLSSecurityPolicy TLSSecurityPolicy noSmithyDocumentSerde } -// The configured endpoint options for the domain and their current status. +// The configured endpoint options for a domain and their current status. type DomainEndpointOptionsStatus struct { - // Options to configure the endpoint for the domain. + // Options to configure the endpoint for a domain. // // This member is required. Options *DomainEndpointOptions - // The status of the endpoint options for the domain. See OptionStatus for the - // status information that's included. + // The status of the endpoint options for a domain. // // This member is required. Status *OptionStatus @@ -613,222 +635,239 @@ type DomainEndpointOptionsStatus struct { noSmithyDocumentSerde } +// Information about an OpenSearch Service domain. type DomainInfo struct { - // The DomainName. + // Name of the domain. DomainName *string - // Specifies the EngineType of the domain. + // The type of search engine that the domain is running.OpenSearch for an + // OpenSearch engine, or Elasticsearch for a legacy Elasticsearch OSS engine. EngineType EngineType noSmithyDocumentSerde } +// Container for information about an OpenSearch Service domain. type DomainInformationContainer struct { + + // Information about an Amazon OpenSearch Service domain. AWSDomainInformation *AWSDomainInformation noSmithyDocumentSerde } -// Information on a package associated with a domain. +// Information about a package that is associated with a domain. For more +// information, see Custom packages for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html). type DomainPackageDetails struct { - // The name of the domain you've associated a package with. + // Name of the domain that the package is associated with. DomainName *string - // State of the association. Values are ASSOCIATING, ASSOCIATION_FAILED, ACTIVE, - // DISSOCIATING, and DISSOCIATION_FAILED. + // State of the association. DomainPackageStatus DomainPackageStatus // Additional information if the package is in an error state. Null otherwise. ErrorDetails *ErrorDetails - // The timestamp of the most recent update to the package association status. + // Timestamp of the most recent update to the package association status. LastUpdated *time.Time - // The internal ID of the package. + // Internal ID of the package. PackageID *string // User-specified name of the package. PackageName *string - // Currently supports only TXT-DICTIONARY. + // The type of package. PackageType PackageType + // The current version of the package. PackageVersion *string - // The relative path on Amazon OpenSearch Service nodes, which can be used as - // synonym_path when the package is a synonym file. + // Denotes the location of the package on the OpenSearch Service cluster nodes. + // It's the same as synonym_path for dictionary files. ReferencePath *string noSmithyDocumentSerde } -// The current status of a domain. +// The current status of an OpenSearch Service domain. type DomainStatus struct { - // The Amazon Resource Name (ARN) of a domain. See IAM identifiers + // The Amazon Resource Name (ARN) of the domain. For more information, see IAM + // identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) in - // the AWS Identity and Access Management User Guide for more information. + // the AWS Identity and Access Management User Guide. // // This member is required. ARN *string - // The type and number of instances in the domain. + // Container for the cluster configuration of the domain. // // This member is required. ClusterConfig *ClusterConfig - // The unique identifier for the specified domain. + // Unique identifier for the domain. // // This member is required. DomainId *string - // The name of a domain. Domain names are unique across the domains owned by an - // account within an AWS region. Domain names start with a letter or number and can - // contain the following characters: a-z (lowercase), 0-9, and - (hyphen). + // Name of the domain. Domain names are unique across all domains owned by the same + // account within an Amazon Web Services Region. // // This member is required. DomainName *string - // IAM access policy as a JSON-formatted string. + // Identity and Access Management (IAM) policy document specifying the access + // policies for the domain. AccessPolicies *string - // The status of the AdvancedOptions. + // Key-value pairs that specify advanced configuration options. AdvancedOptions map[string]string - // The current status of the domain's advanced security options. + // Settings for fine-grained access control. AdvancedSecurityOptions *AdvancedSecurityOptions - // The current status of the domain's Auto-Tune options. + // Auto-Tune settings for the domain. AutoTuneOptions *AutoTuneOptionsOutput - // Specifies change details of the domain configuration change. + // Information about a configuration change happening on the domain. ChangeProgressDetails *ChangeProgressDetails - // The CognitoOptions for the specified domain. For more information, see - // Configuring Amazon Cognito authentication for OpenSearch Dashboards - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html). + // Key-value pairs to configure Amazon Cognito authentication for OpenSearch + // Dashboards. CognitoOptions *CognitoOptions - // The domain creation status. True if the creation of a domain is complete. False - // if domain creation is still in progress. + // Creation status of an OpenSearch Service domain. True if domain creation is + // complete. False if domain creation is still in progress. Created *bool - // The domain deletion status. True if a delete request has been received for the - // domain but resource cleanup is still in progress. False if the domain has not - // been deleted. Once domain deletion is complete, the status of the domain is no - // longer returned. + // Deletion status of an OpenSearch Service domain. True if domain deletion is + // complete. False if domain deletion is still in progress. Once deletion is + // complete, the status of the domain is no longer returned. Deleted *bool - // The current status of the domain's endpoint options. + // Additional options for the domain endpoint, such as whether to require HTTPS for + // all traffic. DomainEndpointOptions *DomainEndpointOptions - // The EBSOptions for the specified domain. + // Container for EBS-based storage settings for the domain. EBSOptions *EBSOptions - // The status of the EncryptionAtRestOptions. + // Encryption at rest settings for the domain. EncryptionAtRestOptions *EncryptionAtRestOptions - // The domain endpoint that you use to submit index and search requests. + // Domain-specific endpoint used to submit index, search, and data upload requests + // to the domain. Endpoint *string - // Map containing the domain endpoints used to submit index and search requests. - // Example key, value: + // The key-value pair that exists if the OpenSearch Service domain uses VPC + // endpoints.. Example key, value: // 'vpc','vpc-endpoint-h2dsd34efgyghrtguk5gt6j2foh4.us-east-1.es.amazonaws.com'. Endpoints map[string]string + // Version of OpenSearch or Elasticsearch that the domain is running, in the format + // Elasticsearch_X.Y or OpenSearch_X.Y. EngineVersion *string - // Log publishing options for the given domain. + // Log publishing options for the domain. LogPublishingOptions map[string]LogPublishingOption - // The status of the NodeToNodeEncryptionOptions. + // Whether node-to-node encryption is enabled or disabled. NodeToNodeEncryptionOptions *NodeToNodeEncryptionOptions - // The status of the domain configuration. True if Amazon OpenSearch Service is - // processing configuration changes. False if the configuration is active. + // The status of the domain configuration. True if OpenSearch Service is processing + // configuration changes. False if the configuration is active. Processing *bool // The current status of the domain's service software. ServiceSoftwareOptions *ServiceSoftwareOptions - // The status of the SnapshotOptions. + // DEPRECATED. Container for parameters required to configure automated snapshots + // of domain indexes. SnapshotOptions *SnapshotOptions - // The status of a domain version upgrade. True if Amazon OpenSearch Service is - // undergoing a version upgrade. False if the configuration is active. + // The status of a domain version upgrade to a new version of OpenSearch or + // Elasticsearch. True if OpenSearch Service is in the process of a version + // upgrade. False if the configuration is active. UpgradeProcessing *bool - // The VPCOptions for the specified domain. For more information, see Launching - // your Amazon OpenSearch Service domains using a VPC - // (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). + // The VPC configuration for the domain. VPCOptions *VPCDerivedInfo noSmithyDocumentSerde } +// Results of a dry run performed in an update domain request. type DryRunResults struct { - // Specifies the way in which Amazon OpenSearch Service applies the update. - // Possible responses are Blue/Green (the update requires a blue/green deployment), - // DynamicUpdate (no blue/green required), Undetermined (the domain is undergoing - // an update and can't predict the deployment type; try again after the update is - // complete), and None (the request doesn't include any configuration changes). + // Specifies the way in which OpenSearch Service will apply an update. Possible + // values are: + // + // * Blue/Green - The update requires a blue/green deployment. + // + // * + // DynamicUpdate - No blue/green deployment required + // + // * Undetermined - The domain + // is in the middle of an update and can't predict the deployment type. Try again + // after the update is complete. + // + // * None - The request doesn't include any + // configuration changes. DeploymentType *string - // Contains an optional message associated with the DryRunResults. + // A message corresponding to the deployment type. Message *string noSmithyDocumentSerde } -// The maintenance schedule duration: duration value and duration unit. See -// Auto-Tune for Amazon OpenSearch Service -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) -// for more information. +// The duration of a maintenance schedule. For more information, see Auto-Tune for +// Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type Duration struct { - // The unit of a maintenance schedule duration. Valid value is HOURS. See - // Auto-Tune for Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // The unit of measurement for the duration of a maintenance schedule. Unit TimeUnit - // Integer to specify the value of a maintenance schedule duration. See Auto-Tune - // for Amazon OpenSearch Service - // (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) - // for more information. + // Integer to specify the value of a maintenance schedule duration. Value int64 noSmithyDocumentSerde } -// Options to enable, disable, and specify the properties of EBS storage volumes. +// Container for the parameters required to enable EBS-based storage for an +// OpenSearch Service domain. type EBSOptions struct { - // Whether EBS-based storage is enabled. + // Indicates whether EBS volumes are attached to data nodes in an OpenSearch + // Service domain. EBSEnabled *bool - // The IOPS for Provisioned IOPS And GP3 EBS volume (SSD). + // Specifies the baseline input/output (I/O) performance of EBS volumes attached to + // data nodes. Applicable only for the gp3 and provisioned IOPS EBS volume types. Iops *int32 - // The Throughput for GP3 EBS volume (SSD). + // Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. + // Applicable only for the gp3 volume type. Throughput *int32 - // Integer to specify the size of an EBS volume. + // Specifies the size (in GiB) of EBS volumes attached to data nodes. VolumeSize *int32 - // The volume type for EBS-based storage. + // Specifies the type of EBS volumes attached to data nodes. VolumeType VolumeType noSmithyDocumentSerde } -// Status of the EBS options for the specified domain. +// The status of the EBS options for the specified OpenSearch Service domain. type EBSOptionsStatus struct { - // The EBS options for the specified domain. + // The configured EBS options for the specified domain. // // This member is required. Options *EBSOptions @@ -841,27 +880,30 @@ type EBSOptionsStatus struct { noSmithyDocumentSerde } -// Specifies encryption at rest options. +// Specifies whether the domain should encrypt data at rest, and if so, the Key +// Management Service (KMS) key to use. Can be used only to create a new domain, +// not update an existing one. type EncryptionAtRestOptions struct { - // The option to enable encryption at rest. + // True to enable encryption at rest. Enabled *bool - // The KMS key ID for encryption at rest options. + // The KMS key ID. Takes the form 1a2a3a4-1a2a-3a4a-5a6a-1a2a3a4a5a6a. KmsKeyId *string noSmithyDocumentSerde } -// Status of the encryption At Rest options for the specified domain. +// Status of the encryption at rest options for the specified OpenSearch Service +// domain. type EncryptionAtRestOptionsStatus struct { - // The Encryption At Rest options for the specified domain. + // Encryption at rest options for the specified domain. // // This member is required. Options *EncryptionAtRestOptions - // The status of the Encryption At Rest options for the specified domain. + // The status of the encryption at rest options for the specified domain. // // This member is required. Status *OptionStatus @@ -869,16 +911,20 @@ type EncryptionAtRestOptionsStatus struct { noSmithyDocumentSerde } +// Additional information if the package is in an error state. Null otherwise. type ErrorDetails struct { + + // A message describing the error. ErrorMessage *string + // The type of error that occurred. ErrorType *string noSmithyDocumentSerde } // A filter used to limit results when describing inbound or outbound cross-cluster -// connections. Multiple values can be specified per filter. A cross-cluster +// connections. You can specify multiple values per filter. A cross-cluster // connection must match at least one of the specified values for it to be returned // from an operation. type Filter struct { @@ -886,144 +932,147 @@ type Filter struct { // The name of the filter. Name *string - // Contains one or more values for the filter. + // One or more values for the filter. Values []string noSmithyDocumentSerde } -// Details of an inbound connection. +// Describes an inbound cross-cluster connection for Amazon OpenSearch Service. For +// more information, see Cross-cluster search for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cross-cluster-search.html). type InboundConnection struct { - // The connection ID for the inbound cross-cluster connection. + // The unique identifier of the connection. ConnectionId *string - // The InboundConnectionStatus for the outbound connection. + // The current status of the connection. ConnectionStatus *InboundConnectionStatus - // The AWSDomainInformation for the local OpenSearch domain. + // Information about the source (local) domain. LocalDomainInfo *DomainInformationContainer - // The AWSDomainInformation for the remote OpenSearch domain. + // Information about the destination (remote) domain. RemoteDomainInfo *DomainInformationContainer noSmithyDocumentSerde } -// The connection status of an inbound cross-cluster connection. +// The status of an inbound cross-cluster connection for OpenSearch Service. type InboundConnectionStatus struct { - // Verbose information for the inbound connection status. + // Information about the connection. Message *string - // The state code for the inbound connection. Can be one of the following: + // The status code for the connection. Can be one of the following: // // * - // PENDING_ACCEPTANCE: Inbound connection is not yet accepted by the remote domain + // PENDING_ACCEPTANCE - Inbound connection is not yet accepted by the remote domain // owner. // // * APPROVED: Inbound connection is pending acceptance by the remote // domain owner. // - // * PROVISIONING: Inbound connection provisioning is in - // progress. - // - // * ACTIVE: Inbound connection is active and ready to use. + // * PROVISIONING: Inbound connection is being provisioned. // // * - // REJECTING: Inbound connection rejection is in process. + // ACTIVE: Inbound connection is active and ready to use. // - // * REJECTED: Inbound - // connection is rejected. + // * REJECTING: Inbound + // connection rejection is in process. // - // * DELETING: Inbound connection deletion is in - // progress. + // * REJECTED: Inbound connection is + // rejected. // - // * DELETED: Inbound connection is deleted and can no longer be used. + // * DELETING: Inbound connection deletion is in progress. + // + // * DELETED: + // Inbound connection is deleted and can no longer be used. StatusCode InboundConnectionStatusCode noSmithyDocumentSerde } -// InstanceCountLimits represents the limits on the number of instances that can be -// created in Amazon OpenSearch Service for a given InstanceType. +// Limits on the number of instances that can be created in OpenSearch Service for +// a given instance type. type InstanceCountLimits struct { - // Maximum number of instances that can be instantiated for a given InstanceType. + // The minimum allowed number of instances. MaximumInstanceCount int32 - // Minimum number of instances that can be instantiated for a given InstanceType. + // The maximum allowed number of instances. MinimumInstanceCount int32 noSmithyDocumentSerde } -// InstanceLimits represents the list of instance-related attributes that are -// available for a given InstanceType. +// Instance-related attributes that are available for a given instance type. type InstanceLimits struct { - // InstanceCountLimits represents the limits on the number of instances that can be - // created in Amazon OpenSearch Service for a given InstanceType. + // Limits on the number of instances that can be created for a given instance type. InstanceCountLimits *InstanceCountLimits noSmithyDocumentSerde } +// Lists all instance types and available features for a given OpenSearch or +// Elasticsearch version. type InstanceTypeDetails struct { + + // Whether fine-grained access control is supported for the instance type. AdvancedSecurityEnabled *bool + // Whether logging is supported for the instance type. AppLogsEnabled *bool + // Whether Amazon Cognito access is supported for the instance type. CognitoEnabled *bool + // Whether encryption at rest and node-to-node encryption are supported for the + // instance type. EncryptionEnabled *bool + // Whether the instance acts as a data node, a dedicated master node, or an + // UltraWarm node. InstanceRole []string + // The instance type. InstanceType OpenSearchPartitionInstanceType + // Whether UltraWarm is supported for the instance type. WarmEnabled *bool noSmithyDocumentSerde } -// Limits for a given InstanceType and for each of its roles. -// -// Limits contains the -// following: StorageTypes, InstanceLimits, and AdditionalLimits +// Limits for a given instance type and for each of its roles. type Limits struct { - // List of additional limits that are specific to a given InstanceType and for each - // of its InstanceRole . + // List of additional limits that are specific to a given instance type for each of + // its instance roles. AdditionalLimits []AdditionalLimit - // InstanceLimits represents the list of instance-related attributes that are - // available for a given InstanceType. + // The limits for a given instance type. InstanceLimits *InstanceLimits - // Storage-related types and attributes that are available for a given - // InstanceType. + // Storage-related attributes that are available for a given instance type. StorageTypes []StorageType noSmithyDocumentSerde } -// Log Publishing option that is set for a given domain. -// -// Attributes and their -// details: -// -// * CloudWatchLogsLogGroupArn: ARN of the Cloudwatch log group to -// publish logs to. -// -// * Enabled: Whether the log publishing for a given log type is -// enabled or not. +// Specifies whether the Amazon OpenSearch Service domain publishes the OpenSearch +// application and slow logs to Amazon CloudWatch. For more information, see +// Monitoring OpenSearch logs with Amazon CloudWatch Logs +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createdomain-configure-slow-logs.html). +// After you enable log publishing, you still have to enable the collection of slow +// logs using the OpenSearch REST API. type LogPublishingOption struct { - // ARN of the Cloudwatch log group to publish logs to. + // The Amazon Resource Name (ARN) of the CloudWatch Logs group to publish logs to. CloudWatchLogsLogGroupArn *string - // Whether the given log publishing option is enabled or not. + // Whether the log should be published. Enabled *bool noSmithyDocumentSerde @@ -1035,31 +1084,33 @@ type LogPublishingOptionsStatus struct { // The log publishing options configured for the domain. Options map[string]LogPublishingOption - // The status of the log publishing options for the domain. See OptionStatus for - // the status information that's included. + // The status of the log publishing options for the domain. Status *OptionStatus noSmithyDocumentSerde } -// Credentials for the master user: username and password, ARN, or both. +// Credentials for the master user for a domain. type MasterUserOptions struct { - // ARN for the master user (if IAM is enabled). + // Amazon Resource Name (ARN) for the master user. Only specify if + // InternalUserDatabaseEnabled is false. MasterUserARN *string - // The master user's username, which is stored in the Amazon OpenSearch Service - // domain's internal database. + // User name for the master user. Only specify if InternalUserDatabaseEnabled is + // true. MasterUserName *string - // The master user's password, which is stored in the Amazon OpenSearch Service - // domain's internal database. + // Password for the master user. Only specify if InternalUserDatabaseEnabled is + // true. MasterUserPassword *string noSmithyDocumentSerde } -// The node-to-node encryption options. +// Enables or disables node-to-node encryption. For more information, see +// Node-to-node encryption for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ntn.html). type NodeToNodeEncryptionOptions struct { // True to enable node-to-node encryption. @@ -1084,15 +1135,15 @@ type NodeToNodeEncryptionOptionsStatus struct { noSmithyDocumentSerde } -// Provides the current status of the entity. +// Provides the current status of an entity. type OptionStatus struct { - // The timestamp of when the entity was created. + // The timestamp when the entity was created. // // This member is required. CreationDate *time.Time - // Provides the OptionState for the domain. + // The state of the entity. // // This member is required. State OptionState @@ -1102,7 +1153,7 @@ type OptionStatus struct { // This member is required. UpdateDate *time.Time - // Indicates whether the domain is being deleted. + // Indicates whether the entity is being deleted. PendingDeletion *bool // The latest version of the entity. @@ -1111,64 +1162,65 @@ type OptionStatus struct { noSmithyDocumentSerde } -// Specifies details about an outbound connection. +// Specifies details about an outbound cross-cluster connection. type OutboundConnection struct { - // The connection alias for the outbound cross-cluster connection. + // Name of the connection. ConnectionAlias *string - // The connection ID for the outbound cross-cluster connection. + // Unique identifier of the connection. ConnectionId *string - // The OutboundConnectionStatus for the outbound connection. + // Status of the connection. ConnectionStatus *OutboundConnectionStatus - // The DomainInformation for the local OpenSearch domain. + // Information about the source (local) domain. LocalDomainInfo *DomainInformationContainer - // The DomainInformation for the remote OpenSearch domain. + // Information about the destination (remote) domain. RemoteDomainInfo *DomainInformationContainer noSmithyDocumentSerde } -// The connection status of an outbound cross-cluster connection. +// The status of an outbound cross-cluster connection. type OutboundConnectionStatus struct { - // Verbose information for the outbound connection status. + // Verbose information for the outbound connection. Message *string - // The state code for the outbound connection. Can be one of the following: + // The status code for the outbound connection. Can be one of the following: // // * - // VALIDATING: The outbound connection request is being validated. + // VALIDATING - The outbound connection request is being validated. // // * - // VALIDATION_FAILED: Validation failed for the connection request. + // VALIDATION_FAILED - Validation failed for the connection request. // // * // PENDING_ACCEPTANCE: Outbound connection request is validated and is not yet // accepted by the remote domain owner. // - // * APPROVED: Outbound connection has been + // * APPROVED - Outbound connection has been // approved by the remote domain owner for getting provisioned. // - // * PROVISIONING: + // * PROVISIONING - // Outbound connection request is in process. // - // * ACTIVE: Outbound connection is + // * ACTIVE - Outbound connection is // active and ready to use. // - // * REJECTING: Outbound connection rejection by remote + // * REJECTING - Outbound connection rejection by remote // domain owner is in progress. // - // * REJECTED: Outbound connection request is + // * REJECTED - Outbound connection request is // rejected by remote domain owner. // - // * DELETING: Outbound connection deletion is in - // progress. + // * DELETING - Outbound connection deletion is + // in progress. // - // * DELETED: Outbound connection is deleted and can no longer be used. + // * DELETED - Outbound connection is deleted and can no longer be + // used. StatusCode OutboundConnectionStatusCode noSmithyDocumentSerde @@ -1176,37 +1228,38 @@ type OutboundConnectionStatus struct { // Basic information about a package. type PackageDetails struct { + + // The package version. AvailablePackageVersion *string - // The timestamp of when the package was created. + // The timestamp when the package was created. CreatedAt *time.Time // Additional information if the package is in an error state. Null otherwise. ErrorDetails *ErrorDetails + // Date and time when the package was last updated. LastUpdatedAt *time.Time // User-specified description of the package. PackageDescription *string - // Internal ID of the package. + // The unique identifier of the package. PackageID *string // User-specified name of the package. PackageName *string - // Current state of the package. Values are COPYING, COPY_FAILED, AVAILABLE, - // DELETING, and DELETE_FAILED. + // Current status of the package. PackageStatus PackageStatus - // Currently supports only TXT-DICTIONARY. + // The type of package. PackageType PackageType noSmithyDocumentSerde } -// The Amazon S3 location for importing the package specified as S3BucketName and -// S3Key +// The Amazon S3 location to import the package from. type PackageSource struct { // The name of the Amazon S3 bucket containing the package. @@ -1218,13 +1271,13 @@ type PackageSource struct { noSmithyDocumentSerde } -// Details of a package version. +// Details about a package version. type PackageVersionHistory struct { - // A message associated with the package version. + // A message associated with the package version when it was uploaded. CommitMessage *string - // The timestamp of when the package was created. + // The date and time when the package was created. CreatedAt *time.Time // The package version. @@ -1233,8 +1286,8 @@ type PackageVersionHistory struct { noSmithyDocumentSerde } -// Contains the specific price and frequency of a recurring charges for a reserved -// OpenSearch instance, or for a reserved OpenSearch instance offering. +// Contains the specific price and frequency of a recurring charges for an +// OpenSearch Reserved Instance, or for a Reserved Instance offering. type RecurringCharge struct { // The monetary amount of the recurring charge. @@ -1246,31 +1299,33 @@ type RecurringCharge struct { noSmithyDocumentSerde } -// Details of a reserved OpenSearch instance. +// Details of an OpenSearch Reserved Instance. type ReservedInstance struct { + + // The unique identifier of the billing subscription. BillingSubscriptionId *int64 - // The currency code for the reserved OpenSearch instance offering. + // The currency code for the offering. CurrencyCode *string // The duration, in seconds, for which the OpenSearch instance is reserved. Duration int32 - // The upfront fixed charge you will paid to purchase the specific reserved - // OpenSearch instance offering. + // The upfront fixed charge you will paid to purchase the specific Reserved + // Instance offering. FixedPrice *float64 // The number of OpenSearch instances that have been reserved. InstanceCount int32 - // The OpenSearch instance type offered by the reserved instance offering. + // The OpenSearch instance type offered by theReserved Instance offering. InstanceType OpenSearchPartitionInstanceType - // The payment option as defined in the reserved OpenSearch instance offering. + // The payment option as defined in the Reserved Instance offering. PaymentOption ReservedInstancePaymentOption - // The charge to your account regardless of whether you are creating any domains - // using the instance offering. + // The recurring charge to your account, regardless of whether you create any + // domains using the Reserved Instance offering. RecurringCharges []RecurringCharge // The customer-specified identifier to track this reservation. @@ -1279,65 +1334,65 @@ type ReservedInstance struct { // The unique identifier for the reservation. ReservedInstanceId *string - // The offering identifier. + // The unique identifier of the Reserved Instance offering. ReservedInstanceOfferingId *string - // The time the reservation started. + // The date and time when the reservation was purchased. StartTime *time.Time - // The state of the reserved OpenSearch instance. + // The state of the Reserved Instance. State *string - // The rate you are charged for each hour for the domain that is using this - // reserved instance. + // The hourly rate at which you're charged for the domain using this Reserved + // Instance. UsagePrice *float64 noSmithyDocumentSerde } -// Details of a reserved OpenSearch instance offering. +// Details of an OpenSearch Reserved Instance offering. type ReservedInstanceOffering struct { - // The currency code for the reserved OpenSearch instance offering. + // The currency code for the Reserved Instance offering. CurrencyCode *string // The duration, in seconds, for which the offering will reserve the OpenSearch // instance. Duration int32 - // The upfront fixed charge you will pay to purchase the specific reserved - // OpenSearch instance offering. + // The upfront fixed charge you will pay to purchase the specific Reserved Instance + // offering. FixedPrice *float64 - // The OpenSearch instance type offered by the reserved instance offering. + // The OpenSearch instance type offered by the Reserved Instance offering. InstanceType OpenSearchPartitionInstanceType - // Payment option for the reserved OpenSearch instance offering + // Payment option for the Reserved Instance offering PaymentOption ReservedInstancePaymentOption - // The charge to your account regardless of whether you are creating any domains - // using the instance offering. + // The recurring charge to your account, regardless of whether you creates any + // domains using the offering. RecurringCharges []RecurringCharge - // The OpenSearch reserved instance offering identifier. + // The unique identifier of the Reserved Instance offering. ReservedInstanceOfferingId *string - // The rate you are charged for each hour the domain that is using the offering is - // running. + // The hourly rate at which you're charged for the domain using this Reserved + // Instance. UsagePrice *float64 noSmithyDocumentSerde } -// The SAML identity povider's information. +// The SAML identity povider information. type SAMLIdp struct { - // The unique entity ID of the application in SAML identity provider. + // The unique entity ID of the application in the SAML identity provider. // // This member is required. EntityId *string - // The metadata of the SAML application in XML format. + // The metadata of the SAML application, in XML format. // // This member is required. MetadataContent *string @@ -1345,10 +1400,10 @@ type SAMLIdp struct { noSmithyDocumentSerde } -// The SAML application configuration for the domain. +// The SAML authentication configuration for an Amazon OpenSearch Service domain. type SAMLOptionsInput struct { - // True if SAML is enabled. + // True to enable SAML authentication for a domain. Enabled *bool // The SAML Identity Provider's information. @@ -1357,8 +1412,8 @@ type SAMLOptionsInput struct { // The backend role that the SAML master user is mapped to. MasterBackendRole *string - // The SAML master username, which is stored in the Amazon OpenSearch Service - // domain's internal database. + // The SAML master user name, which is stored in the domain's internal user + // database. MasterUserName *string // Element of the SAML assertion to use for backend roles. Default is roles. @@ -1368,7 +1423,7 @@ type SAMLOptionsInput struct { // Acceptable values are between 1 and 1440, and the default value is 60. SessionTimeoutMinutes *int32 - // Element of the SAML assertion to use for username. Default is NameID. + // Element of the SAML assertion to use for the user name. Default is NameID. SubjectKey *string noSmithyDocumentSerde @@ -1395,29 +1450,30 @@ type SAMLOptionsOutput struct { noSmithyDocumentSerde } -// Specifies details about the scheduled Auto-Tune action. See Auto-Tune for -// Amazon OpenSearch Service -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html) -// for more information. +// Specifies details about a scheduled Auto-Tune action. For more information, see +// Auto-Tune for Amazon OpenSearch Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html). type ScheduledAutoTuneDetails struct { - // The Auto-Tune action description. + // A description of the Auto-Tune action. Action *string - // The Auto-Tune action type. Valid values are JVM_HEAP_SIZE_TUNING and - // JVM_YOUNG_GEN_TUNING. + // The type of Auto-Tune action. ActionType ScheduledAutoTuneActionType - // The timestamp of the Auto-Tune action scheduled for the domain. + // The date and time when the Auto-Tune action is scheduled for the domain. Date *time.Time - // The Auto-Tune action severity. Valid values are LOW, MEDIUM, and HIGH. + // The severity of the Auto-Tune action. Valid values are LOW, MEDIUM, and HIGH. Severity ScheduledAutoTuneSeverityType noSmithyDocumentSerde } -// The current options of an domain service software options. +// The current status of the service software for an Amazon OpenSearch Service +// domain. For more information, see Service software updates in Amazon OpenSearch +// Service +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/service-software.html). type ServiceSoftwareOptions struct { // The timestamp, in Epoch time, until which you can manually request a service @@ -1431,39 +1487,39 @@ type ServiceSoftwareOptions struct { // The current service software version present on the domain. CurrentVersion *string - // The description of the UpdateStatus. + // A description of the service software update status. Description *string - // The new service software version if one is available. + // The new service software version, if one is available. NewVersion *string // True if a service software is never automatically updated. False if a service - // software is automatically updated after AutomatedUpdateDate. + // software is automatically updated after the automated update date. OptionalDeployment *bool // True if you're able to update your service software version. False if you can't // update your service software version. UpdateAvailable *bool - // The status of your service software update. This field can take the following - // values: ELIGIBLE, PENDING_UPDATE, IN_PROGRESS, COMPLETED, and NOT_ELIGIBLE. + // The status of your service software update. UpdateStatus DeploymentStatus noSmithyDocumentSerde } -// The time, in UTC format, when the service takes a daily automated snapshot of -// the specified domain. Default is 0 hours. +// The time, in UTC format, when OpenSearch Service takes a daily automated +// snapshot of the specified domain. Default is 0 hours. type SnapshotOptions struct { - // The time, in UTC format, when the service takes a daily automated snapshot of - // the specified domain. Default is 0 hours. + // The time, in UTC format, when OpenSearch Service takes a daily automated + // snapshot of the specified domain. Default is 0 hours. AutomatedSnapshotStartHour *int32 noSmithyDocumentSerde } -// Status of a daily automated snapshot. +// Container for information about a daily automated snapshot for an OpenSearch +// Service domain. type SnapshotOptionsStatus struct { // The daily snapshot options specified for the domain. @@ -1479,90 +1535,68 @@ type SnapshotOptionsStatus struct { noSmithyDocumentSerde } -// StorageTypes represents the list of storage-related types and their attributes -// that are available for a given InstanceType. +// A list of storage types for an Amazon OpenSearch Service domain that are +// available for a given intance type. type StorageType struct { - // Sub-type of the given storage type. List of available sub-storage options: - // "instance" storageType has no storageSubType. "ebs" storageType has the - // following valid storageSubTypes: - // - // * standard - // - // * gp2 - // - // * gp3 - // - // * io1 - // - // See - // VolumeType for more information regarding each EBS storage option. + // The storage sub-type, such as gp3 or io1. StorageSubTypeName *string // Limits that are applicable for the given storage type. StorageTypeLimits []StorageTypeLimit - // Type of storage. List of available storage options: - // - // * instance - // Built-in - // storage available for the instance - // * ebs - // Elastic block storage attached to the - // instance + // The name of the storage type. StorageTypeName *string noSmithyDocumentSerde } -// Limits that are applicable for the given storage type. +// Limits that are applicable for the given Amazon OpenSearch Service storage type. type StorageTypeLimit struct { // Name of storage limits that are applicable for the given storage type. If - // StorageType is "ebs", the following storage options are applicable: + // StorageType is ebs, the following options are available: // - // * - // MinimumVolumeSize - // Minimum amount of volume size that is applicable for the - // given storage type. Can be empty if not applicable. - // * MaximumVolumeSize - // Maximum - // amount of volume size that is applicable for the given storage type. Can be + // * MinimumVolumeSize - + // Minimum volume size that is available for the given storage type. Can be empty + // if not applicable. + // + // * MaximumVolumeSize - Maximum volume size that is available + // for the given storage type. Can be empty if not applicable. + // + // * MaximumIops - + // Maximum amount of IOPS that is available for the given the storage type. Can be // empty if not applicable. - // * MaximumIops - // Maximum amount of Iops that is - // applicable for given the storage type. Can be empty if not applicable. + // + // * MinimumIops - Minimum amount of IOPS that is + // available for the given the storage type. Can be empty if not applicable. + // // * - // MinimumIops - // Minimum amount of Iops that is applicable for given the storage - // type. Can be empty if not applicable. - // * MaximumThroughput - // Maximum amount of - // Throughput that is applicable for given the storage type. Can be empty if not - // applicable. - // * MinimumThroughput - // Minimum amount of Throughput that is applicable - // for given the storage type. Can be empty if not applicable. + // MaximumThroughput - Maximum amount of throughput that is available for the given + // the storage type. Can be empty if not applicable. + // + // * MinimumThroughput - Minimum + // amount of throughput that is available for the given the storage type. Can be + // empty if not applicable. LimitName *string - // Values for the StorageTypeLimit$LimitName . + // The limit values. LimitValues []string noSmithyDocumentSerde } -// A key value pair for a resource tag. +// A tag (key-value pair) for an Amazon OpenSearch Service resource. type Tag struct { - // The TagKey, the name of the tag. Tag keys must be unique for the domain to which - // they are attached. + // The tag key. Tag keys must be unique for the domain to which they are attached. // // This member is required. Key *string - // The TagValue, the value assigned to the corresponding tag key. Tag values can be - // null and don't have to be unique in a tag set. For example, you can have a key - // value pair in a tag set of project : Trinity and cost-center : Trinity + // The value assigned to the corresponding tag key. Tag values can be null and + // don't have to be unique in a tag set. For example, you can have a key value pair + // in a tag set of project : Trinity and cost-center : Trinity // // This member is required. Value *string @@ -1570,18 +1604,19 @@ type Tag struct { noSmithyDocumentSerde } -// History of the last 10 upgrades and upgrade eligibility checks. +// History of the last 10 upgrades and upgrade eligibility checks for an Amazon +// OpenSearch Service domain. type UpgradeHistory struct { - // UTC timestamp at which the upgrade API call was made in "yyyy-MM-ddTHH:mm:ssZ" - // format. + // UTC timestamp at which the upgrade API call was made, in the format + // yyyy-MM-ddTHH:mm:ssZ. StartTimestamp *time.Time - // A list of UpgradeStepItem s representing information about each step performed - // as part of a specific upgrade or upgrade eligibility check. + // A list of each step performed as part of a specific upgrade or upgrade + // eligibility check. StepsList []UpgradeStepItem - // A string that briefly describes the upgrade. + // A string that describes the upgrade. UpgradeName *string // The current status of the upgrade. The status can take one of the following @@ -1599,7 +1634,7 @@ type UpgradeHistory struct { noSmithyDocumentSerde } -// Represents a single step of the upgrade or upgrade eligibility check workflow. +// Represents a single step of an upgrade or upgrade eligibility check workflow. type UpgradeStepItem struct { // A list of strings containing detailed information about the errors encountered @@ -1610,7 +1645,7 @@ type UpgradeStepItem struct { // step. ProgressPercent *float64 - // One of three steps an upgrade or upgrade eligibility check goes through: + // One of three steps that an upgrade or upgrade eligibility check goes through: // // * // PreUpgradeCheck @@ -1635,17 +1670,16 @@ type UpgradeStepItem struct { noSmithyDocumentSerde } -// The status of the OpenSearch version options for the specified OpenSearch -// domain. +// The status of the the OpenSearch or Elasticsearch version options for the +// specified Amazon OpenSearch Service domain. type VersionStatus struct { - // The OpenSearch version for the specified OpenSearch domain. + // The OpenSearch or Elasticsearch version for the specified domain. // // This member is required. Options *string - // The status of the OpenSearch version options for the specified OpenSearch - // domain. + // The status of the version options for the specified domain. // // This member is required. Status *OptionStatus @@ -1653,30 +1687,29 @@ type VersionStatus struct { noSmithyDocumentSerde } -// Options to specify the subnets and security groups for the VPC endpoint. For -// more information, see Launching your Amazon OpenSearch Service domains using a -// VPC -// (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). +// Information about the subnets and security groups for an Amazon OpenSearch +// Service domain provisioned within a virtual private cloud (VPC). For more +// information, see Launching your Amazon OpenSearch Service domains using a VPC +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). +// This information only exists if the domain was created with VPCOptions. type VPCDerivedInfo struct { - // The Availability Zones for the domain. Exists only if the domain was created - // with VPCOptions. + // The list of Availability Zones associated with the VPC subnets. AvailabilityZones []string - // The security groups for the VPC endpoint. + // The list of security group IDs associated with the VPC endpoints for the domain. SecurityGroupIds []string - // The subnets for the VPC endpoint. + // A list of subnet IDs associated with the VPC endpoints for the domain. SubnetIds []string - // The VPC ID for the domain. Exists only if the domain was created with - // VPCOptions. + // The ID for your VPC. Amazon VPC generates this value when you create a VPC. VPCId *string noSmithyDocumentSerde } -// Status of the VPC options for the specified domain. +// Status of the VPC options for a specified domain. type VPCDerivedInfoStatus struct { // The VPC options for the specified domain. @@ -1692,28 +1725,91 @@ type VPCDerivedInfoStatus struct { noSmithyDocumentSerde } -// Options to specify the subnets and security groups for the VPC endpoint. For -// more information, see Launching your Amazon OpenSearch Service domains using a -// VPC -// (http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). +// The connection endpoint for connecting to an Amazon OpenSearch Service domain +// through a proxy. +type VpcEndpoint struct { + + // The Amazon Resource Name (ARN) of the domain associated with the endpoint. + DomainArn *string + + // The connection endpoint ID for connecting to the domain. + Endpoint *string + + // The current status of the endpoint. + Status VpcEndpointStatus + + // The unique identifier of the endpoint. + VpcEndpointId *string + + // The creator of the endpoint. + VpcEndpointOwner *string + + // Options to specify the subnets and security groups for an Amazon OpenSearch + // Service VPC endpoint. + VpcOptions *VPCDerivedInfo + + noSmithyDocumentSerde +} + +// Error information when attempting to describe an Amazon OpenSearch +// Service-managed VPC endpoint. +type VpcEndpointError struct { + + // The code associated with the error. + ErrorCode VpcEndpointErrorCode + + // A message describing the error. + ErrorMessage *string + + // The unique identifier of the endpoint. + VpcEndpointId *string + + noSmithyDocumentSerde +} + +// Summary information for an Amazon OpenSearch Service-managed VPC endpoint. +type VpcEndpointSummary struct { + + // The Amazon Resource Name (ARN) of the domain associated with the endpoint. + DomainArn *string + + // The current status of the endpoint. + Status VpcEndpointStatus + + // The unique identifier of the endpoint. + VpcEndpointId *string + + // The creator of the endpoint. + VpcEndpointOwner *string + + noSmithyDocumentSerde +} + +// Options to specify the subnets and security groups for an Amazon OpenSearch +// Service VPC endpoint. For more information, see Launching your Amazon OpenSearch +// Service domains using a VPC +// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html). type VPCOptions struct { - // The security groups for the VPC endpoint. + // The list of security group IDs associated with the VPC endpoints for the domain. + // If you do not provide a security group ID, OpenSearch Service uses the default + // security group for the VPC. SecurityGroupIds []string - // The subnets for the VPC endpoint. + // A list of subnet IDs associated with the VPC endpoints for the domain. If your + // domain uses multiple Availability Zones, you need to provide two subnet IDs, one + // per zone. Otherwise, provide only one. SubnetIds []string noSmithyDocumentSerde } -// The zone awareness configuration for the domain cluster, such as the number of -// availability zones. +// The zone awareness configuration for an Amazon OpenSearch Service domain. type ZoneAwarenessConfig struct { - // An integer value to indicate the number of availability zones for a domain when - // zone awareness is enabled. This should be equal to number of subnets if VPC - // endpoints is enabled. + // If you enabled multiple Availability Zones, this value is the number of zones + // that you want the domain to use. Valid values are 2 and 3. If your domain is + // provisioned within a VPC, this value be equal to number of subnets. AvailabilityZoneCount *int32 noSmithyDocumentSerde diff --git a/service/opensearch/validators.go b/service/opensearch/validators.go index 2cd64abca91..b086b364543 100644 --- a/service/opensearch/validators.go +++ b/service/opensearch/validators.go @@ -70,6 +70,26 @@ func (m *validateOpAssociatePackage) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpAuthorizeVpcEndpointAccess struct { +} + +func (*validateOpAuthorizeVpcEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAuthorizeVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AuthorizeVpcEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAuthorizeVpcEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCancelServiceSoftwareUpdate struct { } @@ -150,6 +170,26 @@ func (m *validateOpCreatePackage) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpCreateVpcEndpoint struct { +} + +func (*validateOpCreateVpcEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateVpcEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateVpcEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDomain struct { } @@ -230,6 +270,26 @@ func (m *validateOpDeletePackage) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteVpcEndpoint struct { +} + +func (*validateOpDeleteVpcEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVpcEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVpcEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeDomainAutoTunes struct { } @@ -350,6 +410,26 @@ func (m *validateOpDescribeInstanceTypeLimits) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDescribeVpcEndpoints struct { +} + +func (*validateOpDescribeVpcEndpoints) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeVpcEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeVpcEndpointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeVpcEndpointsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDissociatePackage struct { } @@ -510,6 +590,46 @@ func (m *validateOpListTags) HandleInitialize(ctx context.Context, in middleware return next.HandleInitialize(ctx, in) } +type validateOpListVpcEndpointAccess struct { +} + +func (*validateOpListVpcEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListVpcEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListVpcEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListVpcEndpointsForDomain struct { +} + +func (*validateOpListVpcEndpointsForDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListVpcEndpointsForDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListVpcEndpointsForDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListVpcEndpointsForDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPurchaseReservedInstanceOffering struct { } @@ -570,6 +690,26 @@ func (m *validateOpRemoveTags) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpRevokeVpcEndpointAccess struct { +} + +func (*validateOpRevokeVpcEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRevokeVpcEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RevokeVpcEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRevokeVpcEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartServiceSoftwareUpdate struct { } @@ -630,6 +770,26 @@ func (m *validateOpUpdatePackage) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateVpcEndpoint struct { +} + +func (*validateOpUpdateVpcEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateVpcEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateVpcEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateVpcEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpgradeDomain struct { } @@ -662,6 +822,10 @@ func addOpAssociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociatePackage{}, middleware.After) } +func addOpAuthorizeVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAuthorizeVpcEndpointAccess{}, middleware.After) +} + func addOpCancelServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelServiceSoftwareUpdate{}, middleware.After) } @@ -678,6 +842,10 @@ func addOpCreatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePackage{}, middleware.After) } +func addOpCreateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateVpcEndpoint{}, middleware.After) +} + func addOpDeleteDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDomain{}, middleware.After) } @@ -694,6 +862,10 @@ func addOpDeletePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePackage{}, middleware.After) } +func addOpDeleteVpcEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVpcEndpoint{}, middleware.After) +} + func addOpDescribeDomainAutoTunesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDomainAutoTunes{}, middleware.After) } @@ -718,6 +890,10 @@ func addOpDescribeInstanceTypeLimitsValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDescribeInstanceTypeLimits{}, middleware.After) } +func addOpDescribeVpcEndpointsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeVpcEndpoints{}, middleware.After) +} + func addOpDissociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDissociatePackage{}, middleware.After) } @@ -750,6 +926,14 @@ func addOpListTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTags{}, middleware.After) } +func addOpListVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListVpcEndpointAccess{}, middleware.After) +} + +func addOpListVpcEndpointsForDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListVpcEndpointsForDomain{}, middleware.After) +} + func addOpPurchaseReservedInstanceOfferingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPurchaseReservedInstanceOffering{}, middleware.After) } @@ -762,6 +946,10 @@ func addOpRemoveTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRemoveTags{}, middleware.After) } +func addOpRevokeVpcEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRevokeVpcEndpointAccess{}, middleware.After) +} + func addOpStartServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartServiceSoftwareUpdate{}, middleware.After) } @@ -774,6 +962,10 @@ func addOpUpdatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePackage{}, middleware.After) } +func addOpUpdateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateVpcEndpoint{}, middleware.After) +} + func addOpUpgradeDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpgradeDomain{}, middleware.After) } @@ -984,6 +1176,24 @@ func validateOpAssociatePackageInput(v *AssociatePackageInput) error { } } +func validateOpAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthorizeVpcEndpointAccessInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.Account == nil { + invalidParams.Add(smithy.NewErrParamRequired("Account")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCancelServiceSoftwareUpdateInput(v *CancelServiceSoftwareUpdateInput) error { if v == nil { return nil @@ -1079,6 +1289,24 @@ func validateOpCreatePackageInput(v *CreatePackageInput) error { } } +func validateOpCreateVpcEndpointInput(v *CreateVpcEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateVpcEndpointInput"} + if v.DomainArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainArn")) + } + if v.VpcOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcOptions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDomainInput(v *DeleteDomainInput) error { if v == nil { return nil @@ -1139,6 +1367,21 @@ func validateOpDeletePackageInput(v *DeletePackageInput) error { } } +func validateOpDeleteVpcEndpointInput(v *DeleteVpcEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcEndpointInput"} + if v.VpcEndpointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeDomainAutoTunesInput(v *DescribeDomainAutoTunesInput) error { if v == nil { return nil @@ -1232,6 +1475,21 @@ func validateOpDescribeInstanceTypeLimitsInput(v *DescribeInstanceTypeLimitsInpu } } +func validateOpDescribeVpcEndpointsInput(v *DescribeVpcEndpointsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeVpcEndpointsInput"} + if v.VpcEndpointIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDissociatePackageInput(v *DissociatePackageInput) error { if v == nil { return nil @@ -1355,6 +1613,36 @@ func validateOpListTagsInput(v *ListTagsInput) error { } } +func validateOpListVpcEndpointAccessInput(v *ListVpcEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListVpcEndpointAccessInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListVpcEndpointsForDomainInput(v *ListVpcEndpointsForDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListVpcEndpointsForDomainInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPurchaseReservedInstanceOfferingInput(v *PurchaseReservedInstanceOfferingInput) error { if v == nil { return nil @@ -1406,6 +1694,24 @@ func validateOpRemoveTagsInput(v *RemoveTagsInput) error { } } +func validateOpRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RevokeVpcEndpointAccessInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.Account == nil { + invalidParams.Add(smithy.NewErrParamRequired("Account")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartServiceSoftwareUpdateInput(v *StartServiceSoftwareUpdateInput) error { if v == nil { return nil @@ -1464,6 +1770,24 @@ func validateOpUpdatePackageInput(v *UpdatePackageInput) error { } } +func validateOpUpdateVpcEndpointInput(v *UpdateVpcEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateVpcEndpointInput"} + if v.VpcEndpointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcEndpointId")) + } + if v.VpcOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcOptions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpgradeDomainInput(v *UpgradeDomainInput) error { if v == nil { return nil diff --git a/service/polly/api_op_SynthesizeSpeech.go b/service/polly/api_op_SynthesizeSpeech.go index 6d410ffcc14..ff05c27e675 100644 --- a/service/polly/api_op_SynthesizeSpeech.go +++ b/service/polly/api_op_SynthesizeSpeech.go @@ -107,8 +107,6 @@ type SynthesizeSpeechInput struct { type SynthesizeSpeechOutput struct { // Stream containing the synthesized speech. - // - // This member is required. AudioStream io.ReadCloser // Specifies the type audio stream. This should reflect the OutputFormat parameter diff --git a/service/polly/types/enums.go b/service/polly/types/enums.go index d65510092bc..89b859f7d4a 100644 --- a/service/polly/types/enums.go +++ b/service/polly/types/enums.go @@ -281,6 +281,10 @@ const ( VoiceIdPedro VoiceId = "Pedro" VoiceIdKajal VoiceId = "Kajal" VoiceIdHiujin VoiceId = "Hiujin" + VoiceIdLaura VoiceId = "Laura" + VoiceIdElin VoiceId = "Elin" + VoiceIdIda VoiceId = "Ida" + VoiceIdSuvi VoiceId = "Suvi" ) // Values returns all known values for VoiceId. Note that this can be expanded in @@ -361,5 +365,9 @@ func (VoiceId) Values() []VoiceId { "Pedro", "Kajal", "Hiujin", + "Laura", + "Elin", + "Ida", + "Suvi", } } diff --git a/service/resourceexplorer2/LICENSE.txt b/service/resourceexplorer2/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/resourceexplorer2/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/resourceexplorer2/api_client.go b/service/resourceexplorer2/api_client.go new file mode 100644 index 00000000000..e818d650f6c --- /dev/null +++ b/service/resourceexplorer2/api_client.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + cryptorand "crypto/rand" + "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" + 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" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "Resource Explorer 2" +const ServiceAPIVersion = "2022-07-28" + +// Client provides the API client to make operations call for AWS Resource +// Explorer. +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) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // 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. 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. 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 +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (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) + } + + finalizeRetryMaxAttemptOptions(&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 noSmithyDocumentSerde = smithydocument.NoSerde + +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, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(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 finalizeRetryMaxAttemptOptions(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, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "resourceexplorer2", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +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 resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// 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 +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +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) +} diff --git a/service/resourceexplorer2/api_client_test.go b/service/resourceexplorer2/api_client_test.go new file mode 100644 index 00000000000..33fb34be558 --- /dev/null +++ b/service/resourceexplorer2/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +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, + }) + + 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/resourceexplorer2/api_op_AssociateDefaultView.go b/service/resourceexplorer2/api_op_AssociateDefaultView.go new file mode 100644 index 00000000000..758323a7220 --- /dev/null +++ b/service/resourceexplorer2/api_op_AssociateDefaultView.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sets the specified view as the default for the Amazon Web Services Region in +// which you call this operation. When a user performs a Search that doesn't +// explicitly specify which view to use, then Amazon Web Services Resource Explorer +// automatically chooses this default view for searches performed in this Amazon +// Web Services Region. If an Amazon Web Services Region doesn't have a default +// view configured, then users must explicitly specify a view with every Search +// operation performed in that Region. +func (c *Client) AssociateDefaultView(ctx context.Context, params *AssociateDefaultViewInput, optFns ...func(*Options)) (*AssociateDefaultViewOutput, error) { + if params == nil { + params = &AssociateDefaultViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateDefaultView", params, optFns, c.addOperationAssociateDefaultViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateDefaultViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateDefaultViewInput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view to set as the default for the Amazon Web Services Region and Amazon Web + // Services account in which you call this operation. The specified view must + // already exist in the called Region. + // + // This member is required. + ViewArn *string + + noSmithyDocumentSerde +} + +type AssociateDefaultViewOutput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view that the operation set as the default for queries made in the Amazon + // Web Services Region and Amazon Web Services account in which you called this + // operation. + ViewArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateDefaultViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateDefaultView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateDefaultView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateDefaultViewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDefaultView(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opAssociateDefaultView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "AssociateDefaultView", + } +} diff --git a/service/resourceexplorer2/api_op_BatchGetView.go b/service/resourceexplorer2/api_op_BatchGetView.go new file mode 100644 index 00000000000..07847e5277a --- /dev/null +++ b/service/resourceexplorer2/api_op_BatchGetView.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves details about a list of views. +func (c *Client) BatchGetView(ctx context.Context, params *BatchGetViewInput, optFns ...func(*Options)) (*BatchGetViewOutput, error) { + if params == nil { + params = &BatchGetViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetView", params, optFns, c.addOperationBatchGetViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetViewInput struct { + + // A list of Amazon resource names (ARNs) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // that identify the views you want details for. + ViewArns []string + + noSmithyDocumentSerde +} + +type BatchGetViewOutput struct { + + // If any of the specified ARNs result in an error, then this structure describes + // the error. + Errors []types.BatchGetViewError + + // A structure with a list of objects with details for each of the specified views. + Views []types.View + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetView(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opBatchGetView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "BatchGetView", + } +} diff --git a/service/resourceexplorer2/api_op_CreateIndex.go b/service/resourceexplorer2/api_op_CreateIndex.go new file mode 100644 index 00000000000..820da51a3a1 --- /dev/null +++ b/service/resourceexplorer2/api_op_CreateIndex.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Turns on Amazon Web Services Resource Explorer in the Amazon Web Services Region +// in which you called this operation by creating an index. Resource Explorer +// begins discovering the resources in this Region and stores the details about the +// resources in the index so that they can be queried by using the Search +// operation. You can create only one index in a Region. This operation creates +// only a local index. To promote the local index in one Amazon Web Services Region +// into the aggregator index for the Amazon Web Services account, use the +// UpdateIndexType operation. For more information, see Turning on cross-Region +// search by creating an aggregator index +// (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html) +// in the Amazon Web Services Resource Explorer User Guide. For more details about +// what happens when you turn on Resource Explorer in an Amazon Web Services +// Region, see Turn on Resource Explorer to index your resources in an Amazon Web +// Services Region +// (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-service-activate.html) +// in the Amazon Web Services Resource Explorer User Guide. If this is the first +// Amazon Web Services Region in which you've created an index for Resource +// Explorer, then this operation also creates a service-linked role +// (https://docs.aws.amazon.com/arexug/mainline/security_iam_service-linked-roles.html) +// in your Amazon Web Services account that allows Resource Explorer to enumerate +// your resources to populate the index. +// +// * Action: resource-explorer-2:CreateIndex +// Resource: The ARN of the index (as it will exist after the operation completes) +// in the Amazon Web Services Region and account in which you're trying to create +// the index. Use the wildcard character () at the end of the string to match the +// eventual UUID. For example, the following Resource element restricts the role or +// user to creating an index in only the us-east-2 Region of the specified account. +// "Resource": "arn:aws:resource-explorer-2:us-east-2::index/" +// Alternatively, you can use "Resource": "" to allow the role or user to create an +// index in any Region. +// +// * Action: iam:CreateServiceLinkedRole Resource: No +// specific resource (). This permission is required only the first time you create +// an index to turn on Resource Explorer in the account. Resource Explorer uses +// this to create the service-linked role needed to index the resources in your +// account +// (https://docs.aws.amazon.com/resource-explorer/latest/userguide/security_iam_service-linked-roles.html). +// Resource Explorer uses the same service-linked role for all additional indexes +// you create afterwards. +func (c *Client) CreateIndex(ctx context.Context, params *CreateIndexInput, optFns ...func(*Options)) (*CreateIndexOutput, error) { + if params == nil { + params = &CreateIndexInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateIndex", params, optFns, c.addOperationCreateIndexMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateIndexOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateIndexInput struct { + + // This value helps ensure idempotency. Resource Explorer uses this value to + // prevent the accidental creation of duplicate versions. We recommend that you + // generate a UUID-type value + // (https://wikipedia.org/wiki/Universally_unique_identifier) to ensure the + // uniqueness of your views. + ClientToken *string + + // The specified tags are attached only to the index created in this Amazon Web + // Services Region. The tags aren't attached to any of the resources listed in the + // index. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateIndexOutput struct { + + // The ARN of the new local index for the Region. You can reference this ARN in IAM + // permission policies to authorize the following operations: DeleteIndex | + // GetIndex | UpdateIndexType | CreateView + Arn *string + + // The date and timestamp when the index was created. + CreatedAt *time.Time + + // Indicates the current state of the index. You can check for changes to the state + // for asynchronous operations by calling the GetIndex operation. The state can + // remain in the CREATING or UPDATING state for several hours as Resource Explorer + // discovers the information about your resources and populates the index. + State types.IndexState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateIndexMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateIndex{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateIndex{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateIndexMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIndex(options.Region), middleware.Before); 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 + } + return nil +} + +type idempotencyToken_initializeOpCreateIndex struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateIndex) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateIndex) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateIndexInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIndexInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateIndexMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIndex{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateIndex(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "CreateIndex", + } +} diff --git a/service/resourceexplorer2/api_op_CreateView.go b/service/resourceexplorer2/api_op_CreateView.go new file mode 100644 index 00000000000..c6d3335be66 --- /dev/null +++ b/service/resourceexplorer2/api_op_CreateView.go @@ -0,0 +1,202 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a view that users can query by using the Search operation. Results from +// queries that you make using this view include only resources that match the +// view's Filters. For more information about Amazon Web Services Resource Explorer +// views, see Managing views +// (https://docs.aws.amazon.com/arexug/mainline/manage-views.html) in the Amazon +// Web Services Resource Explorer User Guide. Only the principals with an IAM +// identity-based policy that grants Allow to the Search action on a Resource with +// the Amazon resource name (ARN) +// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of +// this view can Search using views you create with this operation. +func (c *Client) CreateView(ctx context.Context, params *CreateViewInput, optFns ...func(*Options)) (*CreateViewOutput, error) { + if params == nil { + params = &CreateViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateView", params, optFns, c.addOperationCreateViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateViewInput struct { + + // The name of the new view. This name appears in the list of views in Resource + // Explorer. The name must be no more than 64 characters long, and can include + // letters, digits, and the dash (-) character. The name must be unique within its + // Amazon Web Services Region. + // + // This member is required. + ViewName *string + + // This value helps ensure idempotency. Resource Explorer uses this value to + // prevent the accidental creation of duplicate versions. We recommend that you + // generate a UUID-type value + // (https://wikipedia.org/wiki/Universally_unique_identifier) to ensure the + // uniqueness of your views. + ClientToken *string + + // An array of strings that specify which resources are included in the results of + // queries made using this view. When you use this view in a Search operation, the + // filter string is combined with the search's QueryString parameter using a + // logical AND operator. For information about the supported syntax, see Search + // query reference for Resource Explorer + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html) + // in the Amazon Web Services Resource Explorer User Guide. This query string in + // the context of this operation supports only filter prefixes + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters) + // with optional operators + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators). + // It doesn't support free-form text. For example, the string region:us* + // service:ec2 -tag:stage=prod includes all Amazon EC2 resources in any Amazon Web + // Services Region that begins with the letters us and is not tagged with a key + // Stage that has the value prod. + Filters *types.SearchFilter + + // Specifies optional fields that you want included in search results from this + // view. It is a list of objects that each describe a field to include. The default + // is an empty list, with no optional fields included in the results. + IncludedProperties []types.IncludedProperty + + // Tag key and value pairs that are attached to the view. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateViewOutput struct { + + // A structure that contains the details about the new view. + View *types.View + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateViewMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateViewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateView(options.Region), middleware.Before); 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 + } + return nil +} + +type idempotencyToken_initializeOpCreateView struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateView) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateViewInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateViewInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateViewMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateView{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "CreateView", + } +} diff --git a/service/resourceexplorer2/api_op_DeleteIndex.go b/service/resourceexplorer2/api_op_DeleteIndex.go new file mode 100644 index 00000000000..1aef571b075 --- /dev/null +++ b/service/resourceexplorer2/api_op_DeleteIndex.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Deletes the specified index and turns off Amazon Web Services Resource Explorer +// in the specified Amazon Web Services Region. When you delete an index, Resource +// Explorer stops discovering and indexing resources in that Region. Resource +// Explorer also deletes all views in that Region. These actions occur as +// asynchronous background tasks. You can check to see when the actions are +// complete by using the GetIndex operation and checking the Status response value. +func (c *Client) DeleteIndex(ctx context.Context, params *DeleteIndexInput, optFns ...func(*Options)) (*DeleteIndexOutput, error) { + if params == nil { + params = &DeleteIndexInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIndex", params, optFns, c.addOperationDeleteIndexMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIndexOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIndexInput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the index that you want to delete. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type DeleteIndexOutput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the index that you successfully started the deletion process. This operation is + // asynchronous. To check its status, call the GetIndex operation. + Arn *string + + // The date and time when you last updated this index. + LastUpdatedAt *time.Time + + // Indicates the current state of the index. + State types.IndexState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIndexMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteIndex{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteIndex{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteIndexValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIndex(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteIndex(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "DeleteIndex", + } +} diff --git a/service/resourceexplorer2/api_op_DeleteView.go b/service/resourceexplorer2/api_op_DeleteView.go new file mode 100644 index 00000000000..fc2f8267560 --- /dev/null +++ b/service/resourceexplorer2/api_op_DeleteView.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified view. If the specified view is the default view for its +// Amazon Web Services Region, then all Search operations in that Region must +// explicitly specify the view to use until you configure a new default by calling +// the AssociateDefaultView operation. +func (c *Client) DeleteView(ctx context.Context, params *DeleteViewInput, optFns ...func(*Options)) (*DeleteViewOutput, error) { + if params == nil { + params = &DeleteViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteView", params, optFns, c.addOperationDeleteViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteViewInput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view that you want to delete. + // + // This member is required. + ViewArn *string + + noSmithyDocumentSerde +} + +type DeleteViewOutput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view that you successfully deleted. + ViewArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteViewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteView(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "DeleteView", + } +} diff --git a/service/resourceexplorer2/api_op_DisassociateDefaultView.go b/service/resourceexplorer2/api_op_DisassociateDefaultView.go new file mode 100644 index 00000000000..bc1f79accff --- /dev/null +++ b/service/resourceexplorer2/api_op_DisassociateDefaultView.go @@ -0,0 +1,112 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// After you call this operation, the affected Amazon Web Services Region no longer +// has a default view. All Search operations in that Region must explicitly specify +// a view or the operation fails. You can configure a new default by calling the +// AssociateDefaultView operation. If an Amazon Web Services Region doesn't have a +// default view configured, then users must explicitly specify a view with every +// Search operation performed in that Region. +func (c *Client) DisassociateDefaultView(ctx context.Context, params *DisassociateDefaultViewInput, optFns ...func(*Options)) (*DisassociateDefaultViewOutput, error) { + if params == nil { + params = &DisassociateDefaultViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateDefaultView", params, optFns, c.addOperationDisassociateDefaultViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateDefaultViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateDefaultViewInput struct { + noSmithyDocumentSerde +} + +type DisassociateDefaultViewOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociateDefaultViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateDefaultView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateDefaultView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateDefaultView(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociateDefaultView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "DisassociateDefaultView", + } +} diff --git a/service/resourceexplorer2/api_op_GetDefaultView.go b/service/resourceexplorer2/api_op_GetDefaultView.go new file mode 100644 index 00000000000..c5b212b40b6 --- /dev/null +++ b/service/resourceexplorer2/api_op_GetDefaultView.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the Amazon Resource Name (ARN) of the view that is the default for the +// Amazon Web Services Region in which you call this operation. You can then call +// GetView to retrieve the details of that view. +func (c *Client) GetDefaultView(ctx context.Context, params *GetDefaultViewInput, optFns ...func(*Options)) (*GetDefaultViewOutput, error) { + if params == nil { + params = &GetDefaultViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDefaultView", params, optFns, c.addOperationGetDefaultViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDefaultViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDefaultViewInput struct { + noSmithyDocumentSerde +} + +type GetDefaultViewOutput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view that is the current default for the Amazon Web Services Region in which + // you called this operation. + ViewArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDefaultViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDefaultView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDefaultView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDefaultView(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetDefaultView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "GetDefaultView", + } +} diff --git a/service/resourceexplorer2/api_op_GetIndex.go b/service/resourceexplorer2/api_op_GetIndex.go new file mode 100644 index 00000000000..6690682972b --- /dev/null +++ b/service/resourceexplorer2/api_op_GetIndex.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves details about the Amazon Web Services Resource Explorer index in the +// Amazon Web Services Region in which you invoked the operation. +func (c *Client) GetIndex(ctx context.Context, params *GetIndexInput, optFns ...func(*Options)) (*GetIndexOutput, error) { + if params == nil { + params = &GetIndexInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIndex", params, optFns, c.addOperationGetIndexMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIndexOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetIndexInput struct { + noSmithyDocumentSerde +} + +type GetIndexOutput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the index. + Arn *string + + // The date and time when the index was originally created. + CreatedAt *time.Time + + // The date and time when the index was last updated. + LastUpdatedAt *time.Time + + // If this index is Type=AGGREGATOR, then this response value contains a list of + // the Amazon Web Services Regions that replicate their content to the index in + // this Region. Not present for a local index. + ReplicatingFrom []string + + // Identifies the Amazon Web Services Region that has an index set to + // Type=AGGREGATOR, if one exists. If it does, then the Region you called this + // operation in replicates its index information to the Region specified in this + // response value. Not present if there isn't an aggregator index in the account. + ReplicatingTo []string + + // Indicates the current state of the index in this Amazon Web Services Region. + State types.IndexState + + // Tag key and value pairs that are attached to the index. + Tags map[string]string + + // Specifies the type of the index in this Region. For information about the + // aggregator index and how it differs from a local index, see Turning on + // cross-Region search by creating an aggregator index + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). + Type types.IndexType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIndexMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIndex{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIndex{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIndex(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetIndex(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "GetIndex", + } +} diff --git a/service/resourceexplorer2/api_op_GetView.go b/service/resourceexplorer2/api_op_GetView.go new file mode 100644 index 00000000000..e1f93389422 --- /dev/null +++ b/service/resourceexplorer2/api_op_GetView.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves details of the specified view. +func (c *Client) GetView(ctx context.Context, params *GetViewInput, optFns ...func(*Options)) (*GetViewOutput, error) { + if params == nil { + params = &GetViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetView", params, optFns, c.addOperationGetViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetViewInput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view that you want information about. + // + // This member is required. + ViewArn *string + + noSmithyDocumentSerde +} + +type GetViewOutput struct { + + // Tag key and value pairs that are attached to the view. + Tags map[string]string + + // A structure that contains the details for the requested view. + View *types.View + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetViewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetView(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "GetView", + } +} diff --git a/service/resourceexplorer2/api_op_ListIndexes.go b/service/resourceexplorer2/api_op_ListIndexes.go new file mode 100644 index 00000000000..e84f252e392 --- /dev/null +++ b/service/resourceexplorer2/api_op_ListIndexes.go @@ -0,0 +1,245 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of all of the indexes in Amazon Web Services Regions that are +// currently collecting resource information for Amazon Web Services Resource +// Explorer. +func (c *Client) ListIndexes(ctx context.Context, params *ListIndexesInput, optFns ...func(*Options)) (*ListIndexesOutput, error) { + if params == nil { + params = &ListIndexesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListIndexes", params, optFns, c.addOperationListIndexesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListIndexesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListIndexesInput struct { + + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + MaxResults *int32 + + // The parameter for receiving additional results if you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. + NextToken *string + + // If specified, limits the response to only information about the index in the + // specified list of Amazon Web Services Regions. + Regions []string + + // If specified, limits the output to only indexes of the specified Type, either + // LOCAL or AGGREGATOR. Use this option to discover the aggregator index for your + // account. + Type types.IndexType + + noSmithyDocumentSerde +} + +type ListIndexesOutput struct { + + // A structure that contains the details and status of each index. + Indexes []types.Index + + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListIndexesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListIndexes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListIndexes{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIndexes(options.Region), middleware.Before); 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 + } + return nil +} + +// ListIndexesAPIClient is a client that implements the ListIndexes operation. +type ListIndexesAPIClient interface { + ListIndexes(context.Context, *ListIndexesInput, ...func(*Options)) (*ListIndexesOutput, error) +} + +var _ ListIndexesAPIClient = (*Client)(nil) + +// ListIndexesPaginatorOptions is the paginator options for ListIndexes +type ListIndexesPaginatorOptions struct { + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + 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 +} + +// ListIndexesPaginator is a paginator for ListIndexes +type ListIndexesPaginator struct { + options ListIndexesPaginatorOptions + client ListIndexesAPIClient + params *ListIndexesInput + nextToken *string + firstPage bool +} + +// NewListIndexesPaginator returns a new ListIndexesPaginator +func NewListIndexesPaginator(client ListIndexesAPIClient, params *ListIndexesInput, optFns ...func(*ListIndexesPaginatorOptions)) *ListIndexesPaginator { + if params == nil { + params = &ListIndexesInput{} + } + + options := ListIndexesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListIndexesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIndexesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListIndexes page. +func (p *ListIndexesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndexesOutput, 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.ListIndexes(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_opListIndexes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "ListIndexes", + } +} diff --git a/service/resourceexplorer2/api_op_ListSupportedResourceTypes.go b/service/resourceexplorer2/api_op_ListSupportedResourceTypes.go new file mode 100644 index 00000000000..d208b4c7d76 --- /dev/null +++ b/service/resourceexplorer2/api_op_ListSupportedResourceTypes.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of all resource types currently supported by Amazon Web +// Services Resource Explorer. +func (c *Client) ListSupportedResourceTypes(ctx context.Context, params *ListSupportedResourceTypesInput, optFns ...func(*Options)) (*ListSupportedResourceTypesOutput, error) { + if params == nil { + params = &ListSupportedResourceTypesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSupportedResourceTypes", params, optFns, c.addOperationListSupportedResourceTypesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSupportedResourceTypesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSupportedResourceTypesInput struct { + + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + MaxResults *int32 + + // The parameter for receiving additional results if you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSupportedResourceTypesOutput struct { + + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null. + NextToken *string + + // The list of resource types supported by Resource Explorer. + ResourceTypes []types.SupportedResourceType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSupportedResourceTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSupportedResourceTypes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSupportedResourceTypes{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSupportedResourceTypes(options.Region), middleware.Before); 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 + } + return nil +} + +// ListSupportedResourceTypesAPIClient is a client that implements the +// ListSupportedResourceTypes operation. +type ListSupportedResourceTypesAPIClient interface { + ListSupportedResourceTypes(context.Context, *ListSupportedResourceTypesInput, ...func(*Options)) (*ListSupportedResourceTypesOutput, error) +} + +var _ ListSupportedResourceTypesAPIClient = (*Client)(nil) + +// ListSupportedResourceTypesPaginatorOptions is the paginator options for +// ListSupportedResourceTypes +type ListSupportedResourceTypesPaginatorOptions struct { + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + 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 +} + +// ListSupportedResourceTypesPaginator is a paginator for +// ListSupportedResourceTypes +type ListSupportedResourceTypesPaginator struct { + options ListSupportedResourceTypesPaginatorOptions + client ListSupportedResourceTypesAPIClient + params *ListSupportedResourceTypesInput + nextToken *string + firstPage bool +} + +// NewListSupportedResourceTypesPaginator returns a new +// ListSupportedResourceTypesPaginator +func NewListSupportedResourceTypesPaginator(client ListSupportedResourceTypesAPIClient, params *ListSupportedResourceTypesInput, optFns ...func(*ListSupportedResourceTypesPaginatorOptions)) *ListSupportedResourceTypesPaginator { + if params == nil { + params = &ListSupportedResourceTypesInput{} + } + + options := ListSupportedResourceTypesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSupportedResourceTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSupportedResourceTypesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSupportedResourceTypes page. +func (p *ListSupportedResourceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSupportedResourceTypesOutput, 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.ListSupportedResourceTypes(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_opListSupportedResourceTypes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "ListSupportedResourceTypes", + } +} diff --git a/service/resourceexplorer2/api_op_ListTagsForResource.go b/service/resourceexplorer2/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..45e5624e6f9 --- /dev/null +++ b/service/resourceexplorer2/api_op_ListTagsForResource.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags that are attached to the specified resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view or index that you want to attach tags to. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // The tag key and value pairs that you want to attach to the specified view or + // index. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "ListTagsForResource", + } +} diff --git a/service/resourceexplorer2/api_op_ListViews.go b/service/resourceexplorer2/api_op_ListViews.go new file mode 100644 index 00000000000..39331d316ec --- /dev/null +++ b/service/resourceexplorer2/api_op_ListViews.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the Amazon resource names (ARNs) +// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of +// the views available in the Amazon Web Services Region in which you call this +// operation. Always check the NextToken response parameter for a null value when +// calling a paginated operation. These operations can occasionally return an empty +// set of results even when there are more results available. The NextToken +// response parameter value is null only when there are no more results to display. +func (c *Client) ListViews(ctx context.Context, params *ListViewsInput, optFns ...func(*Options)) (*ListViewsOutput, error) { + if params == nil { + params = &ListViewsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListViews", params, optFns, c.addOperationListViewsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListViewsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListViewsInput struct { + + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + MaxResults *int32 + + // The parameter for receiving additional results if you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. + NextToken *string + + noSmithyDocumentSerde +} + +type ListViewsOutput struct { + + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null. + NextToken *string + + // The list of views available in the Amazon Web Services Region in which you + // called this operation. + Views []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListViewsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListViews{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListViews{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListViews(options.Region), middleware.Before); 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 + } + return nil +} + +// ListViewsAPIClient is a client that implements the ListViews operation. +type ListViewsAPIClient interface { + ListViews(context.Context, *ListViewsInput, ...func(*Options)) (*ListViewsOutput, error) +} + +var _ ListViewsAPIClient = (*Client)(nil) + +// ListViewsPaginatorOptions is the paginator options for ListViews +type ListViewsPaginatorOptions struct { + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + 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 +} + +// ListViewsPaginator is a paginator for ListViews +type ListViewsPaginator struct { + options ListViewsPaginatorOptions + client ListViewsAPIClient + params *ListViewsInput + nextToken *string + firstPage bool +} + +// NewListViewsPaginator returns a new ListViewsPaginator +func NewListViewsPaginator(client ListViewsAPIClient, params *ListViewsInput, optFns ...func(*ListViewsPaginatorOptions)) *ListViewsPaginator { + if params == nil { + params = &ListViewsInput{} + } + + options := ListViewsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListViewsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListViewsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListViews page. +func (p *ListViewsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListViewsOutput, 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.ListViews(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_opListViews(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "ListViews", + } +} diff --git a/service/resourceexplorer2/api_op_Search.go b/service/resourceexplorer2/api_op_Search.go new file mode 100644 index 00000000000..4c1b5f68869 --- /dev/null +++ b/service/resourceexplorer2/api_op_Search.go @@ -0,0 +1,278 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches for resources and displays details about all resources that match the +// specified criteria. You must specify a query string. All search queries must use +// a view. If you don't explicitly specify a view, then Amazon Web Services +// Resource Explorer uses the default view for the Amazon Web Services Region in +// which you call this operation. The results are the logical intersection of the +// results that match both the QueryString parameter supplied to this operation and +// the SearchFilter parameter attached to the view. For the complete syntax +// supported by the QueryString parameter, see Search query syntax reference for +// Resource Explorer +// (https://docs.aws.amazon.com/resource-explorer/latest/APIReference/about-query-syntax.html). +// If your search results are empty, or are missing results that you think should +// be there, see Troubleshooting Resource Explorer search +// (https://docs.aws.amazon.com/resource-explorer/latest/userguide/troubleshooting_search.html). +func (c *Client) Search(ctx context.Context, params *SearchInput, optFns ...func(*Options)) (*SearchOutput, error) { + if params == nil { + params = &SearchInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "Search", params, optFns, c.addOperationSearchMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchInput struct { + + // A string that includes keywords and filters that specify the resources that you + // want to include in the results. For the complete syntax supported by the + // QueryString parameter, see Search query syntax reference for Resource Explorer + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html). + // The search is completely case insensitive. You can specify an empty string to + // return all results up to the limit of 1,000 total results. The operation can + // return only the first 1,000 results. If the resource you want is not included, + // then use a different value for QueryString to refine the results. + // + // This member is required. + QueryString *string + + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + MaxResults *int32 + + // The parameter for receiving additional results if you receive a NextToken + // response in a previous request. A NextToken response indicates that more output + // is available. Set this parameter to the value of the previous call's NextToken + // response to indicate where the output should continue from. + NextToken *string + + // Specifies the Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view to use for the query. If you don't specify a value for this parameter, + // then the operation automatically uses the default view for the Amazon Web + // Services Region in which you called this operation. If the Region either doesn't + // have a default view or if you don't have permission to use the default view, + // then the operation fails with a 401 Unauthorized exception. + ViewArn *string + + noSmithyDocumentSerde +} + +type SearchOutput struct { + + // The number of resources that match the query. + Count *types.ResourceCount + + // If present, indicates that more output is available than is included in the + // current response. Use this value in the NextToken request parameter in a + // subsequent call to the operation to get the next part of the output. You should + // repeat this until the NextToken response element comes back as null. + NextToken *string + + // The list of structures that describe the resources that match the query. + Resources []types.Resource + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view that this operation used to perform the search. + ViewArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearch{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearch{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearch(options.Region), middleware.Before); 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 + } + return nil +} + +// SearchAPIClient is a client that implements the Search operation. +type SearchAPIClient interface { + Search(context.Context, *SearchInput, ...func(*Options)) (*SearchOutput, error) +} + +var _ SearchAPIClient = (*Client)(nil) + +// SearchPaginatorOptions is the paginator options for Search +type SearchPaginatorOptions struct { + // The maximum number of results that you want included on each page of the + // response. If you do not include this parameter, it defaults to a value + // appropriate to the operation. If additional items exist beyond those included in + // the current response, the NextToken response element is present and has a value + // (is not null). Include that value as the NextToken request parameter in the next + // call to the operation to get the next part of the results. An API operation can + // return fewer results than the maximum even when there are more results + // available. You should check NextToken after every operation to ensure that you + // receive all of the results. + 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 +} + +// SearchPaginator is a paginator for Search +type SearchPaginator struct { + options SearchPaginatorOptions + client SearchAPIClient + params *SearchInput + nextToken *string + firstPage bool +} + +// NewSearchPaginator returns a new SearchPaginator +func NewSearchPaginator(client SearchAPIClient, params *SearchInput, optFns ...func(*SearchPaginatorOptions)) *SearchPaginator { + if params == nil { + params = &SearchInput{} + } + + options := SearchPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next Search page. +func (p *SearchPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchOutput, 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.Search(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_opSearch(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "Search", + } +} diff --git a/service/resourceexplorer2/api_op_TagResource.go b/service/resourceexplorer2/api_op_TagResource.go new file mode 100644 index 00000000000..b9c8b8cea58 --- /dev/null +++ b/service/resourceexplorer2/api_op_TagResource.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds one or more tag key and value pairs to an Amazon Web Services Resource +// Explorer view or index. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the view or index that you want to attach tags + // to. + // + // This member is required. + ResourceArn *string + + // A list of tag key and value pairs that you want to attach to the specified view + // or index. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "TagResource", + } +} diff --git a/service/resourceexplorer2/api_op_UntagResource.go b/service/resourceexplorer2/api_op_UntagResource.go new file mode 100644 index 00000000000..48a68e0c42d --- /dev/null +++ b/service/resourceexplorer2/api_op_UntagResource.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes one or more tag key and value pairs from an Amazon Web Services Resource +// Explorer view or index. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the view or index that you want to remove tags + // from. + // + // This member is required. + ResourceArn *string + + // A list of the keys for the tags that you want to remove from the specified view + // or index. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "UntagResource", + } +} diff --git a/service/resourceexplorer2/api_op_UpdateIndexType.go b/service/resourceexplorer2/api_op_UpdateIndexType.go new file mode 100644 index 00000000000..0e50e22d35e --- /dev/null +++ b/service/resourceexplorer2/api_op_UpdateIndexType.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Changes the type of the index from one of the following types to the other. For +// more information about indexes and the role they perform in Amazon Web Services +// Resource Explorer, see Turning on cross-Region search by creating an aggregator +// index +// (https://docs.aws.amazon.com/arexug/mainline/manage-aggregator-region.html) in +// the Amazon Web Services Resource Explorer User Guide. +// +// * AGGREGATOR index type +// The index contains information about resources from all Amazon Web Services +// Regions in the Amazon Web Services account in which you've created a Resource +// Explorer index. Resource information from all other Regions is replicated to +// this Region's index. When you change the index type to AGGREGATOR, Resource +// Explorer turns on replication of all discovered resource information from the +// other Amazon Web Services Regions in your account to this index. You can then, +// from this Region only, perform resource search queries that span all Amazon Web +// Services Regions in the Amazon Web Services account. Turning on replication from +// all other Regions is performed by asynchronous background tasks. You can check +// the status of the asynchronous tasks by using the GetIndex operation. When the +// asynchronous tasks complete, the Status response of that operation changes from +// UPDATING to ACTIVE. After that, you can start to see results from other Amazon +// Web Services Regions in query results. However, it can take several hours for +// replication from all other Regions to complete. You can have only one aggregator +// index per Amazon Web Services account. Before you can promote a different index +// to be the aggregator index for the account, you must first demote the existing +// aggregator index to type LOCAL. +// +// * LOCAL index type The index contains +// information about resources in only the Amazon Web Services Region in which the +// index exists. If an aggregator index in another Region exists, then information +// in this local index is replicated to the aggregator index. When you change the +// index type to LOCAL, Resource Explorer turns off the replication of resource +// information from all other Amazon Web Services Regions in the Amazon Web +// Services account to this Region. The aggregator index remains in the UPDATING +// state until all replication with other Regions successfully stops. You can check +// the status of the asynchronous task by using the GetIndex operation. When +// Resource Explorer successfully stops all replication with other Regions, the +// Status response of that operation changes from UPDATING to ACTIVE. Separately, +// the resource information from other Regions that was previously stored in the +// index is deleted within 30 days by another background task. Until that +// asynchronous task completes, some results from other Regions can continue to +// appear in search results. After you demote an aggregator index to a local index, +// you must wait 24 hours before you can promote another index to be the new +// aggregator index for the account. +func (c *Client) UpdateIndexType(ctx context.Context, params *UpdateIndexTypeInput, optFns ...func(*Options)) (*UpdateIndexTypeOutput, error) { + if params == nil { + params = &UpdateIndexTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateIndexType", params, optFns, c.addOperationUpdateIndexTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateIndexTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateIndexTypeInput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the index that you want to update. + // + // This member is required. + Arn *string + + // The type of the index. To understand the difference between LOCAL and + // AGGREGATOR, see Turning on cross-Region search + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html) + // in the Amazon Web Services Resource Explorer User Guide. + // + // This member is required. + Type types.IndexType + + noSmithyDocumentSerde +} + +type UpdateIndexTypeOutput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the index that you updated. + Arn *string + + // The date and timestamp when the index was last updated. + LastUpdatedAt *time.Time + + // Indicates the state of the request to update the index. This operation is + // asynchronous. Call the GetIndex operation to check for changes. + State types.IndexState + + // Specifies the type of the specified index after the operation completes. + Type types.IndexType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateIndexTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateIndexType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateIndexType{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateIndexTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIndexType(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateIndexType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "UpdateIndexType", + } +} diff --git a/service/resourceexplorer2/api_op_UpdateView.go b/service/resourceexplorer2/api_op_UpdateView.go new file mode 100644 index 00000000000..22eb9ce994a --- /dev/null +++ b/service/resourceexplorer2/api_op_UpdateView.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies some of the details of a view. You can change the filter string and the +// list of included properties. You can't change the name of the view. +func (c *Client) UpdateView(ctx context.Context, params *UpdateViewInput, optFns ...func(*Options)) (*UpdateViewOutput, error) { + if params == nil { + params = &UpdateViewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateView", params, optFns, c.addOperationUpdateViewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateViewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateViewInput struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view that you want to modify. + // + // This member is required. + ViewArn *string + + // An array of strings that specify which resources are included in the results of + // queries made using this view. When you use this view in a Search operation, the + // filter string is combined with the search's QueryString parameter using a + // logical AND operator. For information about the supported syntax, see Search + // query reference for Resource Explorer + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html) + // in the Amazon Web Services Resource Explorer User Guide. This query string in + // the context of this operation supports only filter prefixes + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters) + // with optional operators + // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators). + // It doesn't support free-form text. For example, the string region:us* + // service:ec2 -tag:stage=prod includes all Amazon EC2 resources in any Amazon Web + // Services Region that begins with the letters us and is not tagged with a key + // Stage that has the value prod. + Filters *types.SearchFilter + + // Specifies optional fields that you want included in search results from this + // view. It is a list of objects that each describe a field to include. The default + // is an empty list, with no optional fields included in the results. + IncludedProperties []types.IncludedProperty + + noSmithyDocumentSerde +} + +type UpdateViewOutput struct { + + // Details about the view that you changed with this operation. + View *types.View + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateViewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateView{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateView{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateViewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateView(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateView(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "resource-explorer-2", + OperationName: "UpdateView", + } +} diff --git a/service/resourceexplorer2/deserializers.go b/service/resourceexplorer2/deserializers.go new file mode 100644 index 00000000000..fc8bcb918a7 --- /dev/null +++ b/service/resourceexplorer2/deserializers.go @@ -0,0 +1,4691 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/document" + internaldocument "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/internal/document" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/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" + "io/ioutil" + "strings" +) + +type awsRestjson1_deserializeOpAssociateDefaultView struct { +} + +func (*awsRestjson1_deserializeOpAssociateDefaultView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateDefaultView) 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_deserializeOpErrorAssociateDefaultView(response, &metadata) + } + output := &AssociateDefaultViewOutput{} + 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_deserializeOpDocumentAssociateDefaultViewOutput(&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_deserializeOpErrorAssociateDefaultView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssociateDefaultViewOutput(v **AssociateDefaultViewOutput, 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 *AssociateDefaultViewOutput + if *v == nil { + sv = &AssociateDefaultViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ViewArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ViewArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpBatchGetView struct { +} + +func (*awsRestjson1_deserializeOpBatchGetView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchGetView) 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_deserializeOpErrorBatchGetView(response, &metadata) + } + output := &BatchGetViewOutput{} + 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_deserializeOpDocumentBatchGetViewOutput(&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_deserializeOpErrorBatchGetView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchGetViewOutput(v **BatchGetViewOutput, 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 *BatchGetViewOutput + if *v == nil { + sv = &BatchGetViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Errors": + if err := awsRestjson1_deserializeDocumentBatchGetViewErrors(&sv.Errors, value); err != nil { + return err + } + + case "Views": + if err := awsRestjson1_deserializeDocumentViewList(&sv.Views, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateIndex struct { +} + +func (*awsRestjson1_deserializeOpCreateIndex) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateIndex) 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_deserializeOpErrorCreateIndex(response, &metadata) + } + output := &CreateIndexOutput{} + 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_deserializeOpDocumentCreateIndexOutput(&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_deserializeOpErrorCreateIndex(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateIndexOutput(v **CreateIndexOutput, 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 *CreateIndexOutput + if *v == nil { + sv = &CreateIndexOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexState to be of type string, got %T instead", value) + } + sv.State = types.IndexState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateView struct { +} + +func (*awsRestjson1_deserializeOpCreateView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateView) 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_deserializeOpErrorCreateView(response, &metadata) + } + output := &CreateViewOutput{} + 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_deserializeOpDocumentCreateViewOutput(&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_deserializeOpErrorCreateView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateViewOutput(v **CreateViewOutput, 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 *CreateViewOutput + if *v == nil { + sv = &CreateViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "View": + if err := awsRestjson1_deserializeDocumentView(&sv.View, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteIndex struct { +} + +func (*awsRestjson1_deserializeOpDeleteIndex) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteIndex) 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_deserializeOpErrorDeleteIndex(response, &metadata) + } + output := &DeleteIndexOutput{} + 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_deserializeOpDocumentDeleteIndexOutput(&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_deserializeOpErrorDeleteIndex(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteIndexOutput(v **DeleteIndexOutput, 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 *DeleteIndexOutput + if *v == nil { + sv = &DeleteIndexOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexState to be of type string, got %T instead", value) + } + sv.State = types.IndexState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteView struct { +} + +func (*awsRestjson1_deserializeOpDeleteView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteView) 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_deserializeOpErrorDeleteView(response, &metadata) + } + output := &DeleteViewOutput{} + 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_deserializeOpDocumentDeleteViewOutput(&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_deserializeOpErrorDeleteView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteViewOutput(v **DeleteViewOutput, 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 *DeleteViewOutput + if *v == nil { + sv = &DeleteViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ViewArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ViewArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDisassociateDefaultView struct { +} + +func (*awsRestjson1_deserializeOpDisassociateDefaultView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateDefaultView) 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_deserializeOpErrorDisassociateDefaultView(response, &metadata) + } + output := &DisassociateDefaultViewOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateDefaultView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetDefaultView struct { +} + +func (*awsRestjson1_deserializeOpGetDefaultView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDefaultView) 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_deserializeOpErrorGetDefaultView(response, &metadata) + } + output := &GetDefaultViewOutput{} + 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_deserializeOpDocumentGetDefaultViewOutput(&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_deserializeOpErrorGetDefaultView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDefaultViewOutput(v **GetDefaultViewOutput, 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 *GetDefaultViewOutput + if *v == nil { + sv = &GetDefaultViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ViewArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ViewArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetIndex struct { +} + +func (*awsRestjson1_deserializeOpGetIndex) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetIndex) 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_deserializeOpErrorGetIndex(response, &metadata) + } + output := &GetIndexOutput{} + 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_deserializeOpDocumentGetIndexOutput(&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_deserializeOpErrorGetIndex(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetIndexOutput(v **GetIndexOutput, 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 *GetIndexOutput + if *v == nil { + sv = &GetIndexOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "ReplicatingFrom": + if err := awsRestjson1_deserializeDocumentRegionList(&sv.ReplicatingFrom, value); err != nil { + return err + } + + case "ReplicatingTo": + if err := awsRestjson1_deserializeDocumentRegionList(&sv.ReplicatingTo, value); err != nil { + return err + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexState to be of type string, got %T instead", value) + } + sv.State = types.IndexState(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexType to be of type string, got %T instead", value) + } + sv.Type = types.IndexType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetView struct { +} + +func (*awsRestjson1_deserializeOpGetView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetView) 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_deserializeOpErrorGetView(response, &metadata) + } + output := &GetViewOutput{} + 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_deserializeOpDocumentGetViewOutput(&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_deserializeOpErrorGetView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetViewOutput(v **GetViewOutput, 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 *GetViewOutput + if *v == nil { + sv = &GetViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "View": + if err := awsRestjson1_deserializeDocumentView(&sv.View, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListIndexes struct { +} + +func (*awsRestjson1_deserializeOpListIndexes) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListIndexes) 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_deserializeOpErrorListIndexes(response, &metadata) + } + output := &ListIndexesOutput{} + 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_deserializeOpDocumentListIndexesOutput(&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_deserializeOpErrorListIndexes(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListIndexesOutput(v **ListIndexesOutput, 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 *ListIndexesOutput + if *v == nil { + sv = &ListIndexesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Indexes": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.Indexes, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSupportedResourceTypes struct { +} + +func (*awsRestjson1_deserializeOpListSupportedResourceTypes) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSupportedResourceTypes) 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_deserializeOpErrorListSupportedResourceTypes(response, &metadata) + } + output := &ListSupportedResourceTypesOutput{} + 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_deserializeOpDocumentListSupportedResourceTypesOutput(&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_deserializeOpErrorListSupportedResourceTypes(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSupportedResourceTypesOutput(v **ListSupportedResourceTypesOutput, 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 *ListSupportedResourceTypesOutput + if *v == nil { + sv = &ListSupportedResourceTypesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ResourceTypes": + if err := awsRestjson1_deserializeDocumentResourceTypeList(&sv.ResourceTypes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) 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_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + 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_deserializeOpDocumentListTagsForResourceOutput(&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_deserializeOpErrorListTagsForResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListViews struct { +} + +func (*awsRestjson1_deserializeOpListViews) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListViews) 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_deserializeOpErrorListViews(response, &metadata) + } + output := &ListViewsOutput{} + 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_deserializeOpDocumentListViewsOutput(&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_deserializeOpErrorListViews(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListViewsOutput(v **ListViewsOutput, 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 *ListViewsOutput + if *v == nil { + sv = &ListViewsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Views": + if err := awsRestjson1_deserializeDocumentViewArnList(&sv.Views, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearch struct { +} + +func (*awsRestjson1_deserializeOpSearch) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearch) 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_deserializeOpErrorSearch(response, &metadata) + } + output := &SearchOutput{} + 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_deserializeOpDocumentSearchOutput(&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_deserializeOpErrorSearch(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchOutput(v **SearchOutput, 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 *SearchOutput + if *v == nil { + sv = &SearchOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Count": + if err := awsRestjson1_deserializeDocumentResourceCount(&sv.Count, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Resources": + if err := awsRestjson1_deserializeDocumentResourceList(&sv.Resources, value); err != nil { + return err + } + + case "ViewArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ViewArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) 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_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) 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_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateIndexType struct { +} + +func (*awsRestjson1_deserializeOpUpdateIndexType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateIndexType) 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_deserializeOpErrorUpdateIndexType(response, &metadata) + } + output := &UpdateIndexTypeOutput{} + 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_deserializeOpDocumentUpdateIndexTypeOutput(&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_deserializeOpErrorUpdateIndexType(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + 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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateIndexTypeOutput(v **UpdateIndexTypeOutput, 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 *UpdateIndexTypeOutput + if *v == nil { + sv = &UpdateIndexTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexState to be of type string, got %T instead", value) + } + sv.State = types.IndexState(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexType to be of type string, got %T instead", value) + } + sv.Type = types.IndexType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateView struct { +} + +func (*awsRestjson1_deserializeOpUpdateView) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateView) 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_deserializeOpErrorUpdateView(response, &metadata) + } + output := &UpdateViewOutput{} + 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_deserializeOpDocumentUpdateViewOutput(&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_deserializeOpErrorUpdateView(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateViewOutput(v **UpdateViewOutput, 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 *UpdateViewOutput + if *v == nil { + sv = &UpdateViewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "View": + if err := awsRestjson1_deserializeDocumentView(&sv.View, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + 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_deserializeDocumentAccessDeniedException(&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_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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + 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_deserializeDocumentServiceQuotaExceededException(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + 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_deserializeDocumentThrottlingException(&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_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnauthorizedException{} + 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_deserializeDocumentUnauthorizedException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchGetViewError(v **types.BatchGetViewError, 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.BatchGetViewError + if *v == nil { + sv = &types.BatchGetViewError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "ViewArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ViewArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchGetViewErrors(v *[]types.BatchGetViewError, 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.BatchGetViewError + if *v == nil { + cv = []types.BatchGetViewError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchGetViewError + destAddr := &col + if err := awsRestjson1_deserializeDocumentBatchGetViewError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIncludedProperty(v **types.IncludedProperty, 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.IncludedProperty + if *v == nil { + sv = &types.IncludedProperty{} + } 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 String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIncludedPropertyList(v *[]types.IncludedProperty, 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.IncludedProperty + if *v == nil { + cv = []types.IncludedProperty{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IncludedProperty + destAddr := &col + if err := awsRestjson1_deserializeDocumentIncludedProperty(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIndex(v **types.Index, 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.Index + if *v == nil { + sv = &types.Index{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexType to be of type string, got %T instead", value) + } + sv.Type = types.IndexType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIndexList(v *[]types.Index, 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.Index + if *v == nil { + cv = []types.Index{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Index + destAddr := &col + if err := awsRestjson1_deserializeDocumentIndex(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRegionList(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResource(v **types.Resource, 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.Resource + if *v == nil { + sv = &types.Resource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "LastReportedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastReportedAt = ptr.Time(t) + } + + case "OwningAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OwningAccountId = ptr.String(jtv) + } + + case "Properties": + if err := awsRestjson1_deserializeDocumentResourcePropertyList(&sv.Properties, value); err != nil { + return err + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "Service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceCount(v **types.ResourceCount, 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.ResourceCount + if *v == nil { + sv = &types.ResourceCount{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Complete": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Complete = ptr.Bool(jtv) + } + + case "TotalResources": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalResources = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceList(v *[]types.Resource, 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.Resource + if *v == nil { + cv = []types.Resource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Resource + destAddr := &col + if err := awsRestjson1_deserializeDocumentResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceProperty(v **types.ResourceProperty, 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.ResourceProperty + if *v == nil { + sv = &types.ResourceProperty{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Data": + if err := awsRestjson1_deserializeDocumentDocument(&sv.Data, value); err != nil { + return err + } + + case "LastReportedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastReportedAt = ptr.Time(t) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourcePropertyList(v *[]types.ResourceProperty, 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.ResourceProperty + if *v == nil { + cv = []types.ResourceProperty{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceProperty + destAddr := &col + if err := awsRestjson1_deserializeDocumentResourceProperty(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResourceTypeList(v *[]types.SupportedResourceType, 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.SupportedResourceType + if *v == nil { + cv = []types.SupportedResourceType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SupportedResourceType + destAddr := &col + if err := awsRestjson1_deserializeDocumentSupportedResourceType(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSearchFilter(v **types.SearchFilter, 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.SearchFilter + if *v == nil { + sv = &types.SearchFilter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FilterString": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FilterString = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSupportedResourceType(v **types.SupportedResourceType, 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.SupportedResourceType + if *v == nil { + sv = &types.SupportedResourceType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "Service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, 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]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, 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.UnauthorizedException + if *v == nil { + sv = &types.UnauthorizedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(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 "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 String 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 String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ValidationIssue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ValidationIssue = 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 +} + +func awsRestjson1_deserializeDocumentView(v **types.View, 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.View + if *v == nil { + sv = &types.View{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Filters": + if err := awsRestjson1_deserializeDocumentSearchFilter(&sv.Filters, value); err != nil { + return err + } + + case "IncludedProperties": + if err := awsRestjson1_deserializeDocumentIncludedPropertyList(&sv.IncludedProperties, value); err != nil { + return err + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(t) + } + + case "Owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "Scope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Scope = ptr.String(jtv) + } + + case "ViewArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ViewArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentViewArnList(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentViewList(v *[]types.View, 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.View + if *v == nil { + cv = []types.View{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.View + destAddr := &col + if err := awsRestjson1_deserializeDocumentView(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDocument(v *document.Interface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + *v = internaldocument.NewDocumentUnmarshaler(value) + return nil +} diff --git a/service/resourceexplorer2/doc.go b/service/resourceexplorer2/doc.go new file mode 100644 index 00000000000..fbca79408b7 --- /dev/null +++ b/service/resourceexplorer2/doc.go @@ -0,0 +1,44 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package resourceexplorer2 provides the API client, operations, and parameter +// types for AWS Resource Explorer. +// +// Amazon Web Services Resource Explorer is a resource search and discovery +// service. By using Resource Explorer, you can explore your resources using an +// internet search engine-like experience. Examples of resources include Amazon +// Relational Database Service (Amazon RDS) instances, Amazon Simple Storage +// Service (Amazon S3) buckets, or Amazon DynamoDB tables. You can search for your +// resources using resource metadata like names, tags, and IDs. Resource Explorer +// can search across all of the Amazon Web Services Regions in your account in +// which you turn the service on, to simplify your cross-Region workloads. Resource +// Explorer scans the resources in each of the Amazon Web Services Regions in your +// Amazon Web Services account in which you turn on Resource Explorer. Resource +// Explorer creates and maintains an index +// (https://docs.aws.amazon.com/arexug/mainline/getting-started-terms-and-concepts.html#term-index) +// in each Region, with the details of that Region's resources. You can search +// across all of the indexed Regions in your account +// (https://docs.aws.amazon.com/arexug/mainline/manage-aggregator-region.html) by +// designating one of your Amazon Web Services Regions to contain the aggregator +// index for the account. When you promote a local index in a Region to become the +// aggregator index for the account +// (https://docs.aws.amazon.com/arexug/mainline/manage-aggregator-region-turn-on.html), +// Resource Explorer automatically replicates the index information from all local +// indexes in the other Regions to the aggregator index. Therefore, the Region with +// the aggregator index has a copy of all resource information for all Regions in +// the account where you turned on Resource Explorer. As a result, views in the +// aggregator index Region include resources from all of the indexed Regions in +// your account. For more information about Amazon Web Services Resource Explorer, +// including how to enable and configure the service, see the Amazon Web Services +// Resource Explorer User Guide +// (https://docs.aws.amazon.com/resource-explorer/latest/userguide/). The example +// HTTP query requests and responses in this guide are displayed with the JSON +// (https://json.org) formatted across multiple lines for readability. The actual +// query responses from the Resource Explorer service do not include this extra +// whitespace. We want your feedback about this documentation Our goal is to help +// you get everything you can from Resource Explorer. If this guide helps you to do +// that, then let us know. If the guide isn't helping you, then we want to hear +// from you so we can address the issue. Use the Feedback link that's in the +// upper-right corner of every page. That sends your comments directly to the +// writers of this guide. We review every submission, looking for opportunities to +// improve the documentation. Thank you in advance for your help! +package resourceexplorer2 diff --git a/service/resourceexplorer2/document/doc.go b/service/resourceexplorer2/document/doc.go new file mode 100644 index 00000000000..2b06b14f3cd --- /dev/null +++ b/service/resourceexplorer2/document/doc.go @@ -0,0 +1,66 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package document implements encoding and decoding of open-content that has a JSON-like data model. +// This data-model allows for UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a +// map of UTF-8 strings to these values. +// +// Interface defines the semantics for how a document type is marshalled and unmarshalled for requests and responses +// for the service. To send a document as input to the service you use NewLazyDocument and pass it the Go type to be +// sent to the service. NewLazyDocument returns a document Interface type that encodes the provided Go type during +// the request serialization step after you have invoked an API client operation that uses the document type. +// +// The following examples show how you can create document types using basic Go types. +// +// NewLazyDocument(map[string]interface{}{ +// "favoriteNumber": 42, +// "fruits": []string{"apple", "orange"}, +// "capitals": map[string]interface{}{ +// "Washington": "Olympia", +// "Oregon": "Salem", +// }, +// "skyIsBlue": true, +// }) +// +// NewLazyDocument(3.14159) +// +// NewLazyDocument([]interface{"One", 2, 3, 3.5, "four"}) +// +// NewLazyDocument(true) +// +// Services can send document types as part of their API responses. To retrieve the content of a response document +// you use the UnmarshalSmithyDocument method on the response document. When calling UnmarshalSmithyDocument you pass +// a reference to the Go type that you want to unmarshal and map the response to. +// +// For example, if you expect to receive key/value map from the service response: +// +// var kv map[string]interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&kv); err != nil { +// // handle error +// } +// +// If a service can return one or more data-types in the response, you can use an empty interface and type switch to +// dynamically handle the response type. +// +// var v interface{} +// if err := outputDocument.UnmarshalSmithyDocument(&v); err != nil { +// // handle error +// } +// +// switch vv := v.(type) { +// case map[string]interface{}: +// // handle key/value map +// case []interface{}: +// // handle array of values +// case bool: +// // handle boolean +// case document.Number: +// // handle an arbitrary precision number +// case string: +// // handle string +// default: +// // handle unknown case +// } +// +// The mapping of Go types to document types is covered in more depth in https://pkg.go.dev/github.com/aws/smithy-go/document +// including more in depth examples that cover user-defined structure types. +package document diff --git a/service/resourceexplorer2/document/document.go b/service/resourceexplorer2/document/document.go new file mode 100644 index 00000000000..ab3da0f65d1 --- /dev/null +++ b/service/resourceexplorer2/document/document.go @@ -0,0 +1,34 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + internaldocument "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/internal/document" +) + +// Interface defines a document which is a protocol-agnostic type which supports a +// JSON-like data-model. You can use this type to send UTF-8 strings, arbitrary +// precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 +// strings to these values. +// +// You create a document type using the NewLazyDocument function and passing it the +// Go type to marshal. When receiving a document in an API response, you use the +// document's UnmarshalSmithyDocument function to decode the response to your +// desired Go type. Unless documented specifically generated structure types in +// client packages or client types packages are not supported at this time. Such +// types embed a noSmithyDocumentSerde and will cause an error to be returned when +// attempting to send an API request. +// +// For more information see the accompanying package documentation and linked +// references. +type Interface = internaldocument.Interface + +// You create document type using the NewLazyDocument function and passing it the +// Go type to be marshaled and sent to the service. The document marshaler supports +// semantics similar to the encoding/json Go standard library. +// +// For more information see the accompanying package documentation and linked +// references. +func NewLazyDocument(v interface{}) Interface { + return internaldocument.NewDocumentMarshaler(v) +} diff --git a/service/resourceexplorer2/endpoints.go b/service/resourceexplorer2/endpoints.go new file mode 100644 index 00000000000..d193b5d8c4d --- /dev/null +++ b/service/resourceexplorer2/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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 { + 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 = "resource-explorer-2" + } + 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 + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(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 EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +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 + } + } + +} diff --git a/service/resourceexplorer2/generated.json b/service/resourceexplorer2/generated.json new file mode 100644 index 00000000000..29791d88e97 --- /dev/null +++ b/service/resourceexplorer2/generated.json @@ -0,0 +1,50 @@ +{ + "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_AssociateDefaultView.go", + "api_op_BatchGetView.go", + "api_op_CreateIndex.go", + "api_op_CreateView.go", + "api_op_DeleteIndex.go", + "api_op_DeleteView.go", + "api_op_DisassociateDefaultView.go", + "api_op_GetDefaultView.go", + "api_op_GetIndex.go", + "api_op_GetView.go", + "api_op_ListIndexes.go", + "api_op_ListSupportedResourceTypes.go", + "api_op_ListTagsForResource.go", + "api_op_ListViews.go", + "api_op_Search.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateIndexType.go", + "api_op_UpdateView.go", + "deserializers.go", + "doc.go", + "document/doc.go", + "document/document.go", + "endpoints.go", + "generated.json", + "internal/document/document.go", + "internal/document/document_test.go", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2", + "unstable": false +} diff --git a/service/resourceexplorer2/go.mod b/service/resourceexplorer2/go.mod new file mode 100644 index 00000000000..db384b3d526 --- /dev/null +++ b/service/resourceexplorer2/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 + github.com/aws/smithy-go v1.13.4 +) + +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/resourceexplorer2/go.sum b/service/resourceexplorer2/go.sum new file mode 100644 index 00000000000..b5b882cefe7 --- /dev/null +++ b/service/resourceexplorer2/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk= +github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/resourceexplorer2/go_module_metadata.go b/service/resourceexplorer2/go_module_metadata.go new file mode 100644 index 00000000000..418fb5a4710 --- /dev/null +++ b/service/resourceexplorer2/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package resourceexplorer2 + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/resourceexplorer2/internal/document/document.go b/service/resourceexplorer2/internal/document/document.go new file mode 100644 index 00000000000..864eb42a4ac --- /dev/null +++ b/service/resourceexplorer2/internal/document/document.go @@ -0,0 +1,99 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + "bytes" + "encoding/json" + smithydocument "github.com/aws/smithy-go/document" + smithydocumentjson "github.com/aws/smithy-go/document/json" +) + +// github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/internal/document.smithyDocument +// is an interface which is used to bind a document type to its service client. +type smithyDocument interface { + isSmithyDocument() +} + +// github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/internal/document.Interface +// is a JSON-like data model type that is protocol agnostic and is usedto send +// open-content to a service. +type Interface interface { + smithyDocument + smithydocument.Marshaler + smithydocument.Unmarshaler +} + +type documentMarshaler struct { + value interface{} +} + +func (m *documentMarshaler) UnmarshalSmithyDocument(v interface{}) error { + mBytes, err := m.MarshalSmithyDocument() + if err != nil { + return err + } + + jDecoder := json.NewDecoder(bytes.NewReader(mBytes)) + jDecoder.UseNumber() + + var jv interface{} + if err := jDecoder.Decode(&v); err != nil { + return err + } + + return NewDocumentUnmarshaler(v).UnmarshalSmithyDocument(&jv) +} + +func (m *documentMarshaler) MarshalSmithyDocument() ([]byte, error) { + return smithydocumentjson.NewEncoder().Encode(m.value) +} + +func (m *documentMarshaler) isSmithyDocument() {} + +var _ Interface = (*documentMarshaler)(nil) + +type documentUnmarshaler struct { + value interface{} +} + +func (m *documentUnmarshaler) UnmarshalSmithyDocument(v interface{}) error { + decoder := smithydocumentjson.NewDecoder() + return decoder.DecodeJSONInterface(m.value, v) +} + +func (m *documentUnmarshaler) MarshalSmithyDocument() ([]byte, error) { + return json.Marshal(m.value) +} + +func (m *documentUnmarshaler) isSmithyDocument() {} + +var _ Interface = (*documentUnmarshaler)(nil) + +// NewDocumentMarshaler creates a new document marshaler for the given input type +func NewDocumentMarshaler(v interface{}) Interface { + return &documentMarshaler{ + value: v, + } +} + +// NewDocumentUnmarshaler creates a new document unmarshaler for the given service +// response +func NewDocumentUnmarshaler(v interface{}) Interface { + return &documentUnmarshaler{ + value: v, + } +} + +// github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/internal/document.IsInterface +// returns whether the given Interface implementation is a valid client +// implementation +func IsInterface(v Interface) (ok bool) { + defer func() { + if err := recover(); err != nil { + ok = false + } + }() + v.isSmithyDocument() + return true +} diff --git a/service/resourceexplorer2/internal/document/document_test.go b/service/resourceexplorer2/internal/document/document_test.go new file mode 100644 index 00000000000..775645dcd6e --- /dev/null +++ b/service/resourceexplorer2/internal/document/document_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package document + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +var _ smithyDocument = (Interface)(nil) +var _ smithydocument.Marshaler = (Interface)(nil) +var _ smithydocument.Unmarshaler = (Interface)(nil) diff --git a/service/resourceexplorer2/internal/endpoints/endpoints.go b/service/resourceexplorer2/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..cda6ffc6e45 --- /dev/null +++ b/service/resourceexplorer2/internal/endpoints/endpoints.go @@ -0,0 +1,371 @@ +// 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 Resource Explorer 2 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 + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\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: "resource-explorer-2.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "resource-explorer-2-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "resource-explorer-2-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "resource-explorer-2.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.af-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-northeast-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-northeast-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-northeast-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-southeast-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ap-southeast-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.ca-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.eu-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.eu-north-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.eu-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.eu-west-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.eu-west-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.sa-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.us-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.us-east-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.us-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.us-west-2.api.aws", + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "resource-explorer-2.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "resource-explorer-2-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "resource-explorer-2-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "resource-explorer-2.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.cn-north-1.api.amazonwebservices.com.cn", + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.cn-northwest-1.api.amazonwebservices.com.cn", + }, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "resource-explorer-2-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "resource-explorer-2.{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: "resource-explorer-2-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "resource-explorer-2.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "resource-explorer-2.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "resource-explorer-2-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "resource-explorer-2-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "resource-explorer-2.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.us-gov-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "resource-explorer-2.us-gov-west-1.api.aws", + }, + }, + }, +} diff --git a/service/resourceexplorer2/internal/endpoints/endpoints_test.go b/service/resourceexplorer2/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/resourceexplorer2/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/resourceexplorer2/protocol_test.go b/service/resourceexplorer2/protocol_test.go new file mode 100644 index 00000000000..15706c3d758 --- /dev/null +++ b/service/resourceexplorer2/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 diff --git a/service/resourceexplorer2/serializers.go b/service/resourceexplorer2/serializers.go new file mode 100644 index 00000000000..566a1c50d0a --- /dev/null +++ b/service/resourceexplorer2/serializers.go @@ -0,0 +1,1405 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/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_serializeOpAssociateDefaultView struct { +} + +func (*awsRestjson1_serializeOpAssociateDefaultView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateDefaultView) 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.(*AssociateDefaultViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/AssociateDefaultView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentAssociateDefaultViewInput(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_serializeOpHttpBindingsAssociateDefaultViewInput(v *AssociateDefaultViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateDefaultViewInput(v *AssociateDefaultViewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ViewArn != nil { + ok := object.Key("ViewArn") + ok.String(*v.ViewArn) + } + + return nil +} + +type awsRestjson1_serializeOpBatchGetView struct { +} + +func (*awsRestjson1_serializeOpBatchGetView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchGetView) 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.(*BatchGetViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/BatchGetView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentBatchGetViewInput(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_serializeOpHttpBindingsBatchGetViewInput(v *BatchGetViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchGetViewInput(v *BatchGetViewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ViewArns != nil { + ok := object.Key("ViewArns") + if err := awsRestjson1_serializeDocumentViewArnList(v.ViewArns, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateIndex struct { +} + +func (*awsRestjson1_serializeOpCreateIndex) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateIndex) 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.(*CreateIndexInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CreateIndex") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentCreateIndexInput(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_serializeOpHttpBindingsCreateIndexInput(v *CreateIndexInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateIndexInput(v *CreateIndexInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateView struct { +} + +func (*awsRestjson1_serializeOpCreateView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateView) 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.(*CreateViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CreateView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentCreateViewInput(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_serializeOpHttpBindingsCreateViewInput(v *CreateViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateViewInput(v *CreateViewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentSearchFilter(v.Filters, ok); err != nil { + return err + } + } + + if v.IncludedProperties != nil { + ok := object.Key("IncludedProperties") + if err := awsRestjson1_serializeDocumentIncludedPropertyList(v.IncludedProperties, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.ViewName != nil { + ok := object.Key("ViewName") + ok.String(*v.ViewName) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteIndex struct { +} + +func (*awsRestjson1_serializeOpDeleteIndex) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteIndex) 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.(*DeleteIndexInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteIndex") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentDeleteIndexInput(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_serializeOpHttpBindingsDeleteIndexInput(v *DeleteIndexInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteIndexInput(v *DeleteIndexInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteView struct { +} + +func (*awsRestjson1_serializeOpDeleteView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteView) 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.(*DeleteViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentDeleteViewInput(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_serializeOpHttpBindingsDeleteViewInput(v *DeleteViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteViewInput(v *DeleteViewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ViewArn != nil { + ok := object.Key("ViewArn") + ok.String(*v.ViewArn) + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateDefaultView struct { +} + +func (*awsRestjson1_serializeOpDisassociateDefaultView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateDefaultView) 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.(*DisassociateDefaultViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DisassociateDefaultView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if 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_serializeOpHttpBindingsDisassociateDefaultViewInput(v *DisassociateDefaultViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetDefaultView struct { +} + +func (*awsRestjson1_serializeOpGetDefaultView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDefaultView) 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.(*GetDefaultViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetDefaultView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if 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_serializeOpHttpBindingsGetDefaultViewInput(v *GetDefaultViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetIndex struct { +} + +func (*awsRestjson1_serializeOpGetIndex) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetIndex) 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.(*GetIndexInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetIndex") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if 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_serializeOpHttpBindingsGetIndexInput(v *GetIndexInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetView struct { +} + +func (*awsRestjson1_serializeOpGetView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetView) 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.(*GetViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentGetViewInput(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_serializeOpHttpBindingsGetViewInput(v *GetViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetViewInput(v *GetViewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ViewArn != nil { + ok := object.Key("ViewArn") + ok.String(*v.ViewArn) + } + + return nil +} + +type awsRestjson1_serializeOpListIndexes struct { +} + +func (*awsRestjson1_serializeOpListIndexes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListIndexes) 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.(*ListIndexesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListIndexes") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentListIndexesInput(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_serializeOpHttpBindingsListIndexesInput(v *ListIndexesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListIndexesInput(v *ListIndexesInput, 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) + } + + if v.Regions != nil { + ok := object.Key("Regions") + if err := awsRestjson1_serializeDocumentRegionList(v.Regions, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpListSupportedResourceTypes struct { +} + +func (*awsRestjson1_serializeOpListSupportedResourceTypes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSupportedResourceTypes) 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.(*ListSupportedResourceTypesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListSupportedResourceTypes") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentListSupportedResourceTypesInput(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_serializeOpHttpBindingsListSupportedResourceTypesInput(v *ListSupportedResourceTypesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListSupportedResourceTypesInput(v *ListSupportedResourceTypesInput, 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_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) 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.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); 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_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListViews struct { +} + +func (*awsRestjson1_serializeOpListViews) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListViews) 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.(*ListViewsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListViews") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentListViewsInput(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_serializeOpHttpBindingsListViewsInput(v *ListViewsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListViewsInput(v *ListViewsInput, 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_serializeOpSearch struct { +} + +func (*awsRestjson1_serializeOpSearch) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearch) 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.(*SearchInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/Search") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentSearchInput(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_serializeOpHttpBindingsSearchInput(v *SearchInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchInput(v *SearchInput, 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) + } + + if v.QueryString != nil { + ok := object.Key("QueryString") + ok.String(*v.QueryString) + } + + if v.ViewArn != nil { + ok := object.Key("ViewArn") + ok.String(*v.ViewArn) + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) 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.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(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_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) 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.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); 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_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateIndexType struct { +} + +func (*awsRestjson1_serializeOpUpdateIndexType) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateIndexType) 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.(*UpdateIndexTypeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UpdateIndexType") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentUpdateIndexTypeInput(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_serializeOpHttpBindingsUpdateIndexTypeInput(v *UpdateIndexTypeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateIndexTypeInput(v *UpdateIndexTypeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateView struct { +} + +func (*awsRestjson1_serializeOpUpdateView) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateView) 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.(*UpdateViewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UpdateView") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, 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_serializeOpDocumentUpdateViewInput(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_serializeOpHttpBindingsUpdateViewInput(v *UpdateViewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateViewInput(v *UpdateViewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentSearchFilter(v.Filters, ok); err != nil { + return err + } + } + + if v.IncludedProperties != nil { + ok := object.Key("IncludedProperties") + if err := awsRestjson1_serializeDocumentIncludedPropertyList(v.IncludedProperties, ok); err != nil { + return err + } + } + + if v.ViewArn != nil { + ok := object.Key("ViewArn") + ok.String(*v.ViewArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentIncludedProperty(v *types.IncludedProperty, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentIncludedPropertyList(v []types.IncludedProperty, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentIncludedProperty(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRegionList(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_serializeDocumentSearchFilter(v *types.SearchFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilterString != nil { + ok := object.Key("FilterString") + ok.String(*v.FilterString) + } + + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentViewArnList(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 +} diff --git a/service/resourceexplorer2/types/enums.go b/service/resourceexplorer2/types/enums.go new file mode 100644 index 00000000000..25bc10acaef --- /dev/null +++ b/service/resourceexplorer2/types/enums.go @@ -0,0 +1,52 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type IndexState string + +// Enum values for IndexState +const ( + // Resource Explorer is creating the index. + IndexStateCreating IndexState = "CREATING" + // Index is active. + IndexStateActive IndexState = "ACTIVE" + // Resource Explorer is deleting the index. + IndexStateDeleting IndexState = "DELETING" + // Resource Explorer successfully deleted the index. + IndexStateDeleted IndexState = "DELETED" + // Resource Explorer is switching the index type between local and aggregator. + IndexStateUpdating IndexState = "UPDATING" +) + +// Values returns all known values for IndexState. 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 (IndexState) Values() []IndexState { + return []IndexState{ + "CREATING", + "ACTIVE", + "DELETING", + "DELETED", + "UPDATING", + } +} + +type IndexType string + +// Enum values for IndexType +const ( + // local index + IndexTypeLocal IndexType = "LOCAL" + // aggregator index + IndexTypeAggregator IndexType = "AGGREGATOR" +) + +// Values returns all known values for IndexType. 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 (IndexType) Values() []IndexType { + return []IndexType{ + "LOCAL", + "AGGREGATOR", + } +} diff --git a/service/resourceexplorer2/types/errors.go b/service/resourceexplorer2/types/errors.go new file mode 100644 index 00000000000..ae72254c7a9 --- /dev/null +++ b/service/resourceexplorer2/types/errors.go @@ -0,0 +1,173 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The credentials that you used to call this operation don't have the minimum +// required permissions. +type AccessDeniedException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You tried to create a new view or index when one already exists, and you either +// didn't specify or specified a different idempotency token as the original +// request. +type ConflictException struct { + Message *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 { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed because of internal service error. Try your request again +// later. +type InternalServerException struct { + Message *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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// You specified a resource that doesn't exist. Check the ID or ARN that you used +// to identity the resource, and try again. +type ResourceNotFoundException struct { + Message *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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed because it exceeds a service quota. +type ServiceQuotaExceededException struct { + Message *string + + Name *string + Value *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request failed because you exceeded a rate limit for this operation. For +// more information, see Quotas for Resource Explorer +// (https://docs.aws.amazon.com/arexug/mainline/quotas.html). +type ThrottlingException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The principal making the request isn't permitted to perform the operation. +type UnauthorizedException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnauthorizedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnauthorizedException) ErrorCode() string { return "UnauthorizedException" } +func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You provided an invalid value for one of the operation's parameters. Check the +// syntax for the operation, and try again. +type ValidationException struct { + Message *string + + 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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/resourceexplorer2/types/types.go b/service/resourceexplorer2/types/types.go new file mode 100644 index 00000000000..b3e5a699497 --- /dev/null +++ b/service/resourceexplorer2/types/types.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/document" + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// A collection of error messages for any views that Amazon Web Services Resource +// Explorer couldn't retrieve details. +type BatchGetViewError struct { + + // The description of the error for the specified view. + // + // This member is required. + ErrorMessage *string + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view for which Resource Explorer failed to retrieve details. + // + // This member is required. + ViewArn *string + + noSmithyDocumentSerde +} + +// Information about an additional property that describes a resource, that you can +// optionally include in the view. This lets you view that property in search +// results, and filter your search results based on the value of the property. +type IncludedProperty struct { + + // The name of the property that is included in this view. You can specify the + // following property names for this field: + // + // * Tags + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// An index is the data store used by Amazon Web Services Resource Explorer to hold +// information about your Amazon Web Services resources that the service discovers. +// Creating an index in an Amazon Web Services Region turns on Resource Explorer +// and lets it discover your resources. By default, an index is local, meaning that +// it contains information about resources in only the same Region as the index. +// However, you can promote the index of one Region in the account by calling +// UpdateIndexType to convert it into an aggregator index. The aggregator index +// receives a replicated copy of the index information from all other Regions where +// Resource Explorer is turned on. This allows search operations in that Region to +// return results from all Regions in the account. +type Index struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the index. + Arn *string + + // The Amazon Web Services Region in which the index exists. + Region *string + + // The type of index. It can be one of the following values: + // + // * LOCAL – The index + // contains information about resources from only the same Amazon Web Services + // Region. + // + // * AGGREGATOR – Resource Explorer replicates copies of the indexed + // information about resources in all other Amazon Web Services Regions to the + // aggregator index. This lets search results in the Region with the aggregator + // index to include resources from all Regions in the account where Resource + // Explorer is turned on. + Type IndexType + + noSmithyDocumentSerde +} + +// A resource in Amazon Web Services that Amazon Web Services Resource Explorer has +// discovered, and for which it has stored information in the index of the Amazon +// Web Services Region that contains the resource. +type Resource struct { + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the resource. + Arn *string + + // The date and time that Resource Explorer last queried this resource and updated + // the index with the latest information about the resource. + LastReportedAt *time.Time + + // The Amazon Web Services account that owns the resource. + OwningAccountId *string + + // A structure with additional type-specific details about the resource. These + // properties can be added by turning on integration between Resource Explorer and + // other Amazon Web Services services. + Properties []ResourceProperty + + // The Amazon Web Services Region in which the resource was created and exists. + Region *string + + // The type of the resource. + ResourceType *string + + // The Amazon Web Service that owns the resource and is responsible for creating + // and updating it. + Service *string + + noSmithyDocumentSerde +} + +// Information about the number of results that match the query. At this time, +// Amazon Web Services Resource Explorer doesn't count more than 1,000 matches for +// any query. This structure provides information about whether the query exceeded +// this limit. This field is included in every page when you paginate the results. +type ResourceCount struct { + + // Indicates whether the TotalResources value represents an exhaustive count of + // search results. + // + // * If True, it indicates that the search was exhaustive. Every + // resource that matches the query was counted. + // + // * If False, then the search + // reached the limit of 1,000 matching results, and stopped counting. + Complete *bool + + // The number of resources that match the search query. This value can't exceed + // 1,000. If there are more than 1,000 resources that match the query, then only + // 1,000 are counted and the Complete field is set to false. We recommend that you + // refine your query to return a smaller number of results. + TotalResources *int64 + + noSmithyDocumentSerde +} + +// A structure that describes a property of a resource. +type ResourceProperty struct { + + // Details about this property. The content of this field is a JSON object that + // varies based on the resource type. + Data document.Interface + + // The date and time that the information about this resource property was last + // updated. + LastReportedAt *time.Time + + // The name of this property of the resource. + Name *string + + noSmithyDocumentSerde +} + +// A search filter defines which resources can be part of a search query result +// set. +type SearchFilter struct { + + // The string that contains the search keywords, prefixes, and operators to control + // the results that can be returned by a Search operation. For more details, see + // Search query syntax + // (https://docs.aws.amazon.com/resource-explorer/latest/APIReference/about-query-syntax.html). + // + // This member is required. + FilterString *string + + noSmithyDocumentSerde +} + +// A structure that describes a resource type supported by Amazon Web Services +// Resource Explorer. +type SupportedResourceType struct { + + // The unique identifier of the resource type. + ResourceType *string + + // The Amazon Web Service that is associated with the resource type. This is the + // primary service that lets you create and interact with resources of this type. + Service *string + + noSmithyDocumentSerde +} + +// A structure that describes a request field with a validation error. +type ValidationExceptionField struct { + + // The name of the request field that had a validation error. + // + // This member is required. + Name *string + + // The validation error caused by the request field. + // + // This member is required. + ValidationIssue *string + + noSmithyDocumentSerde +} + +// A view is a structure that defines a set of filters that provide a view into the +// information in the Amazon Web Services Resource Explorer index. The filters +// specify which information from the index is visible to the users of the view. +// For example, you can specify filters that include only resources that are tagged +// with the key "ENV" and the value "DEVELOPMENT" in the results returned by this +// view. You could also create a second view that includes only resources that are +// tagged with "ENV" and "PRODUCTION". +type View struct { + + // An array of SearchFilter objects that specify which resources can be included in + // the results of queries made using this view. + Filters *SearchFilter + + // A structure that contains additional information about the view. + IncludedProperties []IncludedProperty + + // The date and time when this view was last modified. + LastUpdatedAt *time.Time + + // The Amazon Web Services account that owns this view. + Owner *string + + // An Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // an Amazon Web Services account, an organization, or an organizational unit (OU) + // that specifies whether this view includes resources from only the specified + // Amazon Web Services account, all accounts in the specified organization, or all + // accounts in the specified OU. If not specified, the value defaults to the Amazon + // Web Services account used to call this operation. + Scope *string + + // The Amazon resource name (ARN) + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the view. + ViewArn *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/resourceexplorer2/validators.go b/service/resourceexplorer2/validators.go new file mode 100644 index 00000000000..1ceaa7b4bfd --- /dev/null +++ b/service/resourceexplorer2/validators.go @@ -0,0 +1,513 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAssociateDefaultView struct { +} + +func (*validateOpAssociateDefaultView) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateDefaultView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateDefaultViewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateDefaultViewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateView struct { +} + +func (*validateOpCreateView) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateViewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateViewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteIndex struct { +} + +func (*validateOpDeleteIndex) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIndex) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIndexInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIndexInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteView struct { +} + +func (*validateOpDeleteView) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteViewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteViewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetView struct { +} + +func (*validateOpGetView) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetViewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetViewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearch struct { +} + +func (*validateOpSearch) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateIndexType struct { +} + +func (*validateOpUpdateIndexType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateIndexType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateIndexTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateIndexTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateView struct { +} + +func (*validateOpUpdateView) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateViewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateViewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssociateDefaultViewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateDefaultView{}, middleware.After) +} + +func addOpCreateViewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateView{}, middleware.After) +} + +func addOpDeleteIndexValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIndex{}, middleware.After) +} + +func addOpDeleteViewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteView{}, middleware.After) +} + +func addOpGetViewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetView{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpSearchValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearch{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateIndexTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateIndexType{}, middleware.After) +} + +func addOpUpdateViewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateView{}, middleware.After) +} + +func validateIncludedProperty(v *types.IncludedProperty) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IncludedProperty"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIncludedPropertyList(v []types.IncludedProperty) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IncludedPropertyList"} + for i := range v { + if err := validateIncludedProperty(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSearchFilter(v *types.SearchFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchFilter"} + if v.FilterString == nil { + invalidParams.Add(smithy.NewErrParamRequired("FilterString")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociateDefaultViewInput(v *AssociateDefaultViewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateDefaultViewInput"} + if v.ViewArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ViewArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateViewInput(v *CreateViewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateViewInput"} + if v.ViewName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ViewName")) + } + if v.IncludedProperties != nil { + if err := validateIncludedPropertyList(v.IncludedProperties); err != nil { + invalidParams.AddNested("IncludedProperties", err.(smithy.InvalidParamsError)) + } + } + if v.Filters != nil { + if err := validateSearchFilter(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteIndexInput(v *DeleteIndexInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIndexInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteViewInput(v *DeleteViewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteViewInput"} + if v.ViewArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ViewArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetViewInput(v *GetViewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetViewInput"} + if v.ViewArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ViewArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchInput(v *SearchInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchInput"} + if v.QueryString == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryString")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateIndexTypeInput(v *UpdateIndexTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateIndexTypeInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateViewInput(v *UpdateViewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateViewInput"} + if v.ViewArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ViewArn")) + } + if v.IncludedProperties != nil { + if err := validateIncludedPropertyList(v.IncludedProperties); err != nil { + invalidParams.AddNested("IncludedProperties", err.(smithy.InvalidParamsError)) + } + } + if v.Filters != nil { + if err := validateSearchFilter(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/route53/doc.go b/service/route53/doc.go index 9357dc6c59b..82ea541cc6c 100644 --- a/service/route53/doc.go +++ b/service/route53/doc.go @@ -4,5 +4,19 @@ // Amazon Route 53. // // Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web -// service. +// service. You can use Route 53 to: +// +// * Register domain names. For more +// information, see How domain registration works +// (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-domain-registration.html). +// +// * +// Route internet traffic to the resources for your domain For more information, +// see How internet traffic is routed to your website or web application +// (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-dns-service.html). +// +// * +// Check the health of your resources. For more information, see How Route 53 +// checks the health of your resources +// (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-health-checks.html). package route53 diff --git a/service/route53/types/enums.go b/service/route53/types/enums.go index 7a021fd3e04..579e817b9ce 100644 --- a/service/route53/types/enums.go +++ b/service/route53/types/enums.go @@ -92,6 +92,7 @@ const ( CloudWatchRegionUsWest2 CloudWatchRegion = "us-west-2" CloudWatchRegionCaCentral1 CloudWatchRegion = "ca-central-1" CloudWatchRegionEuCentral1 CloudWatchRegion = "eu-central-1" + CloudWatchRegionEuCentral2 CloudWatchRegion = "eu-central-2" CloudWatchRegionEuWest1 CloudWatchRegion = "eu-west-1" CloudWatchRegionEuWest2 CloudWatchRegion = "eu-west-2" CloudWatchRegionEuWest3 CloudWatchRegion = "eu-west-3" @@ -129,6 +130,7 @@ func (CloudWatchRegion) Values() []CloudWatchRegion { "us-west-2", "ca-central-1", "eu-central-1", + "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", @@ -329,6 +331,7 @@ const ( ResourceRecordSetRegionEuWest2 ResourceRecordSetRegion = "eu-west-2" ResourceRecordSetRegionEuWest3 ResourceRecordSetRegion = "eu-west-3" ResourceRecordSetRegionEuCentral1 ResourceRecordSetRegion = "eu-central-1" + ResourceRecordSetRegionEuCentral2 ResourceRecordSetRegion = "eu-central-2" ResourceRecordSetRegionApSoutheast1 ResourceRecordSetRegion = "ap-southeast-1" ResourceRecordSetRegionApSoutheast2 ResourceRecordSetRegion = "ap-southeast-2" ResourceRecordSetRegionApSoutheast3 ResourceRecordSetRegion = "ap-southeast-3" @@ -341,6 +344,7 @@ const ( ResourceRecordSetRegionCnNorthwest1 ResourceRecordSetRegion = "cn-northwest-1" ResourceRecordSetRegionApEast1 ResourceRecordSetRegion = "ap-east-1" ResourceRecordSetRegionMeSouth1 ResourceRecordSetRegion = "me-south-1" + ResourceRecordSetRegionMeCentral1 ResourceRecordSetRegion = "me-central-1" ResourceRecordSetRegionApSouth1 ResourceRecordSetRegion = "ap-south-1" ResourceRecordSetRegionAfSouth1 ResourceRecordSetRegion = "af-south-1" ResourceRecordSetRegionEuSouth1 ResourceRecordSetRegion = "eu-south-1" @@ -360,6 +364,7 @@ func (ResourceRecordSetRegion) Values() []ResourceRecordSetRegion { "eu-west-2", "eu-west-3", "eu-central-1", + "eu-central-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", @@ -372,6 +377,7 @@ func (ResourceRecordSetRegion) Values() []ResourceRecordSetRegion { "cn-northwest-1", "ap-east-1", "me-south-1", + "me-central-1", "ap-south-1", "af-south-1", "eu-south-1", @@ -489,6 +495,7 @@ const ( VPCRegionEuWest2 VPCRegion = "eu-west-2" VPCRegionEuWest3 VPCRegion = "eu-west-3" VPCRegionEuCentral1 VPCRegion = "eu-central-1" + VPCRegionEuCentral2 VPCRegion = "eu-central-2" VPCRegionApEast1 VPCRegion = "ap-east-1" VPCRegionMeSouth1 VPCRegion = "me-south-1" VPCRegionUsGovWest1 VPCRegion = "us-gov-west-1" @@ -525,6 +532,7 @@ func (VPCRegion) Values() []VPCRegion { "eu-west-2", "eu-west-3", "eu-central-1", + "eu-central-2", "ap-east-1", "me-south-1", "us-gov-west-1", diff --git a/service/route53/types/errors.go b/service/route53/types/errors.go index bf9f4172ca5..b2d23838d47 100644 --- a/service/route53/types/errors.go +++ b/service/route53/types/errors.go @@ -494,6 +494,10 @@ func (e *IncompatibleVersion) ErrorFault() smithy.ErrorFault { return smithy.Fau // specified doesn’t exist or it can’t be used with the log group associated with // query log. Update or provide a resource policy to grant permissions for the KMS // key. +// +// * The Key management service (KMS) key you specified is marked as disabled +// for the log group associated with query log. Update or provide a resource policy +// to grant permissions for the KMS key. type InsufficientCloudWatchLogsResourcePolicy struct { Message *string diff --git a/service/route53/types/types.go b/service/route53/types/types.go index 4ecda1b3260..f2c0fad8097 100644 --- a/service/route53/types/types.go +++ b/service/route53/types/types.go @@ -1711,28 +1711,26 @@ type ResourceRecordSet struct { // the resource that this resource record set refers to. The resource typically is // an Amazon Web Services resource, such as an EC2 instance or an ELB load // balancer, and is referred to by an IP address or a DNS domain name, depending on - // the record type. Although creating latency and latency alias resource record - // sets in a private hosted zone is allowed, it's not supported. When Amazon Route - // 53 receives a DNS query for a domain name and type for which you have created - // latency resource record sets, Route 53 selects the latency resource record set - // that has the lowest latency between the end user and the associated Amazon EC2 - // Region. Route 53 then returns the value that is associated with the selected - // resource record set. Note the following: - // - // * You can only specify one - // ResourceRecord per latency resource record set. - // - // * You can only create one - // latency resource record set for each Amazon EC2 Region. - // - // * You aren't required - // to create latency resource record sets for all Amazon EC2 Regions. Route 53 will - // choose the region with the best latency from among the regions that you create - // latency resource record sets for. - // - // * You can't create non-latency resource - // record sets that have the same values for the Name and Type elements as latency - // resource record sets. + // the record type. When Amazon Route 53 receives a DNS query for a domain name and + // type for which you have created latency resource record sets, Route 53 selects + // the latency resource record set that has the lowest latency between the end user + // and the associated Amazon EC2 Region. Route 53 then returns the value that is + // associated with the selected resource record set. Note the following: + // + // * You can + // only specify one ResourceRecord per latency resource record set. + // + // * You can only + // create one latency resource record set for each Amazon EC2 Region. + // + // * You aren't + // required to create latency resource record sets for all Amazon EC2 Regions. + // Route 53 will choose the region with the best latency from among the regions + // that you create latency resource record sets for. + // + // * You can't create + // non-latency resource record sets that have the same values for the Name and Type + // elements as latency resource record sets. Region ResourceRecordSetRegion // Information about the resource records to act upon. If you're creating an alias diff --git a/service/transfer/internal/endpoints/endpoints.go b/service/transfer/internal/endpoints/endpoints.go index 81af6212b2b..aa791b6de94 100644 --- a/service/transfer/internal/endpoints/endpoints.go +++ b/service/transfer/internal/endpoints/endpoints.go @@ -159,6 +159,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{},