From b65c226f47aa1f837699664bdc65c3c3e3611765 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Wed, 1 Nov 2023 18:18:51 +0000 Subject: [PATCH] Regenerated Clients --- .../14a7ecbd90ed4e7c9fddb7b8ce22f173.json | 8 + .../58704f6cb705408abab1e5eae877140f.json | 8 + .../6d75f24830204e738fedc6c828933ad3.json | 8 + .../751fe4aac5c343a784e58b0164d3d321.json | 8 + .../85387b665c774fddb5a719265cbeae0f.json | 8 + .../connect/api_op_BatchGetFlowAssociation.go | 270 +++ service/connect/api_op_CreatePrompt.go | 4 +- service/connect/api_op_GetPromptFile.go | 7 + .../connect/api_op_ListQueueQuickConnects.go | 7 + .../api_op_ListRoutingProfileQueues.go | 7 + .../api_op_ListSecurityProfileApplications.go | 7 + .../api_op_ListSecurityProfilePermissions.go | 7 + service/connect/api_op_ReplicateInstance.go | 5 +- service/connect/api_op_UpdatePrompt.go | 4 +- service/connect/deserializers.go | 1593 ++++++++++--- service/connect/generated.json | 1 + service/connect/serializers.go | 106 + service/connect/types/enums.go | 19 + service/connect/types/types.go | 140 +- service/connect/validators.go | 42 + .../api_op_CreateCrossAccountAttachment.go | 328 +++ .../api_op_DeleteCrossAccountAttachment.go | 271 +++ .../api_op_DescribeCrossAccountAttachment.go | 261 +++ .../api_op_ListCrossAccountAttachments.go | 359 +++ ...api_op_ListCrossAccountResourceAccounts.go | 252 +++ .../api_op_ListCrossAccountResources.go | 369 +++ .../api_op_UpdateCrossAccountAttachment.go | 305 +++ service/globalaccelerator/deserializers.go | 2015 ++++++++++++++--- service/globalaccelerator/doc.go | 4 +- service/globalaccelerator/endpoints.go | 2 +- service/globalaccelerator/generated.json | 7 + service/globalaccelerator/serializers.go | 594 +++++ service/globalaccelerator/types/errors.go | 26 + service/globalaccelerator/types/types.go | 104 +- service/globalaccelerator/validators.go | 250 ++ service/rds/api_op_CreateDBCluster.go | 3 + .../api_op_RestoreDBClusterFromSnapshot.go | 3 + .../api_op_RestoreDBClusterToPointInTime.go | 3 + service/rds/deserializers.go | 74 + service/rds/serializers.go | 38 + service/rds/types/types.go | 18 + service/redshift/api_op_CreateCluster.go | 3 + .../redshift/api_op_FailoverPrimaryCompute.go | 263 +++ service/redshift/api_op_ModifyCluster.go | 4 + .../api_op_RestoreFromClusterSnapshot.go | 4 + service/redshift/deserializers.go | 290 +++ service/redshift/generated.json | 1 + service/redshift/serializers.go | 91 + service/redshift/types/types.go | 20 + service/redshift/validators.go | 39 + service/sagemaker/deserializers.go | 5 + service/sagemaker/types/types.go | 3 + 52 files changed, 7617 insertions(+), 651 deletions(-) create mode 100644 .changelog/14a7ecbd90ed4e7c9fddb7b8ce22f173.json create mode 100644 .changelog/58704f6cb705408abab1e5eae877140f.json create mode 100644 .changelog/6d75f24830204e738fedc6c828933ad3.json create mode 100644 .changelog/751fe4aac5c343a784e58b0164d3d321.json create mode 100644 .changelog/85387b665c774fddb5a719265cbeae0f.json create mode 100644 service/connect/api_op_BatchGetFlowAssociation.go create mode 100644 service/globalaccelerator/api_op_CreateCrossAccountAttachment.go create mode 100644 service/globalaccelerator/api_op_DeleteCrossAccountAttachment.go create mode 100644 service/globalaccelerator/api_op_DescribeCrossAccountAttachment.go create mode 100644 service/globalaccelerator/api_op_ListCrossAccountAttachments.go create mode 100644 service/globalaccelerator/api_op_ListCrossAccountResourceAccounts.go create mode 100644 service/globalaccelerator/api_op_ListCrossAccountResources.go create mode 100644 service/globalaccelerator/api_op_UpdateCrossAccountAttachment.go create mode 100644 service/redshift/api_op_FailoverPrimaryCompute.go diff --git a/.changelog/14a7ecbd90ed4e7c9fddb7b8ce22f173.json b/.changelog/14a7ecbd90ed4e7c9fddb7b8ce22f173.json new file mode 100644 index 00000000000..d3fe789be99 --- /dev/null +++ b/.changelog/14a7ecbd90ed4e7c9fddb7b8ce22f173.json @@ -0,0 +1,8 @@ +{ + "id": "14a7ecbd-90ed-4e7c-9fdd-b7b8ce22f173", + "type": "feature", + "description": "Global Accelerator now support accelerators with cross account endpoints.", + "modules": [ + "service/globalaccelerator" + ] +} \ No newline at end of file diff --git a/.changelog/58704f6cb705408abab1e5eae877140f.json b/.changelog/58704f6cb705408abab1e5eae877140f.json new file mode 100644 index 00000000000..d56ec9f9d86 --- /dev/null +++ b/.changelog/58704f6cb705408abab1e5eae877140f.json @@ -0,0 +1,8 @@ +{ + "id": "58704f6c-b705-408a-bab1-e5eae877140f", + "type": "feature", + "description": "Added support for Multi-AZ deployments for Provisioned RA3 clusters that provide 99.99% SLA availability.", + "modules": [ + "service/redshift" + ] +} \ No newline at end of file diff --git a/.changelog/6d75f24830204e738fedc6c828933ad3.json b/.changelog/6d75f24830204e738fedc6c828933ad3.json new file mode 100644 index 00000000000..0557c14cdfd --- /dev/null +++ b/.changelog/6d75f24830204e738fedc6c828933ad3.json @@ -0,0 +1,8 @@ +{ + "id": "6d75f248-3020-4e73-8fed-c6c828933ad3", + "type": "feature", + "description": "Support for batch transform input in Model dashboard", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/751fe4aac5c343a784e58b0164d3d321.json b/.changelog/751fe4aac5c343a784e58b0164d3d321.json new file mode 100644 index 00000000000..fa5f8494155 --- /dev/null +++ b/.changelog/751fe4aac5c343a784e58b0164d3d321.json @@ -0,0 +1,8 @@ +{ + "id": "751fe4aa-c5c3-43a7-84e5-8b0164d3d321", + "type": "feature", + "description": "Adds the BatchGetFlowAssociation API which returns flow associations (flow-resource) corresponding to the list of resourceArns supplied in the request. This release also adds IsDefault, LastModifiedRegion and LastModifiedTime fields to the responses of several Describe and List APIs.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/85387b665c774fddb5a719265cbeae0f.json b/.changelog/85387b665c774fddb5a719265cbeae0f.json new file mode 100644 index 00000000000..1ebaa273044 --- /dev/null +++ b/.changelog/85387b665c774fddb5a719265cbeae0f.json @@ -0,0 +1,8 @@ +{ + "id": "85387b66-5c77-4fdd-b5a7-19265cbeae0f", + "type": "feature", + "description": "This release adds support for customized networking resources to Amazon RDS Custom.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/service/connect/api_op_BatchGetFlowAssociation.go b/service/connect/api_op_BatchGetFlowAssociation.go new file mode 100644 index 00000000000..f9347b06aa8 --- /dev/null +++ b/service/connect/api_op_BatchGetFlowAssociation.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieve the flow associations for the given resources. +func (c *Client) BatchGetFlowAssociation(ctx context.Context, params *BatchGetFlowAssociationInput, optFns ...func(*Options)) (*BatchGetFlowAssociationOutput, error) { + if params == nil { + params = &BatchGetFlowAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetFlowAssociation", params, optFns, c.addOperationBatchGetFlowAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetFlowAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetFlowAssociationInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID (https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html) + // in the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // A list of resource identifiers to retrieve flow associations. + // + // This member is required. + ResourceIds []string + + // The type of resource association. + ResourceType types.ListFlowAssociationResourceType + + noSmithyDocumentSerde +} + +type BatchGetFlowAssociationOutput struct { + + // Information about flow associations. + FlowAssociationSummaryList []types.FlowAssociationSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetFlowAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetFlowAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetFlowAssociation{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addBatchGetFlowAssociationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpBatchGetFlowAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetFlowAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchGetFlowAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "BatchGetFlowAssociation", + } +} + +type opBatchGetFlowAssociationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opBatchGetFlowAssociationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opBatchGetFlowAssociationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "connect" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "connect" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("connect") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addBatchGetFlowAssociationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opBatchGetFlowAssociationResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/connect/api_op_CreatePrompt.go b/service/connect/api_op_CreatePrompt.go index 48e36365b44..3b1f33c6eef 100644 --- a/service/connect/api_op_CreatePrompt.go +++ b/service/connect/api_op_CreatePrompt.go @@ -46,7 +46,9 @@ type CreatePromptInput struct { // This member is required. Name *string - // The URI for the S3 bucket where the prompt is stored. + // The URI for the S3 bucket where the prompt is stored. You can provide S3 + // pre-signed URLs returned by the GetPromptFile (https://docs.aws.amazon.com/connect/latest/APIReference/API_GetPromptFile.html) + // API instead of providing S3 URIs. // // This member is required. S3Uri *string diff --git a/service/connect/api_op_GetPromptFile.go b/service/connect/api_op_GetPromptFile.go index 6367695cdc5..fb377d9e5e3 100644 --- a/service/connect/api_op_GetPromptFile.go +++ b/service/connect/api_op_GetPromptFile.go @@ -13,6 +13,7 @@ import ( smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // Gets the prompt file. @@ -49,6 +50,12 @@ type GetPromptFileInput struct { type GetPromptFileOutput struct { + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // A generated URL to the prompt that can be given to an unauthorized user so they // can access the prompt in S3. PromptPresignedUrl *string diff --git a/service/connect/api_op_ListQueueQuickConnects.go b/service/connect/api_op_ListQueueQuickConnects.go index 8b252ec74a0..b5684f65fa7 100644 --- a/service/connect/api_op_ListQueueQuickConnects.go +++ b/service/connect/api_op_ListQueueQuickConnects.go @@ -14,6 +14,7 @@ import ( smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // This API is in preview release for Amazon Connect and is subject to change. @@ -59,6 +60,12 @@ type ListQueueQuickConnectsInput struct { type ListQueueQuickConnectsOutput struct { + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // If there are additional results, this is the token for the next set of results. NextToken *string diff --git a/service/connect/api_op_ListRoutingProfileQueues.go b/service/connect/api_op_ListRoutingProfileQueues.go index b4a8c5d3447..e66a32028df 100644 --- a/service/connect/api_op_ListRoutingProfileQueues.go +++ b/service/connect/api_op_ListRoutingProfileQueues.go @@ -14,6 +14,7 @@ import ( smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // Lists the queues associated with a routing profile. @@ -58,6 +59,12 @@ type ListRoutingProfileQueuesInput struct { type ListRoutingProfileQueuesOutput struct { + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // If there are additional results, this is the token for the next set of results. NextToken *string diff --git a/service/connect/api_op_ListSecurityProfileApplications.go b/service/connect/api_op_ListSecurityProfileApplications.go index 3b7efecaae4..3e1c2a6dbfb 100644 --- a/service/connect/api_op_ListSecurityProfileApplications.go +++ b/service/connect/api_op_ListSecurityProfileApplications.go @@ -14,6 +14,7 @@ import ( smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // Returns a list of third-party applications in a specific security profile. @@ -61,6 +62,12 @@ type ListSecurityProfileApplicationsOutput struct { // list of the third-party application's metadata. Applications []types.Application + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // If there are additional results, this is the token for the next set of results. NextToken *string diff --git a/service/connect/api_op_ListSecurityProfilePermissions.go b/service/connect/api_op_ListSecurityProfilePermissions.go index 38a09779764..fd2ced6f7b2 100644 --- a/service/connect/api_op_ListSecurityProfilePermissions.go +++ b/service/connect/api_op_ListSecurityProfilePermissions.go @@ -13,6 +13,7 @@ import ( smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // Lists the permissions granted to a security profile. @@ -56,6 +57,12 @@ type ListSecurityProfilePermissionsInput struct { type ListSecurityProfilePermissionsOutput struct { + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // If there are additional results, this is the token for the next set of results. NextToken *string diff --git a/service/connect/api_op_ReplicateInstance.go b/service/connect/api_op_ReplicateInstance.go index aa8bac1b61b..be79c38f520 100644 --- a/service/connect/api_op_ReplicateInstance.go +++ b/service/connect/api_op_ReplicateInstance.go @@ -16,8 +16,9 @@ import ( ) // Replicates an Amazon Connect instance in the specified Amazon Web Services -// Region. For more information about replicating an Amazon Connect instance, see -// Create a replica of your existing Amazon Connect instance (https://docs.aws.amazon.com/connect/latest/adminguide/create-replica-connect-instance.html) +// Region and copies configuration information for Amazon Connect resources across +// Amazon Web Services Regions. For more information about replicating an Amazon +// Connect instance, see Create a replica of your existing Amazon Connect instance (https://docs.aws.amazon.com/connect/latest/adminguide/create-replica-connect-instance.html) // in the Amazon Connect Administrator Guide. func (c *Client) ReplicateInstance(ctx context.Context, params *ReplicateInstanceInput, optFns ...func(*Options)) (*ReplicateInstanceOutput, error) { if params == nil { diff --git a/service/connect/api_op_UpdatePrompt.go b/service/connect/api_op_UpdatePrompt.go index 1b23315441b..9576ea79770 100644 --- a/service/connect/api_op_UpdatePrompt.go +++ b/service/connect/api_op_UpdatePrompt.go @@ -50,7 +50,9 @@ type UpdatePromptInput struct { // The name of the prompt. Name *string - // The URI for the S3 bucket where the prompt is stored. + // The URI for the S3 bucket where the prompt is stored. You can provide S3 + // pre-signed URLs returned by the GetPromptFile (https://docs.aws.amazon.com/connect/latest/APIReference/API_GetPromptFile.html) + // API instead of providing S3 URIs. S3Uri *string noSmithyDocumentSerde diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index afdfa7bad25..4da77957a9a 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -1468,14 +1468,14 @@ func awsRestjson1_deserializeOpErrorAssociateTrafficDistributionGroupUser(respon } } -type awsRestjson1_deserializeOpClaimPhoneNumber struct { +type awsRestjson1_deserializeOpBatchGetFlowAssociation struct { } -func (*awsRestjson1_deserializeOpClaimPhoneNumber) ID() string { +func (*awsRestjson1_deserializeOpBatchGetFlowAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpClaimPhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpBatchGetFlowAssociation) 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) @@ -1489,9 +1489,9 @@ func (m *awsRestjson1_deserializeOpClaimPhoneNumber) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorClaimPhoneNumber(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorBatchGetFlowAssociation(response, &metadata) } - output := &ClaimPhoneNumberOutput{} + output := &BatchGetFlowAssociationOutput{} out.Result = output var buff [1024]byte @@ -1512,7 +1512,7 @@ func (m *awsRestjson1_deserializeOpClaimPhoneNumber) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentClaimPhoneNumberOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentBatchGetFlowAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1525,7 +1525,7 @@ func (m *awsRestjson1_deserializeOpClaimPhoneNumber) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorClaimPhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorBatchGetFlowAssociation(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)} @@ -1569,15 +1569,15 @@ func awsRestjson1_deserializeOpErrorClaimPhoneNumber(response *smithyhttp.Respon case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("IdempotencyException", errorCode): - return awsRestjson1_deserializeErrorIdempotencyException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1594,7 +1594,7 @@ func awsRestjson1_deserializeOpErrorClaimPhoneNumber(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentClaimPhoneNumberOutput(v **ClaimPhoneNumberOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentBatchGetFlowAssociationOutput(v **BatchGetFlowAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1607,31 +1607,18 @@ func awsRestjson1_deserializeOpDocumentClaimPhoneNumberOutput(v **ClaimPhoneNumb return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ClaimPhoneNumberOutput + var sv *BatchGetFlowAssociationOutput if *v == nil { - sv = &ClaimPhoneNumberOutput{} + sv = &BatchGetFlowAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "PhoneNumberArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.PhoneNumberArn = ptr.String(jtv) - } - - case "PhoneNumberId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PhoneNumberId to be of type string, got %T instead", value) - } - sv.PhoneNumberId = ptr.String(jtv) + case "FlowAssociationSummaryList": + if err := awsRestjson1_deserializeDocumentFlowAssociationSummaryList(&sv.FlowAssociationSummaryList, value); err != nil { + return err } default: @@ -1643,14 +1630,14 @@ func awsRestjson1_deserializeOpDocumentClaimPhoneNumberOutput(v **ClaimPhoneNumb return nil } -type awsRestjson1_deserializeOpCreateAgentStatus struct { +type awsRestjson1_deserializeOpClaimPhoneNumber struct { } -func (*awsRestjson1_deserializeOpCreateAgentStatus) ID() string { +func (*awsRestjson1_deserializeOpClaimPhoneNumber) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateAgentStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpClaimPhoneNumber) 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) @@ -1664,9 +1651,9 @@ func (m *awsRestjson1_deserializeOpCreateAgentStatus) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAgentStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorClaimPhoneNumber(response, &metadata) } - output := &CreateAgentStatusOutput{} + output := &ClaimPhoneNumberOutput{} out.Result = output var buff [1024]byte @@ -1687,7 +1674,7 @@ func (m *awsRestjson1_deserializeOpCreateAgentStatus) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateAgentStatusOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentClaimPhoneNumberOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1700,7 +1687,7 @@ func (m *awsRestjson1_deserializeOpCreateAgentStatus) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateAgentStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorClaimPhoneNumber(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)} @@ -1741,8 +1728,11 @@ func awsRestjson1_deserializeOpErrorCreateAgentStatus(response *smithyhttp.Respo } switch { - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("IdempotencyException", errorCode): + return awsRestjson1_deserializeErrorIdempotencyException(response, errorBody) case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -1750,12 +1740,6 @@ func awsRestjson1_deserializeOpErrorCreateAgentStatus(response *smithyhttp.Respo case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1772,7 +1756,7 @@ func awsRestjson1_deserializeOpErrorCreateAgentStatus(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentCreateAgentStatusOutput(v **CreateAgentStatusOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentClaimPhoneNumberOutput(v **ClaimPhoneNumberOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1785,31 +1769,31 @@ func awsRestjson1_deserializeOpDocumentCreateAgentStatusOutput(v **CreateAgentSt return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateAgentStatusOutput + var sv *ClaimPhoneNumberOutput if *v == nil { - sv = &CreateAgentStatusOutput{} + sv = &ClaimPhoneNumberOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AgentStatusARN": + case "PhoneNumberArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.AgentStatusARN = ptr.String(jtv) + sv.PhoneNumberArn = ptr.String(jtv) } - case "AgentStatusId": + case "PhoneNumberId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AgentStatusId to be of type string, got %T instead", value) + return fmt.Errorf("expected PhoneNumberId to be of type string, got %T instead", value) } - sv.AgentStatusId = ptr.String(jtv) + sv.PhoneNumberId = ptr.String(jtv) } default: @@ -1821,14 +1805,14 @@ func awsRestjson1_deserializeOpDocumentCreateAgentStatusOutput(v **CreateAgentSt return nil } -type awsRestjson1_deserializeOpCreateContactFlow struct { +type awsRestjson1_deserializeOpCreateAgentStatus struct { } -func (*awsRestjson1_deserializeOpCreateContactFlow) ID() string { +func (*awsRestjson1_deserializeOpCreateAgentStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateContactFlow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateAgentStatus) 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) @@ -1842,9 +1826,9 @@ func (m *awsRestjson1_deserializeOpCreateContactFlow) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateContactFlow(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateAgentStatus(response, &metadata) } - output := &CreateContactFlowOutput{} + output := &CreateAgentStatusOutput{} out.Result = output var buff [1024]byte @@ -1865,7 +1849,7 @@ func (m *awsRestjson1_deserializeOpCreateContactFlow) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateContactFlowOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateAgentStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1878,7 +1862,7 @@ func (m *awsRestjson1_deserializeOpCreateContactFlow) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateContactFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateAgentStatus(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)} @@ -1925,9 +1909,6 @@ func awsRestjson1_deserializeOpErrorCreateContactFlow(response *smithyhttp.Respo case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) - case strings.EqualFold("InvalidContactFlowException", errorCode): - return awsRestjson1_deserializeErrorInvalidContactFlowException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) @@ -1953,7 +1934,7 @@ func awsRestjson1_deserializeOpErrorCreateContactFlow(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentCreateContactFlowOutput(v **CreateContactFlowOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateAgentStatusOutput(v **CreateAgentStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1966,31 +1947,31 @@ func awsRestjson1_deserializeOpDocumentCreateContactFlowOutput(v **CreateContact return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateContactFlowOutput + var sv *CreateAgentStatusOutput if *v == nil { - sv = &CreateContactFlowOutput{} + sv = &CreateAgentStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ContactFlowArn": + case "AgentStatusARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.ContactFlowArn = ptr.String(jtv) + sv.AgentStatusARN = ptr.String(jtv) } - case "ContactFlowId": + case "AgentStatusId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ContactFlowId to be of type string, got %T instead", value) + return fmt.Errorf("expected AgentStatusId to be of type string, got %T instead", value) } - sv.ContactFlowId = ptr.String(jtv) + sv.AgentStatusId = ptr.String(jtv) } default: @@ -2002,14 +1983,14 @@ func awsRestjson1_deserializeOpDocumentCreateContactFlowOutput(v **CreateContact return nil } -type awsRestjson1_deserializeOpCreateContactFlowModule struct { +type awsRestjson1_deserializeOpCreateContactFlow struct { } -func (*awsRestjson1_deserializeOpCreateContactFlowModule) ID() string { +func (*awsRestjson1_deserializeOpCreateContactFlow) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateContactFlowModule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateContactFlow) 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) @@ -2023,9 +2004,9 @@ func (m *awsRestjson1_deserializeOpCreateContactFlowModule) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateContactFlowModule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateContactFlow(response, &metadata) } - output := &CreateContactFlowModuleOutput{} + output := &CreateContactFlowOutput{} out.Result = output var buff [1024]byte @@ -2046,7 +2027,7 @@ func (m *awsRestjson1_deserializeOpCreateContactFlowModule) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateContactFlowModuleOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateContactFlowOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2059,7 +2040,7 @@ func (m *awsRestjson1_deserializeOpCreateContactFlowModule) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateContactFlowModule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateContactFlow(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)} @@ -2100,20 +2081,14 @@ func awsRestjson1_deserializeOpErrorCreateContactFlowModule(response *smithyhttp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("DuplicateResourceException", errorCode): return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("IdempotencyException", errorCode): - return awsRestjson1_deserializeErrorIdempotencyException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) - case strings.EqualFold("InvalidContactFlowModuleException", errorCode): - return awsRestjson1_deserializeErrorInvalidContactFlowModuleException(response, errorBody) + case strings.EqualFold("InvalidContactFlowException", errorCode): + return awsRestjson1_deserializeErrorInvalidContactFlowException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) @@ -2140,7 +2115,7 @@ func awsRestjson1_deserializeOpErrorCreateContactFlowModule(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentCreateContactFlowModuleOutput(v **CreateContactFlowModuleOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateContactFlowOutput(v **CreateContactFlowOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2153,31 +2128,31 @@ func awsRestjson1_deserializeOpDocumentCreateContactFlowModuleOutput(v **CreateC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateContactFlowModuleOutput + var sv *CreateContactFlowOutput if *v == nil { - sv = &CreateContactFlowModuleOutput{} + sv = &CreateContactFlowOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Arn": + case "ContactFlowArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.ContactFlowArn = ptr.String(jtv) } - case "Id": + case "ContactFlowId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ContactFlowModuleId to be of type string, got %T instead", value) + return fmt.Errorf("expected ContactFlowId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.ContactFlowId = ptr.String(jtv) } default: @@ -2189,14 +2164,14 @@ func awsRestjson1_deserializeOpDocumentCreateContactFlowModuleOutput(v **CreateC return nil } -type awsRestjson1_deserializeOpCreateEvaluationForm struct { +type awsRestjson1_deserializeOpCreateContactFlowModule struct { } -func (*awsRestjson1_deserializeOpCreateEvaluationForm) ID() string { +func (*awsRestjson1_deserializeOpCreateContactFlowModule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateEvaluationForm) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateContactFlowModule) 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) @@ -2210,9 +2185,9 @@ func (m *awsRestjson1_deserializeOpCreateEvaluationForm) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateEvaluationForm(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateContactFlowModule(response, &metadata) } - output := &CreateEvaluationFormOutput{} + output := &CreateContactFlowModuleOutput{} out.Result = output var buff [1024]byte @@ -2233,7 +2208,7 @@ func (m *awsRestjson1_deserializeOpCreateEvaluationForm) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateEvaluationFormOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateContactFlowModuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2246,7 +2221,7 @@ func (m *awsRestjson1_deserializeOpCreateEvaluationForm) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateEvaluationForm(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateContactFlowModule(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)} @@ -2287,21 +2262,33 @@ func awsRestjson1_deserializeOpErrorCreateEvaluationForm(response *smithyhttp.Re } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + + case strings.EqualFold("IdempotencyException", errorCode): + return awsRestjson1_deserializeErrorIdempotencyException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + case strings.EqualFold("InvalidContactFlowModuleException", errorCode): + return awsRestjson1_deserializeErrorInvalidContactFlowModuleException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -2315,7 +2302,7 @@ func awsRestjson1_deserializeOpErrorCreateEvaluationForm(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentCreateEvaluationFormOutput(v **CreateEvaluationFormOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateContactFlowModuleOutput(v **CreateContactFlowModuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2328,31 +2315,31 @@ func awsRestjson1_deserializeOpDocumentCreateEvaluationFormOutput(v **CreateEval return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateEvaluationFormOutput + var sv *CreateContactFlowModuleOutput if *v == nil { - sv = &CreateEvaluationFormOutput{} + sv = &CreateContactFlowModuleOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "EvaluationFormArn": + case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.EvaluationFormArn = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "EvaluationFormId": + case "Id": 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 ContactFlowModuleId to be of type string, got %T instead", value) } - sv.EvaluationFormId = ptr.String(jtv) + sv.Id = ptr.String(jtv) } default: @@ -2364,14 +2351,14 @@ func awsRestjson1_deserializeOpDocumentCreateEvaluationFormOutput(v **CreateEval return nil } -type awsRestjson1_deserializeOpCreateHoursOfOperation struct { +type awsRestjson1_deserializeOpCreateEvaluationForm struct { } -func (*awsRestjson1_deserializeOpCreateHoursOfOperation) ID() string { +func (*awsRestjson1_deserializeOpCreateEvaluationForm) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateHoursOfOperation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateEvaluationForm) 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) @@ -2385,9 +2372,9 @@ func (m *awsRestjson1_deserializeOpCreateHoursOfOperation) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateHoursOfOperation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateEvaluationForm(response, &metadata) } - output := &CreateHoursOfOperationOutput{} + output := &CreateEvaluationFormOutput{} out.Result = output var buff [1024]byte @@ -2408,7 +2395,7 @@ func (m *awsRestjson1_deserializeOpCreateHoursOfOperation) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateHoursOfOperationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateEvaluationFormOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2421,7 +2408,7 @@ func (m *awsRestjson1_deserializeOpCreateHoursOfOperation) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateHoursOfOperation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateEvaluationForm(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)} @@ -2462,24 +2449,21 @@ func awsRestjson1_deserializeOpErrorCreateHoursOfOperation(response *smithyhttp. } switch { - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceConflictException", errorCode): + return awsRestjson1_deserializeErrorResourceConflictException(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) @@ -2493,7 +2477,7 @@ func awsRestjson1_deserializeOpErrorCreateHoursOfOperation(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentCreateHoursOfOperationOutput(v **CreateHoursOfOperationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateEvaluationFormOutput(v **CreateEvaluationFormOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2506,31 +2490,31 @@ func awsRestjson1_deserializeOpDocumentCreateHoursOfOperationOutput(v **CreateHo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateHoursOfOperationOutput + var sv *CreateEvaluationFormOutput if *v == nil { - sv = &CreateHoursOfOperationOutput{} + sv = &CreateEvaluationFormOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "HoursOfOperationArn": + case "EvaluationFormArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.HoursOfOperationArn = ptr.String(jtv) + sv.EvaluationFormArn = ptr.String(jtv) } - case "HoursOfOperationId": + case "EvaluationFormId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected HoursOfOperationId to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } - sv.HoursOfOperationId = ptr.String(jtv) + sv.EvaluationFormId = ptr.String(jtv) } default: @@ -2542,14 +2526,14 @@ func awsRestjson1_deserializeOpDocumentCreateHoursOfOperationOutput(v **CreateHo return nil } -type awsRestjson1_deserializeOpCreateInstance struct { +type awsRestjson1_deserializeOpCreateHoursOfOperation struct { } -func (*awsRestjson1_deserializeOpCreateInstance) ID() string { +func (*awsRestjson1_deserializeOpCreateHoursOfOperation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateHoursOfOperation) 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) @@ -2563,9 +2547,9 @@ func (m *awsRestjson1_deserializeOpCreateInstance) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateInstance(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateHoursOfOperation(response, &metadata) } - output := &CreateInstanceOutput{} + output := &CreateHoursOfOperationOutput{} out.Result = output var buff [1024]byte @@ -2586,7 +2570,7 @@ func (m *awsRestjson1_deserializeOpCreateInstance) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateInstanceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateHoursOfOperationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2599,7 +2583,7 @@ func (m *awsRestjson1_deserializeOpCreateInstance) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateHoursOfOperation(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)} @@ -2640,18 +2624,24 @@ func awsRestjson1_deserializeOpErrorCreateInstance(response *smithyhttp.Response } switch { + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -2665,7 +2655,7 @@ func awsRestjson1_deserializeOpErrorCreateInstance(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentCreateInstanceOutput(v **CreateInstanceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateHoursOfOperationOutput(v **CreateHoursOfOperationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2678,31 +2668,31 @@ func awsRestjson1_deserializeOpDocumentCreateInstanceOutput(v **CreateInstanceOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateInstanceOutput + var sv *CreateHoursOfOperationOutput if *v == nil { - sv = &CreateInstanceOutput{} + sv = &CreateHoursOfOperationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Arn": + case "HoursOfOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.HoursOfOperationArn = ptr.String(jtv) } - case "Id": + case "HoursOfOperationId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) + return fmt.Errorf("expected HoursOfOperationId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.HoursOfOperationId = ptr.String(jtv) } default: @@ -2714,14 +2704,14 @@ func awsRestjson1_deserializeOpDocumentCreateInstanceOutput(v **CreateInstanceOu return nil } -type awsRestjson1_deserializeOpCreateIntegrationAssociation struct { +type awsRestjson1_deserializeOpCreateInstance struct { } -func (*awsRestjson1_deserializeOpCreateIntegrationAssociation) ID() string { +func (*awsRestjson1_deserializeOpCreateInstance) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateIntegrationAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateInstance) 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) @@ -2735,9 +2725,9 @@ func (m *awsRestjson1_deserializeOpCreateIntegrationAssociation) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateIntegrationAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateInstance(response, &metadata) } - output := &CreateIntegrationAssociationOutput{} + output := &CreateInstanceOutput{} out.Result = output var buff [1024]byte @@ -2758,7 +2748,7 @@ func (m *awsRestjson1_deserializeOpCreateIntegrationAssociation) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateIntegrationAssociationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateInstanceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2771,7 +2761,7 @@ func (m *awsRestjson1_deserializeOpCreateIntegrationAssociation) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateIntegrationAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateInstance(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)} @@ -2812,9 +2802,6 @@ func awsRestjson1_deserializeOpErrorCreateIntegrationAssociation(response *smith } switch { - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -2824,6 +2811,9 @@ func awsRestjson1_deserializeOpErrorCreateIntegrationAssociation(response *smith 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) @@ -2837,7 +2827,7 @@ func awsRestjson1_deserializeOpErrorCreateIntegrationAssociation(response *smith } } -func awsRestjson1_deserializeOpDocumentCreateIntegrationAssociationOutput(v **CreateIntegrationAssociationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateInstanceOutput(v **CreateInstanceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2850,31 +2840,31 @@ func awsRestjson1_deserializeOpDocumentCreateIntegrationAssociationOutput(v **Cr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateIntegrationAssociationOutput + var sv *CreateInstanceOutput if *v == nil { - sv = &CreateIntegrationAssociationOutput{} + sv = &CreateInstanceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "IntegrationAssociationArn": + case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.IntegrationAssociationArn = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "IntegrationAssociationId": + case "Id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected IntegrationAssociationId to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) } - sv.IntegrationAssociationId = ptr.String(jtv) + sv.Id = ptr.String(jtv) } default: @@ -2886,14 +2876,14 @@ func awsRestjson1_deserializeOpDocumentCreateIntegrationAssociationOutput(v **Cr return nil } -type awsRestjson1_deserializeOpCreateParticipant struct { +type awsRestjson1_deserializeOpCreateIntegrationAssociation struct { } -func (*awsRestjson1_deserializeOpCreateParticipant) ID() string { +func (*awsRestjson1_deserializeOpCreateIntegrationAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateParticipant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateIntegrationAssociation) 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) @@ -2907,9 +2897,9 @@ func (m *awsRestjson1_deserializeOpCreateParticipant) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateParticipant(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateIntegrationAssociation(response, &metadata) } - output := &CreateParticipantOutput{} + output := &CreateIntegrationAssociationOutput{} out.Result = output var buff [1024]byte @@ -2930,7 +2920,7 @@ func (m *awsRestjson1_deserializeOpCreateParticipant) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateParticipantOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateIntegrationAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2943,7 +2933,7 @@ func (m *awsRestjson1_deserializeOpCreateParticipant) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateParticipant(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateIntegrationAssociation(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)} @@ -2984,6 +2974,9 @@ func awsRestjson1_deserializeOpErrorCreateParticipant(response *smithyhttp.Respo } switch { + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -2993,9 +2986,6 @@ func awsRestjson1_deserializeOpErrorCreateParticipant(response *smithyhttp.Respo 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) @@ -3009,7 +2999,7 @@ func awsRestjson1_deserializeOpErrorCreateParticipant(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentCreateParticipantOutput(v **CreateParticipantOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateIntegrationAssociationOutput(v **CreateIntegrationAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3022,27 +3012,31 @@ func awsRestjson1_deserializeOpDocumentCreateParticipantOutput(v **CreatePartici return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateParticipantOutput + var sv *CreateIntegrationAssociationOutput if *v == nil { - sv = &CreateParticipantOutput{} + sv = &CreateIntegrationAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ParticipantCredentials": - if err := awsRestjson1_deserializeDocumentParticipantTokenCredentials(&sv.ParticipantCredentials, value); err != nil { - return err + case "IntegrationAssociationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.IntegrationAssociationArn = ptr.String(jtv) } - case "ParticipantId": + case "IntegrationAssociationId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ParticipantId to be of type string, got %T instead", value) + return fmt.Errorf("expected IntegrationAssociationId to be of type string, got %T instead", value) } - sv.ParticipantId = ptr.String(jtv) + sv.IntegrationAssociationId = ptr.String(jtv) } default: @@ -3054,14 +3048,14 @@ func awsRestjson1_deserializeOpDocumentCreateParticipantOutput(v **CreatePartici return nil } -type awsRestjson1_deserializeOpCreatePrompt struct { +type awsRestjson1_deserializeOpCreateParticipant struct { } -func (*awsRestjson1_deserializeOpCreatePrompt) ID() string { +func (*awsRestjson1_deserializeOpCreateParticipant) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreatePrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateParticipant) 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) @@ -3075,9 +3069,9 @@ func (m *awsRestjson1_deserializeOpCreatePrompt) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreatePrompt(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateParticipant(response, &metadata) } - output := &CreatePromptOutput{} + output := &CreateParticipantOutput{} out.Result = output var buff [1024]byte @@ -3098,7 +3092,7 @@ func (m *awsRestjson1_deserializeOpCreatePrompt) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreatePromptOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateParticipantOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3111,7 +3105,7 @@ func (m *awsRestjson1_deserializeOpCreatePrompt) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreatePrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateParticipant(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)} @@ -3152,20 +3146,17 @@ func awsRestjson1_deserializeOpErrorCreatePrompt(response *smithyhttp.Response, } switch { - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -3180,7 +3171,7 @@ func awsRestjson1_deserializeOpErrorCreatePrompt(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreatePromptOutput(v **CreatePromptOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateParticipantOutput(v **CreateParticipantOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3193,31 +3184,27 @@ func awsRestjson1_deserializeOpDocumentCreatePromptOutput(v **CreatePromptOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreatePromptOutput + var sv *CreateParticipantOutput if *v == nil { - sv = &CreatePromptOutput{} + sv = &CreateParticipantOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "PromptARN": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) - } - sv.PromptARN = ptr.String(jtv) + case "ParticipantCredentials": + if err := awsRestjson1_deserializeDocumentParticipantTokenCredentials(&sv.ParticipantCredentials, value); err != nil { + return err } - case "PromptId": + case "ParticipantId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + return fmt.Errorf("expected ParticipantId to be of type string, got %T instead", value) } - sv.PromptId = ptr.String(jtv) + sv.ParticipantId = ptr.String(jtv) } default: @@ -3229,14 +3216,14 @@ func awsRestjson1_deserializeOpDocumentCreatePromptOutput(v **CreatePromptOutput return nil } -type awsRestjson1_deserializeOpCreateQueue struct { +type awsRestjson1_deserializeOpCreatePrompt struct { } -func (*awsRestjson1_deserializeOpCreateQueue) ID() string { +func (*awsRestjson1_deserializeOpCreatePrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreatePrompt) 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) @@ -3250,9 +3237,9 @@ func (m *awsRestjson1_deserializeOpCreateQueue) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateQueue(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreatePrompt(response, &metadata) } - output := &CreateQueueOutput{} + output := &CreatePromptOutput{} out.Result = output var buff [1024]byte @@ -3273,7 +3260,7 @@ func (m *awsRestjson1_deserializeOpCreateQueue) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateQueueOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreatePromptOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3286,7 +3273,7 @@ func (m *awsRestjson1_deserializeOpCreateQueue) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreatePrompt(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)} @@ -3342,9 +3329,6 @@ func awsRestjson1_deserializeOpErrorCreateQueue(response *smithyhttp.Response, m case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -3358,7 +3342,7 @@ func awsRestjson1_deserializeOpErrorCreateQueue(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreatePromptOutput(v **CreatePromptOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3371,31 +3355,31 @@ func awsRestjson1_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateQueueOutput + var sv *CreatePromptOutput if *v == nil { - sv = &CreateQueueOutput{} + sv = &CreatePromptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "QueueArn": + case "PromptARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.QueueArn = ptr.String(jtv) + sv.PromptARN = ptr.String(jtv) } - case "QueueId": + case "PromptId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueueId to be of type string, got %T instead", value) + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) } - sv.QueueId = ptr.String(jtv) + sv.PromptId = ptr.String(jtv) } default: @@ -3407,14 +3391,14 @@ func awsRestjson1_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, return nil } -type awsRestjson1_deserializeOpCreateQuickConnect struct { +type awsRestjson1_deserializeOpCreateQueue struct { } -func (*awsRestjson1_deserializeOpCreateQuickConnect) ID() string { +func (*awsRestjson1_deserializeOpCreateQueue) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateQuickConnect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateQueue) 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) @@ -3428,9 +3412,9 @@ func (m *awsRestjson1_deserializeOpCreateQuickConnect) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateQuickConnect(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateQueue(response, &metadata) } - output := &CreateQuickConnectOutput{} + output := &CreateQueueOutput{} out.Result = output var buff [1024]byte @@ -3451,7 +3435,7 @@ func (m *awsRestjson1_deserializeOpCreateQuickConnect) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateQuickConnectOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateQueueOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3464,7 +3448,7 @@ func (m *awsRestjson1_deserializeOpCreateQuickConnect) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateQuickConnect(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateQueue(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)} @@ -3536,7 +3520,7 @@ func awsRestjson1_deserializeOpErrorCreateQuickConnect(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentCreateQuickConnectOutput(v **CreateQuickConnectOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3549,31 +3533,31 @@ func awsRestjson1_deserializeOpDocumentCreateQuickConnectOutput(v **CreateQuickC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateQuickConnectOutput + var sv *CreateQueueOutput if *v == nil { - sv = &CreateQuickConnectOutput{} + sv = &CreateQueueOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "QuickConnectARN": + case "QueueArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.QuickConnectARN = ptr.String(jtv) + sv.QueueArn = ptr.String(jtv) } - case "QuickConnectId": + case "QueueId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QuickConnectId to be of type string, got %T instead", value) + return fmt.Errorf("expected QueueId to be of type string, got %T instead", value) } - sv.QuickConnectId = ptr.String(jtv) + sv.QueueId = ptr.String(jtv) } default: @@ -3585,14 +3569,14 @@ func awsRestjson1_deserializeOpDocumentCreateQuickConnectOutput(v **CreateQuickC return nil } -type awsRestjson1_deserializeOpCreateRoutingProfile struct { +type awsRestjson1_deserializeOpCreateQuickConnect struct { } -func (*awsRestjson1_deserializeOpCreateRoutingProfile) ID() string { +func (*awsRestjson1_deserializeOpCreateQuickConnect) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateRoutingProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateQuickConnect) 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) @@ -3606,9 +3590,9 @@ func (m *awsRestjson1_deserializeOpCreateRoutingProfile) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateRoutingProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateQuickConnect(response, &metadata) } - output := &CreateRoutingProfileOutput{} + output := &CreateQuickConnectOutput{} out.Result = output var buff [1024]byte @@ -3629,7 +3613,7 @@ func (m *awsRestjson1_deserializeOpCreateRoutingProfile) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateRoutingProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateQuickConnectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3642,7 +3626,7 @@ func (m *awsRestjson1_deserializeOpCreateRoutingProfile) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateRoutingProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateQuickConnect(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)} @@ -3714,7 +3698,7 @@ func awsRestjson1_deserializeOpErrorCreateRoutingProfile(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentCreateRoutingProfileOutput(v **CreateRoutingProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateQuickConnectOutput(v **CreateQuickConnectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3727,31 +3711,31 @@ func awsRestjson1_deserializeOpDocumentCreateRoutingProfileOutput(v **CreateRout return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateRoutingProfileOutput + var sv *CreateQuickConnectOutput if *v == nil { - sv = &CreateRoutingProfileOutput{} + sv = &CreateQuickConnectOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "RoutingProfileArn": + case "QuickConnectARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.RoutingProfileArn = ptr.String(jtv) + sv.QuickConnectARN = ptr.String(jtv) } - case "RoutingProfileId": + case "QuickConnectId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RoutingProfileId to be of type string, got %T instead", value) + return fmt.Errorf("expected QuickConnectId to be of type string, got %T instead", value) } - sv.RoutingProfileId = ptr.String(jtv) + sv.QuickConnectId = ptr.String(jtv) } default: @@ -3763,14 +3747,14 @@ func awsRestjson1_deserializeOpDocumentCreateRoutingProfileOutput(v **CreateRout return nil } -type awsRestjson1_deserializeOpCreateRule struct { +type awsRestjson1_deserializeOpCreateRoutingProfile struct { } -func (*awsRestjson1_deserializeOpCreateRule) ID() string { +func (*awsRestjson1_deserializeOpCreateRoutingProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateRoutingProfile) 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) @@ -3784,9 +3768,9 @@ func (m *awsRestjson1_deserializeOpCreateRule) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateRoutingProfile(response, &metadata) } - output := &CreateRuleOutput{} + output := &CreateRoutingProfileOutput{} out.Result = output var buff [1024]byte @@ -3807,7 +3791,7 @@ func (m *awsRestjson1_deserializeOpCreateRule) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateRuleOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateRoutingProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3820,7 +3804,185 @@ func (m *awsRestjson1_deserializeOpCreateRule) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateRoutingProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateRoutingProfileOutput(v **CreateRoutingProfileOutput, 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 *CreateRoutingProfileOutput + if *v == nil { + sv = &CreateRoutingProfileOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RoutingProfileArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.RoutingProfileArn = ptr.String(jtv) + } + + case "RoutingProfileId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoutingProfileId to be of type string, got %T instead", value) + } + sv.RoutingProfileId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateRule struct { +} + +func (*awsRestjson1_deserializeOpCreateRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateRule) 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_deserializeOpErrorCreateRule(response, &metadata) + } + output := &CreateRuleOutput{} + 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_deserializeOpDocumentCreateRuleOutput(&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_deserializeOpErrorCreateRule(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)} @@ -13865,6 +14027,31 @@ func awsRestjson1_deserializeOpDocumentGetPromptFileOutput(v **GetPromptFileOutp for key, value := range shape { switch key { + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "PromptPresignedUrl": if value != nil { jtv, ok := value.(string) @@ -17820,6 +18007,31 @@ func awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(v **ListQueu for key, value := range shape { switch key { + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -18324,6 +18536,31 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRo for key, value := range shape { switch key { + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -19001,6 +19238,31 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(v * return err } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -19164,6 +19426,31 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(v ** for key, value := range shape { switch key { + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -31264,6 +31551,31 @@ func awsRestjson1_deserializeDocumentAgentStatus(v **types.AgentStatus, value in sv.DisplayOrder = ptr.Int32(int32(i64)) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -31410,6 +31722,31 @@ func awsRestjson1_deserializeDocumentAgentStatusSummary(v **types.AgentStatusSum sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -35869,6 +36206,98 @@ func awsRestjson1_deserializeDocumentEventBridgeActionDefinition(v **types.Event return nil } +func awsRestjson1_deserializeDocumentFlowAssociationSummary(v **types.FlowAssociationSummary, 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.FlowAssociationSummary + if *v == nil { + sv = &types.FlowAssociationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FlowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.FlowId = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ListFlowAssociationResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = types.ListFlowAssociationResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFlowAssociationSummaryList(v *[]types.FlowAssociationSummary, 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.FlowAssociationSummary + if *v == nil { + cv = []types.FlowAssociationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FlowAssociationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentFlowAssociationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentFunctionArnsList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -35950,76 +36379,38 @@ func awsRestjson1_deserializeDocumentHierarchyGroup(v **types.HierarchyGroup, va sv.Id = ptr.String(jtv) } - case "LevelId": + case "LastModifiedRegion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected HierarchyLevelId to be of type string, got %T instead", value) + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) } - sv.LevelId = ptr.String(jtv) + sv.LastModifiedRegion = ptr.String(jtv) } - case "Name": + case "LastModifiedTime": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HierarchyGroupName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentHierarchyGroupSummary(v **types.HierarchyGroupSummary, 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) - } + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - var sv *types.HierarchyGroupSummary - if *v == nil { - sv = &types.HierarchyGroupSummary{} - } else { - sv = *v - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) } - case "Id": + case "LevelId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected HierarchyGroupId to be of type string, got %T instead", value) + return fmt.Errorf("expected HierarchyLevelId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.LevelId = ptr.String(jtv) } case "Name": @@ -36031,6 +36422,11 @@ func awsRestjson1_deserializeDocumentHierarchyGroupSummary(v **types.HierarchyGr sv.Name = ptr.String(jtv) } + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + default: _, _ = key, value @@ -36040,41 +36436,7 @@ func awsRestjson1_deserializeDocumentHierarchyGroupSummary(v **types.HierarchyGr return nil } -func awsRestjson1_deserializeDocumentHierarchyGroupSummaryList(v *[]types.HierarchyGroupSummary, 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.HierarchyGroupSummary - if *v == nil { - cv = []types.HierarchyGroupSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.HierarchyGroupSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentHierarchyGroupSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentHierarchyGroupSummaryReference(v **types.HierarchyGroupSummaryReference, value interface{}) error { +func awsRestjson1_deserializeDocumentHierarchyGroupSummary(v **types.HierarchyGroupSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -36087,9 +36449,126 @@ func awsRestjson1_deserializeDocumentHierarchyGroupSummaryReference(v **types.Hi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.HierarchyGroupSummaryReference + var sv *types.HierarchyGroupSummary if *v == nil { - sv = &types.HierarchyGroupSummaryReference{} + sv = &types.HierarchyGroupSummary{} + } 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 ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HierarchyGroupId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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 HierarchyGroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHierarchyGroupSummaryList(v *[]types.HierarchyGroupSummary, 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.HierarchyGroupSummary + if *v == nil { + cv = []types.HierarchyGroupSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.HierarchyGroupSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentHierarchyGroupSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentHierarchyGroupSummaryReference(v **types.HierarchyGroupSummaryReference, 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.HierarchyGroupSummaryReference + if *v == nil { + sv = &types.HierarchyGroupSummaryReference{} } else { sv = *v } @@ -36163,6 +36642,31 @@ func awsRestjson1_deserializeDocumentHierarchyLevel(v **types.HierarchyLevel, va sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -36645,6 +37149,31 @@ func awsRestjson1_deserializeDocumentHoursOfOperation(v **types.HoursOfOperation sv.HoursOfOperationId = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -36835,6 +37364,31 @@ func awsRestjson1_deserializeDocumentHoursOfOperationSummary(v **types.HoursOfOp sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -39540,6 +40094,31 @@ func awsRestjson1_deserializeDocumentPrompt(v **types.Prompt, value interface{}) sv.Description = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -39655,6 +40234,31 @@ func awsRestjson1_deserializeDocumentPromptSummary(v **types.PromptSummary, valu sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -39884,6 +40488,31 @@ func awsRestjson1_deserializeDocumentQueue(v **types.Queue, value interface{}) e sv.HoursOfOperationId = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "MaxContacts": if value != nil { jtv, ok := value.(json.Number) @@ -40180,6 +40809,31 @@ func awsRestjson1_deserializeDocumentQueueSummary(v **types.QueueSummary, value sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -40272,6 +40926,31 @@ func awsRestjson1_deserializeDocumentQuickConnect(v **types.QuickConnect, value sv.Description = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -40447,6 +41126,31 @@ func awsRestjson1_deserializeDocumentQuickConnectSummary(v **types.QuickConnectS sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -41055,6 +41759,40 @@ func awsRestjson1_deserializeDocumentRoutingProfile(v **types.RoutingProfile, va sv.InstanceId = ptr.String(jtv) } + case "IsDefault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsDefault = jtv + } + + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "MediaConcurrencies": if err := awsRestjson1_deserializeDocumentMediaConcurrencies(&sv.MediaConcurrencies, value); err != nil { return err @@ -41377,6 +42115,31 @@ func awsRestjson1_deserializeDocumentRoutingProfileSummary(v **types.RoutingProf sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -42058,6 +42821,31 @@ func awsRestjson1_deserializeDocumentSecurityProfile(v **types.SecurityProfile, sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "OrganizationResourceId": if value != nil { jtv, ok := value.(string) @@ -42286,6 +43074,31 @@ func awsRestjson1_deserializeDocumentSecurityProfileSummary(v **types.SecurityPr sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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) @@ -44160,6 +44973,31 @@ func awsRestjson1_deserializeDocumentUser(v **types.User, value interface{}) err return err } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "PhoneConfig": if err := awsRestjson1_deserializeDocumentUserPhoneConfig(&sv.PhoneConfig, value); err != nil { return err @@ -44865,6 +45703,31 @@ func awsRestjson1_deserializeDocumentUserSummary(v **types.UserSummary, value in sv.Id = ptr.String(jtv) } + case "LastModifiedRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.LastModifiedRegion = ptr.String(jtv) + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "Username": if value != nil { jtv, ok := value.(string) diff --git a/service/connect/generated.json b/service/connect/generated.json index f106cbefbf6..688f4bce79a 100644 --- a/service/connect/generated.json +++ b/service/connect/generated.json @@ -21,6 +21,7 @@ "api_op_AssociateRoutingProfileQueues.go", "api_op_AssociateSecurityKey.go", "api_op_AssociateTrafficDistributionGroupUser.go", + "api_op_BatchGetFlowAssociation.go", "api_op_ClaimPhoneNumber.go", "api_op_CreateAgentStatus.go", "api_op_CreateContactFlow.go", diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 48c458aec9b..b707dfec2de 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -1140,6 +1140,101 @@ func awsRestjson1_serializeOpDocumentAssociateTrafficDistributionGroupUserInput( return nil } +type awsRestjson1_serializeOpBatchGetFlowAssociation struct { +} + +func (*awsRestjson1_serializeOpBatchGetFlowAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchGetFlowAssociation) 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.(*BatchGetFlowAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/flow-associations-batch/{InstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsBatchGetFlowAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchGetFlowAssociationInput(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_serializeOpHttpBindingsBatchGetFlowAssociationInput(v *BatchGetFlowAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchGetFlowAssociationInput(v *BatchGetFlowAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceIds != nil { + ok := object.Key("ResourceIds") + if err := awsRestjson1_serializeDocumentResourceArnListMaxLimit100(v.ResourceIds, ok); err != nil { + return err + } + } + + if len(v.ResourceType) > 0 { + ok := object.Key("ResourceType") + ok.String(string(v.ResourceType)) + } + + return nil +} + type awsRestjson1_serializeOpClaimPhoneNumber struct { } @@ -20995,6 +21090,17 @@ func awsRestjson1_serializeDocumentRequiredTaskTemplateFields(v []types.Required return nil } +func awsRestjson1_serializeDocumentResourceArnListMaxLimit100(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_serializeDocumentResourceTagsSearchCriteria(v *types.ResourceTagsSearchCriteria, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index 69cafd59bf9..9ba78b0fc7a 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -791,6 +791,25 @@ func (LexVersion) Values() []LexVersion { } } +type ListFlowAssociationResourceType string + +// Enum values for ListFlowAssociationResourceType +const ( + ListFlowAssociationResourceTypeSmsPhoneNumber ListFlowAssociationResourceType = "SMS_PHONE_NUMBER" + ListFlowAssociationResourceTypeVoicePhoneNumber ListFlowAssociationResourceType = "VOICE_PHONE_NUMBER" +) + +// Values returns all known values for ListFlowAssociationResourceType. 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 (ListFlowAssociationResourceType) Values() []ListFlowAssociationResourceType { + return []ListFlowAssociationResourceType{ + "SMS_PHONE_NUMBER", + "VOICE_PHONE_NUMBER", + } +} + type MonitorCapability string // Enum values for MonitorCapability diff --git a/service/connect/types/types.go b/service/connect/types/types.go index 122d22b09b7..20030ffef91 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -85,6 +85,12 @@ type AgentStatus struct { // The display order of the agent status. DisplayOrder *int32 + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the agent status. Name *string @@ -125,6 +131,12 @@ type AgentStatusSummary struct { // The identifier for an agent status. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the agent status. Name *string @@ -1466,6 +1478,21 @@ type FilterV2 struct { noSmithyDocumentSerde } +// Information about flow associations. +type FlowAssociationSummary struct { + + // The identifier of the flow. + FlowId *string + + // The identifier of the resource. + ResourceId *string + + // The type of resource association. + ResourceType ListFlowAssociationResourceType + + noSmithyDocumentSerde +} + // Contains information about a hierarchy group. type HierarchyGroup struct { @@ -1478,6 +1505,12 @@ type HierarchyGroup struct { // The identifier of the hierarchy group. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The identifier of the level in the hierarchy group. LevelId *string @@ -1512,6 +1545,12 @@ type HierarchyGroupSummary struct { // The identifier of the hierarchy group. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the hierarchy group. Name *string @@ -1539,6 +1578,12 @@ type HierarchyLevel struct { // The identifier of the hierarchy level. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the hierarchy level. Name *string @@ -1699,6 +1744,12 @@ type HoursOfOperation struct { // The identifier for the hours of operation. HoursOfOperationId *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name for the hours of operation. Name *string @@ -1771,6 +1822,12 @@ type HoursOfOperationSummary struct { // The identifier of the hours of operation. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the hours of operation. Name *string @@ -2466,6 +2523,12 @@ type Prompt struct { // The description of the prompt. Description *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the prompt. Name *string @@ -2520,6 +2583,12 @@ type PromptSummary struct { // The identifier of the prompt. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the prompt. Name *string @@ -2556,6 +2625,12 @@ type Queue struct { // The identifier for the hours of operation. HoursOfOperationId *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The maximum number of contacts that can be in the queue before it is considered // full. MaxContacts *int32 @@ -2667,6 +2742,12 @@ type QueueSummary struct { // The identifier of the queue. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the queue. Name *string @@ -2682,6 +2763,12 @@ type QuickConnect struct { // The description. Description *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the quick connect. Name *string @@ -2762,6 +2849,12 @@ type QuickConnectSummary struct { // The identifier for the quick connect. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the quick connect. Name *string @@ -2905,6 +2998,15 @@ type RoutingProfile struct { // in the Amazon Resource Name (ARN) of the instance. InstanceId *string + // Whether this a default routing profile. + IsDefault bool + + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The channels agents can handle in the Contact Control Panel (CCP) for this // routing profile. MediaConcurrencies []MediaConcurrency @@ -3068,6 +3170,12 @@ type RoutingProfileSummary struct { // The identifier of the routing profile. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the routing profile. Name *string @@ -3280,6 +3388,12 @@ type SecurityProfile struct { // The identifier for the security profile. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The organization resource identifier for the security profile. OrganizationResourceId *string @@ -3361,6 +3475,12 @@ type SecurityProfileSummary struct { // The identifier of the security profile. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The name of the security profile. Name *string @@ -3702,9 +3822,11 @@ type TrafficDistributionGroup struct { // replication. The default traffic distribution group cannot be deleted by the // DeleteTrafficDistributionGroup API. The default traffic distribution group is // deleted as part of the process for deleting a replica. The SignInConfig - // distribution is available only on the default TrafficDistributionGroup . If you - // call UpdateTrafficDistribution with a modified SignInConfig and a non-default - // TrafficDistributionGroup , an InvalidRequestException is returned. + // distribution is available only on a default TrafficDistributionGroup (see the + // IsDefault parameter in the TrafficDistributionGroup (https://docs.aws.amazon.com/connect/latest/APIReference/API_TrafficDistributionGroup.html) + // data type). If you call UpdateTrafficDistribution with a modified SignInConfig + // and a non-default TrafficDistributionGroup , an InvalidRequestException is + // returned. IsDefault bool // The name of the traffic distribution group. @@ -3847,6 +3969,12 @@ type User struct { // Information about the user identity. IdentityInfo *UserIdentityInfo + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // Information about the phone configuration for the user. PhoneConfig *UserPhoneConfig @@ -4096,6 +4224,12 @@ type UserSummary struct { // The identifier of the user account. Id *string + // The Amazon Web Services Region where this resource was last modified. + LastModifiedRegion *string + + // The timestamp when this resource was last modified. + LastModifiedTime *time.Time + // The Amazon Connect user name of the user account. Username *string diff --git a/service/connect/validators.go b/service/connect/validators.go index e3cdc0ffad6..c1a9cbfde45 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -250,6 +250,26 @@ func (m *validateOpAssociateTrafficDistributionGroupUser) HandleInitialize(ctx c return next.HandleInitialize(ctx, in) } +type validateOpBatchGetFlowAssociation struct { +} + +func (*validateOpBatchGetFlowAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchGetFlowAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchGetFlowAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchGetFlowAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpClaimPhoneNumber struct { } @@ -4198,6 +4218,10 @@ func addOpAssociateTrafficDistributionGroupUserValidationMiddleware(stack *middl return stack.Initialize.Add(&validateOpAssociateTrafficDistributionGroupUser{}, middleware.After) } +func addOpBatchGetFlowAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchGetFlowAssociation{}, middleware.After) +} + func addOpClaimPhoneNumberValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpClaimPhoneNumber{}, middleware.After) } @@ -6504,6 +6528,24 @@ func validateOpAssociateTrafficDistributionGroupUserInput(v *AssociateTrafficDis } } +func validateOpBatchGetFlowAssociationInput(v *BatchGetFlowAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetFlowAssociationInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.ResourceIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpClaimPhoneNumberInput(v *ClaimPhoneNumberInput) error { if v == nil { return nil diff --git a/service/globalaccelerator/api_op_CreateCrossAccountAttachment.go b/service/globalaccelerator/api_op_CreateCrossAccountAttachment.go new file mode 100644 index 00000000000..81011b77521 --- /dev/null +++ b/service/globalaccelerator/api_op_CreateCrossAccountAttachment.go @@ -0,0 +1,328 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a cross-account attachment in Global Accelerator. You create a +// cross-account attachment to specify the principals who have permission to add to +// accelerators in their own account the resources in your account that you also +// list in the attachment. A principal can be an Amazon Web Services account number +// or the Amazon Resource Name (ARN) for an accelerator. For account numbers that +// are listed as principals, to add a resource listed in the attachment to an +// accelerator, you must sign in to an account specified as a principal. Then you +// can add the resources that are listed to any of your accelerators. If an +// accelerator ARN is listed in the cross-account attachment as a principal, anyone +// with permission to make updates to the accelerator can add as endpoints +// resources that are listed in the attachment. +func (c *Client) CreateCrossAccountAttachment(ctx context.Context, params *CreateCrossAccountAttachmentInput, optFns ...func(*Options)) (*CreateCrossAccountAttachmentOutput, error) { + if params == nil { + params = &CreateCrossAccountAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateCrossAccountAttachment", params, optFns, c.addOperationCreateCrossAccountAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateCrossAccountAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateCrossAccountAttachmentInput struct { + + // A unique, case-sensitive identifier that you provide to ensure the + // idempotency—that is, the uniqueness—of the request. + // + // This member is required. + IdempotencyToken *string + + // The name of the cross-account attachment. + // + // This member is required. + Name *string + + // The principals to list in the cross-account attachment. A principal can be an + // Amazon Web Services account number or the Amazon Resource Name (ARN) for an + // accelerator. + Principals []string + + // The Amazon Resource Names (ARNs) for the resources to list in the cross-account + // attachment. A resource can be any supported Amazon Web Services resource type + // for Global Accelerator. + Resources []types.Resource + + // Create tags for cross-account attachment. For more information, see Tagging in + // Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html) + // in the Global Accelerator Developer Guide. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateCrossAccountAttachmentOutput struct { + + // Information about the cross-account attachment. + CrossAccountAttachment *types.Attachment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateCrossAccountAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCreateCrossAccountAttachmentResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateCrossAccountAttachmentMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateCrossAccountAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCrossAccountAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateCrossAccountAttachment struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateCrossAccountAttachment) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateCrossAccountAttachment) 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.(*CreateCrossAccountAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCrossAccountAttachmentInput ") + } + + if input.IdempotencyToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.IdempotencyToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateCrossAccountAttachmentMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCrossAccountAttachment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateCrossAccountAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "CreateCrossAccountAttachment", + } +} + +type opCreateCrossAccountAttachmentResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateCrossAccountAttachmentResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateCrossAccountAttachmentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "globalaccelerator" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "globalaccelerator" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("globalaccelerator") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateCrossAccountAttachmentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateCrossAccountAttachmentResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/globalaccelerator/api_op_DeleteCrossAccountAttachment.go b/service/globalaccelerator/api_op_DeleteCrossAccountAttachment.go new file mode 100644 index 00000000000..c2a17df818a --- /dev/null +++ b/service/globalaccelerator/api_op_DeleteCrossAccountAttachment.go @@ -0,0 +1,271 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete a cross-account attachment. When you delete an attachment, Global +// Accelerator revokes the permission to use the resources in the attachment from +// all principals in the list of principals. Global Accelerator revokes the +// permission for specific resources by doing the following: +// - If the principal is an account ID, Global Accelerator reviews every +// accelerator in the account and removes cross-account endpoints from all +// accelerators. +// - If the principal is an accelerator, Global Accelerator reviews just that +// accelerator and removes cross-account endpoints from it. +// +// If there are overlapping permissions provided by multiple cross-account +// attachments, Global Accelerator only removes endpoints if there are no current +// cross-account attachments that provide access permission. For example, if you +// delete a cross-account attachment that lists an accelerator as a principal, but +// another cross-account attachment includes the account ID that owns that +// accelerator, endpoints will not be removed from the accelerator. +func (c *Client) DeleteCrossAccountAttachment(ctx context.Context, params *DeleteCrossAccountAttachmentInput, optFns ...func(*Options)) (*DeleteCrossAccountAttachmentOutput, error) { + if params == nil { + params = &DeleteCrossAccountAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCrossAccountAttachment", params, optFns, c.addOperationDeleteCrossAccountAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCrossAccountAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteCrossAccountAttachmentInput struct { + + // The Amazon Resource Name (ARN) for the cross-account attachment to delete. + // + // This member is required. + AttachmentArn *string + + noSmithyDocumentSerde +} + +type DeleteCrossAccountAttachmentOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCrossAccountAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addDeleteCrossAccountAttachmentResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteCrossAccountAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCrossAccountAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCrossAccountAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "DeleteCrossAccountAttachment", + } +} + +type opDeleteCrossAccountAttachmentResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteCrossAccountAttachmentResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteCrossAccountAttachmentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "globalaccelerator" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "globalaccelerator" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("globalaccelerator") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteCrossAccountAttachmentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteCrossAccountAttachmentResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/globalaccelerator/api_op_DescribeCrossAccountAttachment.go b/service/globalaccelerator/api_op_DescribeCrossAccountAttachment.go new file mode 100644 index 00000000000..2987d364f4d --- /dev/null +++ b/service/globalaccelerator/api_op_DescribeCrossAccountAttachment.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets configuration information about a cross-account attachment. +func (c *Client) DescribeCrossAccountAttachment(ctx context.Context, params *DescribeCrossAccountAttachmentInput, optFns ...func(*Options)) (*DescribeCrossAccountAttachmentOutput, error) { + if params == nil { + params = &DescribeCrossAccountAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeCrossAccountAttachment", params, optFns, c.addOperationDescribeCrossAccountAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeCrossAccountAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeCrossAccountAttachmentInput struct { + + // The Amazon Resource Name (ARN) for the cross-account attachment to describe. + // + // This member is required. + AttachmentArn *string + + noSmithyDocumentSerde +} + +type DescribeCrossAccountAttachmentOutput struct { + + // Information about the cross-account attachment. + CrossAccountAttachment *types.Attachment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeCrossAccountAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addDescribeCrossAccountAttachmentResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDescribeCrossAccountAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCrossAccountAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeCrossAccountAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "DescribeCrossAccountAttachment", + } +} + +type opDescribeCrossAccountAttachmentResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeCrossAccountAttachmentResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeCrossAccountAttachmentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "globalaccelerator" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "globalaccelerator" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("globalaccelerator") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeCrossAccountAttachmentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeCrossAccountAttachmentResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/globalaccelerator/api_op_ListCrossAccountAttachments.go b/service/globalaccelerator/api_op_ListCrossAccountAttachments.go new file mode 100644 index 00000000000..6a81bc39f3d --- /dev/null +++ b/service/globalaccelerator/api_op_ListCrossAccountAttachments.go @@ -0,0 +1,359 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the cross-account attachments that have been created in Global Accelerator. +func (c *Client) ListCrossAccountAttachments(ctx context.Context, params *ListCrossAccountAttachmentsInput, optFns ...func(*Options)) (*ListCrossAccountAttachmentsOutput, error) { + if params == nil { + params = &ListCrossAccountAttachmentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCrossAccountAttachments", params, optFns, c.addOperationListCrossAccountAttachmentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCrossAccountAttachmentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCrossAccountAttachmentsInput struct { + + // The number of cross-account attachment objects that you want to return with + // this call. The default value is 10. + MaxResults *int32 + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string + + noSmithyDocumentSerde +} + +type ListCrossAccountAttachmentsOutput struct { + + // Information about the cross-account attachments. + CrossAccountAttachments []types.Attachment + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCrossAccountAttachmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCrossAccountAttachments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCrossAccountAttachments{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListCrossAccountAttachmentsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCrossAccountAttachments(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCrossAccountAttachmentsAPIClient is a client that implements the +// ListCrossAccountAttachments operation. +type ListCrossAccountAttachmentsAPIClient interface { + ListCrossAccountAttachments(context.Context, *ListCrossAccountAttachmentsInput, ...func(*Options)) (*ListCrossAccountAttachmentsOutput, error) +} + +var _ ListCrossAccountAttachmentsAPIClient = (*Client)(nil) + +// ListCrossAccountAttachmentsPaginatorOptions is the paginator options for +// ListCrossAccountAttachments +type ListCrossAccountAttachmentsPaginatorOptions struct { + // The number of cross-account attachment objects that you want to return with + // this call. The default value is 10. + 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 +} + +// ListCrossAccountAttachmentsPaginator is a paginator for +// ListCrossAccountAttachments +type ListCrossAccountAttachmentsPaginator struct { + options ListCrossAccountAttachmentsPaginatorOptions + client ListCrossAccountAttachmentsAPIClient + params *ListCrossAccountAttachmentsInput + nextToken *string + firstPage bool +} + +// NewListCrossAccountAttachmentsPaginator returns a new +// ListCrossAccountAttachmentsPaginator +func NewListCrossAccountAttachmentsPaginator(client ListCrossAccountAttachmentsAPIClient, params *ListCrossAccountAttachmentsInput, optFns ...func(*ListCrossAccountAttachmentsPaginatorOptions)) *ListCrossAccountAttachmentsPaginator { + if params == nil { + params = &ListCrossAccountAttachmentsInput{} + } + + options := ListCrossAccountAttachmentsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCrossAccountAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCrossAccountAttachmentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCrossAccountAttachments page. +func (p *ListCrossAccountAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCrossAccountAttachmentsOutput, 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.ListCrossAccountAttachments(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_opListCrossAccountAttachments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "ListCrossAccountAttachments", + } +} + +type opListCrossAccountAttachmentsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListCrossAccountAttachmentsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListCrossAccountAttachmentsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "globalaccelerator" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "globalaccelerator" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("globalaccelerator") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListCrossAccountAttachmentsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListCrossAccountAttachmentsResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/globalaccelerator/api_op_ListCrossAccountResourceAccounts.go b/service/globalaccelerator/api_op_ListCrossAccountResourceAccounts.go new file mode 100644 index 00000000000..b852956c6f5 --- /dev/null +++ b/service/globalaccelerator/api_op_ListCrossAccountResourceAccounts.go @@ -0,0 +1,252 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the accounts that have cross-account endpoints. +func (c *Client) ListCrossAccountResourceAccounts(ctx context.Context, params *ListCrossAccountResourceAccountsInput, optFns ...func(*Options)) (*ListCrossAccountResourceAccountsOutput, error) { + if params == nil { + params = &ListCrossAccountResourceAccountsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCrossAccountResourceAccounts", params, optFns, c.addOperationListCrossAccountResourceAccountsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCrossAccountResourceAccountsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCrossAccountResourceAccountsInput struct { + noSmithyDocumentSerde +} + +type ListCrossAccountResourceAccountsOutput struct { + + // The account IDs of principals (resource owners) in a cross-account attachment + // who can add endpoints (resources) listed in the same attachment. + ResourceOwnerAwsAccountIds []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCrossAccountResourceAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCrossAccountResourceAccounts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCrossAccountResourceAccounts{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListCrossAccountResourceAccountsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCrossAccountResourceAccounts(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListCrossAccountResourceAccounts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "ListCrossAccountResourceAccounts", + } +} + +type opListCrossAccountResourceAccountsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListCrossAccountResourceAccountsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListCrossAccountResourceAccountsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "globalaccelerator" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "globalaccelerator" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("globalaccelerator") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListCrossAccountResourceAccountsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListCrossAccountResourceAccountsResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/globalaccelerator/api_op_ListCrossAccountResources.go b/service/globalaccelerator/api_op_ListCrossAccountResources.go new file mode 100644 index 00000000000..bfddee6a45c --- /dev/null +++ b/service/globalaccelerator/api_op_ListCrossAccountResources.go @@ -0,0 +1,369 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the cross-account endpoints available to add to an accelerator. +func (c *Client) ListCrossAccountResources(ctx context.Context, params *ListCrossAccountResourcesInput, optFns ...func(*Options)) (*ListCrossAccountResourcesOutput, error) { + if params == nil { + params = &ListCrossAccountResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCrossAccountResources", params, optFns, c.addOperationListCrossAccountResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCrossAccountResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCrossAccountResourcesInput struct { + + // The account ID of a resource owner in a cross-account attachment. + // + // This member is required. + ResourceOwnerAwsAccountId *string + + // The Amazon Resource Name (ARN) of an accelerator in a cross-account attachment. + AcceleratorArn *string + + // The number of cross-account endpoints objects that you want to return with this + // call. The default value is 10. + MaxResults *int32 + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string + + noSmithyDocumentSerde +} + +type ListCrossAccountResourcesOutput struct { + + // The endpoints attached to an accelerator in a cross-account attachment. + CrossAccountResources []types.CrossAccountResource + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCrossAccountResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCrossAccountResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCrossAccountResources{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListCrossAccountResourcesResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpListCrossAccountResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCrossAccountResources(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListCrossAccountResourcesAPIClient is a client that implements the +// ListCrossAccountResources operation. +type ListCrossAccountResourcesAPIClient interface { + ListCrossAccountResources(context.Context, *ListCrossAccountResourcesInput, ...func(*Options)) (*ListCrossAccountResourcesOutput, error) +} + +var _ ListCrossAccountResourcesAPIClient = (*Client)(nil) + +// ListCrossAccountResourcesPaginatorOptions is the paginator options for +// ListCrossAccountResources +type ListCrossAccountResourcesPaginatorOptions struct { + // The number of cross-account endpoints objects that you want to return with this + // call. The default value is 10. + 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 +} + +// ListCrossAccountResourcesPaginator is a paginator for ListCrossAccountResources +type ListCrossAccountResourcesPaginator struct { + options ListCrossAccountResourcesPaginatorOptions + client ListCrossAccountResourcesAPIClient + params *ListCrossAccountResourcesInput + nextToken *string + firstPage bool +} + +// NewListCrossAccountResourcesPaginator returns a new +// ListCrossAccountResourcesPaginator +func NewListCrossAccountResourcesPaginator(client ListCrossAccountResourcesAPIClient, params *ListCrossAccountResourcesInput, optFns ...func(*ListCrossAccountResourcesPaginatorOptions)) *ListCrossAccountResourcesPaginator { + if params == nil { + params = &ListCrossAccountResourcesInput{} + } + + options := ListCrossAccountResourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCrossAccountResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCrossAccountResourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCrossAccountResources page. +func (p *ListCrossAccountResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCrossAccountResourcesOutput, 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.ListCrossAccountResources(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_opListCrossAccountResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "ListCrossAccountResources", + } +} + +type opListCrossAccountResourcesResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListCrossAccountResourcesResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListCrossAccountResourcesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "globalaccelerator" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "globalaccelerator" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("globalaccelerator") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListCrossAccountResourcesResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListCrossAccountResourcesResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/globalaccelerator/api_op_UpdateCrossAccountAttachment.go b/service/globalaccelerator/api_op_UpdateCrossAccountAttachment.go new file mode 100644 index 00000000000..265dcbb1b6c --- /dev/null +++ b/service/globalaccelerator/api_op_UpdateCrossAccountAttachment.go @@ -0,0 +1,305 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/globalaccelerator/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a cross-account attachment to add or remove principals or resources. +// When you update an attachment to remove a principal (account ID or accelerator) +// or a resource, Global Accelerator revokes the permission for specific resources +// by doing the following: +// - If the principal is an account ID, Global Accelerator reviews every +// accelerator in the account and removes cross-account endpoints from all +// accelerators. +// - If the principal is an accelerator, Global Accelerator reviews just that +// accelerator and removes cross-account endpoints from it. +// +// If there are overlapping permissions provided by multiple cross-account +// attachments, Global Accelerator only removes endpoints if there are no current +// cross-account attachments that provide access permission. For example, if you +// delete a cross-account attachment that lists an accelerator as a principal, but +// another cross-account attachment includes the account ID that owns that +// accelerator, endpoints will not be removed from the accelerator. +func (c *Client) UpdateCrossAccountAttachment(ctx context.Context, params *UpdateCrossAccountAttachmentInput, optFns ...func(*Options)) (*UpdateCrossAccountAttachmentOutput, error) { + if params == nil { + params = &UpdateCrossAccountAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCrossAccountAttachment", params, optFns, c.addOperationUpdateCrossAccountAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCrossAccountAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateCrossAccountAttachmentInput struct { + + // The Amazon Resource Name (ARN) of the cross-account attachment to update. + // + // This member is required. + AttachmentArn *string + + // The principals to add to the cross-account attachment. A principal is an + // account or the Amazon Resource Name (ARN) of an accelerator that the attachment + // gives permission to add the resources from another account, listed in the + // attachment. To add more than one principal, separate the account numbers or + // accelerator ARNs, or both, with commas. + AddPrincipals []string + + // The resources to add to the cross-account attachment. A resource listed in a + // cross-account attachment can be added to an accelerator by the principals that + // are listed in the attachment. To add more than one resource, separate the + // resource ARNs with commas. + AddResources []types.Resource + + // The name of the cross-account attachment. + Name *string + + // The principals to remove from the cross-account attachment. A principal is an + // account or the Amazon Resource Name (ARN) of an accelerator that is given + // permission to add the resources from another account, listed in the + // cross-account attachment. To remove more than one principal, separate the + // account numbers or accelerator ARNs, or both, with commas. + RemovePrincipals []string + + // The resources to remove from the cross-account attachment. A resource listed in + // a cross-account attachment can be added to an accelerator fy principals that are + // listed in the cross-account attachment. To remove more than one resource, + // separate the resource ARNs with commas. + RemoveResources []types.Resource + + noSmithyDocumentSerde +} + +type UpdateCrossAccountAttachmentOutput struct { + + // Information about the updated cross-account attachment. + CrossAccountAttachment *types.Attachment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCrossAccountAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateCrossAccountAttachment{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addUpdateCrossAccountAttachmentResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateCrossAccountAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCrossAccountAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCrossAccountAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "globalaccelerator", + OperationName: "UpdateCrossAccountAttachment", + } +} + +type opUpdateCrossAccountAttachmentResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateCrossAccountAttachmentResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateCrossAccountAttachmentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "globalaccelerator" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "globalaccelerator" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("globalaccelerator") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateCrossAccountAttachmentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateCrossAccountAttachmentResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/globalaccelerator/deserializers.go b/service/globalaccelerator/deserializers.go index c2c261f1feb..eb515a18cec 100644 --- a/service/globalaccelerator/deserializers.go +++ b/service/globalaccelerator/deserializers.go @@ -611,6 +611,129 @@ func awsAwsjson11_deserializeOpErrorCreateAccelerator(response *smithyhttp.Respo } } +type awsAwsjson11_deserializeOpCreateCrossAccountAttachment struct { +} + +func (*awsAwsjson11_deserializeOpCreateCrossAccountAttachment) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateCrossAccountAttachment) 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_deserializeOpErrorCreateCrossAccountAttachment(response, &metadata) + } + output := &CreateCrossAccountAttachmentOutput{} + 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_deserializeOpDocumentCreateCrossAccountAttachmentOutput(&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_deserializeOpErrorCreateCrossAccountAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("TransactionInProgressException", errorCode): + return awsAwsjson11_deserializeErrorTransactionInProgressException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateCustomRoutingAccelerator struct { } @@ -1339,6 +1462,107 @@ func awsAwsjson11_deserializeOpErrorDeleteAccelerator(response *smithyhttp.Respo } } +type awsAwsjson11_deserializeOpDeleteCrossAccountAttachment struct { +} + +func (*awsAwsjson11_deserializeOpDeleteCrossAccountAttachment) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteCrossAccountAttachment) 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_deserializeOpErrorDeleteCrossAccountAttachment(response, &metadata) + } + output := &DeleteCrossAccountAttachmentOutput{} + 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_deserializeOpErrorDeleteCrossAccountAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("AttachmentNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAttachmentNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + case strings.EqualFold("TransactionInProgressException", errorCode): + return awsAwsjson11_deserializeErrorTransactionInProgressException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteCustomRoutingAccelerator struct { } @@ -2278,14 +2502,14 @@ func awsAwsjson11_deserializeOpErrorDescribeAcceleratorAttributes(response *smit } } -type awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator struct { +type awsAwsjson11_deserializeOpDescribeCrossAccountAttachment struct { } -func (*awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) ID() string { +func (*awsAwsjson11_deserializeOpDescribeCrossAccountAttachment) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeCrossAccountAttachment) 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) @@ -2299,9 +2523,9 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCrossAccountAttachment(response, &metadata) } - output := &DescribeCustomRoutingAcceleratorOutput{} + output := &DescribeCrossAccountAttachmentOutput{} out.Result = output var buff [1024]byte @@ -2321,7 +2545,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) HandleDeser return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeCrossAccountAttachmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2335,7 +2559,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) HandleDeser return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeCrossAccountAttachment(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)} @@ -2376,8 +2600,11 @@ func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(response *s } switch { - case strings.EqualFold("AcceleratorNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("AttachmentNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAttachmentNotFoundException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -2395,14 +2622,14 @@ func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(response *s } } -type awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes struct { +type awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator struct { } -func (*awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) ID() string { +func (*awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAccelerator) 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) @@ -2416,9 +2643,9 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAcceleratorAttributes(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(response, &metadata) } - output := &DescribeCustomRoutingAcceleratorAttributesOutput{} + output := &DescribeCustomRoutingAcceleratorOutput{} out.Result = output var buff [1024]byte @@ -2438,7 +2665,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) H return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorAttributesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2452,7 +2679,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) H return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAcceleratorAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAccelerator(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)} @@ -2512,14 +2739,14 @@ func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAcceleratorAttributes(r } } -type awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup struct { +type awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes struct { } -func (*awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) ID() string { +func (*awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingAcceleratorAttributes) 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) @@ -2533,9 +2760,9 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAcceleratorAttributes(response, &metadata) } - output := &DescribeCustomRoutingEndpointGroupOutput{} + output := &DescribeCustomRoutingAcceleratorAttributesOutput{} out.Result = output var buff [1024]byte @@ -2555,7 +2782,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) HandleDes return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingEndpointGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorAttributesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2569,7 +2796,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) HandleDes return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingAcceleratorAttributes(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)} @@ -2610,8 +2837,8 @@ func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(response } switch { - case strings.EqualFold("EndpointGroupNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) + case strings.EqualFold("AcceleratorNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -2629,14 +2856,14 @@ func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(response } } -type awsAwsjson11_deserializeOpDescribeCustomRoutingListener struct { +type awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup struct { } -func (*awsAwsjson11_deserializeOpDescribeCustomRoutingListener) ID() string { +func (*awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingEndpointGroup) 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) @@ -2650,9 +2877,9 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingListener) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(response, &metadata) } - output := &DescribeCustomRoutingListenerOutput{} + output := &DescribeCustomRoutingEndpointGroupOutput{} out.Result = output var buff [1024]byte @@ -2672,7 +2899,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingListener) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingListenerOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingEndpointGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2686,7 +2913,7 @@ func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingListener) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingEndpointGroup(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)} @@ -2727,15 +2954,15 @@ func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(response *smit } switch { + case strings.EqualFold("EndpointGroupNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) + case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) - case strings.EqualFold("ListenerNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2746,14 +2973,14 @@ func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(response *smit } } -type awsAwsjson11_deserializeOpDescribeEndpointGroup struct { +type awsAwsjson11_deserializeOpDescribeCustomRoutingListener struct { } -func (*awsAwsjson11_deserializeOpDescribeEndpointGroup) ID() string { +func (*awsAwsjson11_deserializeOpDescribeCustomRoutingListener) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeCustomRoutingListener) 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) @@ -2767,9 +2994,9 @@ func (m *awsAwsjson11_deserializeOpDescribeEndpointGroup) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(response, &metadata) } - output := &DescribeEndpointGroupOutput{} + output := &DescribeCustomRoutingListenerOutput{} out.Result = output var buff [1024]byte @@ -2789,7 +3016,7 @@ func (m *awsAwsjson11_deserializeOpDescribeEndpointGroup) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeEndpointGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingListenerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2803,7 +3030,7 @@ func (m *awsAwsjson11_deserializeOpDescribeEndpointGroup) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeCustomRoutingListener(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)} @@ -2844,15 +3071,15 @@ func awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(response *smithyhttp.R } switch { - case strings.EqualFold("EndpointGroupNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) - case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + case strings.EqualFold("ListenerNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2863,14 +3090,14 @@ func awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpDescribeListener struct { +type awsAwsjson11_deserializeOpDescribeEndpointGroup struct { } -func (*awsAwsjson11_deserializeOpDescribeListener) ID() string { +func (*awsAwsjson11_deserializeOpDescribeEndpointGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeListener) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeEndpointGroup) 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) @@ -2884,9 +3111,9 @@ func (m *awsAwsjson11_deserializeOpDescribeListener) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeListener(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(response, &metadata) } - output := &DescribeListenerOutput{} + output := &DescribeEndpointGroupOutput{} out.Result = output var buff [1024]byte @@ -2906,7 +3133,7 @@ func (m *awsAwsjson11_deserializeOpDescribeListener) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeListenerOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeEndpointGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2920,7 +3147,7 @@ func (m *awsAwsjson11_deserializeOpDescribeListener) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeListener(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeEndpointGroup(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)} @@ -2961,15 +3188,15 @@ func awsAwsjson11_deserializeOpErrorDescribeListener(response *smithyhttp.Respon } switch { + case strings.EqualFold("EndpointGroupNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) + case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) - case strings.EqualFold("ListenerNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2980,14 +3207,14 @@ func awsAwsjson11_deserializeOpErrorDescribeListener(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpListAccelerators struct { +type awsAwsjson11_deserializeOpDescribeListener struct { } -func (*awsAwsjson11_deserializeOpListAccelerators) ID() string { +func (*awsAwsjson11_deserializeOpDescribeListener) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAccelerators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeListener) 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) @@ -3001,9 +3228,9 @@ func (m *awsAwsjson11_deserializeOpListAccelerators) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAccelerators(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeListener(response, &metadata) } - output := &ListAcceleratorsOutput{} + output := &DescribeListenerOutput{} out.Result = output var buff [1024]byte @@ -3023,7 +3250,7 @@ func (m *awsAwsjson11_deserializeOpListAccelerators) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAcceleratorsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeListenerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3037,7 +3264,7 @@ func (m *awsAwsjson11_deserializeOpListAccelerators) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAccelerators(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeListener(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)} @@ -3084,8 +3311,8 @@ func awsAwsjson11_deserializeOpErrorListAccelerators(response *smithyhttp.Respon case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + case strings.EqualFold("ListenerNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3097,14 +3324,14 @@ func awsAwsjson11_deserializeOpErrorListAccelerators(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpListByoipCidrs struct { +type awsAwsjson11_deserializeOpListAccelerators struct { } -func (*awsAwsjson11_deserializeOpListByoipCidrs) ID() string { +func (*awsAwsjson11_deserializeOpListAccelerators) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListByoipCidrs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAccelerators) 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) @@ -3118,9 +3345,9 @@ func (m *awsAwsjson11_deserializeOpListByoipCidrs) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListByoipCidrs(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAccelerators(response, &metadata) } - output := &ListByoipCidrsOutput{} + output := &ListAcceleratorsOutput{} out.Result = output var buff [1024]byte @@ -3140,7 +3367,7 @@ func (m *awsAwsjson11_deserializeOpListByoipCidrs) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListByoipCidrsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAcceleratorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3154,7 +3381,7 @@ func (m *awsAwsjson11_deserializeOpListByoipCidrs) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListByoipCidrs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAccelerators(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)} @@ -3195,9 +3422,6 @@ func awsAwsjson11_deserializeOpErrorListByoipCidrs(response *smithyhttp.Response } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -3217,14 +3441,14 @@ func awsAwsjson11_deserializeOpErrorListByoipCidrs(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpListCustomRoutingAccelerators struct { +type awsAwsjson11_deserializeOpListByoipCidrs struct { } -func (*awsAwsjson11_deserializeOpListCustomRoutingAccelerators) ID() string { +func (*awsAwsjson11_deserializeOpListByoipCidrs) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCustomRoutingAccelerators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListByoipCidrs) 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) @@ -3238,9 +3462,9 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingAccelerators) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListByoipCidrs(response, &metadata) } - output := &ListCustomRoutingAcceleratorsOutput{} + output := &ListByoipCidrsOutput{} out.Result = output var buff [1024]byte @@ -3260,7 +3484,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingAccelerators) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCustomRoutingAcceleratorsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListByoipCidrsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3274,7 +3498,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingAccelerators) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListByoipCidrs(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)} @@ -3315,6 +3539,9 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(response *smit } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -3334,14 +3561,14 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(response *smit } } -type awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups struct { +type awsAwsjson11_deserializeOpListCrossAccountAttachments struct { } -func (*awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) ID() string { +func (*awsAwsjson11_deserializeOpListCrossAccountAttachments) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCrossAccountAttachments) 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) @@ -3355,9 +3582,9 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCrossAccountAttachments(response, &metadata) } - output := &ListCustomRoutingEndpointGroupsOutput{} + output := &ListCrossAccountAttachmentsOutput{} out.Result = output var buff [1024]byte @@ -3377,7 +3604,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCustomRoutingEndpointGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCrossAccountAttachmentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3391,7 +3618,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCrossAccountAttachments(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)} @@ -3432,6 +3659,9 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response *sm } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -3441,9 +3671,6 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response *sm case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - case strings.EqualFold("ListenerNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3454,14 +3681,14 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response *sm } } -type awsAwsjson11_deserializeOpListCustomRoutingListeners struct { +type awsAwsjson11_deserializeOpListCrossAccountResourceAccounts struct { } -func (*awsAwsjson11_deserializeOpListCustomRoutingListeners) ID() string { +func (*awsAwsjson11_deserializeOpListCrossAccountResourceAccounts) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCustomRoutingListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCrossAccountResourceAccounts) 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) @@ -3475,9 +3702,9 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingListeners) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCrossAccountResourceAccounts(response, &metadata) } - output := &ListCustomRoutingListenersOutput{} + output := &ListCrossAccountResourceAccountsOutput{} out.Result = output var buff [1024]byte @@ -3497,7 +3724,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingListeners) HandleDeserialize return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCustomRoutingListenersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCrossAccountResourceAccountsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3511,7 +3738,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingListeners) HandleDeserialize return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCrossAccountResourceAccounts(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)} @@ -3552,18 +3779,12 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(response *smithyh } switch { - case strings.EqualFold("AcceleratorNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) - case strings.EqualFold("InvalidArgumentException", errorCode): - return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3574,14 +3795,14 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(response *smithyh } } -type awsAwsjson11_deserializeOpListCustomRoutingPortMappings struct { +type awsAwsjson11_deserializeOpListCrossAccountResources struct { } -func (*awsAwsjson11_deserializeOpListCustomRoutingPortMappings) ID() string { +func (*awsAwsjson11_deserializeOpListCrossAccountResources) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCrossAccountResources) 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) @@ -3595,9 +3816,9 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappings) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappings(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCrossAccountResources(response, &metadata) } - output := &ListCustomRoutingPortMappingsOutput{} + output := &ListCrossAccountResourcesOutput{} out.Result = output var buff [1024]byte @@ -3617,7 +3838,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappings) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCrossAccountResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3631,7 +3852,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappings) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCrossAccountResources(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)} @@ -3675,8 +3896,8 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappings(response *smit case strings.EqualFold("AcceleratorNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) - case strings.EqualFold("EndpointGroupNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -3697,14 +3918,14 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappings(response *smit } } -type awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination struct { +type awsAwsjson11_deserializeOpListCustomRoutingAccelerators struct { } -func (*awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) ID() string { +func (*awsAwsjson11_deserializeOpListCustomRoutingAccelerators) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCustomRoutingAccelerators) 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) @@ -3718,9 +3939,9 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(response, &metadata) } - output := &ListCustomRoutingPortMappingsByDestinationOutput{} + output := &ListCustomRoutingAcceleratorsOutput{} out.Result = output var buff [1024]byte @@ -3740,7 +3961,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) H return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsByDestinationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCustomRoutingAcceleratorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3754,7 +3975,7 @@ func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) H return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCustomRoutingAccelerators(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)} @@ -3795,9 +4016,6 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(r } switch { - case strings.EqualFold("EndpointNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEndpointNotFoundException(response, errorBody) - case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -3817,14 +4035,14 @@ func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(r } } -type awsAwsjson11_deserializeOpListEndpointGroups struct { +type awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups struct { } -func (*awsAwsjson11_deserializeOpListEndpointGroups) ID() string { +func (*awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListEndpointGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCustomRoutingEndpointGroups) 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) @@ -3838,9 +4056,9 @@ func (m *awsAwsjson11_deserializeOpListEndpointGroups) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListEndpointGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(response, &metadata) } - output := &ListEndpointGroupsOutput{} + output := &ListCustomRoutingEndpointGroupsOutput{} out.Result = output var buff [1024]byte @@ -3860,7 +4078,7 @@ func (m *awsAwsjson11_deserializeOpListEndpointGroups) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListEndpointGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCustomRoutingEndpointGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3874,7 +4092,7 @@ func (m *awsAwsjson11_deserializeOpListEndpointGroups) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListEndpointGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCustomRoutingEndpointGroups(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)} @@ -3937,14 +4155,14 @@ func awsAwsjson11_deserializeOpErrorListEndpointGroups(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpListListeners struct { +type awsAwsjson11_deserializeOpListCustomRoutingListeners struct { } -func (*awsAwsjson11_deserializeOpListListeners) ID() string { +func (*awsAwsjson11_deserializeOpListCustomRoutingListeners) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListListeners) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCustomRoutingListeners) 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) @@ -3958,9 +4176,9 @@ func (m *awsAwsjson11_deserializeOpListListeners) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListListeners(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(response, &metadata) } - output := &ListListenersOutput{} + output := &ListCustomRoutingListenersOutput{} out.Result = output var buff [1024]byte @@ -3980,7 +4198,7 @@ func (m *awsAwsjson11_deserializeOpListListeners) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListListenersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCustomRoutingListenersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3994,7 +4212,7 @@ func (m *awsAwsjson11_deserializeOpListListeners) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCustomRoutingListeners(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)} @@ -4057,14 +4275,14 @@ func awsAwsjson11_deserializeOpErrorListListeners(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpListCustomRoutingPortMappings struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpListCustomRoutingPortMappings) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappings) 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) @@ -4078,9 +4296,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_deserializeOpErrorListCustomRoutingPortMappings(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListCustomRoutingPortMappingsOutput{} out.Result = output var buff [1024]byte @@ -4100,7 +4318,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4114,7 +4332,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappings(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)} @@ -4158,12 +4376,18 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("AcceleratorNotFoundException", errorCode): return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) + case strings.EqualFold("EndpointGroupNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEndpointGroupNotFoundException(response, errorBody) + case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4174,14 +4398,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpProvisionByoipCidr struct { +type awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination struct { } -func (*awsAwsjson11_deserializeOpProvisionByoipCidr) ID() string { +func (*awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCustomRoutingPortMappingsByDestination) 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) @@ -4195,9 +4419,9 @@ func (m *awsAwsjson11_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorProvisionByoipCidr(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(response, &metadata) } - output := &ProvisionByoipCidrOutput{} + output := &ListCustomRoutingPortMappingsByDestinationOutput{} out.Result = output var buff [1024]byte @@ -4217,7 +4441,7 @@ func (m *awsAwsjson11_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentProvisionByoipCidrOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCustomRoutingPortMappingsByDestinationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4231,7 +4455,7 @@ func (m *awsAwsjson11_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCustomRoutingPortMappingsByDestination(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)} @@ -4272,11 +4496,8 @@ func awsAwsjson11_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Resp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("IncorrectCidrStateException", errorCode): - return awsAwsjson11_deserializeErrorIncorrectCidrStateException(response, errorBody) + case strings.EqualFold("EndpointNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEndpointNotFoundException(response, errorBody) case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) @@ -4284,8 +4505,8 @@ func awsAwsjson11_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Resp case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4297,14 +4518,14 @@ func awsAwsjson11_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints struct { +type awsAwsjson11_deserializeOpListEndpointGroups struct { } -func (*awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints) ID() string { +func (*awsAwsjson11_deserializeOpListEndpointGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListEndpointGroups) 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) @@ -4318,17 +4539,497 @@ func (m *awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRemoveCustomRoutingEndpoints(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListEndpointGroups(response, &metadata) } - output := &RemoveCustomRoutingEndpointsOutput{} + output := &ListEndpointGroupsOutput{} 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_deserializeOpDocumentListEndpointGroupsOutput(&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_deserializeOpErrorListEndpointGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("ListenerNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorListenerNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListListeners struct { +} + +func (*awsAwsjson11_deserializeOpListListeners) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListListeners) 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_deserializeOpErrorListListeners(response, &metadata) + } + output := &ListListenersOutput{} + 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_deserializeOpDocumentListListenersOutput(&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_deserializeOpErrorListListeners(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AcceleratorNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +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) + 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_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 = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&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_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 + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AcceleratorNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpProvisionByoipCidr struct { +} + +func (*awsAwsjson11_deserializeOpProvisionByoipCidr) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpProvisionByoipCidr) 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_deserializeOpErrorProvisionByoipCidr(response, &metadata) + } + output := &ProvisionByoipCidrOutput{} + 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_deserializeOpDocumentProvisionByoipCidrOutput(&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_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("IncorrectCidrStateException", errorCode): + return awsAwsjson11_deserializeErrorIncorrectCidrStateException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints struct { +} + +func (*awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRemoveCustomRoutingEndpoints) 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_deserializeOpErrorRemoveCustomRoutingEndpoints(response, &metadata) + } + output := &RemoveCustomRoutingEndpointsOutput{} + 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 } @@ -4779,7 +5480,127 @@ func (m *awsAwsjson11_deserializeOpUpdateAccelerator) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateAcceleratorOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateAcceleratorOutput(&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_deserializeOpErrorUpdateAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AcceleratorNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) + + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceErrorException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) + + case strings.EqualFold("InvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateAcceleratorAttributes struct { +} + +func (*awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) 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_deserializeOpErrorUpdateAcceleratorAttributes(response, &metadata) + } + output := &UpdateAcceleratorAttributesOutput{} + 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_deserializeOpDocumentUpdateAcceleratorAttributesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4793,7 +5614,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAccelerator) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateAccelerator(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateAcceleratorAttributes(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)} @@ -4856,14 +5677,14 @@ func awsAwsjson11_deserializeOpErrorUpdateAccelerator(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpUpdateAcceleratorAttributes struct { +type awsAwsjson11_deserializeOpUpdateCrossAccountAttachment struct { } -func (*awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) ID() string { +func (*awsAwsjson11_deserializeOpUpdateCrossAccountAttachment) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateCrossAccountAttachment) 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) @@ -4877,9 +5698,9 @@ func (m *awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAcceleratorAttributes(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateCrossAccountAttachment(response, &metadata) } - output := &UpdateAcceleratorAttributesOutput{} + output := &UpdateCrossAccountAttachmentOutput{} out.Result = output var buff [1024]byte @@ -4899,7 +5720,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateAcceleratorAttributesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateCrossAccountAttachmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4913,7 +5734,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAcceleratorAttributes) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateAcceleratorAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateCrossAccountAttachment(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)} @@ -4954,18 +5775,24 @@ func awsAwsjson11_deserializeOpErrorUpdateAcceleratorAttributes(response *smithy } switch { - case strings.EqualFold("AcceleratorNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAcceleratorNotFoundException(response, errorBody) - case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("AttachmentNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAttachmentNotFoundException(response, errorBody) + case strings.EqualFold("InternalServiceErrorException", errorCode): return awsAwsjson11_deserializeErrorInternalServiceErrorException(response, errorBody) case strings.EqualFold("InvalidArgumentException", errorCode): return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("TransactionInProgressException", errorCode): + return awsAwsjson11_deserializeErrorTransactionInProgressException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5880,6 +6707,41 @@ func awsAwsjson11_deserializeErrorAssociatedListenerFoundException(response *smi return output } +func awsAwsjson11_deserializeErrorAttachmentNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + 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 + } + + output := &types.AttachmentNotFoundException{} + err := awsAwsjson11_deserializeDocumentAttachmentNotFoundException(&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 awsAwsjson11_deserializeErrorByoipCidrNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -6754,21 +7616,232 @@ func awsAwsjson11_deserializeDocumentAccelerators(v *[]types.Accelerator, value cv = *v } - for _, value := range shape { - var col types.Accelerator - destAddr := &col - if err := awsAwsjson11_deserializeDocumentAccelerator(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for _, value := range shape { + var col types.Accelerator + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAccelerator(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_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 ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAssociatedEndpointGroupFoundException(v **types.AssociatedEndpointGroupFoundException, 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.AssociatedEndpointGroupFoundException + if *v == nil { + sv = &types.AssociatedEndpointGroupFoundException{} + } 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: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAssociatedListenerFoundException(v **types.AssociatedListenerFoundException, 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.AssociatedListenerFoundException + if *v == nil { + sv = &types.AssociatedListenerFoundException{} + } 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: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAttachment(v **types.Attachment, 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.Attachment + if *v == nil { + sv = &types.Attachment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AttachmentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AttachmentArn = ptr.String(jtv) + } + + case "CreatedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = 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 AttachmentName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Principals": + if err := awsAwsjson11_deserializeDocumentPrincipals(&sv.Principals, value); err != nil { + return err + } + + case "Resources": + if err := awsAwsjson11_deserializeDocumentResources(&sv.Resources, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsAwsjson11_deserializeDocumentAttachmentNotFoundException(v **types.AttachmentNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6781,9 +7854,9 @@ func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.AttachmentNotFoundException if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.AttachmentNotFoundException{} } else { sv = *v } @@ -6808,7 +7881,7 @@ func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsAwsjson11_deserializeDocumentAssociatedEndpointGroupFoundException(v **types.AssociatedEndpointGroupFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentAttachments(v *[]types.Attachment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6816,39 +7889,33 @@ func awsAwsjson11_deserializeDocumentAssociatedEndpointGroupFoundException(v **t return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssociatedEndpointGroupFoundException + var cv []types.Attachment if *v == nil { - sv = &types.AssociatedEndpointGroupFoundException{} + cv = []types.Attachment{} } else { - sv = *v + cv = *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: - _, _ = key, value - + for _, value := range shape { + var col types.Attachment + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAttachment(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentAssociatedListenerFoundException(v **types.AssociatedListenerFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentAwsAccountIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6856,35 +7923,31 @@ func awsAwsjson11_deserializeDocumentAssociatedListenerFoundException(v **types. return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AssociatedListenerFoundException + var cv []string if *v == nil { - sv = &types.AssociatedListenerFoundException{} + cv = []string{} } else { - sv = *v + cv = *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) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -7146,6 +8209,89 @@ func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsAwsjson11_deserializeDocumentCrossAccountResource(v **types.CrossAccountResource, 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.CrossAccountResource + if *v == nil { + sv = &types.CrossAccountResource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AttachmentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AttachmentArn = ptr.String(jtv) + } + + case "EndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EndpointId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentCrossAccountResources(v *[]types.CrossAccountResource, 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.CrossAccountResource + if *v == nil { + cv = []types.CrossAccountResource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CrossAccountResource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentCrossAccountResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentCustomRoutingAccelerator(v **types.CustomRoutingAccelerator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9089,7 +10235,113 @@ func awsAwsjson11_deserializeDocumentPortRange(v **types.PortRange, value interf return nil } -func awsAwsjson11_deserializeDocumentPortRanges(v *[]types.PortRange, value interface{}) error { +func awsAwsjson11_deserializeDocumentPortRanges(v *[]types.PortRange, 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.PortRange + if *v == nil { + cv = []types.PortRange{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PortRange + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPortRange(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPrincipals(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 Principal to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentProtocols(v *[]types.Protocol, 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.Protocol + if *v == nil { + cv = []types.Protocol{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Protocol + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Protocol to be of type string, got %T instead", value) + } + col = types.Protocol(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResource(v **types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9097,33 +10349,48 @@ func awsAwsjson11_deserializeDocumentPortRanges(v *[]types.PortRange, value inte return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PortRange + var sv *types.Resource if *v == nil { - cv = []types.PortRange{} + sv = &types.Resource{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.PortRange - destAddr := &col - if err := awsAwsjson11_deserializeDocumentPortRange(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "EndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EndpointId = ptr.String(jtv) + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentProtocols(v *[]types.Protocol, value interface{}) error { +func awsAwsjson11_deserializeDocumentResources(v *[]types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9136,22 +10403,20 @@ func awsAwsjson11_deserializeDocumentProtocols(v *[]types.Protocol, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Protocol + var cv []types.Resource if *v == nil { - cv = []types.Protocol{} + cv = []types.Resource{} } else { cv = *v } for _, value := range shape { - var col types.Protocol - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Protocol to be of type string, got %T instead", value) - } - col = types.Protocol(jtv) + var col types.Resource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResource(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -9531,6 +10796,42 @@ func awsAwsjson11_deserializeOpDocumentCreateAcceleratorOutput(v **CreateAcceler return nil } +func awsAwsjson11_deserializeOpDocumentCreateCrossAccountAttachmentOutput(v **CreateCrossAccountAttachmentOutput, 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 *CreateCrossAccountAttachmentOutput + if *v == nil { + sv = &CreateCrossAccountAttachmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CrossAccountAttachment": + if err := awsAwsjson11_deserializeDocumentAttachment(&sv.CrossAccountAttachment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateCustomRoutingAcceleratorOutput(v **CreateCustomRoutingAcceleratorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9819,6 +11120,42 @@ func awsAwsjson11_deserializeOpDocumentDescribeAcceleratorOutput(v **DescribeAcc return nil } +func awsAwsjson11_deserializeOpDocumentDescribeCrossAccountAttachmentOutput(v **DescribeCrossAccountAttachmentOutput, 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 *DescribeCrossAccountAttachmentOutput + if *v == nil { + sv = &DescribeCrossAccountAttachmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CrossAccountAttachment": + if err := awsAwsjson11_deserializeDocumentAttachment(&sv.CrossAccountAttachment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeCustomRoutingAcceleratorAttributesOutput(v **DescribeCustomRoutingAcceleratorAttributesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10125,6 +11462,132 @@ func awsAwsjson11_deserializeOpDocumentListByoipCidrsOutput(v **ListByoipCidrsOu return nil } +func awsAwsjson11_deserializeOpDocumentListCrossAccountAttachmentsOutput(v **ListCrossAccountAttachmentsOutput, 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 *ListCrossAccountAttachmentsOutput + if *v == nil { + sv = &ListCrossAccountAttachmentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CrossAccountAttachments": + if err := awsAwsjson11_deserializeDocumentAttachments(&sv.CrossAccountAttachments, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListCrossAccountResourceAccountsOutput(v **ListCrossAccountResourceAccountsOutput, 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 *ListCrossAccountResourceAccountsOutput + if *v == nil { + sv = &ListCrossAccountResourceAccountsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResourceOwnerAwsAccountIds": + if err := awsAwsjson11_deserializeDocumentAwsAccountIds(&sv.ResourceOwnerAwsAccountIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListCrossAccountResourcesOutput(v **ListCrossAccountResourcesOutput, 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 *ListCrossAccountResourcesOutput + if *v == nil { + sv = &ListCrossAccountResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CrossAccountResources": + if err := awsAwsjson11_deserializeDocumentCrossAccountResources(&sv.CrossAccountResources, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListCustomRoutingAcceleratorsOutput(v **ListCustomRoutingAcceleratorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10646,6 +12109,42 @@ func awsAwsjson11_deserializeOpDocumentUpdateAcceleratorOutput(v **UpdateAcceler return nil } +func awsAwsjson11_deserializeOpDocumentUpdateCrossAccountAttachmentOutput(v **UpdateCrossAccountAttachmentOutput, 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 *UpdateCrossAccountAttachmentOutput + if *v == nil { + sv = &UpdateCrossAccountAttachmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CrossAccountAttachment": + if err := awsAwsjson11_deserializeDocumentAttachment(&sv.CrossAccountAttachment, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateCustomRoutingAcceleratorAttributesOutput(v **UpdateCustomRoutingAcceleratorAttributesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/globalaccelerator/doc.go b/service/globalaccelerator/doc.go index f4c0944d06b..c9c0432ccbe 100644 --- a/service/globalaccelerator/doc.go +++ b/service/globalaccelerator/doc.go @@ -29,8 +29,8 @@ // addresses: two static IPv4 addresses and two static IPv6 addresses. With a // standard accelerator for IPv4, instead of using the addresses that Global // Accelerator provides, you can configure these entry points to be IPv4 addresses -// from your own IP address ranges that you bring toGlobal Accelerator (BYOIP). For -// a standard accelerator, they distribute incoming application traffic across +// from your own IP address ranges that you bring to Global Accelerator (BYOIP). +// For a standard accelerator, they distribute incoming application traffic across // multiple endpoint resources in multiple Amazon Web Services Regions , which // increases the availability of your applications. Endpoints for standard // accelerators can be Network Load Balancers, Application Load Balancers, Amazon diff --git a/service/globalaccelerator/endpoints.go b/service/globalaccelerator/endpoints.go index 00b1a3ea74b..bb65fb5953c 100644 --- a/service/globalaccelerator/endpoints.go +++ b/service/globalaccelerator/endpoints.go @@ -430,7 +430,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://globalaccelerator-fips.") diff --git a/service/globalaccelerator/generated.json b/service/globalaccelerator/generated.json index 25b09b4d3af..c8410e99de6 100644 --- a/service/globalaccelerator/generated.json +++ b/service/globalaccelerator/generated.json @@ -14,12 +14,14 @@ "api_op_AdvertiseByoipCidr.go", "api_op_AllowCustomRoutingTraffic.go", "api_op_CreateAccelerator.go", + "api_op_CreateCrossAccountAttachment.go", "api_op_CreateCustomRoutingAccelerator.go", "api_op_CreateCustomRoutingEndpointGroup.go", "api_op_CreateCustomRoutingListener.go", "api_op_CreateEndpointGroup.go", "api_op_CreateListener.go", "api_op_DeleteAccelerator.go", + "api_op_DeleteCrossAccountAttachment.go", "api_op_DeleteCustomRoutingAccelerator.go", "api_op_DeleteCustomRoutingEndpointGroup.go", "api_op_DeleteCustomRoutingListener.go", @@ -29,6 +31,7 @@ "api_op_DeprovisionByoipCidr.go", "api_op_DescribeAccelerator.go", "api_op_DescribeAcceleratorAttributes.go", + "api_op_DescribeCrossAccountAttachment.go", "api_op_DescribeCustomRoutingAccelerator.go", "api_op_DescribeCustomRoutingAcceleratorAttributes.go", "api_op_DescribeCustomRoutingEndpointGroup.go", @@ -37,6 +40,9 @@ "api_op_DescribeListener.go", "api_op_ListAccelerators.go", "api_op_ListByoipCidrs.go", + "api_op_ListCrossAccountAttachments.go", + "api_op_ListCrossAccountResourceAccounts.go", + "api_op_ListCrossAccountResources.go", "api_op_ListCustomRoutingAccelerators.go", "api_op_ListCustomRoutingEndpointGroups.go", "api_op_ListCustomRoutingListeners.go", @@ -52,6 +58,7 @@ "api_op_UntagResource.go", "api_op_UpdateAccelerator.go", "api_op_UpdateAcceleratorAttributes.go", + "api_op_UpdateCrossAccountAttachment.go", "api_op_UpdateCustomRoutingAccelerator.go", "api_op_UpdateCustomRoutingAcceleratorAttributes.go", "api_op_UpdateCustomRoutingListener.go", diff --git a/service/globalaccelerator/serializers.go b/service/globalaccelerator/serializers.go index 863dfbc3515..5a8ae17869e 100644 --- a/service/globalaccelerator/serializers.go +++ b/service/globalaccelerator/serializers.go @@ -291,6 +291,61 @@ func (m *awsAwsjson11_serializeOpCreateAccelerator) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateCrossAccountAttachment struct { +} + +func (*awsAwsjson11_serializeOpCreateCrossAccountAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateCrossAccountAttachment) 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.(*CreateCrossAccountAttachmentInput) + _ = 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("GlobalAccelerator_V20180706.CreateCrossAccountAttachment") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateCrossAccountAttachmentInput(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_serializeOpCreateCustomRoutingAccelerator struct { } @@ -621,6 +676,61 @@ func (m *awsAwsjson11_serializeOpDeleteAccelerator) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteCrossAccountAttachment struct { +} + +func (*awsAwsjson11_serializeOpDeleteCrossAccountAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteCrossAccountAttachment) 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.(*DeleteCrossAccountAttachmentInput) + _ = 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("GlobalAccelerator_V20180706.DeleteCrossAccountAttachment") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteCrossAccountAttachmentInput(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_serializeOpDeleteCustomRoutingAccelerator struct { } @@ -1116,6 +1226,61 @@ func (m *awsAwsjson11_serializeOpDescribeAcceleratorAttributes) HandleSerialize( return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeCrossAccountAttachment struct { +} + +func (*awsAwsjson11_serializeOpDescribeCrossAccountAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeCrossAccountAttachment) 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.(*DescribeCrossAccountAttachmentInput) + _ = 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("GlobalAccelerator_V20180706.DescribeCrossAccountAttachment") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeCrossAccountAttachmentInput(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_serializeOpDescribeCustomRoutingAccelerator struct { } @@ -1556,6 +1721,171 @@ func (m *awsAwsjson11_serializeOpListByoipCidrs) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListCrossAccountAttachments struct { +} + +func (*awsAwsjson11_serializeOpListCrossAccountAttachments) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListCrossAccountAttachments) 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.(*ListCrossAccountAttachmentsInput) + _ = 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("GlobalAccelerator_V20180706.ListCrossAccountAttachments") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListCrossAccountAttachmentsInput(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_serializeOpListCrossAccountResourceAccounts struct { +} + +func (*awsAwsjson11_serializeOpListCrossAccountResourceAccounts) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListCrossAccountResourceAccounts) 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.(*ListCrossAccountResourceAccountsInput) + _ = 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("GlobalAccelerator_V20180706.ListCrossAccountResourceAccounts") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListCrossAccountResourceAccountsInput(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_serializeOpListCrossAccountResources struct { +} + +func (*awsAwsjson11_serializeOpListCrossAccountResources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListCrossAccountResources) 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.(*ListCrossAccountResourcesInput) + _ = 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("GlobalAccelerator_V20180706.ListCrossAccountResources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListCrossAccountResourcesInput(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_serializeOpListCustomRoutingAccelerators struct { } @@ -2381,6 +2711,61 @@ func (m *awsAwsjson11_serializeOpUpdateAcceleratorAttributes) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateCrossAccountAttachment struct { +} + +func (*awsAwsjson11_serializeOpUpdateCrossAccountAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateCrossAccountAttachment) 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.(*UpdateCrossAccountAttachmentInput) + _ = 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("GlobalAccelerator_V20180706.UpdateCrossAccountAttachment") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateCrossAccountAttachmentInput(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_serializeOpUpdateCustomRoutingAccelerator struct { } @@ -2768,6 +3153,11 @@ func awsAwsjson11_serializeDocumentCustomRoutingEndpointConfiguration(v *types.C object := value.Object() defer object.Close() + if v.AttachmentArn != nil { + ok := object.Key("AttachmentArn") + ok.String(*v.AttachmentArn) + } + if v.EndpointId != nil { ok := object.Key("EndpointId") ok.String(*v.EndpointId) @@ -2826,6 +3216,11 @@ func awsAwsjson11_serializeDocumentEndpointConfiguration(v *types.EndpointConfig object := value.Object() defer object.Close() + if v.AttachmentArn != nil { + ok := object.Key("AttachmentArn") + ok.String(*v.AttachmentArn) + } + if v.ClientIPPreservationEnabled != nil { ok := object.Key("ClientIPPreservationEnabled") ok.Boolean(*v.ClientIPPreservationEnabled) @@ -2969,6 +3364,47 @@ func awsAwsjson11_serializeDocumentPortRanges(v []types.PortRange, value smithyj return nil } +func awsAwsjson11_serializeDocumentPrincipals(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_serializeDocumentResource(v *types.Resource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndpointId != nil { + ok := object.Key("EndpointId") + ok.String(*v.EndpointId) + } + + if v.Region != nil { + ok := object.Key("Region") + ok.String(*v.Region) + } + + return nil +} + +func awsAwsjson11_serializeDocumentResources(v []types.Resource, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentResource(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3137,6 +3573,44 @@ func awsAwsjson11_serializeOpDocumentCreateAcceleratorInput(v *CreateAccelerator return nil } +func awsAwsjson11_serializeOpDocumentCreateCrossAccountAttachmentInput(v *CreateCrossAccountAttachmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IdempotencyToken != nil { + ok := object.Key("IdempotencyToken") + ok.String(*v.IdempotencyToken) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Principals != nil { + ok := object.Key("Principals") + if err := awsAwsjson11_serializeDocumentPrincipals(v.Principals, ok); err != nil { + return err + } + } + + if v.Resources != nil { + ok := object.Key("Resources") + if err := awsAwsjson11_serializeDocumentResources(v.Resources, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateCustomRoutingAcceleratorInput(v *CreateCustomRoutingAcceleratorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3356,6 +3830,18 @@ func awsAwsjson11_serializeOpDocumentDeleteAcceleratorInput(v *DeleteAccelerator return nil } +func awsAwsjson11_serializeOpDocumentDeleteCrossAccountAttachmentInput(v *DeleteCrossAccountAttachmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttachmentArn != nil { + ok := object.Key("AttachmentArn") + ok.String(*v.AttachmentArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteCustomRoutingAcceleratorInput(v *DeleteCustomRoutingAcceleratorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3488,6 +3974,18 @@ func awsAwsjson11_serializeOpDocumentDescribeAcceleratorInput(v *DescribeAcceler return nil } +func awsAwsjson11_serializeOpDocumentDescribeCrossAccountAttachmentInput(v *DescribeCrossAccountAttachmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttachmentArn != nil { + ok := object.Key("AttachmentArn") + ok.String(*v.AttachmentArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeCustomRoutingAcceleratorAttributesInput(v *DescribeCustomRoutingAcceleratorAttributesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3594,6 +4092,57 @@ func awsAwsjson11_serializeOpDocumentListByoipCidrsInput(v *ListByoipCidrsInput, return nil } +func awsAwsjson11_serializeOpDocumentListCrossAccountAttachmentsInput(v *ListCrossAccountAttachmentsInput, 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_serializeOpDocumentListCrossAccountResourceAccountsInput(v *ListCrossAccountResourceAccountsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsAwsjson11_serializeOpDocumentListCrossAccountResourcesInput(v *ListCrossAccountResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AcceleratorArn != nil { + ok := object.Key("AcceleratorArn") + ok.String(*v.AcceleratorArn) + } + + 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.ResourceOwnerAwsAccountId != nil { + ok := object.Key("ResourceOwnerAwsAccountId") + ok.String(*v.ResourceOwnerAwsAccountId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListCustomRoutingAcceleratorsInput(v *ListCustomRoutingAcceleratorsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3914,6 +4463,51 @@ func awsAwsjson11_serializeOpDocumentUpdateAcceleratorInput(v *UpdateAccelerator return nil } +func awsAwsjson11_serializeOpDocumentUpdateCrossAccountAttachmentInput(v *UpdateCrossAccountAttachmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddPrincipals != nil { + ok := object.Key("AddPrincipals") + if err := awsAwsjson11_serializeDocumentPrincipals(v.AddPrincipals, ok); err != nil { + return err + } + } + + if v.AddResources != nil { + ok := object.Key("AddResources") + if err := awsAwsjson11_serializeDocumentResources(v.AddResources, ok); err != nil { + return err + } + } + + if v.AttachmentArn != nil { + ok := object.Key("AttachmentArn") + ok.String(*v.AttachmentArn) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RemovePrincipals != nil { + ok := object.Key("RemovePrincipals") + if err := awsAwsjson11_serializeDocumentPrincipals(v.RemovePrincipals, ok); err != nil { + return err + } + } + + if v.RemoveResources != nil { + ok := object.Key("RemoveResources") + if err := awsAwsjson11_serializeDocumentResources(v.RemoveResources, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateCustomRoutingAcceleratorAttributesInput(v *UpdateCustomRoutingAcceleratorAttributesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/globalaccelerator/types/errors.go b/service/globalaccelerator/types/errors.go index ce58dc1d2c5..a736d7d0c42 100644 --- a/service/globalaccelerator/types/errors.go +++ b/service/globalaccelerator/types/errors.go @@ -141,6 +141,32 @@ func (e *AssociatedListenerFoundException) ErrorCode() string { } func (e *AssociatedListenerFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// No cross-account attachment was found. +type AttachmentNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AttachmentNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AttachmentNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AttachmentNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AttachmentNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *AttachmentNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The CIDR that you specified was not found or is incorrect. type ByoipCidrNotFoundException struct { Message *string diff --git a/service/globalaccelerator/types/types.go b/service/globalaccelerator/types/types.go index 6987a12635d..52cfae4dd9d 100644 --- a/service/globalaccelerator/types/types.go +++ b/service/globalaccelerator/types/types.go @@ -112,6 +112,32 @@ type AcceleratorEvent struct { noSmithyDocumentSerde } +// A cross-account attachment in Global Accelerator. A cross-account attachment +// specifies the principals who have permission to add to accelerators in their own +// account the resources in your account that you also list in the attachment. +type Attachment struct { + + // The Amazon Resource Name (ARN) of the cross-account attachment. + AttachmentArn *string + + // The date and time that the cross-account attachment was created. + CreatedTime *time.Time + + // The date and time that the cross-account attachment was last modified. + LastModifiedTime *time.Time + + // The name of the cross-account attachment. + Name *string + + // The principals included in the cross-account attachment. + Principals []string + + // The resources included in the cross-account attachment. + Resources []Resource + + noSmithyDocumentSerde +} + // Information about an IP address range that is provisioned for use with your // Amazon Web Services resources through bring your own IP address (BYOIP). The // following describes each BYOIP State that your IP address range can be in. @@ -195,6 +221,23 @@ type CidrAuthorizationContext struct { noSmithyDocumentSerde } +// An endpoint (Amazon Web Services resource) that is listed in a cross-account +// attachment and can be added to an accelerator by specified principals, that are +// also listed in the attachment. +type CrossAccountResource struct { + + // The Amazon Resource Name (ARN) of the cross-account attachment that specifies + // the endpoints (resources) that can be added to accelerators and principals that + // have permission to add the endpoints to accelerators. + AttachmentArn *string + + // The endpoint ID for the endpoint that is listed in a cross-account attachment + // and can be added to an accelerator by specified principals. + EndpointId *string + + noSmithyDocumentSerde +} + // Attributes of a custom routing accelerator. type CustomRoutingAccelerator struct { @@ -316,6 +359,11 @@ type CustomRoutingDestinationDescription struct { // private cloud (VPC) subnet IDs. type CustomRoutingEndpointConfiguration struct { + // The Amazon Resource Name (ARN) of the cross-account attachment that specifies + // the endpoints (resources) that can be added to accelerators and principals that + // have permission to add the endpoints to accelerators. + AttachmentArn *string + // An ID for the endpoint. For custom routing accelerators, this is the virtual // private cloud (VPC) subnet ID. EndpointId *string @@ -413,16 +461,21 @@ type DestinationPortMapping struct { // it as an endpoint. type EndpointConfiguration struct { + // The Amazon Resource Name (ARN) of the cross-account attachment that specifies + // the endpoints (resources) that can be added to accelerators and principals that + // have permission to add the endpoints to accelerators. + AttachmentArn *string + // Indicates whether client IP address preservation is enabled for an endpoint. - // The value is true or false. The default value is true for new accelerators. If - // the value is set to true, the client's IP address is preserved in the - // X-Forwarded-For request header as traffic travels to applications on the - // endpoint fronted by the accelerator. Client IP address preservation is - // supported, in specific Amazon Web Services Regions, for endpoints that are - // Application Load Balancers, Amazon EC2 instances, and Network Load Balancers - // with Security Groups. IMPORTANT: You cannot use client IP address preservation - // with Network Load Balancers with TLS listeners. For more information, see - // Preserve client IP addresses in Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/preserve-client-ip-address.html) + // The value is true or false. The default value is true for Application Load + // Balancer endpoints. If the value is set to true, the client's IP address is + // preserved in the X-Forwarded-For request header as traffic travels to + // applications on the endpoint fronted by the accelerator. Client IP address + // preservation is supported, in specific Amazon Web Services Regions, for + // endpoints that are Application Load Balancers, Amazon EC2 instances, and Network + // Load Balancers with security groups. IMPORTANT: You cannot use client IP address + // preservation with Network Load Balancers with TLS listeners. For more + // information, see Preserve client IP addresses in Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/preserve-client-ip-address.html) // in the Global Accelerator Developer Guide. ClientIPPreservationEnabled *bool @@ -451,15 +504,15 @@ type EndpointConfiguration struct { type EndpointDescription struct { // Indicates whether client IP address preservation is enabled for an endpoint. - // The value is true or false. The default value is true for new accelerators. If - // the value is set to true, the client's IP address is preserved in the - // X-Forwarded-For request header as traffic travels to applications on the - // endpoint fronted by the accelerator. Client IP address preservation is - // supported, in specific Amazon Web Services Regions, for endpoints that are - // Application Load Balancers, Amazon EC2 instances, and Network Load Balancers - // with Security Groups. IMPORTANT: You cannot use client IP address preservation - // with Network Load Balancers with TLS listeners. For more information, see - // Preserve client IP addresses in Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/preserve-client-ip-address.html) + // The value is true or false. The default value is true for Application Load + // Balancers endpoints. If the value is set to true, the client's IP address is + // preserved in the X-Forwarded-For request header as traffic travels to + // applications on the endpoint fronted by the accelerator. Client IP address + // preservation is supported, in specific Amazon Web Services Regions, for + // endpoints that are Application Load Balancers, Amazon EC2 instances, and Network + // Load Balancers with security groups. IMPORTANT: You cannot use client IP address + // preservation with Network Load Balancers with TLS listeners. For more + // information, see Preserve client IP addresses in Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/preserve-client-ip-address.html) // in the Global Accelerator Developer Guide. ClientIPPreservationEnabled *bool @@ -676,6 +729,21 @@ type PortRange struct { noSmithyDocumentSerde } +// An Amazon Web Services resource that is supported by Global Accelerator and can +// be added as an endpoint for an accelerator. +type Resource struct { + + // The endpoint ID for the endpoint (Amazon Web Services resource). + // + // This member is required. + EndpointId *string + + // The Amazon Web Services Region where a resource is located. + Region *string + + noSmithyDocumentSerde +} + // An IP address/port combination. type SocketAddress struct { diff --git a/service/globalaccelerator/validators.go b/service/globalaccelerator/validators.go index a52d0b87dbe..921d4ee6bfe 100644 --- a/service/globalaccelerator/validators.go +++ b/service/globalaccelerator/validators.go @@ -110,6 +110,26 @@ func (m *validateOpCreateAccelerator) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpCreateCrossAccountAttachment struct { +} + +func (*validateOpCreateCrossAccountAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateCrossAccountAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateCrossAccountAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateCrossAccountAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateCustomRoutingAccelerator struct { } @@ -230,6 +250,26 @@ func (m *validateOpDeleteAccelerator) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDeleteCrossAccountAttachment struct { +} + +func (*validateOpDeleteCrossAccountAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCrossAccountAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCrossAccountAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCrossAccountAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteCustomRoutingAccelerator struct { } @@ -410,6 +450,26 @@ func (m *validateOpDescribeAccelerator) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDescribeCrossAccountAttachment struct { +} + +func (*validateOpDescribeCrossAccountAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeCrossAccountAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeCrossAccountAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeCrossAccountAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeCustomRoutingAcceleratorAttributes struct { } @@ -530,6 +590,26 @@ func (m *validateOpDescribeListener) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpListCrossAccountResources struct { +} + +func (*validateOpListCrossAccountResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCrossAccountResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCrossAccountResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCrossAccountResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListCustomRoutingEndpointGroups struct { } @@ -810,6 +890,26 @@ func (m *validateOpUpdateAccelerator) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpUpdateCrossAccountAttachment struct { +} + +func (*validateOpUpdateCrossAccountAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCrossAccountAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCrossAccountAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCrossAccountAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateCustomRoutingAcceleratorAttributes struct { } @@ -950,6 +1050,10 @@ func addOpCreateAcceleratorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAccelerator{}, middleware.After) } +func addOpCreateCrossAccountAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateCrossAccountAttachment{}, middleware.After) +} + func addOpCreateCustomRoutingAcceleratorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCustomRoutingAccelerator{}, middleware.After) } @@ -974,6 +1078,10 @@ func addOpDeleteAcceleratorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAccelerator{}, middleware.After) } +func addOpDeleteCrossAccountAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCrossAccountAttachment{}, middleware.After) +} + func addOpDeleteCustomRoutingAcceleratorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCustomRoutingAccelerator{}, middleware.After) } @@ -1010,6 +1118,10 @@ func addOpDescribeAcceleratorValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDescribeAccelerator{}, middleware.After) } +func addOpDescribeCrossAccountAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeCrossAccountAttachment{}, middleware.After) +} + func addOpDescribeCustomRoutingAcceleratorAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCustomRoutingAcceleratorAttributes{}, middleware.After) } @@ -1034,6 +1146,10 @@ func addOpDescribeListenerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeListener{}, middleware.After) } +func addOpListCrossAccountResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCrossAccountResources{}, middleware.After) +} + func addOpListCustomRoutingEndpointGroupsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListCustomRoutingEndpointGroups{}, middleware.After) } @@ -1090,6 +1206,10 @@ func addOpUpdateAcceleratorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAccelerator{}, middleware.After) } +func addOpUpdateCrossAccountAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCrossAccountAttachment{}, middleware.After) +} + func addOpUpdateCustomRoutingAcceleratorAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateCustomRoutingAcceleratorAttributes{}, middleware.After) } @@ -1202,6 +1322,38 @@ func validateEndpointIdentifiers(v []types.EndpointIdentifier) error { } } +func validateResource(v *types.Resource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Resource"} + if v.EndpointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResources(v []types.Resource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Resources"} + for i := range v { + if err := validateResource(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -1329,6 +1481,34 @@ func validateOpCreateAcceleratorInput(v *CreateAcceleratorInput) error { } } +func validateOpCreateCrossAccountAttachmentInput(v *CreateCrossAccountAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCrossAccountAttachmentInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Resources != nil { + if err := validateResources(v.Resources); err != nil { + invalidParams.AddNested("Resources", err.(smithy.InvalidParamsError)) + } + } + if v.IdempotencyToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdempotencyToken")) + } + if v.Tags != nil { + if err := validateTags(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateCustomRoutingAcceleratorInput(v *CreateCustomRoutingAcceleratorInput) error { if v == nil { return nil @@ -1461,6 +1641,21 @@ func validateOpDeleteAcceleratorInput(v *DeleteAcceleratorInput) error { } } +func validateOpDeleteCrossAccountAttachmentInput(v *DeleteCrossAccountAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCrossAccountAttachmentInput"} + if v.AttachmentArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteCustomRoutingAcceleratorInput(v *DeleteCustomRoutingAcceleratorInput) error { if v == nil { return nil @@ -1599,6 +1794,21 @@ func validateOpDescribeAcceleratorInput(v *DescribeAcceleratorInput) error { } } +func validateOpDescribeCrossAccountAttachmentInput(v *DescribeCrossAccountAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeCrossAccountAttachmentInput"} + if v.AttachmentArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeCustomRoutingAcceleratorAttributesInput(v *DescribeCustomRoutingAcceleratorAttributesInput) error { if v == nil { return nil @@ -1689,6 +1899,21 @@ func validateOpDescribeListenerInput(v *DescribeListenerInput) error { } } +func validateOpListCrossAccountResourcesInput(v *ListCrossAccountResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCrossAccountResourcesInput"} + if v.ResourceOwnerAwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceOwnerAwsAccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListCustomRoutingEndpointGroupsInput(v *ListCustomRoutingEndpointGroupsInput) error { if v == nil { return nil @@ -1929,6 +2154,31 @@ func validateOpUpdateAcceleratorInput(v *UpdateAcceleratorInput) error { } } +func validateOpUpdateCrossAccountAttachmentInput(v *UpdateCrossAccountAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCrossAccountAttachmentInput"} + if v.AttachmentArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentArn")) + } + if v.AddResources != nil { + if err := validateResources(v.AddResources); err != nil { + invalidParams.AddNested("AddResources", err.(smithy.InvalidParamsError)) + } + } + if v.RemoveResources != nil { + if err := validateResources(v.RemoveResources); err != nil { + invalidParams.AddNested("RemoveResources", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateCustomRoutingAcceleratorAttributesInput(v *UpdateCustomRoutingAcceleratorAttributesInput) error { if v == nil { return nil diff --git a/service/rds/api_op_CreateDBCluster.go b/service/rds/api_op_CreateDBCluster.go index dcf82f6cea9..7d0ef273101 100644 --- a/service/rds/api_op_CreateDBCluster.go +++ b/service/rds/api_op_CreateDBCluster.go @@ -445,6 +445,9 @@ type CreateDBClusterInput struct { // it, the DB cluster is public. PubliclyAccessible *bool + // Reserved for future use. + RdsCustomClusterConfiguration *types.RdsCustomClusterConfiguration + // The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this // DB cluster is created as a read replica. Valid for Cluster Type: Aurora DB // clusters and Multi-AZ DB clusters diff --git a/service/rds/api_op_RestoreDBClusterFromSnapshot.go b/service/rds/api_op_RestoreDBClusterFromSnapshot.go index 4193cf37e5c..159ba0939c6 100644 --- a/service/rds/api_op_RestoreDBClusterFromSnapshot.go +++ b/service/rds/api_op_RestoreDBClusterFromSnapshot.go @@ -249,6 +249,9 @@ type RestoreDBClusterFromSnapshotInput struct { // Valid for: Aurora DB clusters and Multi-AZ DB clusters PubliclyAccessible *bool + // Reserved for future use. + RdsCustomClusterConfiguration *types.RdsCustomClusterConfiguration + // For DB clusters in serverless DB engine mode, the scaling properties of the DB // cluster. Valid for: Aurora DB clusters only ScalingConfiguration *types.ScalingConfiguration diff --git a/service/rds/api_op_RestoreDBClusterToPointInTime.go b/service/rds/api_op_RestoreDBClusterToPointInTime.go index 78710e4d8f4..f7a9816e200 100644 --- a/service/rds/api_op_RestoreDBClusterToPointInTime.go +++ b/service/rds/api_op_RestoreDBClusterToPointInTime.go @@ -205,6 +205,9 @@ type RestoreDBClusterToPointInTimeInput struct { // Valid for: Multi-AZ DB clusters only PubliclyAccessible *bool + // Reserved for future use. + RdsCustomClusterConfiguration *types.RdsCustomClusterConfiguration + // The date and time to restore the DB cluster to. Valid Values: Value must be a // time in Universal Coordinated Time (UTC) format Constraints: // - Must be before the latest restorable time for the DB instance diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index f731abd1b77..d9ee196e3f3 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -24677,6 +24677,12 @@ func awsAwsquery_deserializeDocumentClusterPendingModifiedValues(v **types.Clust return err } + case strings.EqualFold("RdsCustomClusterConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRdsCustomClusterConfiguration(&sv.RdsCustomClusterConfiguration, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("StorageType", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -25998,6 +26004,12 @@ func awsAwsquery_deserializeDocumentDBCluster(v **types.DBCluster, decoder smith sv.PubliclyAccessible = ptr.Bool(xtv) } + case strings.EqualFold("RdsCustomClusterConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRdsCustomClusterConfiguration(&sv.RdsCustomClusterConfiguration, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("ReaderEndpoint", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -44857,6 +44869,68 @@ func awsAwsquery_deserializeDocumentRangeListUnwrapped(v *[]types.Range, decoder *v = sv return nil } +func awsAwsquery_deserializeDocumentRdsCustomClusterConfiguration(v **types.RdsCustomClusterConfiguration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RdsCustomClusterConfiguration + if *v == nil { + sv = &types.RdsCustomClusterConfiguration{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("InterconnectSubnetId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InterconnectSubnetId = ptr.String(xtv) + } + + case strings.EqualFold("TransitGatewayMulticastDomainId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TransitGatewayMulticastDomainId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeDocumentReadersArnList(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/rds/serializers.go b/service/rds/serializers.go index a77bcc4cd9b..36cad8d13f6 100644 --- a/service/rds/serializers.go +++ b/service/rds/serializers.go @@ -9840,6 +9840,23 @@ func awsAwsquery_serializeDocumentProcessorFeatureList(v []types.ProcessorFeatur return nil } +func awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v *types.RdsCustomClusterConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.InterconnectSubnetId != nil { + objectKey := object.Key("InterconnectSubnetId") + objectKey.String(*v.InterconnectSubnetId) + } + + if v.TransitGatewayMulticastDomainId != nil { + objectKey := object.Key("TransitGatewayMulticastDomainId") + objectKey.String(*v.TransitGatewayMulticastDomainId) + } + + return nil +} + func awsAwsquery_serializeDocumentScalingConfiguration(v *types.ScalingConfiguration, value query.Value) error { object := value.Object() _ = object @@ -10785,6 +10802,13 @@ func awsAwsquery_serializeOpDocumentCreateDBClusterInput(v *CreateDBClusterInput objectKey.Boolean(*v.PubliclyAccessible) } + if v.RdsCustomClusterConfiguration != nil { + objectKey := object.Key("RdsCustomClusterConfiguration") + if err := awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v.RdsCustomClusterConfiguration, objectKey); err != nil { + return err + } + } + if v.ReplicationSourceIdentifier != nil { objectKey := object.Key("ReplicationSourceIdentifier") objectKey.String(*v.ReplicationSourceIdentifier) @@ -15209,6 +15233,13 @@ func awsAwsquery_serializeOpDocumentRestoreDBClusterFromSnapshotInput(v *Restore objectKey.Boolean(*v.PubliclyAccessible) } + if v.RdsCustomClusterConfiguration != nil { + objectKey := object.Key("RdsCustomClusterConfiguration") + if err := awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v.RdsCustomClusterConfiguration, objectKey); err != nil { + return err + } + } + if v.ScalingConfiguration != nil { objectKey := object.Key("ScalingConfiguration") if err := awsAwsquery_serializeDocumentScalingConfiguration(v.ScalingConfiguration, objectKey); err != nil { @@ -15346,6 +15377,13 @@ func awsAwsquery_serializeOpDocumentRestoreDBClusterToPointInTimeInput(v *Restor objectKey.Boolean(*v.PubliclyAccessible) } + if v.RdsCustomClusterConfiguration != nil { + objectKey := object.Key("RdsCustomClusterConfiguration") + if err := awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v.RdsCustomClusterConfiguration, objectKey); err != nil { + return err + } + } + if v.RestoreToTime != nil { objectKey := object.Key("RestoreToTime") objectKey.String(smithytime.FormatDateTime(*v.RestoreToTime)) diff --git a/service/rds/types/types.go b/service/rds/types/types.go index 12827090a8a..a80fcfe79cb 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -307,6 +307,9 @@ type ClusterPendingModifiedValues struct { // these log types are in the process of being activated or deactivated. PendingCloudwatchLogsExports *PendingCloudwatchLogsExports + // Reserved for future use. + RdsCustomClusterConfiguration *RdsCustomClusterConfiguration + // The storage type for the DB cluster. StorageType *string @@ -713,6 +716,9 @@ type DBCluster struct { // Multi-AZ DB clusters. PubliclyAccessible *bool + // Reserved for future use. + RdsCustomClusterConfiguration *RdsCustomClusterConfiguration + // Contains one or more identifiers of the read replicas associated with this DB // cluster. ReadReplicaIdentifiers []string @@ -3531,6 +3537,18 @@ type Range struct { noSmithyDocumentSerde } +// Reserved for future use. +type RdsCustomClusterConfiguration struct { + + // Reserved for future use. + InterconnectSubnetId *string + + // Reserved for future use. + TransitGatewayMulticastDomainId *string + + noSmithyDocumentSerde +} + // This data type is used as a response element in the DescribeReservedDBInstances // and DescribeReservedDBInstancesOfferings actions. type RecurringCharge struct { diff --git a/service/redshift/api_op_CreateCluster.go b/service/redshift/api_op_CreateCluster.go index 900922c1367..f931715d175 100644 --- a/service/redshift/api_op_CreateCluster.go +++ b/service/redshift/api_op_CreateCluster.go @@ -235,6 +235,9 @@ type CreateClusterInput struct { // quote), " (double quote), \ , / , or @ . MasterUserPassword *string + // If true, Amazon Redshift will deploy the cluster in two Availability Zones (AZ). + MultiAZ *bool + // The number of compute nodes in the cluster. This parameter is required when the // ClusterType parameter is specified as multi-node . For information about // determining how many nodes you need, go to Working with Clusters (https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#how-many-nodes) diff --git a/service/redshift/api_op_FailoverPrimaryCompute.go b/service/redshift/api_op_FailoverPrimaryCompute.go new file mode 100644 index 00000000000..25a66cd54aa --- /dev/null +++ b/service/redshift/api_op_FailoverPrimaryCompute.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshift + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/redshift/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Fails over the primary compute unit of the specified Multi-AZ cluster to +// another Availability Zone. +func (c *Client) FailoverPrimaryCompute(ctx context.Context, params *FailoverPrimaryComputeInput, optFns ...func(*Options)) (*FailoverPrimaryComputeOutput, error) { + if params == nil { + params = &FailoverPrimaryComputeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "FailoverPrimaryCompute", params, optFns, c.addOperationFailoverPrimaryComputeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*FailoverPrimaryComputeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type FailoverPrimaryComputeInput struct { + + // The unique identifier of the cluster for which the primary compute unit will be + // failed over to another Availability Zone. + // + // This member is required. + ClusterIdentifier *string + + noSmithyDocumentSerde +} + +type FailoverPrimaryComputeOutput struct { + + // Describes a cluster. + Cluster *types.Cluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationFailoverPrimaryComputeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsquery_serializeOpFailoverPrimaryCompute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpFailoverPrimaryCompute{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); 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, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addFailoverPrimaryComputeResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpFailoverPrimaryComputeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opFailoverPrimaryCompute(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opFailoverPrimaryCompute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift", + OperationName: "FailoverPrimaryCompute", + } +} + +type opFailoverPrimaryComputeResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opFailoverPrimaryComputeResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opFailoverPrimaryComputeResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "redshift" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "redshift" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("redshift") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addFailoverPrimaryComputeResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opFailoverPrimaryComputeResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/redshift/api_op_ModifyCluster.go b/service/redshift/api_op_ModifyCluster.go index 6a1990e15f1..5d5a323017a 100644 --- a/service/redshift/api_op_ModifyCluster.go +++ b/service/redshift/api_op_ModifyCluster.go @@ -181,6 +181,10 @@ type ModifyClusterInput struct { // quote), " (double quote), \ , / , or @ . MasterUserPassword *string + // If true and the cluster is currently only deployed in a single Availability + // Zone, the cluster will be modified to be deployed in two Availability Zones. + MultiAZ *bool + // The new identifier for the cluster. Constraints: // - Must contain from 1 to 63 alphanumeric characters or hyphens. // - Alphabetic characters must be lowercase. diff --git a/service/redshift/api_op_RestoreFromClusterSnapshot.go b/service/redshift/api_op_RestoreFromClusterSnapshot.go index 57f3fcb56b9..7cbf696dd33 100644 --- a/service/redshift/api_op_RestoreFromClusterSnapshot.go +++ b/service/redshift/api_op_RestoreFromClusterSnapshot.go @@ -175,6 +175,10 @@ type RestoreFromClusterSnapshotInput struct { // ManageMasterPassword is true. MasterPasswordSecretKmsKeyId *string + // If true, the snapshot will be restored to a cluster deployed in two + // Availability Zones. + MultiAZ *bool + // The node type that the restored cluster will be provisioned with. Default: The // node type of the cluster from which the snapshot was taken. You can modify this // if you are using any DS node type. In that case, you can choose to restore into diff --git a/service/redshift/deserializers.go b/service/redshift/deserializers.go index 2da6f9f0d17..620df6619a3 100644 --- a/service/redshift/deserializers.go +++ b/service/redshift/deserializers.go @@ -254,6 +254,9 @@ func awsAwsquery_deserializeOpErrorAddPartner(response *smithyhttp.Response, met case strings.EqualFold("UnauthorizedPartnerIntegration", errorCode): return awsAwsquery_deserializeErrorUnauthorizedPartnerIntegrationFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1280,6 +1283,9 @@ func awsAwsquery_deserializeOpErrorCopyClusterSnapshot(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("ClusterNotFound", errorCode): + return awsAwsquery_deserializeErrorClusterNotFoundFault(response, errorBody) + case strings.EqualFold("ClusterSnapshotAlreadyExists", errorCode): return awsAwsquery_deserializeErrorClusterSnapshotAlreadyExistsFault(response, errorBody) @@ -1583,6 +1589,9 @@ func awsAwsquery_deserializeOpErrorCreateCluster(response *smithyhttp.Response, case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsquery_deserializeErrorUnauthorizedOperation(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2798,6 +2807,9 @@ func awsAwsquery_deserializeOpErrorCreateScheduledAction(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("ClusterNotFound", errorCode): + return awsAwsquery_deserializeErrorClusterNotFoundFault(response, errorBody) + case strings.EqualFold("InvalidSchedule", errorCode): return awsAwsquery_deserializeErrorInvalidScheduleFault(response, errorBody) @@ -2816,6 +2828,9 @@ func awsAwsquery_deserializeOpErrorCreateScheduledAction(response *smithyhttp.Re case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsquery_deserializeErrorUnauthorizedOperation(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4492,6 +4507,9 @@ func awsAwsquery_deserializeOpErrorDeletePartner(response *smithyhttp.Response, case strings.EqualFold("UnauthorizedPartnerIntegration", errorCode): return awsAwsquery_deserializeErrorUnauthorizedPartnerIntegrationFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7690,6 +7708,9 @@ func awsAwsquery_deserializeOpErrorDescribeLoggingStatus(response *smithyhttp.Re case strings.EqualFold("ClusterNotFound", errorCode): return awsAwsquery_deserializeErrorClusterNotFoundFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8026,6 +8047,9 @@ func awsAwsquery_deserializeOpErrorDescribePartners(response *smithyhttp.Respons case strings.EqualFold("UnauthorizedPartnerIntegration", errorCode): return awsAwsquery_deserializeErrorUnauthorizedPartnerIntegrationFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8476,6 +8500,9 @@ func awsAwsquery_deserializeOpErrorDescribeResize(response *smithyhttp.Response, case strings.EqualFold("ResizeNotFound", errorCode): return awsAwsquery_deserializeErrorResizeNotFoundFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9352,6 +9379,9 @@ func awsAwsquery_deserializeOpErrorDisableLogging(response *smithyhttp.Response, case strings.EqualFold("InvalidClusterState", errorCode): return awsAwsquery_deserializeErrorInvalidClusterStateFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9469,6 +9499,9 @@ func awsAwsquery_deserializeOpErrorDisableSnapshotCopy(response *smithyhttp.Resp case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsquery_deserializeErrorUnauthorizedOperation(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9703,6 +9736,9 @@ func awsAwsquery_deserializeOpErrorEnableLogging(response *smithyhttp.Response, case strings.EqualFold("InvalidS3KeyPrefixFault", errorCode): return awsAwsquery_deserializeErrorInvalidS3KeyPrefixFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9851,6 +9887,123 @@ func awsAwsquery_deserializeOpErrorEnableSnapshotCopy(response *smithyhttp.Respo } } +type awsAwsquery_deserializeOpFailoverPrimaryCompute struct { +} + +func (*awsAwsquery_deserializeOpFailoverPrimaryCompute) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpFailoverPrimaryCompute) 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, awsAwsquery_deserializeOpErrorFailoverPrimaryCompute(response, &metadata) + } + output := &FailoverPrimaryComputeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("FailoverPrimaryComputeResult") + 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 + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentFailoverPrimaryComputeOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorFailoverPrimaryCompute(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ClusterNotFound", errorCode): + return awsAwsquery_deserializeErrorClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidClusterState", errorCode): + return awsAwsquery_deserializeErrorInvalidClusterStateFault(response, errorBody) + + case strings.EqualFold("UnauthorizedOperation", errorCode): + return awsAwsquery_deserializeErrorUnauthorizedOperation(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpGetClusterCredentials struct { } @@ -10942,6 +11095,9 @@ func awsAwsquery_deserializeOpErrorModifyClusterDbRevision(response *smithyhttp. case strings.EqualFold("InvalidClusterState", errorCode): return awsAwsquery_deserializeErrorInvalidClusterStateFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -12065,6 +12221,9 @@ func awsAwsquery_deserializeOpErrorModifyScheduledAction(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("ClusterNotFound", errorCode): + return awsAwsquery_deserializeErrorClusterNotFoundFault(response, errorBody) + case strings.EqualFold("InvalidSchedule", errorCode): return awsAwsquery_deserializeErrorInvalidScheduleFault(response, errorBody) @@ -12080,6 +12239,9 @@ func awsAwsquery_deserializeOpErrorModifyScheduledAction(response *smithyhttp.Re case strings.EqualFold("UnauthorizedOperation", errorCode): return awsAwsquery_deserializeErrorUnauthorizedOperation(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -12539,6 +12701,9 @@ func awsAwsquery_deserializeOpErrorPauseCluster(response *smithyhttp.Response, m case strings.EqualFold("InvalidClusterState", errorCode): return awsAwsquery_deserializeErrorInvalidClusterStateFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -13697,6 +13862,9 @@ func awsAwsquery_deserializeOpErrorResumeCluster(response *smithyhttp.Response, case strings.EqualFold("InvalidClusterState", errorCode): return awsAwsquery_deserializeErrorInvalidClusterStateFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -14168,6 +14336,9 @@ func awsAwsquery_deserializeOpErrorRotateEncryptionKey(response *smithyhttp.Resp case strings.EqualFold("InvalidClusterState", errorCode): return awsAwsquery_deserializeErrorInvalidClusterStateFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -14282,6 +14453,9 @@ func awsAwsquery_deserializeOpErrorUpdatePartnerStatus(response *smithyhttp.Resp case strings.EqualFold("UnauthorizedPartnerIntegration", errorCode): return awsAwsquery_deserializeErrorUnauthorizedPartnerIntegrationFault(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsquery_deserializeErrorUnsupportedOperationFault(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -22318,6 +22492,25 @@ func awsAwsquery_deserializeDocumentCluster(v **types.Cluster, decoder smithyxml sv.ModifyStatus = ptr.String(xtv) } + case strings.EqualFold("MultiAZ", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MultiAZ = ptr.String(xtv) + } + + case strings.EqualFold("MultiAZSecondary", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSecondaryClusterInfo(&sv.MultiAZSecondary, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("NextMaintenanceWindowStartTime", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -35548,6 +35741,61 @@ func awsAwsquery_deserializeDocumentScheduledSnapshotTimeListUnwrapped(v *[]time *v = sv return nil } +func awsAwsquery_deserializeDocumentSecondaryClusterInfo(v **types.SecondaryClusterInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SecondaryClusterInfo + if *v == nil { + sv = &types.SecondaryClusterInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AvailabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("ClusterNodes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentClusterNodesList(&sv.ClusterNodes, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeDocumentSnapshot(v **types.Snapshot, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -45190,6 +45438,48 @@ func awsAwsquery_deserializeOpDocumentEnableSnapshotCopyOutput(v **EnableSnapsho return nil } +func awsAwsquery_deserializeOpDocumentFailoverPrimaryComputeOutput(v **FailoverPrimaryComputeOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *FailoverPrimaryComputeOutput + if *v == nil { + sv = &FailoverPrimaryComputeOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Cluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCluster(&sv.Cluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentGetClusterCredentialsOutput(v **GetClusterCredentialsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/redshift/generated.json b/service/redshift/generated.json index ba7afcd4f31..7717cabcd56 100644 --- a/service/redshift/generated.json +++ b/service/redshift/generated.json @@ -100,6 +100,7 @@ "api_op_DisassociateDataShareConsumer.go", "api_op_EnableLogging.go", "api_op_EnableSnapshotCopy.go", + "api_op_FailoverPrimaryCompute.go", "api_op_GetClusterCredentials.go", "api_op_GetClusterCredentialsWithIAM.go", "api_op_GetReservedNodeExchangeConfigurationOptions.go", diff --git a/service/redshift/serializers.go b/service/redshift/serializers.go index 03342f4815a..046c7ddc22d 100644 --- a/service/redshift/serializers.go +++ b/service/redshift/serializers.go @@ -5772,6 +5772,70 @@ func (m *awsAwsquery_serializeOpEnableSnapshotCopy) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpFailoverPrimaryCompute struct { +} + +func (*awsAwsquery_serializeOpFailoverPrimaryCompute) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpFailoverPrimaryCompute) 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.(*FailoverPrimaryComputeInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("FailoverPrimaryCompute") + body.Key("Version").String("2012-12-01") + + if err := awsAwsquery_serializeOpDocumentFailoverPrimaryComputeInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpGetClusterCredentials struct { } @@ -9014,6 +9078,11 @@ func awsAwsquery_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, va objectKey.String(*v.MasterUserPassword) } + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + if v.NodeType != nil { objectKey := object.Key("NodeType") objectKey.String(*v.NodeType) @@ -11082,6 +11151,18 @@ func awsAwsquery_serializeOpDocumentEnableSnapshotCopyInput(v *EnableSnapshotCop return nil } +func awsAwsquery_serializeOpDocumentFailoverPrimaryComputeInput(v *FailoverPrimaryComputeInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ClusterIdentifier != nil { + objectKey := object.Key("ClusterIdentifier") + objectKey.String(*v.ClusterIdentifier) + } + + return nil +} + func awsAwsquery_serializeOpDocumentGetClusterCredentialsInput(v *GetClusterCredentialsInput, value query.Value) error { object := value.Object() _ = object @@ -11412,6 +11493,11 @@ func awsAwsquery_serializeOpDocumentModifyClusterInput(v *ModifyClusterInput, va objectKey.String(*v.MasterUserPassword) } + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + if v.NewClusterIdentifier != nil { objectKey := object.Key("NewClusterIdentifier") objectKey.String(*v.NewClusterIdentifier) @@ -12034,6 +12120,11 @@ func awsAwsquery_serializeOpDocumentRestoreFromClusterSnapshotInput(v *RestoreFr objectKey.String(*v.MasterPasswordSecretKmsKeyId) } + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + if v.NodeType != nil { objectKey := object.Key("NodeType") objectKey.String(*v.NodeType) diff --git a/service/redshift/types/types.go b/service/redshift/types/types.go index 5d5cb55f162..b7566b9bffe 100644 --- a/service/redshift/types/types.go +++ b/service/redshift/types/types.go @@ -301,6 +301,13 @@ type Cluster struct { // The status of a modify operation, if any, initiated for the cluster. ModifyStatus *string + // A boolean value that, if true, indicates that the cluster is deployed in two + // Availability Zones. + MultiAZ *string + + // The secondary compute unit of a cluster, if Multi-AZ deployment is turned on. + MultiAZSecondary *SecondaryClusterInfo + // The date and time in UTC when system maintenance can begin. NextMaintenanceWindowStartTime *time.Time @@ -1649,6 +1656,19 @@ type ScheduledActionType struct { noSmithyDocumentSerde } +// The AvailabilityZone and ClusterNodes information of the secondary compute unit. +type SecondaryClusterInfo struct { + + // The name of the Availability Zone in which the secondary compute unit of the + // cluster is located. + AvailabilityZone *string + + // The nodes in the secondary compute unit. + ClusterNodes []ClusterNode + + noSmithyDocumentSerde +} + // Describes a snapshot. type Snapshot struct { diff --git a/service/redshift/validators.go b/service/redshift/validators.go index ec2272e4a14..9fe93f1f2de 100644 --- a/service/redshift/validators.go +++ b/service/redshift/validators.go @@ -1170,6 +1170,26 @@ func (m *validateOpEnableSnapshotCopy) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpFailoverPrimaryCompute struct { +} + +func (*validateOpFailoverPrimaryCompute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpFailoverPrimaryCompute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*FailoverPrimaryComputeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpFailoverPrimaryComputeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetClusterCredentials struct { } @@ -2102,6 +2122,10 @@ func addOpEnableSnapshotCopyValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpEnableSnapshotCopy{}, middleware.After) } +func addOpFailoverPrimaryComputeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpFailoverPrimaryCompute{}, middleware.After) +} + func addOpGetClusterCredentialsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetClusterCredentials{}, middleware.After) } @@ -3409,6 +3433,21 @@ func validateOpEnableSnapshotCopyInput(v *EnableSnapshotCopyInput) error { } } +func validateOpFailoverPrimaryComputeInput(v *FailoverPrimaryComputeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FailoverPrimaryComputeInput"} + if v.ClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetClusterCredentialsInput(v *GetClusterCredentialsInput) error { if v == nil { return nil diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index 46148a48462..d20e5e4945b 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -55029,6 +55029,11 @@ func awsAwsjson11_deserializeDocumentModelDashboardMonitoringSchedule(v **types. for key, value := range shape { switch key { + case "BatchTransformInput": + if err := awsAwsjson11_deserializeDocumentBatchTransformInput(&sv.BatchTransformInput, value); err != nil { + return err + } + case "CreationTime": if value != nil { switch jtv := value.(type) { diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index 912c5c94159..2bdf5fa4d22 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -8376,6 +8376,9 @@ type ModelDashboardModelCard struct { // Dashboard. type ModelDashboardMonitoringSchedule struct { + // Input object for the batch transform job. + BatchTransformInput *BatchTransformInput + // A timestamp that indicates when the monitoring schedule was created. CreationTime *time.Time