From a0296d6993b9d1d7d36b54e3347678dde5dd5454 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 21 Dec 2023 19:16:40 +0000 Subject: [PATCH] Regenerated Clients --- .../58823dabdb3149b583324622fdc66bd8.json | 8 + .../5c2076ee46e24217bf9560b2cf0da43f.json | 8 + .../706905ff42dd487c8fbafe3af9f35121.json | 8 + .../76c9e10f0e964e419aedb1e03ff4ef95.json | 8 + .../7cf6cecd2b814bdcacb16a6e0bfc0b9b.json | 8 + .../9c9818afe4e140a9886131d232af4486.json | 8 + .../b2b33e94130b4715afeed67a472a5dd3.json | 8 + .../edc72d224f04441cab21a73edeb54a41.json | 8 + .../f1be3dfba685443cb6d2d7335af41d89.json | 8 + .../f55e20ca4ab24453bfe809a672ea4732.json | 8 + service/amp/api_op_CreateWorkspace.go | 6 + service/amp/deserializers.go | 27 + service/amp/serializers.go | 5 + service/amp/types/types.go | 6 + .../api_op_CreateApplication.go | 7 + .../api_op_DeleteApplication.go | 133 + .../appintegrations/api_op_GetApplication.go | 7 + .../api_op_ListApplicationAssociations.go | 240 + .../api_op_UpdateApplication.go | 7 + service/appintegrations/deserializers.go | 478 ++ service/appintegrations/generated.json | 2 + service/appintegrations/serializers.go | 163 + service/appintegrations/types/errors.go | 26 + service/appintegrations/types/types.go | 16 + service/appintegrations/validators.go | 78 + service/bedrockagent/deserializers.go | 144 + service/bedrockagent/serializers.go | 68 + service/bedrockagent/types/enums.go | 2 + service/bedrockagent/types/types.go | 60 + service/bedrockagent/validators.go | 60 + .../codecommit/api_op_BatchGetRepositories.go | 4 + service/codecommit/api_op_CreateRepository.go | 8 + .../api_op_UpdateRepositoryEncryptionKey.go | 153 + service/codecommit/deserializers.go | 545 +++ service/codecommit/doc.go | 2 + service/codecommit/endpoints.go | 2 +- service/codecommit/generated.json | 1 + service/codecommit/serializers.go | 77 + service/codecommit/types/enums.go | 27 + service/codecommit/types/errors.go | 82 + service/codecommit/types/types.go | 25 + service/codecommit/validators.go | 42 + .../api_op_AssociateUserProficiencies.go | 144 + .../api_op_CreatePredefinedAttribute.go | 144 + .../api_op_DeletePredefinedAttribute.go | 138 + .../api_op_DescribePredefinedAttribute.go | 143 + .../api_op_DisassociateUserProficiencies.go | 144 + .../api_op_ListPredefinedAttributes.go | 240 + .../connect/api_op_ListUserProficiencies.go | 251 + service/connect/api_op_SearchContacts.go | 254 + .../api_op_SearchPredefinedAttributes.go | 248 + .../api_op_UpdateContactRoutingData.go | 160 + .../api_op_UpdatePredefinedAttribute.go | 142 + .../connect/api_op_UpdateUserProficiencies.go | 145 + service/connect/deserializers.go | 4113 +++++++++++++---- service/connect/generated.json | 12 + service/connect/serializers.go | 1765 ++++++- service/connect/types/enums.go | 74 +- service/connect/types/types.go | 369 +- service/connect/types/types_exported_test.go | 18 + service/connect/validators.go | 860 +++- service/medialive/deserializers.go | 92 + service/medialive/serializers.go | 37 + service/medialive/types/enums.go | 62 + service/medialive/types/types.go | 49 +- service/medialive/validators.go | 10 +- service/neptunegraph/api_op_GetGraph.go | 376 ++ .../neptunegraph/api_op_GetGraphSnapshot.go | 382 ++ service/neptunegraph/api_op_GetImportTask.go | 425 ++ .../api_op_GetPrivateGraphEndpoint.go | 388 ++ service/neptunegraph/generated.json | 3 +- service/neptunegraph/go.mod | 1 + service/neptunegraph/go.sum | 12 + service/rds/api_op_CreateDBCluster.go | 14 +- service/rds/api_op_DisableHttpEndpoint.go | 144 + service/rds/api_op_EnableHttpEndpoint.go | 147 + service/rds/api_op_ModifyDBCluster.go | 16 +- service/rds/deserializers.go | 445 ++ service/rds/generated.json | 2 + service/rds/serializers.go | 152 + service/rds/types/errors.go | 26 + service/rds/types/types.go | 10 +- service/rds/validators.go | 78 + service/rdsdata/api_op_ExecuteSql.go | 6 +- service/rdsdata/deserializers.go | 964 +++- service/rdsdata/doc.go | 12 +- service/rdsdata/endpoints.go | 2 +- service/rdsdata/types/errors.go | 222 +- service/sagemaker/api_op_CreateTrainingJob.go | 6 + .../sagemaker/api_op_DescribeTrainingJob.go | 6 + service/sagemaker/api_op_Search.go | 3 + service/sagemaker/api_op_UpdateTrainingJob.go | 8 + service/sagemaker/deserializers.go | 45 + service/sagemaker/serializers.go | 75 + service/sagemaker/types/types.go | 40 +- .../internal/endpoints/endpoints.go | 3 + .../internal/endpoints/endpoints.go | 3 + 97 files changed, 15011 insertions(+), 1202 deletions(-) create mode 100644 .changelog/58823dabdb3149b583324622fdc66bd8.json create mode 100644 .changelog/5c2076ee46e24217bf9560b2cf0da43f.json create mode 100644 .changelog/706905ff42dd487c8fbafe3af9f35121.json create mode 100644 .changelog/76c9e10f0e964e419aedb1e03ff4ef95.json create mode 100644 .changelog/7cf6cecd2b814bdcacb16a6e0bfc0b9b.json create mode 100644 .changelog/9c9818afe4e140a9886131d232af4486.json create mode 100644 .changelog/b2b33e94130b4715afeed67a472a5dd3.json create mode 100644 .changelog/edc72d224f04441cab21a73edeb54a41.json create mode 100644 .changelog/f1be3dfba685443cb6d2d7335af41d89.json create mode 100644 .changelog/f55e20ca4ab24453bfe809a672ea4732.json create mode 100644 service/appintegrations/api_op_DeleteApplication.go create mode 100644 service/appintegrations/api_op_ListApplicationAssociations.go create mode 100644 service/codecommit/api_op_UpdateRepositoryEncryptionKey.go create mode 100644 service/connect/api_op_AssociateUserProficiencies.go create mode 100644 service/connect/api_op_CreatePredefinedAttribute.go create mode 100644 service/connect/api_op_DeletePredefinedAttribute.go create mode 100644 service/connect/api_op_DescribePredefinedAttribute.go create mode 100644 service/connect/api_op_DisassociateUserProficiencies.go create mode 100644 service/connect/api_op_ListPredefinedAttributes.go create mode 100644 service/connect/api_op_ListUserProficiencies.go create mode 100644 service/connect/api_op_SearchContacts.go create mode 100644 service/connect/api_op_SearchPredefinedAttributes.go create mode 100644 service/connect/api_op_UpdateContactRoutingData.go create mode 100644 service/connect/api_op_UpdatePredefinedAttribute.go create mode 100644 service/connect/api_op_UpdateUserProficiencies.go create mode 100644 service/rds/api_op_DisableHttpEndpoint.go create mode 100644 service/rds/api_op_EnableHttpEndpoint.go diff --git a/.changelog/58823dabdb3149b583324622fdc66bd8.json b/.changelog/58823dabdb3149b583324622fdc66bd8.json new file mode 100644 index 00000000000..6008e5b62b1 --- /dev/null +++ b/.changelog/58823dabdb3149b583324622fdc66bd8.json @@ -0,0 +1,8 @@ +{ + "id": "58823dab-db31-49b5-8332-4622fdc66bd8", + "type": "feature", + "description": "The Amazon AppIntegrations service adds DeleteApplication API for deleting applications, and updates APIs to support third party applications reacting to workspace events and make data requests to Amazon Connect for agent and contact events.", + "modules": [ + "service/appintegrations" + ] +} \ No newline at end of file diff --git a/.changelog/5c2076ee46e24217bf9560b2cf0da43f.json b/.changelog/5c2076ee46e24217bf9560b2cf0da43f.json new file mode 100644 index 00000000000..9897f464872 --- /dev/null +++ b/.changelog/5c2076ee46e24217bf9560b2cf0da43f.json @@ -0,0 +1,8 @@ +{ + "id": "5c2076ee-46e2-4217-bf95-60b2cf0da43f", + "type": "feature", + "description": "This release adds support for using RDS Data API with Aurora PostgreSQL Serverless v2 and provisioned DB clusters.", + "modules": [ + "service/rdsdata" + ] +} \ No newline at end of file diff --git a/.changelog/706905ff42dd487c8fbafe3af9f35121.json b/.changelog/706905ff42dd487c8fbafe3af9f35121.json new file mode 100644 index 00000000000..2f7d5d5ff3e --- /dev/null +++ b/.changelog/706905ff42dd487c8fbafe3af9f35121.json @@ -0,0 +1,8 @@ +{ + "id": "706905ff-42dd-487c-8fba-fe3af9f35121", + "type": "feature", + "description": "Amazon SageMaker Training now provides model training container access for debugging purposes. Amazon SageMaker Search now provides the ability to use visibility conditions to limit resource access to a single domain or multiple domains.", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/76c9e10f0e964e419aedb1e03ff4ef95.json b/.changelog/76c9e10f0e964e419aedb1e03ff4ef95.json new file mode 100644 index 00000000000..eeff5faab78 --- /dev/null +++ b/.changelog/76c9e10f0e964e419aedb1e03ff4ef95.json @@ -0,0 +1,8 @@ +{ + "id": "76c9e10f-0e96-4e41-9aed-b1e03ff4ef95", + "type": "feature", + "description": "This release introduces Amazon Aurora as a vector store on Knowledge Bases for Amazon Bedrock", + "modules": [ + "service/bedrockagent" + ] +} \ No newline at end of file diff --git a/.changelog/7cf6cecd2b814bdcacb16a6e0bfc0b9b.json b/.changelog/7cf6cecd2b814bdcacb16a6e0bfc0b9b.json new file mode 100644 index 00000000000..4059ba7982d --- /dev/null +++ b/.changelog/7cf6cecd2b814bdcacb16a6e0bfc0b9b.json @@ -0,0 +1,8 @@ +{ + "id": "7cf6cecd-2b81-4bdc-acb1-6a6e0bfc0b9b", + "type": "feature", + "description": "This release adds support for using RDS Data API with Aurora PostgreSQL Serverless v2 and provisioned DB clusters.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/.changelog/9c9818afe4e140a9886131d232af4486.json b/.changelog/9c9818afe4e140a9886131d232af4486.json new file mode 100644 index 00000000000..d728a5024d1 --- /dev/null +++ b/.changelog/9c9818afe4e140a9886131d232af4486.json @@ -0,0 +1,8 @@ +{ + "id": "9c9818af-e4e1-40a9-8861-31d232af4486", + "type": "feature", + "description": "AWS CodeCommit now supports customer managed keys from AWS Key Management Service. UpdateRepositoryEncryptionKey is added for updating the key configuration. CreateRepository, GetRepository, BatchGetRepositories are updated with new input or output parameters.", + "modules": [ + "service/codecommit" + ] +} \ No newline at end of file diff --git a/.changelog/b2b33e94130b4715afeed67a472a5dd3.json b/.changelog/b2b33e94130b4715afeed67a472a5dd3.json new file mode 100644 index 00000000000..85c4931699f --- /dev/null +++ b/.changelog/b2b33e94130b4715afeed67a472a5dd3.json @@ -0,0 +1,8 @@ +{ + "id": "b2b33e94-130b-4715-afee-d67a472a5dd3", + "type": "feature", + "description": "Adds APIs to manage User Proficiencies and Predefined Attributes. Enhances StartOutboundVoiceContact API input. Introduces SearchContacts API. Enhances DescribeContact API. Adds an API to update Routing Attributes in QueuePriority and QueueTimeAdjustmentSeconds.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/edc72d224f04441cab21a73edeb54a41.json b/.changelog/edc72d224f04441cab21a73edeb54a41.json new file mode 100644 index 00000000000..3a4ddfd9ccb --- /dev/null +++ b/.changelog/edc72d224f04441cab21a73edeb54a41.json @@ -0,0 +1,8 @@ +{ + "id": "edc72d22-4f04-441c-ab21-a73edeb54a41", + "type": "feature", + "description": "Adds Waiters for successful creation and deletion of Graph, Graph Snapshot, Import Task and Private Endpoints for Neptune Analytics", + "modules": [ + "service/neptunegraph" + ] +} \ No newline at end of file diff --git a/.changelog/f1be3dfba685443cb6d2d7335af41d89.json b/.changelog/f1be3dfba685443cb6d2d7335af41d89.json new file mode 100644 index 00000000000..679d3f8ca58 --- /dev/null +++ b/.changelog/f1be3dfba685443cb6d2d7335af41d89.json @@ -0,0 +1,8 @@ +{ + "id": "f1be3dfb-a685-443c-b6d2-d7335af41d89", + "type": "feature", + "description": "This release updates Amazon Managed Service for Prometheus APIs to support customer managed KMS keys.", + "modules": [ + "service/amp" + ] +} \ No newline at end of file diff --git a/.changelog/f55e20ca4ab24453bfe809a672ea4732.json b/.changelog/f55e20ca4ab24453bfe809a672ea4732.json new file mode 100644 index 00000000000..e0813e3db84 --- /dev/null +++ b/.changelog/f55e20ca4ab24453bfe809a672ea4732.json @@ -0,0 +1,8 @@ +{ + "id": "f55e20ca-4ab2-4453-bfe8-09a672ea4732", + "type": "feature", + "description": "MediaLive now supports the ability to configure the audio that an AWS Elemental Link UHD device produces, when the device is configured as the source for a flow in AWS Elemental MediaConnect.", + "modules": [ + "service/medialive" + ] +} \ No newline at end of file diff --git a/service/amp/api_op_CreateWorkspace.go b/service/amp/api_op_CreateWorkspace.go index 60e7c0a041c..7c6a953b1a4 100644 --- a/service/amp/api_op_CreateWorkspace.go +++ b/service/amp/api_op_CreateWorkspace.go @@ -39,6 +39,9 @@ type CreateWorkspaceInput struct { // idempotency of the request. ClientToken *string + // Optional, customer managed KMS key used to encrypt data for this workspace + KmsKeyArn *string + // Optional, user-provided tags for this workspace. Tags map[string]string @@ -63,6 +66,9 @@ type CreateWorkspaceOutput struct { // This member is required. WorkspaceId *string + // Customer managed KMS key ARN for this workspace + KmsKeyArn *string + // The tags of this workspace. Tags map[string]string diff --git a/service/amp/deserializers.go b/service/amp/deserializers.go index 088a8f6e77d..013411c1afa 100644 --- a/service/amp/deserializers.go +++ b/service/amp/deserializers.go @@ -876,6 +876,15 @@ func awsRestjson1_deserializeOpDocumentCreateWorkspaceOutput(v **CreateWorkspace sv.Arn = ptr.String(jtv) } + case "kmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + case "status": if err := awsRestjson1_deserializeDocumentWorkspaceStatus(&sv.Status, value); err != nil { return err @@ -5950,6 +5959,15 @@ func awsRestjson1_deserializeDocumentWorkspaceDescription(v **types.WorkspaceDes } } + case "kmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + case "prometheusEndpoint": if value != nil { jtv, ok := value.(string) @@ -6083,6 +6101,15 @@ func awsRestjson1_deserializeDocumentWorkspaceSummary(v **types.WorkspaceSummary } } + case "kmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + case "status": if err := awsRestjson1_deserializeDocumentWorkspaceStatus(&sv.Status, value); err != nil { return err diff --git a/service/amp/serializers.go b/service/amp/serializers.go index 72fbd28a3c8..2c0fabb401f 100644 --- a/service/amp/serializers.go +++ b/service/amp/serializers.go @@ -490,6 +490,11 @@ func awsRestjson1_serializeOpDocumentCreateWorkspaceInput(v *CreateWorkspaceInpu ok.String(*v.ClientToken) } + if v.KmsKeyArn != nil { + ok := object.Key("kmsKeyArn") + ok.String(*v.KmsKeyArn) + } + if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { diff --git a/service/amp/types/types.go b/service/amp/types/types.go index f638129f821..60818efc52f 100644 --- a/service/amp/types/types.go +++ b/service/amp/types/types.go @@ -435,6 +435,9 @@ type WorkspaceDescription struct { // Alias of this workspace. Alias *string + // The customer managed KMS key of this workspace. + KmsKeyArn *string + // Prometheus endpoint URI. PrometheusEndpoint *string @@ -481,6 +484,9 @@ type WorkspaceSummary struct { // Alias of this workspace. Alias *string + // Customer managed KMS key ARN for this workspace + KmsKeyArn *string + // The tags of this workspace. Tags map[string]string diff --git a/service/appintegrations/api_op_CreateApplication.go b/service/appintegrations/api_op_CreateApplication.go index c3742b8fc6f..98a439478d6 100644 --- a/service/appintegrations/api_op_CreateApplication.go +++ b/service/appintegrations/api_op_CreateApplication.go @@ -56,10 +56,17 @@ type CreateApplicationInput struct { // The description of the application. Description *string + // The configuration of events or requests that the application has access to. + Permissions []string + // The events that the application publishes. + // + // Deprecated: Publications has been replaced with Permissions Publications []types.Publication // The events that the application subscribes. + // + // Deprecated: Subscriptions has been replaced with Permissions Subscriptions []types.Subscription // The tags used to organize, track, or control access for this resource. For diff --git a/service/appintegrations/api_op_DeleteApplication.go b/service/appintegrations/api_op_DeleteApplication.go new file mode 100644 index 00000000000..be8eea0625c --- /dev/null +++ b/service/appintegrations/api_op_DeleteApplication.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the Application. Only Applications that don't have any Application +// Associations can be deleted. +func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicationInput, optFns ...func(*Options)) (*DeleteApplicationOutput, error) { + if params == nil { + params = &DeleteApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteApplication", params, optFns, c.addOperationDeleteApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteApplicationInput struct { + + // The Amazon Resource Name (ARN) of the Application. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type DeleteApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplication(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteApplication", + } +} diff --git a/service/appintegrations/api_op_GetApplication.go b/service/appintegrations/api_op_GetApplication.go index 56cc83ccfb4..5082e931da7 100644 --- a/service/appintegrations/api_op_GetApplication.go +++ b/service/appintegrations/api_op_GetApplication.go @@ -66,10 +66,17 @@ type GetApplicationOutput struct { // The namespace of the application. Namespace *string + // The configuration of events or requests that the application has access to. + Permissions []string + // The events that the application publishes. + // + // Deprecated: Publications has been replaced with Permissions Publications []types.Publication // The events that the application subscribes. + // + // Deprecated: Subscriptions has been replaced with Permissions Subscriptions []types.Subscription // The tags used to organize, track, or control access for this resource. For diff --git a/service/appintegrations/api_op_ListApplicationAssociations.go b/service/appintegrations/api_op_ListApplicationAssociations.go new file mode 100644 index 00000000000..c066cfcf431 --- /dev/null +++ b/service/appintegrations/api_op_ListApplicationAssociations.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/appintegrations/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a paginated list of application associations for an application. +func (c *Client) ListApplicationAssociations(ctx context.Context, params *ListApplicationAssociationsInput, optFns ...func(*Options)) (*ListApplicationAssociationsOutput, error) { + if params == nil { + params = &ListApplicationAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListApplicationAssociations", params, optFns, c.addOperationListApplicationAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListApplicationAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListApplicationAssociationsInput struct { + + // A unique identifier for the Application. + // + // This member is required. + ApplicationId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListApplicationAssociationsOutput struct { + + // List of Application Associations for the Application. + ApplicationAssociations []types.ApplicationAssociationSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListApplicationAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplicationAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplicationAssociations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListApplicationAssociations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListApplicationAssociationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplicationAssociations(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListApplicationAssociationsAPIClient is a client that implements the +// ListApplicationAssociations operation. +type ListApplicationAssociationsAPIClient interface { + ListApplicationAssociations(context.Context, *ListApplicationAssociationsInput, ...func(*Options)) (*ListApplicationAssociationsOutput, error) +} + +var _ ListApplicationAssociationsAPIClient = (*Client)(nil) + +// ListApplicationAssociationsPaginatorOptions is the paginator options for +// ListApplicationAssociations +type ListApplicationAssociationsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListApplicationAssociationsPaginator is a paginator for +// ListApplicationAssociations +type ListApplicationAssociationsPaginator struct { + options ListApplicationAssociationsPaginatorOptions + client ListApplicationAssociationsAPIClient + params *ListApplicationAssociationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationAssociationsPaginator returns a new +// ListApplicationAssociationsPaginator +func NewListApplicationAssociationsPaginator(client ListApplicationAssociationsAPIClient, params *ListApplicationAssociationsInput, optFns ...func(*ListApplicationAssociationsPaginatorOptions)) *ListApplicationAssociationsPaginator { + if params == nil { + params = &ListApplicationAssociationsInput{} + } + + options := ListApplicationAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListApplicationAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListApplicationAssociations page. +func (p *ListApplicationAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationAssociationsOutput, 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.ListApplicationAssociations(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_opListApplicationAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListApplicationAssociations", + } +} diff --git a/service/appintegrations/api_op_UpdateApplication.go b/service/appintegrations/api_op_UpdateApplication.go index 81cebd44e1a..a33b436ba33 100644 --- a/service/appintegrations/api_op_UpdateApplication.go +++ b/service/appintegrations/api_op_UpdateApplication.go @@ -45,10 +45,17 @@ type UpdateApplicationInput struct { // The name of the application. Name *string + // The configuration of events or requests that the application has access to. + Permissions []string + // The events that the application publishes. + // + // Deprecated: Publications has been replaced with Permissions Publications []types.Publication // The events that the application subscribes. + // + // Deprecated: Subscriptions has been replaced with Permissions Subscriptions []types.Subscription noSmithyDocumentSerde diff --git a/service/appintegrations/deserializers.go b/service/appintegrations/deserializers.go index 2efe3564091..2454193f2ac 100644 --- a/service/appintegrations/deserializers.go +++ b/service/appintegrations/deserializers.go @@ -135,6 +135,9 @@ func awsRestjson1_deserializeOpErrorCreateApplication(response *smithyhttp.Respo case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -600,6 +603,101 @@ func awsRestjson1_deserializeOpDocumentCreateEventIntegrationOutput(v **CreateEv return nil } +type awsRestjson1_deserializeOpDeleteApplication struct { +} + +func (*awsRestjson1_deserializeOpDeleteApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteApplication) 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_deserializeOpErrorDeleteApplication(response, &metadata) + } + output := &DeleteApplicationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteApplication(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 awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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 + + } +} + type awsRestjson1_deserializeOpDeleteDataIntegration struct { } @@ -1017,6 +1115,11 @@ func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOu sv.Namespace = ptr.String(jtv) } + case "Permissions": + if err := awsRestjson1_deserializeDocumentPermissionList(&sv.Permissions, value); err != nil { + return err + } + case "Publications": if err := awsRestjson1_deserializeDocumentPublicationList(&sv.Publications, value); err != nil { return err @@ -1469,6 +1572,174 @@ func awsRestjson1_deserializeOpDocumentGetEventIntegrationOutput(v **GetEventInt return nil } +type awsRestjson1_deserializeOpListApplicationAssociations struct { +} + +func (*awsRestjson1_deserializeOpListApplicationAssociations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListApplicationAssociations) 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_deserializeOpErrorListApplicationAssociations(response, &metadata) + } + output := &ListApplicationAssociationsOutput{} + 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_deserializeOpDocumentListApplicationAssociationsOutput(&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_deserializeOpErrorListApplicationAssociations(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 awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsRestjson1_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDocumentListApplicationAssociationsOutput(v **ListApplicationAssociationsOutput, 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 *ListApplicationAssociationsOutput + if *v == nil { + sv = &ListApplicationAssociationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationAssociations": + if err := awsRestjson1_deserializeDocumentApplicationAssociationsList(&sv.ApplicationAssociations, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListApplications struct { } @@ -2725,6 +2996,9 @@ func awsRestjson1_deserializeOpErrorUpdateApplication(response *smithyhttp.Respo case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3177,6 +3451,42 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo return output } +func awsRestjson1_deserializeErrorUnsupportedOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnsupportedOperationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentUnsupportedOperationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3253,6 +3563,98 @@ func awsRestjson1_deserializeDocumentApplicationApprovedOrigins(v *[]string, val return nil } +func awsRestjson1_deserializeDocumentApplicationAssociationsList(v *[]types.ApplicationAssociationSummary, 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.ApplicationAssociationSummary + if *v == nil { + cv = []types.ApplicationAssociationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ApplicationAssociationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentApplicationAssociationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationAssociationSummary(v **types.ApplicationAssociationSummary, 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.ApplicationAssociationSummary + if *v == nil { + sv = &types.ApplicationAssociationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + case "ApplicationAssociationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ApplicationAssociationArn = ptr.String(jtv) + } + + case "ClientId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientId to be of type string, got %T instead", value) + } + sv.ClientId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentApplicationsList(v *[]types.ApplicationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4254,6 +4656,42 @@ func awsRestjson1_deserializeDocumentObjectConfiguration(v *map[string]map[strin return nil } +func awsRestjson1_deserializeDocumentPermissionList(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 Permission to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentPublication(v **types.Publication, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4642,3 +5080,43 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc *v = sv return nil } + +func awsRestjson1_deserializeDocumentUnsupportedOperationException(v **types.UnsupportedOperationException, 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.UnsupportedOperationException + if *v == nil { + sv = &types.UnsupportedOperationException{} + } 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/appintegrations/generated.json b/service/appintegrations/generated.json index 663be6340f7..9b93b3aa814 100644 --- a/service/appintegrations/generated.json +++ b/service/appintegrations/generated.json @@ -12,11 +12,13 @@ "api_op_CreateApplication.go", "api_op_CreateDataIntegration.go", "api_op_CreateEventIntegration.go", + "api_op_DeleteApplication.go", "api_op_DeleteDataIntegration.go", "api_op_DeleteEventIntegration.go", "api_op_GetApplication.go", "api_op_GetDataIntegration.go", "api_op_GetEventIntegration.go", + "api_op_ListApplicationAssociations.go", "api_op_ListApplications.go", "api_op_ListDataIntegrationAssociations.go", "api_op_ListDataIntegrations.go", diff --git a/service/appintegrations/serializers.go b/service/appintegrations/serializers.go index b9f9817a6c9..e5086c11215 100644 --- a/service/appintegrations/serializers.go +++ b/service/appintegrations/serializers.go @@ -108,6 +108,13 @@ func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplication ok.String(*v.Namespace) } + if v.Permissions != nil { + ok := object.Key("Permissions") + if err := awsRestjson1_serializeDocumentPermissionList(v.Permissions, ok); err != nil { + return err + } + } + if v.Publications != nil { ok := object.Key("Publications") if err := awsRestjson1_serializeDocumentPublicationList(v.Publications, ok); err != nil { @@ -359,6 +366,71 @@ func awsRestjson1_serializeOpDocumentCreateEventIntegrationInput(v *CreateEventI return nil } +type awsRestjson1_serializeOpDeleteApplication struct { +} + +func (*awsRestjson1_serializeOpDeleteApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteApplication) 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.(*DeleteApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{Arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + 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_serializeOpHttpBindingsDeleteApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteApplicationInput(v *DeleteApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteDataIntegration struct { } @@ -684,6 +756,79 @@ func awsRestjson1_serializeOpHttpBindingsGetEventIntegrationInput(v *GetEventInt return nil } +type awsRestjson1_serializeOpListApplicationAssociations struct { +} + +func (*awsRestjson1_serializeOpListApplicationAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListApplicationAssociations) 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.(*ListApplicationAssociationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/associations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + 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_serializeOpHttpBindingsListApplicationAssociationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListApplicationAssociationsInput(v *ListApplicationAssociationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListApplications struct { } @@ -1345,6 +1490,13 @@ func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplication ok.String(*v.Name) } + if v.Permissions != nil { + ok := object.Key("Permissions") + if err := awsRestjson1_serializeDocumentPermissionList(v.Permissions, ok); err != nil { + return err + } + } + if v.Publications != nil { ok := object.Key("Publications") if err := awsRestjson1_serializeDocumentPublicationList(v.Publications, ok); err != nil { @@ -1674,6 +1826,17 @@ func awsRestjson1_serializeDocumentObjectConfiguration(v map[string]map[string][ return nil } +func awsRestjson1_serializeDocumentPermissionList(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_serializeDocumentPublication(v *types.Publication, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/appintegrations/types/errors.go b/service/appintegrations/types/errors.go index 9c2391cfb0f..409ad010933 100644 --- a/service/appintegrations/types/errors.go +++ b/service/appintegrations/types/errors.go @@ -188,3 +188,29 @@ func (e *ThrottlingException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The operation is not supported. +type UnsupportedOperationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedOperationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedOperationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedOperationException" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/appintegrations/types/types.go b/service/appintegrations/types/types.go index 95178986538..2f9e830adb8 100644 --- a/service/appintegrations/types/types.go +++ b/service/appintegrations/types/types.go @@ -7,6 +7,22 @@ import ( "time" ) +// Summary information about the Application Association. +type ApplicationAssociationSummary struct { + + // The Amazon Resource Name (ARN) of the Application. + ApplicationArn *string + + // The Amazon Resource Name (ARN) of the Application Association. + ApplicationAssociationArn *string + + // The identifier for the client that is associated with the Application + // Association. + ClientId *string + + noSmithyDocumentSerde +} + // The configuration for where the application should be loaded from. type ApplicationSourceConfig struct { diff --git a/service/appintegrations/validators.go b/service/appintegrations/validators.go index 6fb8e88a20e..f8d276dd161 100644 --- a/service/appintegrations/validators.go +++ b/service/appintegrations/validators.go @@ -70,6 +70,26 @@ func (m *validateOpCreateEventIntegration) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDeleteApplication struct { +} + +func (*validateOpDeleteApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDataIntegration struct { } @@ -170,6 +190,26 @@ func (m *validateOpGetEventIntegration) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListApplicationAssociations struct { +} + +func (*validateOpListApplicationAssociations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListApplicationAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListApplicationAssociationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListApplicationAssociationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListDataIntegrationAssociations struct { } @@ -342,6 +382,10 @@ func addOpCreateEventIntegrationValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpCreateEventIntegration{}, middleware.After) } +func addOpDeleteApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteApplication{}, middleware.After) +} + func addOpDeleteDataIntegrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataIntegration{}, middleware.After) } @@ -362,6 +406,10 @@ func addOpGetEventIntegrationValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetEventIntegration{}, middleware.After) } +func addOpListApplicationAssociationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListApplicationAssociations{}, middleware.After) +} + func addOpListDataIntegrationAssociationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDataIntegrationAssociations{}, middleware.After) } @@ -629,6 +677,21 @@ func validateOpCreateEventIntegrationInput(v *CreateEventIntegrationInput) error } } +func validateOpDeleteApplicationInput(v *DeleteApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDataIntegrationInput(v *DeleteDataIntegrationInput) error { if v == nil { return nil @@ -704,6 +767,21 @@ func validateOpGetEventIntegrationInput(v *GetEventIntegrationInput) error { } } +func validateOpListApplicationAssociationsInput(v *ListApplicationAssociationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListApplicationAssociationsInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListDataIntegrationAssociationsInput(v *ListDataIntegrationAssociationsInput) error { if v == nil { return nil diff --git a/service/bedrockagent/deserializers.go b/service/bedrockagent/deserializers.go index 896671fac8c..e541f20711e 100644 --- a/service/bedrockagent/deserializers.go +++ b/service/bedrockagent/deserializers.go @@ -9958,6 +9958,145 @@ func awsRestjson1_deserializeDocumentPromptOverrideConfiguration(v **types.Promp return nil } +func awsRestjson1_deserializeDocumentRdsConfiguration(v **types.RdsConfiguration, 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.RdsConfiguration + if *v == nil { + sv = &types.RdsConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "credentialsSecretArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) + } + sv.CredentialsSecretArn = ptr.String(jtv) + } + + case "databaseName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RdsDatabaseName to be of type string, got %T instead", value) + } + sv.DatabaseName = ptr.String(jtv) + } + + case "fieldMapping": + if err := awsRestjson1_deserializeDocumentRdsFieldMapping(&sv.FieldMapping, value); err != nil { + return err + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RdsArn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "tableName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RdsTableName to be of type string, got %T instead", value) + } + sv.TableName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRdsFieldMapping(v **types.RdsFieldMapping, 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.RdsFieldMapping + if *v == nil { + sv = &types.RdsFieldMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "metadataField": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + sv.MetadataField = ptr.String(jtv) + } + + case "primaryKeyField": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + sv.PrimaryKeyField = ptr.String(jtv) + } + + case "textField": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + sv.TextField = ptr.String(jtv) + } + + case "vectorField": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) + } + sv.VectorField = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentRecommendedActions(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10433,6 +10572,11 @@ func awsRestjson1_deserializeDocumentStorageConfiguration(v **types.StorageConfi return err } + case "rdsConfiguration": + if err := awsRestjson1_deserializeDocumentRdsConfiguration(&sv.RdsConfiguration, value); err != nil { + return err + } + case "redisEnterpriseCloudConfiguration": if err := awsRestjson1_deserializeDocumentRedisEnterpriseCloudConfiguration(&sv.RedisEnterpriseCloudConfiguration, value); err != nil { return err diff --git a/service/bedrockagent/serializers.go b/service/bedrockagent/serializers.go index cc7852f6150..458d295075d 100644 --- a/service/bedrockagent/serializers.go +++ b/service/bedrockagent/serializers.go @@ -4142,6 +4142,67 @@ func awsRestjson1_serializeDocumentPromptOverrideConfiguration(v *types.PromptOv return nil } +func awsRestjson1_serializeDocumentRdsConfiguration(v *types.RdsConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CredentialsSecretArn != nil { + ok := object.Key("credentialsSecretArn") + ok.String(*v.CredentialsSecretArn) + } + + if v.DatabaseName != nil { + ok := object.Key("databaseName") + ok.String(*v.DatabaseName) + } + + if v.FieldMapping != nil { + ok := object.Key("fieldMapping") + if err := awsRestjson1_serializeDocumentRdsFieldMapping(v.FieldMapping, ok); err != nil { + return err + } + } + + if v.ResourceArn != nil { + ok := object.Key("resourceArn") + ok.String(*v.ResourceArn) + } + + if v.TableName != nil { + ok := object.Key("tableName") + ok.String(*v.TableName) + } + + return nil +} + +func awsRestjson1_serializeDocumentRdsFieldMapping(v *types.RdsFieldMapping, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetadataField != nil { + ok := object.Key("metadataField") + ok.String(*v.MetadataField) + } + + if v.PrimaryKeyField != nil { + ok := object.Key("primaryKeyField") + ok.String(*v.PrimaryKeyField) + } + + if v.TextField != nil { + ok := object.Key("textField") + ok.String(*v.TextField) + } + + if v.VectorField != nil { + ok := object.Key("vectorField") + ok.String(*v.VectorField) + } + + return nil +} + func awsRestjson1_serializeDocumentRedisEnterpriseCloudConfiguration(v *types.RedisEnterpriseCloudConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4281,6 +4342,13 @@ func awsRestjson1_serializeDocumentStorageConfiguration(v *types.StorageConfigur } } + if v.RdsConfiguration != nil { + ok := object.Key("rdsConfiguration") + if err := awsRestjson1_serializeDocumentRdsConfiguration(v.RdsConfiguration, ok); err != nil { + return err + } + } + if v.RedisEnterpriseCloudConfiguration != nil { ok := object.Key("redisEnterpriseCloudConfiguration") if err := awsRestjson1_serializeDocumentRedisEnterpriseCloudConfiguration(v.RedisEnterpriseCloudConfiguration, ok); err != nil { diff --git a/service/bedrockagent/types/enums.go b/service/bedrockagent/types/enums.go index 1f83ce046a8..cfc164b57d6 100644 --- a/service/bedrockagent/types/enums.go +++ b/service/bedrockagent/types/enums.go @@ -281,6 +281,7 @@ const ( KnowledgeBaseStorageTypeOpensearchServerless KnowledgeBaseStorageType = "OPENSEARCH_SERVERLESS" KnowledgeBaseStorageTypePinecone KnowledgeBaseStorageType = "PINECONE" KnowledgeBaseStorageTypeRedisEnterpriseCloud KnowledgeBaseStorageType = "REDIS_ENTERPRISE_CLOUD" + KnowledgeBaseStorageTypeRds KnowledgeBaseStorageType = "RDS" ) // Values returns all known values for KnowledgeBaseStorageType. Note that this @@ -291,6 +292,7 @@ func (KnowledgeBaseStorageType) Values() []KnowledgeBaseStorageType { "OPENSEARCH_SERVERLESS", "PINECONE", "REDIS_ENTERPRISE_CLOUD", + "RDS", } } diff --git a/service/bedrockagent/types/types.go b/service/bedrockagent/types/types.go index d663d88275d..ceb567213d6 100644 --- a/service/bedrockagent/types/types.go +++ b/service/bedrockagent/types/types.go @@ -1052,6 +1052,63 @@ type PromptOverrideConfiguration struct { noSmithyDocumentSerde } +// Contains the configurations to use RDS to store knowledge base data. +type RdsConfiguration struct { + + // Arn of a SecretsManager Secret. + // + // This member is required. + CredentialsSecretArn *string + + // Name of the database within RDS + // + // This member is required. + DatabaseName *string + + // A mapping of Bedrock Knowledge Base fields to RDS column names + // + // This member is required. + FieldMapping *RdsFieldMapping + + // Arn of a RDS Resource. + // + // This member is required. + ResourceArn *string + + // Name of the table within RDS + // + // This member is required. + TableName *string + + noSmithyDocumentSerde +} + +// A mapping of Bedrock Knowledge Base fields to RDS column names +type RdsFieldMapping struct { + + // Name of the column + // + // This member is required. + MetadataField *string + + // Name of the column + // + // This member is required. + PrimaryKeyField *string + + // Name of the column + // + // This member is required. + TextField *string + + // Name of the column + // + // This member is required. + VectorField *string + + noSmithyDocumentSerde +} + // Contains the configurations to use Redis Enterprise Cloud to store knowledge // base data. type RedisEnterpriseCloudConfiguration struct { @@ -1150,6 +1207,9 @@ type StorageConfiguration struct { // Contains the configurations to use Pinecone to store knowledge base data. PineconeConfiguration *PineconeConfiguration + // Contains the configurations to use RDS to store knowledge base data. + RdsConfiguration *RdsConfiguration + // Contains the configurations to use Redis Enterprise Cloud to store knowledge // base data. RedisEnterpriseCloudConfiguration *RedisEnterpriseCloudConfiguration diff --git a/service/bedrockagent/validators.go b/service/bedrockagent/validators.go index db6e13d0e8b..ff441950fcf 100644 --- a/service/bedrockagent/validators.go +++ b/service/bedrockagent/validators.go @@ -1192,6 +1192,61 @@ func validatePromptOverrideConfiguration(v *types.PromptOverrideConfiguration) e } } +func validateRdsConfiguration(v *types.RdsConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RdsConfiguration"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.CredentialsSecretArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CredentialsSecretArn")) + } + if v.DatabaseName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DatabaseName")) + } + if v.TableName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableName")) + } + if v.FieldMapping == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldMapping")) + } else if v.FieldMapping != nil { + if err := validateRdsFieldMapping(v.FieldMapping); err != nil { + invalidParams.AddNested("FieldMapping", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRdsFieldMapping(v *types.RdsFieldMapping) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RdsFieldMapping"} + if v.PrimaryKeyField == nil { + invalidParams.Add(smithy.NewErrParamRequired("PrimaryKeyField")) + } + if v.VectorField == nil { + invalidParams.Add(smithy.NewErrParamRequired("VectorField")) + } + if v.TextField == nil { + invalidParams.Add(smithy.NewErrParamRequired("TextField")) + } + if v.MetadataField == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataField")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRedisEnterpriseCloudConfiguration(v *types.RedisEnterpriseCloudConfiguration) error { if v == nil { return nil @@ -1279,6 +1334,11 @@ func validateStorageConfiguration(v *types.StorageConfiguration) error { invalidParams.AddNested("RedisEnterpriseCloudConfiguration", err.(smithy.InvalidParamsError)) } } + if v.RdsConfiguration != nil { + if err := validateRdsConfiguration(v.RdsConfiguration); err != nil { + invalidParams.AddNested("RdsConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/codecommit/api_op_BatchGetRepositories.go b/service/codecommit/api_op_BatchGetRepositories.go index c256530210b..8482104fb50 100644 --- a/service/codecommit/api_op_BatchGetRepositories.go +++ b/service/codecommit/api_op_BatchGetRepositories.go @@ -48,6 +48,10 @@ type BatchGetRepositoriesInput struct { // Represents the output of a batch get repositories operation. type BatchGetRepositoriesOutput struct { + // Returns information about any errors returned when attempting to retrieve + // information about the repositories. + Errors []types.BatchGetRepositoriesError + // A list of repositories returned by the batch get repositories operation. Repositories []types.RepositoryMetadata diff --git a/service/codecommit/api_op_CreateRepository.go b/service/codecommit/api_op_CreateRepository.go index 3675df7a50d..ac0114c9098 100644 --- a/service/codecommit/api_op_CreateRepository.go +++ b/service/codecommit/api_op_CreateRepository.go @@ -41,6 +41,14 @@ type CreateRepositoryInput struct { // This member is required. RepositoryName *string + // The ID of the encryption key. You can view the ID of an encryption key in the + // KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more + // information about acceptable values for kmsKeyID, see KeyId (https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId) + // in the Decrypt API description in the Key Management Service API Reference. If + // no key is specified, the default aws/codecommit Amazon Web Services managed key + // is used. + KmsKeyId *string + // A comment or description about the new repository. The description field for a // repository accepts all HTML characters and all valid Unicode characters. // Applications that do not HTML-encode the description and display it in a webpage diff --git a/service/codecommit/api_op_UpdateRepositoryEncryptionKey.go b/service/codecommit/api_op_UpdateRepositoryEncryptionKey.go new file mode 100644 index 00000000000..df7f20a4c56 --- /dev/null +++ b/service/codecommit/api_op_UpdateRepositoryEncryptionKey.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecommit + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the Key Management Service encryption key used to encrypt and decrypt a +// CodeCommit repository. +func (c *Client) UpdateRepositoryEncryptionKey(ctx context.Context, params *UpdateRepositoryEncryptionKeyInput, optFns ...func(*Options)) (*UpdateRepositoryEncryptionKeyOutput, error) { + if params == nil { + params = &UpdateRepositoryEncryptionKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRepositoryEncryptionKey", params, optFns, c.addOperationUpdateRepositoryEncryptionKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRepositoryEncryptionKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRepositoryEncryptionKeyInput struct { + + // The ID of the encryption key. You can view the ID of an encryption key in the + // KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more + // information about acceptable values for keyID, see KeyId (https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId) + // in the Decrypt API description in the Key Management Service API Reference. + // + // This member is required. + KmsKeyId *string + + // The name of the repository for which you want to update the KMS encryption key + // used to encrypt and decrypt the repository. + // + // This member is required. + RepositoryName *string + + noSmithyDocumentSerde +} + +type UpdateRepositoryEncryptionKeyOutput struct { + + // The ID of the encryption key. + KmsKeyId *string + + // The ID of the encryption key formerly used to encrypt and decrypt the + // repository. + OriginalKmsKeyId *string + + // The ID of the repository. + RepositoryId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRepositoryEncryptionKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateRepositoryEncryptionKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateRepositoryEncryptionKey{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateRepositoryEncryptionKey"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRepositoryEncryptionKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRepositoryEncryptionKey(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRepositoryEncryptionKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateRepositoryEncryptionKey", + } +} diff --git a/service/codecommit/deserializers.go b/service/codecommit/deserializers.go index ab477785886..c32652e04ad 100644 --- a/service/codecommit/deserializers.go +++ b/service/codecommit/deserializers.go @@ -1782,6 +1782,12 @@ func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Respon case strings.EqualFold("EncryptionKeyDisabledException", errorCode): return awsAwsjson11_deserializeErrorEncryptionKeyDisabledException(response, errorBody) + case strings.EqualFold("EncryptionKeyInvalidIdException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyInvalidIdException(response, errorBody) + + case strings.EqualFold("EncryptionKeyInvalidUsageException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyInvalidUsageException(response, errorBody) + case strings.EqualFold("EncryptionKeyNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEncryptionKeyNotFoundException(response, errorBody) @@ -11357,6 +11363,147 @@ func awsAwsjson11_deserializeOpErrorUpdateRepositoryDescription(response *smithy } } +type awsAwsjson11_deserializeOpUpdateRepositoryEncryptionKey struct { +} + +func (*awsAwsjson11_deserializeOpUpdateRepositoryEncryptionKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateRepositoryEncryptionKey) 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_deserializeOpErrorUpdateRepositoryEncryptionKey(response, &metadata) + } + output := &UpdateRepositoryEncryptionKeyOutput{} + 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_deserializeOpDocumentUpdateRepositoryEncryptionKeyOutput(&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_deserializeOpErrorUpdateRepositoryEncryptionKey(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("EncryptionIntegrityChecksFailedException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionIntegrityChecksFailedException(response, errorBody) + + case strings.EqualFold("EncryptionKeyAccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyAccessDeniedException(response, errorBody) + + case strings.EqualFold("EncryptionKeyDisabledException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyDisabledException(response, errorBody) + + case strings.EqualFold("EncryptionKeyInvalidIdException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyInvalidIdException(response, errorBody) + + case strings.EqualFold("EncryptionKeyInvalidUsageException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyInvalidUsageException(response, errorBody) + + case strings.EqualFold("EncryptionKeyNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyNotFoundException(response, errorBody) + + case strings.EqualFold("EncryptionKeyRequiredException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyRequiredException(response, errorBody) + + case strings.EqualFold("EncryptionKeyUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorEncryptionKeyUnavailableException(response, errorBody) + + case strings.EqualFold("InvalidRepositoryNameException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRepositoryNameException(response, errorBody) + + case strings.EqualFold("RepositoryDoesNotExistException", errorCode): + return awsAwsjson11_deserializeErrorRepositoryDoesNotExistException(response, errorBody) + + case strings.EqualFold("RepositoryNameRequiredException", errorCode): + return awsAwsjson11_deserializeErrorRepositoryNameRequiredException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpUpdateRepositoryName struct { } @@ -12890,6 +13037,76 @@ func awsAwsjson11_deserializeErrorEncryptionKeyDisabledException(response *smith return output } +func awsAwsjson11_deserializeErrorEncryptionKeyInvalidIdException(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.EncryptionKeyInvalidIdException{} + err := awsAwsjson11_deserializeDocumentEncryptionKeyInvalidIdException(&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_deserializeErrorEncryptionKeyInvalidUsageException(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.EncryptionKeyInvalidUsageException{} + err := awsAwsjson11_deserializeDocumentEncryptionKeyInvalidUsageException(&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_deserializeErrorEncryptionKeyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -12925,6 +13142,41 @@ func awsAwsjson11_deserializeErrorEncryptionKeyNotFoundException(response *smith return output } +func awsAwsjson11_deserializeErrorEncryptionKeyRequiredException(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.EncryptionKeyRequiredException{} + err := awsAwsjson11_deserializeDocumentEncryptionKeyRequiredException(&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_deserializeErrorEncryptionKeyUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -19389,6 +19641,107 @@ func awsAwsjson11_deserializeDocumentBatchGetCommitsErrorsList(v *[]types.BatchG return nil } +func awsAwsjson11_deserializeDocumentBatchGetRepositoriesError(v **types.BatchGetRepositoriesError, 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.BatchGetRepositoriesError + if *v == nil { + sv = &types.BatchGetRepositoriesError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchGetRepositoriesErrorCodeEnum to be of type string, got %T instead", value) + } + sv.ErrorCode = types.BatchGetRepositoriesErrorCodeEnum(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "repositoryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryId to be of type string, got %T instead", value) + } + sv.RepositoryId = ptr.String(jtv) + } + + case "repositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBatchGetRepositoriesErrorsList(v *[]types.BatchGetRepositoriesError, 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.BatchGetRepositoriesError + if *v == nil { + cv = []types.BatchGetRepositoriesError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchGetRepositoriesError + destAddr := &col + if err := awsAwsjson11_deserializeDocumentBatchGetRepositoriesError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentBeforeCommitIdAndAfterCommitIdAreSameException(v **types.BeforeCommitIdAndAfterCommitIdAreSameException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21552,6 +21905,86 @@ func awsAwsjson11_deserializeDocumentEncryptionKeyDisabledException(v **types.En return nil } +func awsAwsjson11_deserializeDocumentEncryptionKeyInvalidIdException(v **types.EncryptionKeyInvalidIdException, 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.EncryptionKeyInvalidIdException + if *v == nil { + sv = &types.EncryptionKeyInvalidIdException{} + } 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEncryptionKeyInvalidUsageException(v **types.EncryptionKeyInvalidUsageException, 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.EncryptionKeyInvalidUsageException + if *v == nil { + sv = &types.EncryptionKeyInvalidUsageException{} + } 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentEncryptionKeyNotFoundException(v **types.EncryptionKeyNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21592,6 +22025,46 @@ func awsAwsjson11_deserializeDocumentEncryptionKeyNotFoundException(v **types.En return nil } +func awsAwsjson11_deserializeDocumentEncryptionKeyRequiredException(v **types.EncryptionKeyRequiredException, 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.EncryptionKeyRequiredException + if *v == nil { + sv = &types.EncryptionKeyRequiredException{} + } 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentEncryptionKeyUnavailableException(v **types.EncryptionKeyUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -28345,6 +28818,15 @@ func awsAwsjson11_deserializeDocumentRepositoryMetadata(v **types.RepositoryMeta sv.DefaultBranch = ptr.String(jtv) } + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + case "lastModifiedDate": if value != nil { switch jtv := value.(type) { @@ -30462,6 +30944,11 @@ func awsAwsjson11_deserializeOpDocumentBatchGetRepositoriesOutput(v **BatchGetRe for key, value := range shape { switch key { + case "errors": + if err := awsAwsjson11_deserializeDocumentBatchGetRepositoriesErrorsList(&sv.Errors, value); err != nil { + return err + } + case "repositories": if err := awsAwsjson11_deserializeDocumentRepositoryMetadataList(&sv.Repositories, value); err != nil { return err @@ -33365,3 +33852,61 @@ func awsAwsjson11_deserializeOpDocumentUpdatePullRequestTitleOutput(v **UpdatePu *v = sv return nil } + +func awsAwsjson11_deserializeOpDocumentUpdateRepositoryEncryptionKeyOutput(v **UpdateRepositoryEncryptionKeyOutput, 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 *UpdateRepositoryEncryptionKeyOutput + if *v == nil { + sv = &UpdateRepositoryEncryptionKeyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "originalKmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.OriginalKmsKeyId = ptr.String(jtv) + } + + case "repositoryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryId to be of type string, got %T instead", value) + } + sv.RepositoryId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/codecommit/doc.go b/service/codecommit/doc.go index ebaa1113570..dd5faf9cb72 100644 --- a/service/codecommit/doc.go +++ b/service/codecommit/doc.go @@ -16,6 +16,8 @@ // your Amazon Web Services account. // - UpdateRepositoryDescription , which sets or updates the description of the // repository. +// - UpdateRepositoryEncryptionKey , which updates the Key Management Service +// encryption key used to encrypt and decrypt a repository. // - UpdateRepositoryName , which changes the name of the repository. If you // change the name of a repository, no other users of that repository can access it // until you send them the new HTTPS or SSH URL to use. diff --git a/service/codecommit/endpoints.go b/service/codecommit/endpoints.go index 55d63e10775..db1274070f4 100644 --- a/service/codecommit/endpoints.go +++ b/service/codecommit/endpoints.go @@ -366,7 +366,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://codecommit-fips.") diff --git a/service/codecommit/generated.json b/service/codecommit/generated.json index cce34d019e5..50614f74d82 100644 --- a/service/codecommit/generated.json +++ b/service/codecommit/generated.json @@ -86,6 +86,7 @@ "api_op_UpdatePullRequestStatus.go", "api_op_UpdatePullRequestTitle.go", "api_op_UpdateRepositoryDescription.go", + "api_op_UpdateRepositoryEncryptionKey.go", "api_op_UpdateRepositoryName.go", "auth.go", "deserializers.go", diff --git a/service/codecommit/serializers.go b/service/codecommit/serializers.go index 088798a3c83..c614d888d45 100644 --- a/service/codecommit/serializers.go +++ b/service/codecommit/serializers.go @@ -4250,6 +4250,61 @@ func (m *awsAwsjson11_serializeOpUpdateRepositoryDescription) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateRepositoryEncryptionKey struct { +} + +func (*awsAwsjson11_serializeOpUpdateRepositoryEncryptionKey) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateRepositoryEncryptionKey) 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.(*UpdateRepositoryEncryptionKeyInput) + _ = 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("CodeCommit_20150413.UpdateRepositoryEncryptionKey") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateRepositoryEncryptionKeyInput(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_serializeOpUpdateRepositoryName struct { } @@ -4978,6 +5033,11 @@ func awsAwsjson11_serializeOpDocumentCreateRepositoryInput(v *CreateRepositoryIn object := value.Object() defer object.Close() + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + if v.RepositoryDescription != nil { ok := object.Key("repositoryDescription") ok.String(*v.RepositoryDescription) @@ -6690,6 +6750,23 @@ func awsAwsjson11_serializeOpDocumentUpdateRepositoryDescriptionInput(v *UpdateR return nil } +func awsAwsjson11_serializeOpDocumentUpdateRepositoryEncryptionKeyInput(v *UpdateRepositoryEncryptionKeyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.RepositoryName != nil { + ok := object.Key("repositoryName") + ok.String(*v.RepositoryName) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateRepositoryNameInput(v *UpdateRepositoryNameInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/codecommit/types/enums.go b/service/codecommit/types/enums.go index 83773ec5828..9d807cbf6ab 100644 --- a/service/codecommit/types/enums.go +++ b/service/codecommit/types/enums.go @@ -20,6 +20,33 @@ func (ApprovalState) Values() []ApprovalState { } } +type BatchGetRepositoriesErrorCodeEnum string + +// Enum values for BatchGetRepositoriesErrorCodeEnum +const ( + BatchGetRepositoriesErrorCodeEnumEncryptionIntegrityChecksFailedException BatchGetRepositoriesErrorCodeEnum = "EncryptionIntegrityChecksFailedException" + BatchGetRepositoriesErrorCodeEnumEncryptionKeyAccessDeniedException BatchGetRepositoriesErrorCodeEnum = "EncryptionKeyAccessDeniedException" + BatchGetRepositoriesErrorCodeEnumEncryptionKeyDisabledException BatchGetRepositoriesErrorCodeEnum = "EncryptionKeyDisabledException" + BatchGetRepositoriesErrorCodeEnumEncryptionKeyNotFoundException BatchGetRepositoriesErrorCodeEnum = "EncryptionKeyNotFoundException" + BatchGetRepositoriesErrorCodeEnumEncryptionKeyUnavailableException BatchGetRepositoriesErrorCodeEnum = "EncryptionKeyUnavailableException" + BatchGetRepositoriesErrorCodeEnumRepositoryDoesNotExistException BatchGetRepositoriesErrorCodeEnum = "RepositoryDoesNotExistException" +) + +// Values returns all known values for BatchGetRepositoriesErrorCodeEnum. 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 (BatchGetRepositoriesErrorCodeEnum) Values() []BatchGetRepositoriesErrorCodeEnum { + return []BatchGetRepositoriesErrorCodeEnum{ + "EncryptionIntegrityChecksFailedException", + "EncryptionKeyAccessDeniedException", + "EncryptionKeyDisabledException", + "EncryptionKeyNotFoundException", + "EncryptionKeyUnavailableException", + "RepositoryDoesNotExistException", + } +} + type ChangeTypeEnum string // Enum values for ChangeTypeEnum diff --git a/service/codecommit/types/errors.go b/service/codecommit/types/errors.go index 0016e37e1e0..19f96aa172c 100644 --- a/service/codecommit/types/errors.go +++ b/service/codecommit/types/errors.go @@ -1147,6 +1147,62 @@ func (e *EncryptionKeyDisabledException) ErrorCode() string { } func (e *EncryptionKeyDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The Key Management Service encryption key is not valid. +type EncryptionKeyInvalidIdException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EncryptionKeyInvalidIdException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EncryptionKeyInvalidIdException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EncryptionKeyInvalidIdException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EncryptionKeyInvalidIdException" + } + return *e.ErrorCodeOverride +} +func (e *EncryptionKeyInvalidIdException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A KMS encryption key was used to try and encrypt or decrypt a repository, but +// either the repository or the key was not in a valid state to support the +// operation. +type EncryptionKeyInvalidUsageException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EncryptionKeyInvalidUsageException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EncryptionKeyInvalidUsageException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EncryptionKeyInvalidUsageException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EncryptionKeyInvalidUsageException" + } + return *e.ErrorCodeOverride +} +func (e *EncryptionKeyInvalidUsageException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // No encryption key was found. type EncryptionKeyNotFoundException struct { Message *string @@ -1173,6 +1229,32 @@ func (e *EncryptionKeyNotFoundException) ErrorCode() string { } func (e *EncryptionKeyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// A KMS encryption key ID is required but was not specified. +type EncryptionKeyRequiredException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EncryptionKeyRequiredException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EncryptionKeyRequiredException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EncryptionKeyRequiredException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EncryptionKeyRequiredException" + } + return *e.ErrorCodeOverride +} +func (e *EncryptionKeyRequiredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The encryption key is not available. type EncryptionKeyUnavailableException struct { Message *string diff --git a/service/codecommit/types/types.go b/service/codecommit/types/types.go index 19600681e5d..c6737cab977 100644 --- a/service/codecommit/types/types.go +++ b/service/codecommit/types/types.go @@ -196,6 +196,27 @@ type BatchGetCommitsError struct { noSmithyDocumentSerde } +// Returns information about errors in a BatchGetRepositories operation. +type BatchGetRepositoriesError struct { + + // An error code that specifies the type of failure. + ErrorCode BatchGetRepositoriesErrorCodeEnum + + // An error message that provides detail about why the repository either was not + // found or was not in a valid state. + ErrorMessage *string + + // The ID of a repository that either could not be found or was not in a valid + // state. + RepositoryId *string + + // The name of a repository that either could not be found or was not in a valid + // state. + RepositoryName *string + + noSmithyDocumentSerde +} + // Returns information about a specific Git blob object. type BlobMetadata struct { @@ -1026,6 +1047,10 @@ type RepositoryMetadata struct { // The repository's default branch name. DefaultBranch *string + // The ID of the Key Management Service encryption key used to encrypt and decrypt + // the repository. + KmsKeyId *string + // The date and time the repository was last modified, in timestamp format. LastModifiedDate *time.Time diff --git a/service/codecommit/validators.go b/service/codecommit/validators.go index ae03821d150..dedd9a4de4a 100644 --- a/service/codecommit/validators.go +++ b/service/codecommit/validators.go @@ -1490,6 +1490,26 @@ func (m *validateOpUpdateRepositoryDescription) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpUpdateRepositoryEncryptionKey struct { +} + +func (*validateOpUpdateRepositoryEncryptionKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRepositoryEncryptionKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRepositoryEncryptionKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRepositoryEncryptionKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateRepositoryName struct { } @@ -1806,6 +1826,10 @@ func addOpUpdateRepositoryDescriptionValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpUpdateRepositoryDescription{}, middleware.After) } +func addOpUpdateRepositoryEncryptionKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRepositoryEncryptionKey{}, middleware.After) +} + func addOpUpdateRepositoryNameValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRepositoryName{}, middleware.After) } @@ -3472,6 +3496,24 @@ func validateOpUpdateRepositoryDescriptionInput(v *UpdateRepositoryDescriptionIn } } +func validateOpUpdateRepositoryEncryptionKeyInput(v *UpdateRepositoryEncryptionKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRepositoryEncryptionKeyInput"} + if v.RepositoryName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryName")) + } + if v.KmsKeyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KmsKeyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateRepositoryNameInput(v *UpdateRepositoryNameInput) error { if v == nil { return nil diff --git a/service/connect/api_op_AssociateUserProficiencies.go b/service/connect/api_op_AssociateUserProficiencies.go new file mode 100644 index 00000000000..26ef0fae84b --- /dev/null +++ b/service/connect/api_op_AssociateUserProficiencies.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// >Associates a set of proficiencies with a user. +func (c *Client) AssociateUserProficiencies(ctx context.Context, params *AssociateUserProficienciesInput, optFns ...func(*Options)) (*AssociateUserProficienciesOutput, error) { + if params == nil { + params = &AssociateUserProficienciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateUserProficiencies", params, optFns, c.addOperationAssociateUserProficienciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateUserProficienciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateUserProficienciesInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN of the instance). + // + // This member is required. + InstanceId *string + + // The identifier of the user account. + // + // This member is required. + UserId *string + + // The proficiencies to associate with the user. + // + // This member is required. + UserProficiencies []types.UserProficiency + + noSmithyDocumentSerde +} + +type AssociateUserProficienciesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateUserProficienciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateUserProficiencies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateUserProficiencies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateUserProficiencies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateUserProficienciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateUserProficiencies(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociateUserProficiencies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssociateUserProficiencies", + } +} diff --git a/service/connect/api_op_CreatePredefinedAttribute.go b/service/connect/api_op_CreatePredefinedAttribute.go new file mode 100644 index 00000000000..13c198ab945 --- /dev/null +++ b/service/connect/api_op_CreatePredefinedAttribute.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new predefined attribute for the specified Amazon Connect instance. +func (c *Client) CreatePredefinedAttribute(ctx context.Context, params *CreatePredefinedAttributeInput, optFns ...func(*Options)) (*CreatePredefinedAttributeOutput, error) { + if params == nil { + params = &CreatePredefinedAttributeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePredefinedAttribute", params, optFns, c.addOperationCreatePredefinedAttributeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePredefinedAttributeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePredefinedAttributeInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The name of the predefined attribute. + // + // This member is required. + Name *string + + // The values of the predefined attribute. + // + // This member is required. + Values types.PredefinedAttributeValues + + noSmithyDocumentSerde +} + +type CreatePredefinedAttributeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePredefinedAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePredefinedAttribute"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreatePredefinedAttributeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePredefinedAttribute(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreatePredefinedAttribute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreatePredefinedAttribute", + } +} diff --git a/service/connect/api_op_DeletePredefinedAttribute.go b/service/connect/api_op_DeletePredefinedAttribute.go new file mode 100644 index 00000000000..f5668faf057 --- /dev/null +++ b/service/connect/api_op_DeletePredefinedAttribute.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a predefined attribute from the specified Amazon Connect instance. +func (c *Client) DeletePredefinedAttribute(ctx context.Context, params *DeletePredefinedAttributeInput, optFns ...func(*Options)) (*DeletePredefinedAttributeOutput, error) { + if params == nil { + params = &DeletePredefinedAttributeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePredefinedAttribute", params, optFns, c.addOperationDeletePredefinedAttributeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePredefinedAttributeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePredefinedAttributeInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The name of the predefined attribute. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DeletePredefinedAttributeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePredefinedAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePredefinedAttribute"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeletePredefinedAttributeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePredefinedAttribute(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeletePredefinedAttribute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeletePredefinedAttribute", + } +} diff --git a/service/connect/api_op_DescribePredefinedAttribute.go b/service/connect/api_op_DescribePredefinedAttribute.go new file mode 100644 index 00000000000..baebfef4ac1 --- /dev/null +++ b/service/connect/api_op_DescribePredefinedAttribute.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes a predefined attribute for the specified Amazon Connect instance. +func (c *Client) DescribePredefinedAttribute(ctx context.Context, params *DescribePredefinedAttributeInput, optFns ...func(*Options)) (*DescribePredefinedAttributeOutput, error) { + if params == nil { + params = &DescribePredefinedAttributeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribePredefinedAttribute", params, optFns, c.addOperationDescribePredefinedAttributeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribePredefinedAttributeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribePredefinedAttributeInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The name of the predefined attribute. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DescribePredefinedAttributeOutput struct { + + // Information about the predefined attribute. + PredefinedAttribute *types.PredefinedAttribute + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribePredefinedAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePredefinedAttribute"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDescribePredefinedAttributeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePredefinedAttribute(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribePredefinedAttribute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribePredefinedAttribute", + } +} diff --git a/service/connect/api_op_DisassociateUserProficiencies.go b/service/connect/api_op_DisassociateUserProficiencies.go new file mode 100644 index 00000000000..61bb2cc43d2 --- /dev/null +++ b/service/connect/api_op_DisassociateUserProficiencies.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates a set of proficiencies from a user. +func (c *Client) DisassociateUserProficiencies(ctx context.Context, params *DisassociateUserProficienciesInput, optFns ...func(*Options)) (*DisassociateUserProficienciesOutput, error) { + if params == nil { + params = &DisassociateUserProficienciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateUserProficiencies", params, optFns, c.addOperationDisassociateUserProficienciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateUserProficienciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateUserProficienciesInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The identifier of the user account. + // + // This member is required. + UserId *string + + // The proficiencies to disassociate from the user. + // + // This member is required. + UserProficiencies []types.UserProficiencyDisassociate + + noSmithyDocumentSerde +} + +type DisassociateUserProficienciesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociateUserProficienciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateUserProficiencies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateUserProficiencies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateUserProficiencies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateUserProficienciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateUserProficiencies(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociateUserProficiencies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisassociateUserProficiencies", + } +} diff --git a/service/connect/api_op_ListPredefinedAttributes.go b/service/connect/api_op_ListPredefinedAttributes.go new file mode 100644 index 00000000000..0960624a60b --- /dev/null +++ b/service/connect/api_op_ListPredefinedAttributes.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists predefined attributes for the specified Amazon Connect instance. +func (c *Client) ListPredefinedAttributes(ctx context.Context, params *ListPredefinedAttributesInput, optFns ...func(*Options)) (*ListPredefinedAttributesOutput, error) { + if params == nil { + params = &ListPredefinedAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPredefinedAttributes", params, optFns, c.addOperationListPredefinedAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPredefinedAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPredefinedAttributesInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListPredefinedAttributesOutput struct { + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Summary of the predefined attributes. + PredefinedAttributeSummaryList []types.PredefinedAttributeSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPredefinedAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPredefinedAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPredefinedAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListPredefinedAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListPredefinedAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPredefinedAttributes(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListPredefinedAttributesAPIClient is a client that implements the +// ListPredefinedAttributes operation. +type ListPredefinedAttributesAPIClient interface { + ListPredefinedAttributes(context.Context, *ListPredefinedAttributesInput, ...func(*Options)) (*ListPredefinedAttributesOutput, error) +} + +var _ ListPredefinedAttributesAPIClient = (*Client)(nil) + +// ListPredefinedAttributesPaginatorOptions is the paginator options for +// ListPredefinedAttributes +type ListPredefinedAttributesPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListPredefinedAttributesPaginator is a paginator for ListPredefinedAttributes +type ListPredefinedAttributesPaginator struct { + options ListPredefinedAttributesPaginatorOptions + client ListPredefinedAttributesAPIClient + params *ListPredefinedAttributesInput + nextToken *string + firstPage bool +} + +// NewListPredefinedAttributesPaginator returns a new +// ListPredefinedAttributesPaginator +func NewListPredefinedAttributesPaginator(client ListPredefinedAttributesAPIClient, params *ListPredefinedAttributesInput, optFns ...func(*ListPredefinedAttributesPaginatorOptions)) *ListPredefinedAttributesPaginator { + if params == nil { + params = &ListPredefinedAttributesInput{} + } + + options := ListPredefinedAttributesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPredefinedAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPredefinedAttributesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPredefinedAttributes page. +func (p *ListPredefinedAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPredefinedAttributesOutput, 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.ListPredefinedAttributes(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_opListPredefinedAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListPredefinedAttributes", + } +} diff --git a/service/connect/api_op_ListUserProficiencies.go b/service/connect/api_op_ListUserProficiencies.go new file mode 100644 index 00000000000..539ac47e26d --- /dev/null +++ b/service/connect/api_op_ListUserProficiencies.go @@ -0,0 +1,251 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Lists proficiencies associated with a user. +func (c *Client) ListUserProficiencies(ctx context.Context, params *ListUserProficienciesInput, optFns ...func(*Options)) (*ListUserProficienciesOutput, error) { + if params == nil { + params = &ListUserProficienciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListUserProficiencies", params, optFns, c.addOperationListUserProficienciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListUserProficienciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListUserProficienciesInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The identifier of the user account. + // + // This member is required. + UserId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListUserProficienciesOutput struct { + + // The region in which a user's proficiencies were last modified. + LastModifiedRegion *string + + // The last time that the user's proficiencies are were modified. + LastModifiedTime *time.Time + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Information about the user proficiencies. + UserProficiencyList []types.UserProficiency + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListUserProficienciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListUserProficiencies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListUserProficiencies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListUserProficiencies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListUserProficienciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUserProficiencies(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListUserProficienciesAPIClient is a client that implements the +// ListUserProficiencies operation. +type ListUserProficienciesAPIClient interface { + ListUserProficiencies(context.Context, *ListUserProficienciesInput, ...func(*Options)) (*ListUserProficienciesOutput, error) +} + +var _ ListUserProficienciesAPIClient = (*Client)(nil) + +// ListUserProficienciesPaginatorOptions is the paginator options for +// ListUserProficiencies +type ListUserProficienciesPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListUserProficienciesPaginator is a paginator for ListUserProficiencies +type ListUserProficienciesPaginator struct { + options ListUserProficienciesPaginatorOptions + client ListUserProficienciesAPIClient + params *ListUserProficienciesInput + nextToken *string + firstPage bool +} + +// NewListUserProficienciesPaginator returns a new ListUserProficienciesPaginator +func NewListUserProficienciesPaginator(client ListUserProficienciesAPIClient, params *ListUserProficienciesInput, optFns ...func(*ListUserProficienciesPaginatorOptions)) *ListUserProficienciesPaginator { + if params == nil { + params = &ListUserProficienciesInput{} + } + + options := ListUserProficienciesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListUserProficienciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserProficienciesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListUserProficiencies page. +func (p *ListUserProficienciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserProficienciesOutput, 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.ListUserProficiencies(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_opListUserProficiencies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListUserProficiencies", + } +} diff --git a/service/connect/api_op_SearchContacts.go b/service/connect/api_op_SearchContacts.go new file mode 100644 index 00000000000..5225b90404d --- /dev/null +++ b/service/connect/api_op_SearchContacts.go @@ -0,0 +1,254 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches contacts in an Amazon Connect instance. +func (c *Client) SearchContacts(ctx context.Context, params *SearchContactsInput, optFns ...func(*Options)) (*SearchContactsOutput, error) { + if params == nil { + params = &SearchContactsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchContacts", params, optFns, c.addOperationSearchContactsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchContactsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchContactsInput struct { + + // The identifier of Amazon Connect instance. You can find the instance ID in the + // Amazon Resource Name (ARN) of the instance + // + // This member is required. + InstanceId *string + + // Time range that you want to search results + // + // This member is required. + TimeRange *types.SearchContactsTimeRange + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The search criteria to be used to return contacts. + SearchCriteria *types.SearchCriteria + + // Specifies a field to sort by and a sort order + Sort *types.Sort + + noSmithyDocumentSerde +} + +type SearchContactsOutput struct { + + // Information about the contacts. + // + // This member is required. + Contacts []types.ContactSearchSummary + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // The total number of contacts which matched your search query. + TotalCount *int64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchContactsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchContacts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchContacts{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SearchContacts"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSearchContactsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchContacts(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// SearchContactsAPIClient is a client that implements the SearchContacts +// operation. +type SearchContactsAPIClient interface { + SearchContacts(context.Context, *SearchContactsInput, ...func(*Options)) (*SearchContactsOutput, error) +} + +var _ SearchContactsAPIClient = (*Client)(nil) + +// SearchContactsPaginatorOptions is the paginator options for SearchContacts +type SearchContactsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// SearchContactsPaginator is a paginator for SearchContacts +type SearchContactsPaginator struct { + options SearchContactsPaginatorOptions + client SearchContactsAPIClient + params *SearchContactsInput + nextToken *string + firstPage bool +} + +// NewSearchContactsPaginator returns a new SearchContactsPaginator +func NewSearchContactsPaginator(client SearchContactsAPIClient, params *SearchContactsInput, optFns ...func(*SearchContactsPaginatorOptions)) *SearchContactsPaginator { + if params == nil { + params = &SearchContactsInput{} + } + + options := SearchContactsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchContactsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchContacts page. +func (p *SearchContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchContactsOutput, 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.SearchContacts(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_opSearchContacts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SearchContacts", + } +} diff --git a/service/connect/api_op_SearchPredefinedAttributes.go b/service/connect/api_op_SearchPredefinedAttributes.go new file mode 100644 index 00000000000..5a3d98d3b5e --- /dev/null +++ b/service/connect/api_op_SearchPredefinedAttributes.go @@ -0,0 +1,248 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Predefined attributes that meet certain criteria. +func (c *Client) SearchPredefinedAttributes(ctx context.Context, params *SearchPredefinedAttributesInput, optFns ...func(*Options)) (*SearchPredefinedAttributesOutput, error) { + if params == nil { + params = &SearchPredefinedAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchPredefinedAttributes", params, optFns, c.addOperationSearchPredefinedAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchPredefinedAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchPredefinedAttributesInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The search criteria to be used to return predefined attributes. + SearchCriteria *types.PredefinedAttributeSearchCriteria + + noSmithyDocumentSerde +} + +type SearchPredefinedAttributesOutput struct { + + // The approximate number of predefined attributes which matched your search query. + ApproximateTotalCount *int64 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // Predefined attributes matched by the search criteria. + PredefinedAttributes []types.PredefinedAttribute + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchPredefinedAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchPredefinedAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchPredefinedAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SearchPredefinedAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpSearchPredefinedAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchPredefinedAttributes(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// SearchPredefinedAttributesAPIClient is a client that implements the +// SearchPredefinedAttributes operation. +type SearchPredefinedAttributesAPIClient interface { + SearchPredefinedAttributes(context.Context, *SearchPredefinedAttributesInput, ...func(*Options)) (*SearchPredefinedAttributesOutput, error) +} + +var _ SearchPredefinedAttributesAPIClient = (*Client)(nil) + +// SearchPredefinedAttributesPaginatorOptions is the paginator options for +// SearchPredefinedAttributes +type SearchPredefinedAttributesPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// SearchPredefinedAttributesPaginator is a paginator for +// SearchPredefinedAttributes +type SearchPredefinedAttributesPaginator struct { + options SearchPredefinedAttributesPaginatorOptions + client SearchPredefinedAttributesAPIClient + params *SearchPredefinedAttributesInput + nextToken *string + firstPage bool +} + +// NewSearchPredefinedAttributesPaginator returns a new +// SearchPredefinedAttributesPaginator +func NewSearchPredefinedAttributesPaginator(client SearchPredefinedAttributesAPIClient, params *SearchPredefinedAttributesInput, optFns ...func(*SearchPredefinedAttributesPaginatorOptions)) *SearchPredefinedAttributesPaginator { + if params == nil { + params = &SearchPredefinedAttributesInput{} + } + + options := SearchPredefinedAttributesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchPredefinedAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchPredefinedAttributesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchPredefinedAttributes page. +func (p *SearchPredefinedAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchPredefinedAttributesOutput, 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.SearchPredefinedAttributes(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_opSearchPredefinedAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SearchPredefinedAttributes", + } +} diff --git a/service/connect/api_op_UpdateContactRoutingData.go b/service/connect/api_op_UpdateContactRoutingData.go new file mode 100644 index 00000000000..19a9c16490c --- /dev/null +++ b/service/connect/api_op_UpdateContactRoutingData.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release for Amazon Connect and is subject to change. +// Updates routing priority and age on the contact (QueuePriority and +// QueueTimeAdjustmentInSeconds). These properties can be used to change a +// customer's position in the queue. For example, you can move a contact to the +// back of the queue by setting a lower routing priority relative to other contacts +// in queue; or you can move a contact to the front of the queue by increasing the +// routing age which will make the contact look artificially older and therefore +// higher up in the first-in-first-out routing order. Note that adjusting the +// routing age of a contact affects only its position in queue, and not its actual +// queue wait time as reported through metrics. These properties can also be +// updated by using the Set routing priority / age flow block (https://docs.aws.amazon.com/connect/latest/adminguide/change-routing-priority.html) +// . +func (c *Client) UpdateContactRoutingData(ctx context.Context, params *UpdateContactRoutingDataInput, optFns ...func(*Options)) (*UpdateContactRoutingDataOutput, error) { + if params == nil { + params = &UpdateContactRoutingDataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateContactRoutingData", params, optFns, c.addOperationUpdateContactRoutingDataMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateContactRoutingDataOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateContactRoutingDataInput struct { + + // The identifier of the contact in this instance of Amazon Connect. + // + // This member is required. + ContactId *string + + // 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 + + // Priority of the contact in the queue. The default priority for new contacts is + // 5. You can raise the priority of a contact compared to other contacts in the + // queue by assigning them a higher priority, such as 1 or 2. + QueuePriority *int64 + + // The number of seconds to add or subtract from the contact's routing age. + // Contacts are routed to agents on a first-come, first-serve basis. This means + // that changing their amount of time in queue compared to others also changes + // their position in queue. + QueueTimeAdjustmentSeconds *int32 + + noSmithyDocumentSerde +} + +type UpdateContactRoutingDataOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateContactRoutingDataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateContactRoutingData{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateContactRoutingData{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateContactRoutingData"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateContactRoutingDataValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateContactRoutingData(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateContactRoutingData(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateContactRoutingData", + } +} diff --git a/service/connect/api_op_UpdatePredefinedAttribute.go b/service/connect/api_op_UpdatePredefinedAttribute.go new file mode 100644 index 00000000000..92fcb0307a5 --- /dev/null +++ b/service/connect/api_op_UpdatePredefinedAttribute.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a predefined attribute for the specified Amazon Connect instance. +func (c *Client) UpdatePredefinedAttribute(ctx context.Context, params *UpdatePredefinedAttributeInput, optFns ...func(*Options)) (*UpdatePredefinedAttributeOutput, error) { + if params == nil { + params = &UpdatePredefinedAttributeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePredefinedAttribute", params, optFns, c.addOperationUpdatePredefinedAttributeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePredefinedAttributeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePredefinedAttributeInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The name of the predefined attribute. + // + // This member is required. + Name *string + + // The values of the predefined attribute. + Values types.PredefinedAttributeValues + + noSmithyDocumentSerde +} + +type UpdatePredefinedAttributeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePredefinedAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePredefinedAttribute{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePredefinedAttribute"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdatePredefinedAttributeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePredefinedAttribute(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdatePredefinedAttribute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdatePredefinedAttribute", + } +} diff --git a/service/connect/api_op_UpdateUserProficiencies.go b/service/connect/api_op_UpdateUserProficiencies.go new file mode 100644 index 00000000000..707106990f9 --- /dev/null +++ b/service/connect/api_op_UpdateUserProficiencies.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the properties associated with the proficiencies of a user. +func (c *Client) UpdateUserProficiencies(ctx context.Context, params *UpdateUserProficienciesInput, optFns ...func(*Options)) (*UpdateUserProficienciesOutput, error) { + if params == nil { + params = &UpdateUserProficienciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateUserProficiencies", params, optFns, c.addOperationUpdateUserProficienciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateUserProficienciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateUserProficienciesInput struct { + + // The identifier of the Amazon Connect instance. You can find the instance ID in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The identifier of the user account. + // + // This member is required. + UserId *string + + // The proficiencies to be updated for the user. Proficiencies must first be + // associated to the user. You can do this using AssociateUserProficiencies API. + // + // This member is required. + UserProficiencies []types.UserProficiency + + noSmithyDocumentSerde +} + +type UpdateUserProficienciesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateUserProficienciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateUserProficiencies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateUserProficiencies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateUserProficiencies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateUserProficienciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateUserProficiencies(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateUserProficiencies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateUserProficiencies", + } +} diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index 49a081ae703..e68d45e13f2 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -1757,6 +1757,107 @@ func awsRestjson1_deserializeOpErrorAssociateTrafficDistributionGroupUser(respon } } +type awsRestjson1_deserializeOpAssociateUserProficiencies struct { +} + +func (*awsRestjson1_deserializeOpAssociateUserProficiencies) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateUserProficiencies) 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_deserializeOpErrorAssociateUserProficiencies(response, &metadata) + } + output := &AssociateUserProficienciesOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociateUserProficiencies(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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpBatchAssociateAnalyticsDataSet struct { } @@ -4166,6 +4267,113 @@ func awsRestjson1_deserializeOpDocumentCreatePersistentContactAssociationOutput( return nil } +type awsRestjson1_deserializeOpCreatePredefinedAttribute struct { +} + +func (*awsRestjson1_deserializeOpCreatePredefinedAttribute) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreatePredefinedAttribute) 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_deserializeOpErrorCreatePredefinedAttribute(response, &metadata) + } + output := &CreatePredefinedAttributeOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreatePredefinedAttribute(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 + + } +} + type awsRestjson1_deserializeOpCreatePrompt struct { } @@ -7518,14 +7726,14 @@ func awsRestjson1_deserializeOpErrorDeleteIntegrationAssociation(response *smith } } -type awsRestjson1_deserializeOpDeletePrompt struct { +type awsRestjson1_deserializeOpDeletePredefinedAttribute struct { } -func (*awsRestjson1_deserializeOpDeletePrompt) ID() string { +func (*awsRestjson1_deserializeOpDeletePredefinedAttribute) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeletePrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePredefinedAttribute) 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) @@ -7539,9 +7747,9 @@ func (m *awsRestjson1_deserializeOpDeletePrompt) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePrompt(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePredefinedAttribute(response, &metadata) } - output := &DeletePromptOutput{} + output := &DeletePredefinedAttributeOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -7553,7 +7761,7 @@ func (m *awsRestjson1_deserializeOpDeletePrompt) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeletePrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePredefinedAttribute(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)} @@ -7603,6 +7811,9 @@ func awsRestjson1_deserializeOpErrorDeletePrompt(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -7619,14 +7830,14 @@ func awsRestjson1_deserializeOpErrorDeletePrompt(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeleteQueue struct { +type awsRestjson1_deserializeOpDeletePrompt struct { } -func (*awsRestjson1_deserializeOpDeleteQueue) ID() string { +func (*awsRestjson1_deserializeOpDeletePrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePrompt) 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) @@ -7640,9 +7851,9 @@ func (m *awsRestjson1_deserializeOpDeleteQueue) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteQueue(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePrompt(response, &metadata) } - output := &DeleteQueueOutput{} + output := &DeletePromptOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -7654,7 +7865,7 @@ func (m *awsRestjson1_deserializeOpDeleteQueue) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePrompt(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)} @@ -7704,9 +7915,6 @@ func awsRestjson1_deserializeOpErrorDeleteQueue(response *smithyhttp.Response, m case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -7723,14 +7931,14 @@ func awsRestjson1_deserializeOpErrorDeleteQueue(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpDeleteQuickConnect struct { +type awsRestjson1_deserializeOpDeleteQueue struct { } -func (*awsRestjson1_deserializeOpDeleteQuickConnect) ID() string { +func (*awsRestjson1_deserializeOpDeleteQueue) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteQuickConnect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteQueue) 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) @@ -7744,9 +7952,9 @@ func (m *awsRestjson1_deserializeOpDeleteQuickConnect) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteQuickConnect(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteQueue(response, &metadata) } - output := &DeleteQuickConnectOutput{} + output := &DeleteQueueOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -7758,7 +7966,7 @@ func (m *awsRestjson1_deserializeOpDeleteQuickConnect) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteQuickConnect(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteQueue(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)} @@ -7808,6 +8016,9 @@ func awsRestjson1_deserializeOpErrorDeleteQuickConnect(response *smithyhttp.Resp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -7824,14 +8035,14 @@ func awsRestjson1_deserializeOpErrorDeleteQuickConnect(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpDeleteRoutingProfile struct { +type awsRestjson1_deserializeOpDeleteQuickConnect struct { } -func (*awsRestjson1_deserializeOpDeleteRoutingProfile) ID() string { +func (*awsRestjson1_deserializeOpDeleteQuickConnect) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRoutingProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteQuickConnect) 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) @@ -7845,9 +8056,9 @@ func (m *awsRestjson1_deserializeOpDeleteRoutingProfile) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRoutingProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteQuickConnect(response, &metadata) } - output := &DeleteRoutingProfileOutput{} + output := &DeleteQuickConnectOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -7859,7 +8070,7 @@ func (m *awsRestjson1_deserializeOpDeleteRoutingProfile) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteRoutingProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteQuickConnect(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)} @@ -7909,9 +8120,6 @@ func awsRestjson1_deserializeOpErrorDeleteRoutingProfile(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -7928,14 +8136,14 @@ func awsRestjson1_deserializeOpErrorDeleteRoutingProfile(response *smithyhttp.Re } } -type awsRestjson1_deserializeOpDeleteRule struct { +type awsRestjson1_deserializeOpDeleteRoutingProfile struct { } -func (*awsRestjson1_deserializeOpDeleteRule) ID() string { +func (*awsRestjson1_deserializeOpDeleteRoutingProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRoutingProfile) 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) @@ -7949,9 +8157,9 @@ func (m *awsRestjson1_deserializeOpDeleteRule) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRoutingProfile(response, &metadata) } - output := &DeleteRuleOutput{} + output := &DeleteRoutingProfileOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -7963,7 +8171,111 @@ func (m *awsRestjson1_deserializeOpDeleteRule) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRoutingProfile(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("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("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(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 + + } +} + +type awsRestjson1_deserializeOpDeleteRule struct { +} + +func (*awsRestjson1_deserializeOpDeleteRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteRule) 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_deserializeOpErrorDeleteRule(response, &metadata) + } + output := &DeleteRuleOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteRule(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)} @@ -10763,14 +11075,14 @@ func awsRestjson1_deserializeOpDocumentDescribePhoneNumberOutput(v **DescribePho return nil } -type awsRestjson1_deserializeOpDescribePrompt struct { +type awsRestjson1_deserializeOpDescribePredefinedAttribute struct { } -func (*awsRestjson1_deserializeOpDescribePrompt) ID() string { +func (*awsRestjson1_deserializeOpDescribePredefinedAttribute) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribePrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribePredefinedAttribute) 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) @@ -10784,9 +11096,9 @@ func (m *awsRestjson1_deserializeOpDescribePrompt) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribePrompt(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribePredefinedAttribute(response, &metadata) } - output := &DescribePromptOutput{} + output := &DescribePredefinedAttributeOutput{} out.Result = output var buff [1024]byte @@ -10807,7 +11119,7 @@ func (m *awsRestjson1_deserializeOpDescribePrompt) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribePromptOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribePredefinedAttributeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10820,7 +11132,7 @@ func (m *awsRestjson1_deserializeOpDescribePrompt) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribePrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribePredefinedAttribute(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)} @@ -10886,7 +11198,7 @@ func awsRestjson1_deserializeOpErrorDescribePrompt(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentDescribePromptOutput(v **DescribePromptOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribePredefinedAttributeOutput(v **DescribePredefinedAttributeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10899,17 +11211,17 @@ func awsRestjson1_deserializeOpDocumentDescribePromptOutput(v **DescribePromptOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribePromptOutput + var sv *DescribePredefinedAttributeOutput if *v == nil { - sv = &DescribePromptOutput{} + sv = &DescribePredefinedAttributeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Prompt": - if err := awsRestjson1_deserializeDocumentPrompt(&sv.Prompt, value); err != nil { + case "PredefinedAttribute": + if err := awsRestjson1_deserializeDocumentPredefinedAttribute(&sv.PredefinedAttribute, value); err != nil { return err } @@ -10922,14 +11234,14 @@ func awsRestjson1_deserializeOpDocumentDescribePromptOutput(v **DescribePromptOu return nil } -type awsRestjson1_deserializeOpDescribeQueue struct { +type awsRestjson1_deserializeOpDescribePrompt struct { } -func (*awsRestjson1_deserializeOpDescribeQueue) ID() string { +func (*awsRestjson1_deserializeOpDescribePrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribePrompt) 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) @@ -10943,9 +11255,9 @@ func (m *awsRestjson1_deserializeOpDescribeQueue) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeQueue(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribePrompt(response, &metadata) } - output := &DescribeQueueOutput{} + output := &DescribePromptOutput{} out.Result = output var buff [1024]byte @@ -10966,7 +11278,7 @@ func (m *awsRestjson1_deserializeOpDescribeQueue) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeQueueOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribePromptOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10979,7 +11291,7 @@ func (m *awsRestjson1_deserializeOpDescribeQueue) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribePrompt(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)} @@ -11045,7 +11357,7 @@ func awsRestjson1_deserializeOpErrorDescribeQueue(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDescribeQueueOutput(v **DescribeQueueOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribePromptOutput(v **DescribePromptOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11058,17 +11370,17 @@ func awsRestjson1_deserializeOpDocumentDescribeQueueOutput(v **DescribeQueueOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeQueueOutput + var sv *DescribePromptOutput if *v == nil { - sv = &DescribeQueueOutput{} + sv = &DescribePromptOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Queue": - if err := awsRestjson1_deserializeDocumentQueue(&sv.Queue, value); err != nil { + case "Prompt": + if err := awsRestjson1_deserializeDocumentPrompt(&sv.Prompt, value); err != nil { return err } @@ -11081,14 +11393,14 @@ func awsRestjson1_deserializeOpDocumentDescribeQueueOutput(v **DescribeQueueOutp return nil } -type awsRestjson1_deserializeOpDescribeQuickConnect struct { +type awsRestjson1_deserializeOpDescribeQueue struct { } -func (*awsRestjson1_deserializeOpDescribeQuickConnect) ID() string { +func (*awsRestjson1_deserializeOpDescribeQueue) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeQuickConnect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeQueue) 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) @@ -11102,9 +11414,9 @@ func (m *awsRestjson1_deserializeOpDescribeQuickConnect) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeQuickConnect(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeQueue(response, &metadata) } - output := &DescribeQuickConnectOutput{} + output := &DescribeQueueOutput{} out.Result = output var buff [1024]byte @@ -11125,7 +11437,7 @@ func (m *awsRestjson1_deserializeOpDescribeQuickConnect) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeQuickConnectOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeQueueOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11138,7 +11450,7 @@ func (m *awsRestjson1_deserializeOpDescribeQuickConnect) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeQuickConnect(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeQueue(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)} @@ -11204,7 +11516,7 @@ func awsRestjson1_deserializeOpErrorDescribeQuickConnect(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentDescribeQuickConnectOutput(v **DescribeQuickConnectOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeQueueOutput(v **DescribeQueueOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11217,17 +11529,17 @@ func awsRestjson1_deserializeOpDocumentDescribeQuickConnectOutput(v **DescribeQu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeQuickConnectOutput + var sv *DescribeQueueOutput if *v == nil { - sv = &DescribeQuickConnectOutput{} + sv = &DescribeQueueOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "QuickConnect": - if err := awsRestjson1_deserializeDocumentQuickConnect(&sv.QuickConnect, value); err != nil { + case "Queue": + if err := awsRestjson1_deserializeDocumentQueue(&sv.Queue, value); err != nil { return err } @@ -11240,14 +11552,14 @@ func awsRestjson1_deserializeOpDocumentDescribeQuickConnectOutput(v **DescribeQu return nil } -type awsRestjson1_deserializeOpDescribeRoutingProfile struct { +type awsRestjson1_deserializeOpDescribeQuickConnect struct { } -func (*awsRestjson1_deserializeOpDescribeRoutingProfile) ID() string { +func (*awsRestjson1_deserializeOpDescribeQuickConnect) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeQuickConnect) 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) @@ -11261,9 +11573,9 @@ func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeRoutingProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeQuickConnect(response, &metadata) } - output := &DescribeRoutingProfileOutput{} + output := &DescribeQuickConnectOutput{} out.Result = output var buff [1024]byte @@ -11284,7 +11596,7 @@ func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeRoutingProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeQuickConnectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11297,7 +11609,7 @@ func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeRoutingProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeQuickConnect(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)} @@ -11363,7 +11675,7 @@ func awsRestjson1_deserializeOpErrorDescribeRoutingProfile(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentDescribeRoutingProfileOutput(v **DescribeRoutingProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeQuickConnectOutput(v **DescribeQuickConnectOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11376,17 +11688,17 @@ func awsRestjson1_deserializeOpDocumentDescribeRoutingProfileOutput(v **Describe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeRoutingProfileOutput + var sv *DescribeQuickConnectOutput if *v == nil { - sv = &DescribeRoutingProfileOutput{} + sv = &DescribeQuickConnectOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "RoutingProfile": - if err := awsRestjson1_deserializeDocumentRoutingProfile(&sv.RoutingProfile, value); err != nil { + case "QuickConnect": + if err := awsRestjson1_deserializeDocumentQuickConnect(&sv.QuickConnect, value); err != nil { return err } @@ -11399,14 +11711,14 @@ func awsRestjson1_deserializeOpDocumentDescribeRoutingProfileOutput(v **Describe return nil } -type awsRestjson1_deserializeOpDescribeRule struct { +type awsRestjson1_deserializeOpDescribeRoutingProfile struct { } -func (*awsRestjson1_deserializeOpDescribeRule) ID() string { +func (*awsRestjson1_deserializeOpDescribeRoutingProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) 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) @@ -11420,9 +11732,9 @@ func (m *awsRestjson1_deserializeOpDescribeRule) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeRoutingProfile(response, &metadata) } - output := &DescribeRuleOutput{} + output := &DescribeRoutingProfileOutput{} out.Result = output var buff [1024]byte @@ -11443,7 +11755,7 @@ func (m *awsRestjson1_deserializeOpDescribeRule) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeRuleOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeRoutingProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11456,7 +11768,7 @@ func (m *awsRestjson1_deserializeOpDescribeRule) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeRoutingProfile(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)} @@ -11497,12 +11809,12 @@ func awsRestjson1_deserializeOpErrorDescribeRule(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(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) @@ -11522,7 +11834,7 @@ func awsRestjson1_deserializeOpErrorDescribeRule(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDescribeRuleOutput(v **DescribeRuleOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeRoutingProfileOutput(v **DescribeRoutingProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11535,17 +11847,17 @@ func awsRestjson1_deserializeOpDocumentDescribeRuleOutput(v **DescribeRuleOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeRuleOutput + var sv *DescribeRoutingProfileOutput if *v == nil { - sv = &DescribeRuleOutput{} + sv = &DescribeRoutingProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Rule": - if err := awsRestjson1_deserializeDocumentRule(&sv.Rule, value); err != nil { + case "RoutingProfile": + if err := awsRestjson1_deserializeDocumentRoutingProfile(&sv.RoutingProfile, value); err != nil { return err } @@ -11558,14 +11870,14 @@ func awsRestjson1_deserializeOpDocumentDescribeRuleOutput(v **DescribeRuleOutput return nil } -type awsRestjson1_deserializeOpDescribeSecurityProfile struct { +type awsRestjson1_deserializeOpDescribeRule struct { } -func (*awsRestjson1_deserializeOpDescribeSecurityProfile) ID() string { +func (*awsRestjson1_deserializeOpDescribeRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeRule) 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) @@ -11579,9 +11891,9 @@ func (m *awsRestjson1_deserializeOpDescribeSecurityProfile) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeSecurityProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeRule(response, &metadata) } - output := &DescribeSecurityProfileOutput{} + output := &DescribeRuleOutput{} out.Result = output var buff [1024]byte @@ -11602,7 +11914,7 @@ func (m *awsRestjson1_deserializeOpDescribeSecurityProfile) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11615,7 +11927,7 @@ func (m *awsRestjson1_deserializeOpDescribeSecurityProfile) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeRule(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)} @@ -11656,12 +11968,12 @@ func awsRestjson1_deserializeOpErrorDescribeSecurityProfile(response *smithyhttp } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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) @@ -11681,7 +11993,7 @@ func awsRestjson1_deserializeOpErrorDescribeSecurityProfile(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(v **DescribeSecurityProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeRuleOutput(v **DescribeRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11694,17 +12006,17 @@ func awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(v **Describ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeSecurityProfileOutput + var sv *DescribeRuleOutput if *v == nil { - sv = &DescribeSecurityProfileOutput{} + sv = &DescribeRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "SecurityProfile": - if err := awsRestjson1_deserializeDocumentSecurityProfile(&sv.SecurityProfile, value); err != nil { + case "Rule": + if err := awsRestjson1_deserializeDocumentRule(&sv.Rule, value); err != nil { return err } @@ -11717,14 +12029,14 @@ func awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(v **Describ return nil } -type awsRestjson1_deserializeOpDescribeTrafficDistributionGroup struct { +type awsRestjson1_deserializeOpDescribeSecurityProfile struct { } -func (*awsRestjson1_deserializeOpDescribeTrafficDistributionGroup) ID() string { +func (*awsRestjson1_deserializeOpDescribeSecurityProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeTrafficDistributionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeSecurityProfile) 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) @@ -11738,9 +12050,9 @@ func (m *awsRestjson1_deserializeOpDescribeTrafficDistributionGroup) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeTrafficDistributionGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeSecurityProfile(response, &metadata) } - output := &DescribeTrafficDistributionGroupOutput{} + output := &DescribeSecurityProfileOutput{} out.Result = output var buff [1024]byte @@ -11761,7 +12073,7 @@ func (m *awsRestjson1_deserializeOpDescribeTrafficDistributionGroup) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeTrafficDistributionGroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11774,7 +12086,166 @@ func (m *awsRestjson1_deserializeOpDescribeTrafficDistributionGroup) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeTrafficDistributionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeSecurityProfile(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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeSecurityProfileOutput(v **DescribeSecurityProfileOutput, 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 *DescribeSecurityProfileOutput + if *v == nil { + sv = &DescribeSecurityProfileOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SecurityProfile": + if err := awsRestjson1_deserializeDocumentSecurityProfile(&sv.SecurityProfile, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeTrafficDistributionGroup struct { +} + +func (*awsRestjson1_deserializeOpDescribeTrafficDistributionGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeTrafficDistributionGroup) 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_deserializeOpErrorDescribeTrafficDistributionGroup(response, &metadata) + } + output := &DescribeTrafficDistributionGroupOutput{} + 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_deserializeOpDocumentDescribeTrafficDistributionGroupOutput(&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_deserializeOpErrorDescribeTrafficDistributionGroup(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)} @@ -13877,6 +14348,107 @@ func awsRestjson1_deserializeOpErrorDisassociateTrafficDistributionGroupUser(res } } +type awsRestjson1_deserializeOpDisassociateUserProficiencies struct { +} + +func (*awsRestjson1_deserializeOpDisassociateUserProficiencies) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateUserProficiencies) 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_deserializeOpErrorDisassociateUserProficiencies(response, &metadata) + } + output := &DisassociateUserProficienciesOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateUserProficiencies(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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDismissUserContact struct { } @@ -19541,14 +20113,14 @@ func awsRestjson1_deserializeOpDocumentListPhoneNumbersV2Output(v **ListPhoneNum return nil } -type awsRestjson1_deserializeOpListPrompts struct { +type awsRestjson1_deserializeOpListPredefinedAttributes struct { } -func (*awsRestjson1_deserializeOpListPrompts) ID() string { +func (*awsRestjson1_deserializeOpListPredefinedAttributes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPrompts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPredefinedAttributes) 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) @@ -19562,9 +20134,9 @@ func (m *awsRestjson1_deserializeOpListPrompts) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPrompts(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPredefinedAttributes(response, &metadata) } - output := &ListPromptsOutput{} + output := &ListPredefinedAttributesOutput{} out.Result = output var buff [1024]byte @@ -19585,7 +20157,7 @@ func (m *awsRestjson1_deserializeOpListPrompts) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPromptsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPredefinedAttributesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -19598,7 +20170,7 @@ func (m *awsRestjson1_deserializeOpListPrompts) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPrompts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPredefinedAttributes(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)} @@ -19664,7 +20236,7 @@ func awsRestjson1_deserializeOpErrorListPrompts(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListPromptsOutput(v **ListPromptsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPredefinedAttributesOutput(v **ListPredefinedAttributesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -19677,9 +20249,9 @@ func awsRestjson1_deserializeOpDocumentListPromptsOutput(v **ListPromptsOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPromptsOutput + var sv *ListPredefinedAttributesOutput if *v == nil { - sv = &ListPromptsOutput{} + sv = &ListPredefinedAttributesOutput{} } else { sv = *v } @@ -19695,8 +20267,8 @@ func awsRestjson1_deserializeOpDocumentListPromptsOutput(v **ListPromptsOutput, sv.NextToken = ptr.String(jtv) } - case "PromptSummaryList": - if err := awsRestjson1_deserializeDocumentPromptSummaryList(&sv.PromptSummaryList, value); err != nil { + case "PredefinedAttributeSummaryList": + if err := awsRestjson1_deserializeDocumentPredefinedAttributeSummaryList(&sv.PredefinedAttributeSummaryList, value); err != nil { return err } @@ -19709,14 +20281,14 @@ func awsRestjson1_deserializeOpDocumentListPromptsOutput(v **ListPromptsOutput, return nil } -type awsRestjson1_deserializeOpListQueueQuickConnects struct { +type awsRestjson1_deserializeOpListPrompts struct { } -func (*awsRestjson1_deserializeOpListQueueQuickConnects) ID() string { +func (*awsRestjson1_deserializeOpListPrompts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListQueueQuickConnects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPrompts) 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) @@ -19730,9 +20302,9 @@ func (m *awsRestjson1_deserializeOpListQueueQuickConnects) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListQueueQuickConnects(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPrompts(response, &metadata) } - output := &ListQueueQuickConnectsOutput{} + output := &ListPromptsOutput{} out.Result = output var buff [1024]byte @@ -19753,7 +20325,7 @@ func (m *awsRestjson1_deserializeOpListQueueQuickConnects) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPromptsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -19766,7 +20338,7 @@ func (m *awsRestjson1_deserializeOpListQueueQuickConnects) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListQueueQuickConnects(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPrompts(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)} @@ -19832,7 +20404,7 @@ func awsRestjson1_deserializeOpErrorListQueueQuickConnects(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(v **ListQueueQuickConnectsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPromptsOutput(v **ListPromptsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -19845,40 +20417,15 @@ func awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(v **ListQueu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListQueueQuickConnectsOutput + var sv *ListPromptsOutput if *v == nil { - sv = &ListQueueQuickConnectsOutput{} + sv = &ListPromptsOutput{} } else { sv = *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) @@ -19888,8 +20435,8 @@ func awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(v **ListQueu sv.NextToken = ptr.String(jtv) } - case "QuickConnectSummaryList": - if err := awsRestjson1_deserializeDocumentQuickConnectSummaryList(&sv.QuickConnectSummaryList, value); err != nil { + case "PromptSummaryList": + if err := awsRestjson1_deserializeDocumentPromptSummaryList(&sv.PromptSummaryList, value); err != nil { return err } @@ -19902,14 +20449,14 @@ func awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(v **ListQueu return nil } -type awsRestjson1_deserializeOpListQueues struct { +type awsRestjson1_deserializeOpListQueueQuickConnects struct { } -func (*awsRestjson1_deserializeOpListQueues) ID() string { +func (*awsRestjson1_deserializeOpListQueueQuickConnects) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListQueueQuickConnects) 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) @@ -19923,9 +20470,9 @@ func (m *awsRestjson1_deserializeOpListQueues) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListQueues(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListQueueQuickConnects(response, &metadata) } - output := &ListQueuesOutput{} + output := &ListQueueQuickConnectsOutput{} out.Result = output var buff [1024]byte @@ -19946,7 +20493,7 @@ func (m *awsRestjson1_deserializeOpListQueues) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListQueuesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -19959,7 +20506,7 @@ func (m *awsRestjson1_deserializeOpListQueues) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListQueueQuickConnects(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)} @@ -20025,7 +20572,7 @@ func awsRestjson1_deserializeOpErrorListQueues(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListQueueQuickConnectsOutput(v **ListQueueQuickConnectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20038,15 +20585,40 @@ func awsRestjson1_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListQueuesOutput + var sv *ListQueueQuickConnectsOutput if *v == nil { - sv = &ListQueuesOutput{} + sv = &ListQueueQuickConnectsOutput{} } else { sv = *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) @@ -20056,8 +20628,8 @@ func awsRestjson1_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, va sv.NextToken = ptr.String(jtv) } - case "QueueSummaryList": - if err := awsRestjson1_deserializeDocumentQueueSummaryList(&sv.QueueSummaryList, value); err != nil { + case "QuickConnectSummaryList": + if err := awsRestjson1_deserializeDocumentQuickConnectSummaryList(&sv.QuickConnectSummaryList, value); err != nil { return err } @@ -20070,14 +20642,14 @@ func awsRestjson1_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, va return nil } -type awsRestjson1_deserializeOpListQuickConnects struct { +type awsRestjson1_deserializeOpListQueues struct { } -func (*awsRestjson1_deserializeOpListQuickConnects) ID() string { +func (*awsRestjson1_deserializeOpListQueues) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListQuickConnects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListQueues) 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) @@ -20091,9 +20663,9 @@ func (m *awsRestjson1_deserializeOpListQuickConnects) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListQuickConnects(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListQueues(response, &metadata) } - output := &ListQuickConnectsOutput{} + output := &ListQueuesOutput{} out.Result = output var buff [1024]byte @@ -20114,7 +20686,7 @@ func (m *awsRestjson1_deserializeOpListQuickConnects) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListQueuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20127,7 +20699,7 @@ func (m *awsRestjson1_deserializeOpListQuickConnects) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListQuickConnects(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListQueues(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)} @@ -20193,7 +20765,7 @@ func awsRestjson1_deserializeOpErrorListQuickConnects(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(v **ListQuickConnectsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20206,9 +20778,9 @@ func awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(v **ListQuickConn return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListQuickConnectsOutput + var sv *ListQueuesOutput if *v == nil { - sv = &ListQuickConnectsOutput{} + sv = &ListQueuesOutput{} } else { sv = *v } @@ -20224,8 +20796,8 @@ func awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(v **ListQuickConn sv.NextToken = ptr.String(jtv) } - case "QuickConnectSummaryList": - if err := awsRestjson1_deserializeDocumentQuickConnectSummaryList(&sv.QuickConnectSummaryList, value); err != nil { + case "QueueSummaryList": + if err := awsRestjson1_deserializeDocumentQueueSummaryList(&sv.QueueSummaryList, value); err != nil { return err } @@ -20238,14 +20810,14 @@ func awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(v **ListQuickConn return nil } -type awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2 struct { +type awsRestjson1_deserializeOpListQuickConnects struct { } -func (*awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2) ID() string { +func (*awsRestjson1_deserializeOpListQuickConnects) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListQuickConnects) 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) @@ -20259,9 +20831,9 @@ func (m *awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRealtimeContactAnalysisSegmentsV2(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListQuickConnects(response, &metadata) } - output := &ListRealtimeContactAnalysisSegmentsV2Output{} + output := &ListQuickConnectsOutput{} out.Result = output var buff [1024]byte @@ -20282,7 +20854,7 @@ func (m *awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2) Handle return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRealtimeContactAnalysisSegmentsV2Output(&output, shape) + err = awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20295,7 +20867,7 @@ func (m *awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2) Handle return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRealtimeContactAnalysisSegmentsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListQuickConnects(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)} @@ -20336,18 +20908,15 @@ func awsRestjson1_deserializeOpErrorListRealtimeContactAnalysisSegmentsV2(respon } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(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("OutputTypeNotFoundException", errorCode): - return awsRestjson1_deserializeErrorOutputTypeNotFoundException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -20364,7 +20933,7 @@ func awsRestjson1_deserializeOpErrorListRealtimeContactAnalysisSegmentsV2(respon } } -func awsRestjson1_deserializeOpDocumentListRealtimeContactAnalysisSegmentsV2Output(v **ListRealtimeContactAnalysisSegmentsV2Output, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(v **ListQuickConnectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20377,47 +20946,29 @@ func awsRestjson1_deserializeOpDocumentListRealtimeContactAnalysisSegmentsV2Outp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRealtimeContactAnalysisSegmentsV2Output + var sv *ListQuickConnectsOutput if *v == nil { - sv = &ListRealtimeContactAnalysisSegmentsV2Output{} + sv = &ListQuickConnectsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Channel": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RealTimeContactAnalysisSupportedChannel to be of type string, got %T instead", value) - } - sv.Channel = types.RealTimeContactAnalysisSupportedChannel(jtv) - } - case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LargeNextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "Segments": - if err := awsRestjson1_deserializeDocumentRealtimeContactAnalysisSegments(&sv.Segments, value); err != nil { + case "QuickConnectSummaryList": + if err := awsRestjson1_deserializeDocumentQuickConnectSummaryList(&sv.QuickConnectSummaryList, value); err != nil { return err } - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RealTimeContactAnalysisStatus to be of type string, got %T instead", value) - } - sv.Status = types.RealTimeContactAnalysisStatus(jtv) - } - default: _, _ = key, value @@ -20427,14 +20978,14 @@ func awsRestjson1_deserializeOpDocumentListRealtimeContactAnalysisSegmentsV2Outp return nil } -type awsRestjson1_deserializeOpListRoutingProfileQueues struct { +type awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2 struct { } -func (*awsRestjson1_deserializeOpListRoutingProfileQueues) ID() string { +func (*awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRealtimeContactAnalysisSegmentsV2) 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) @@ -20448,9 +20999,9 @@ func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRealtimeContactAnalysisSegmentsV2(response, &metadata) } - output := &ListRoutingProfileQueuesOutput{} + output := &ListRealtimeContactAnalysisSegmentsV2Output{} out.Result = output var buff [1024]byte @@ -20471,7 +21022,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRealtimeContactAnalysisSegmentsV2Output(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20484,7 +21035,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRealtimeContactAnalysisSegmentsV2(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)} @@ -20525,15 +21076,18 @@ func awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response *smithyhtt } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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("OutputTypeNotFoundException", errorCode): + return awsRestjson1_deserializeErrorOutputTypeNotFoundException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -20550,7 +21104,7 @@ func awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRoutingProfileQueuesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRealtimeContactAnalysisSegmentsV2Output(v **ListRealtimeContactAnalysisSegmentsV2Output, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20563,54 +21117,47 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRoutingProfileQueuesOutput + var sv *ListRealtimeContactAnalysisSegmentsV2Output if *v == nil { - sv = &ListRoutingProfileQueuesOutput{} + sv = &ListRealtimeContactAnalysisSegmentsV2Output{} } else { sv = *v } for key, value := range shape { switch key { - case "LastModifiedRegion": + case "Channel": 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) - + return fmt.Errorf("expected RealTimeContactAnalysisSupportedChannel to be of type string, got %T instead", value) } + sv.Channel = types.RealTimeContactAnalysisSupportedChannel(jtv) } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected LargeNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "RoutingProfileQueueConfigSummaryList": - if err := awsRestjson1_deserializeDocumentRoutingProfileQueueConfigSummaryList(&sv.RoutingProfileQueueConfigSummaryList, value); err != nil { + case "Segments": + if err := awsRestjson1_deserializeDocumentRealtimeContactAnalysisSegments(&sv.Segments, value); err != nil { return err } + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RealTimeContactAnalysisStatus to be of type string, got %T instead", value) + } + sv.Status = types.RealTimeContactAnalysisStatus(jtv) + } + default: _, _ = key, value @@ -20620,14 +21167,14 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRo return nil } -type awsRestjson1_deserializeOpListRoutingProfiles struct { +type awsRestjson1_deserializeOpListRoutingProfileQueues struct { } -func (*awsRestjson1_deserializeOpListRoutingProfiles) ID() string { +func (*awsRestjson1_deserializeOpListRoutingProfileQueues) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) 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) @@ -20641,9 +21188,9 @@ func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response, &metadata) } - output := &ListRoutingProfilesOutput{} + output := &ListRoutingProfileQueuesOutput{} out.Result = output var buff [1024]byte @@ -20664,7 +21211,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20677,7 +21224,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRoutingProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRoutingProfileQueues(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)} @@ -20743,7 +21290,7 @@ func awsRestjson1_deserializeOpErrorListRoutingProfiles(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRoutingProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRoutingProfileQueuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20756,15 +21303,40 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRouting return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRoutingProfilesOutput + var sv *ListRoutingProfileQueuesOutput if *v == nil { - sv = &ListRoutingProfilesOutput{} + sv = &ListRoutingProfileQueuesOutput{} } else { sv = *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) @@ -20774,8 +21346,8 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRouting sv.NextToken = ptr.String(jtv) } - case "RoutingProfileSummaryList": - if err := awsRestjson1_deserializeDocumentRoutingProfileSummaryList(&sv.RoutingProfileSummaryList, value); err != nil { + case "RoutingProfileQueueConfigSummaryList": + if err := awsRestjson1_deserializeDocumentRoutingProfileQueueConfigSummaryList(&sv.RoutingProfileQueueConfigSummaryList, value); err != nil { return err } @@ -20788,14 +21360,14 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRouting return nil } -type awsRestjson1_deserializeOpListRules struct { +type awsRestjson1_deserializeOpListRoutingProfiles struct { } -func (*awsRestjson1_deserializeOpListRules) ID() string { +func (*awsRestjson1_deserializeOpListRoutingProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRoutingProfiles) 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) @@ -20809,9 +21381,9 @@ func (m *awsRestjson1_deserializeOpListRules) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRules(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfiles(response, &metadata) } - output := &ListRulesOutput{} + output := &ListRoutingProfilesOutput{} out.Result = output var buff [1024]byte @@ -20832,7 +21404,7 @@ func (m *awsRestjson1_deserializeOpListRules) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRulesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20845,7 +21417,7 @@ func (m *awsRestjson1_deserializeOpListRules) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRoutingProfiles(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)} @@ -20886,12 +21458,12 @@ func awsRestjson1_deserializeOpErrorListRules(response *smithyhttp.Response, met } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(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) @@ -20911,7 +21483,7 @@ func awsRestjson1_deserializeOpErrorListRules(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRoutingProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20924,9 +21496,9 @@ func awsRestjson1_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRulesOutput + var sv *ListRoutingProfilesOutput if *v == nil { - sv = &ListRulesOutput{} + sv = &ListRoutingProfilesOutput{} } else { sv = *v } @@ -20942,8 +21514,8 @@ func awsRestjson1_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, valu sv.NextToken = ptr.String(jtv) } - case "RuleSummaryList": - if err := awsRestjson1_deserializeDocumentRuleSummaryList(&sv.RuleSummaryList, value); err != nil { + case "RoutingProfileSummaryList": + if err := awsRestjson1_deserializeDocumentRoutingProfileSummaryList(&sv.RoutingProfileSummaryList, value); err != nil { return err } @@ -20956,14 +21528,14 @@ func awsRestjson1_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, valu return nil } -type awsRestjson1_deserializeOpListSecurityKeys struct { +type awsRestjson1_deserializeOpListRules struct { } -func (*awsRestjson1_deserializeOpListSecurityKeys) ID() string { +func (*awsRestjson1_deserializeOpListRules) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRules) 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) @@ -20977,9 +21549,9 @@ func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityKeys(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRules(response, &metadata) } - output := &ListSecurityKeysOutput{} + output := &ListRulesOutput{} out.Result = output var buff [1024]byte @@ -21000,7 +21572,7 @@ func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21013,7 +21585,7 @@ func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRules(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)} @@ -21054,12 +21626,12 @@ func awsRestjson1_deserializeOpErrorListSecurityKeys(response *smithyhttp.Respon } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(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) @@ -21079,7 +21651,7 @@ func awsRestjson1_deserializeOpErrorListSecurityKeys(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKeysOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21092,9 +21664,9 @@ func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityKeysOutput + var sv *ListRulesOutput if *v == nil { - sv = &ListSecurityKeysOutput{} + sv = &ListRulesOutput{} } else { sv = *v } @@ -21110,8 +21682,8 @@ func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKe sv.NextToken = ptr.String(jtv) } - case "SecurityKeys": - if err := awsRestjson1_deserializeDocumentSecurityKeysList(&sv.SecurityKeys, value); err != nil { + case "RuleSummaryList": + if err := awsRestjson1_deserializeDocumentRuleSummaryList(&sv.RuleSummaryList, value); err != nil { return err } @@ -21124,14 +21696,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKe return nil } -type awsRestjson1_deserializeOpListSecurityProfileApplications struct { +type awsRestjson1_deserializeOpListSecurityKeys struct { } -func (*awsRestjson1_deserializeOpListSecurityProfileApplications) ID() string { +func (*awsRestjson1_deserializeOpListSecurityKeys) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityProfileApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityKeys) 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) @@ -21145,9 +21717,9 @@ func (m *awsRestjson1_deserializeOpListSecurityProfileApplications) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfileApplications(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityKeys(response, &metadata) } - output := &ListSecurityProfileApplicationsOutput{} + output := &ListSecurityKeysOutput{} out.Result = output var buff [1024]byte @@ -21168,7 +21740,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfileApplications) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21181,7 +21753,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfileApplications) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityProfileApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityKeys(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)} @@ -21247,7 +21819,7 @@ func awsRestjson1_deserializeOpErrorListSecurityProfileApplications(response *sm } } -func awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(v **ListSecurityProfileApplicationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKeysOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21260,45 +21832,15 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityProfileApplicationsOutput + var sv *ListSecurityKeysOutput if *v == nil { - sv = &ListSecurityProfileApplicationsOutput{} + sv = &ListSecurityKeysOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Applications": - if err := awsRestjson1_deserializeDocumentApplications(&sv.Applications, value); err != nil { - 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) @@ -21308,6 +21850,11 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(v * sv.NextToken = ptr.String(jtv) } + case "SecurityKeys": + if err := awsRestjson1_deserializeDocumentSecurityKeysList(&sv.SecurityKeys, value); err != nil { + return err + } + default: _, _ = key, value @@ -21317,14 +21864,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(v * return nil } -type awsRestjson1_deserializeOpListSecurityProfilePermissions struct { +type awsRestjson1_deserializeOpListSecurityProfileApplications struct { } -func (*awsRestjson1_deserializeOpListSecurityProfilePermissions) ID() string { +func (*awsRestjson1_deserializeOpListSecurityProfileApplications) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityProfilePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityProfileApplications) 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) @@ -21338,9 +21885,9 @@ func (m *awsRestjson1_deserializeOpListSecurityProfilePermissions) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfilePermissions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfileApplications(response, &metadata) } - output := &ListSecurityProfilePermissionsOutput{} + output := &ListSecurityProfileApplicationsOutput{} out.Result = output var buff [1024]byte @@ -21361,7 +21908,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfilePermissions) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21374,7 +21921,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfilePermissions) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityProfilePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityProfileApplications(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)} @@ -21440,7 +21987,7 @@ func awsRestjson1_deserializeOpErrorListSecurityProfilePermissions(response *smi } } -func awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(v **ListSecurityProfilePermissionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityProfileApplicationsOutput(v **ListSecurityProfileApplicationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21453,15 +22000,20 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityProfilePermissionsOutput + var sv *ListSecurityProfileApplicationsOutput if *v == nil { - sv = &ListSecurityProfilePermissionsOutput{} + sv = &ListSecurityProfileApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "Applications": + if err := awsRestjson1_deserializeDocumentApplications(&sv.Applications, value); err != nil { + return err + } + case "LastModifiedRegion": if value != nil { jtv, ok := value.(string) @@ -21496,11 +22048,6 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(v ** sv.NextToken = ptr.String(jtv) } - case "Permissions": - if err := awsRestjson1_deserializeDocumentPermissionsList(&sv.Permissions, value); err != nil { - return err - } - default: _, _ = key, value @@ -21510,14 +22057,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(v ** return nil } -type awsRestjson1_deserializeOpListSecurityProfiles struct { +type awsRestjson1_deserializeOpListSecurityProfilePermissions struct { } -func (*awsRestjson1_deserializeOpListSecurityProfiles) ID() string { +func (*awsRestjson1_deserializeOpListSecurityProfilePermissions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityProfilePermissions) 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) @@ -21531,9 +22078,9 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfilePermissions(response, &metadata) } - output := &ListSecurityProfilesOutput{} + output := &ListSecurityProfilePermissionsOutput{} out.Result = output var buff [1024]byte @@ -21554,7 +22101,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21567,7 +22114,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityProfilePermissions(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)} @@ -21633,7 +22180,7 @@ func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecurityProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityProfilePermissionsOutput(v **ListSecurityProfilePermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21646,15 +22193,40 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityProfilesOutput + var sv *ListSecurityProfilePermissionsOutput if *v == nil { - sv = &ListSecurityProfilesOutput{} + sv = &ListSecurityProfilePermissionsOutput{} } else { sv = *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) @@ -21664,8 +22236,8 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri sv.NextToken = ptr.String(jtv) } - case "SecurityProfileSummaryList": - if err := awsRestjson1_deserializeDocumentSecurityProfileSummaryList(&sv.SecurityProfileSummaryList, value); err != nil { + case "Permissions": + if err := awsRestjson1_deserializeDocumentPermissionsList(&sv.Permissions, value); err != nil { return err } @@ -21678,14 +22250,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListSecurityProfiles struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListSecurityProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityProfiles) 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) @@ -21699,9 +22271,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfiles(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListSecurityProfilesOutput{} out.Result = output var buff [1024]byte @@ -21722,7 +22294,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21735,7 +22307,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityProfiles(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)} @@ -21801,7 +22373,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecurityProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21814,17 +22386,26 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListSecurityProfilesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListSecurityProfilesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SecurityProfileSummaryList": + if err := awsRestjson1_deserializeDocumentSecurityProfileSummaryList(&sv.SecurityProfileSummaryList, value); err != nil { return err } @@ -21837,14 +22418,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListTaskTemplates struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpListTaskTemplates) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTaskTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -21858,9 +22439,9 @@ func (m *awsRestjson1_deserializeOpListTaskTemplates) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTaskTemplates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ListTaskTemplatesOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -21881,7 +22462,7 @@ func (m *awsRestjson1_deserializeOpListTaskTemplates) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTaskTemplatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21894,7 +22475,166 @@ func (m *awsRestjson1_deserializeOpListTaskTemplates) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTaskTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTaskTemplates struct { +} + +func (*awsRestjson1_deserializeOpListTaskTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTaskTemplates) 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_deserializeOpErrorListTaskTemplates(response, &metadata) + } + output := &ListTaskTemplatesOutput{} + 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_deserializeOpDocumentListTaskTemplatesOutput(&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_deserializeOpErrorListTaskTemplates(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)} @@ -22671,14 +23411,14 @@ func awsRestjson1_deserializeOpDocumentListUserHierarchyGroupsOutput(v **ListUse return nil } -type awsRestjson1_deserializeOpListUsers struct { +type awsRestjson1_deserializeOpListUserProficiencies struct { } -func (*awsRestjson1_deserializeOpListUsers) ID() string { +func (*awsRestjson1_deserializeOpListUserProficiencies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListUserProficiencies) 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) @@ -22692,9 +23432,9 @@ func (m *awsRestjson1_deserializeOpListUsers) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListUsers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListUserProficiencies(response, &metadata) } - output := &ListUsersOutput{} + output := &ListUserProficienciesOutput{} out.Result = output var buff [1024]byte @@ -22715,7 +23455,7 @@ func (m *awsRestjson1_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListUsersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListUserProficienciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22728,7 +23468,7 @@ func (m *awsRestjson1_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListUserProficiencies(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)} @@ -22794,7 +23534,7 @@ func awsRestjson1_deserializeOpErrorListUsers(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListUserProficienciesOutput(v **ListUserProficienciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22807,15 +23547,40 @@ func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListUsersOutput + var sv *ListUserProficienciesOutput if *v == nil { - sv = &ListUsersOutput{} + sv = &ListUserProficienciesOutput{} } else { sv = *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) @@ -22825,8 +23590,8 @@ func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, valu sv.NextToken = ptr.String(jtv) } - case "UserSummaryList": - if err := awsRestjson1_deserializeDocumentUserSummaryList(&sv.UserSummaryList, value); err != nil { + case "UserProficiencyList": + if err := awsRestjson1_deserializeDocumentUserProficiencyList(&sv.UserProficiencyList, value); err != nil { return err } @@ -22839,14 +23604,14 @@ func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, valu return nil } -type awsRestjson1_deserializeOpListViews struct { +type awsRestjson1_deserializeOpListUsers struct { } -func (*awsRestjson1_deserializeOpListViews) ID() string { +func (*awsRestjson1_deserializeOpListUsers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListViews) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListUsers) 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) @@ -22860,9 +23625,9 @@ func (m *awsRestjson1_deserializeOpListViews) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListViews(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListUsers(response, &metadata) } - output := &ListViewsOutput{} + output := &ListUsersOutput{} out.Result = output var buff [1024]byte @@ -22883,7 +23648,7 @@ func (m *awsRestjson1_deserializeOpListViews) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListViewsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListUsersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22896,7 +23661,7 @@ func (m *awsRestjson1_deserializeOpListViews) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListViews(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListUsers(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)} @@ -22937,9 +23702,6 @@ func awsRestjson1_deserializeOpErrorListViews(response *smithyhttp.Response, met } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -22952,8 +23714,8 @@ func awsRestjson1_deserializeOpErrorListViews(response *smithyhttp.Response, met case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -22965,7 +23727,7 @@ func awsRestjson1_deserializeOpErrorListViews(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentListViewsOutput(v **ListViewsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22978,9 +23740,9 @@ func awsRestjson1_deserializeOpDocumentListViewsOutput(v **ListViewsOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListViewsOutput + var sv *ListUsersOutput if *v == nil { - sv = &ListViewsOutput{} + sv = &ListUsersOutput{} } else { sv = *v } @@ -22991,13 +23753,13 @@ func awsRestjson1_deserializeOpDocumentListViewsOutput(v **ListViewsOutput, valu if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ViewsNextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "ViewsSummaryList": - if err := awsRestjson1_deserializeDocumentViewsSummaryList(&sv.ViewsSummaryList, value); err != nil { + case "UserSummaryList": + if err := awsRestjson1_deserializeDocumentUserSummaryList(&sv.UserSummaryList, value); err != nil { return err } @@ -23010,14 +23772,14 @@ func awsRestjson1_deserializeOpDocumentListViewsOutput(v **ListViewsOutput, valu return nil } -type awsRestjson1_deserializeOpListViewVersions struct { +type awsRestjson1_deserializeOpListViews struct { } -func (*awsRestjson1_deserializeOpListViewVersions) ID() string { +func (*awsRestjson1_deserializeOpListViews) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListViewVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListViews) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23031,9 +23793,9 @@ func (m *awsRestjson1_deserializeOpListViewVersions) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListViewVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListViews(response, &metadata) } - output := &ListViewVersionsOutput{} + output := &ListViewsOutput{} out.Result = output var buff [1024]byte @@ -23054,7 +23816,7 @@ func (m *awsRestjson1_deserializeOpListViewVersions) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListViewVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListViewsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23067,7 +23829,7 @@ func (m *awsRestjson1_deserializeOpListViewVersions) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListViewVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListViews(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23136,7 +23898,7 @@ func awsRestjson1_deserializeOpErrorListViewVersions(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListViewVersionsOutput(v **ListViewVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListViewsOutput(v **ListViewsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -23149,9 +23911,9 @@ func awsRestjson1_deserializeOpDocumentListViewVersionsOutput(v **ListViewVersio return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListViewVersionsOutput + var sv *ListViewsOutput if *v == nil { - sv = &ListViewVersionsOutput{} + sv = &ListViewsOutput{} } else { sv = *v } @@ -23167,8 +23929,8 @@ func awsRestjson1_deserializeOpDocumentListViewVersionsOutput(v **ListViewVersio sv.NextToken = ptr.String(jtv) } - case "ViewVersionSummaryList": - if err := awsRestjson1_deserializeDocumentViewVersionSummaryList(&sv.ViewVersionSummaryList, value); err != nil { + case "ViewsSummaryList": + if err := awsRestjson1_deserializeDocumentViewsSummaryList(&sv.ViewsSummaryList, value); err != nil { return err } @@ -23181,14 +23943,14 @@ func awsRestjson1_deserializeOpDocumentListViewVersionsOutput(v **ListViewVersio return nil } -type awsRestjson1_deserializeOpMonitorContact struct { +type awsRestjson1_deserializeOpListViewVersions struct { } -func (*awsRestjson1_deserializeOpMonitorContact) ID() string { +func (*awsRestjson1_deserializeOpListViewVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpMonitorContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListViewVersions) 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) @@ -23202,9 +23964,9 @@ func (m *awsRestjson1_deserializeOpMonitorContact) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorMonitorContact(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListViewVersions(response, &metadata) } - output := &MonitorContactOutput{} + output := &ListViewVersionsOutput{} out.Result = output var buff [1024]byte @@ -23225,7 +23987,7 @@ func (m *awsRestjson1_deserializeOpMonitorContact) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentMonitorContactOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListViewVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23238,7 +24000,178 @@ func (m *awsRestjson1_deserializeOpMonitorContact) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorMonitorContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListViewVersions(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 awsRestjson1_deserializeErrorAccessDeniedException(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) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListViewVersionsOutput(v **ListViewVersionsOutput, 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 *ListViewVersionsOutput + if *v == nil { + sv = &ListViewVersionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ViewsNextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ViewVersionSummaryList": + if err := awsRestjson1_deserializeDocumentViewVersionSummaryList(&sv.ViewVersionSummaryList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpMonitorContact struct { +} + +func (*awsRestjson1_deserializeOpMonitorContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpMonitorContact) 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_deserializeOpErrorMonitorContact(response, &metadata) + } + output := &MonitorContactOutput{} + 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_deserializeOpDocumentMonitorContactOutput(&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_deserializeOpErrorMonitorContact(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)} @@ -24204,14 +25137,14 @@ func awsRestjson1_deserializeOpDocumentSearchAvailablePhoneNumbersOutput(v **Sea return nil } -type awsRestjson1_deserializeOpSearchHoursOfOperations struct { +type awsRestjson1_deserializeOpSearchContacts struct { } -func (*awsRestjson1_deserializeOpSearchHoursOfOperations) ID() string { +func (*awsRestjson1_deserializeOpSearchContacts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchHoursOfOperations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchContacts) 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) @@ -24225,9 +25158,9 @@ func (m *awsRestjson1_deserializeOpSearchHoursOfOperations) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchHoursOfOperations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchContacts(response, &metadata) } - output := &SearchHoursOfOperationsOutput{} + output := &SearchContactsOutput{} out.Result = output var buff [1024]byte @@ -24248,7 +25181,7 @@ func (m *awsRestjson1_deserializeOpSearchHoursOfOperations) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchHoursOfOperationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchContactsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24261,7 +25194,7 @@ func (m *awsRestjson1_deserializeOpSearchHoursOfOperations) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchHoursOfOperations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchContacts(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)} @@ -24327,7 +25260,7 @@ func awsRestjson1_deserializeOpErrorSearchHoursOfOperations(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentSearchHoursOfOperationsOutput(v **SearchHoursOfOperationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchContactsOutput(v **SearchContactsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24340,30 +25273,17 @@ func awsRestjson1_deserializeOpDocumentSearchHoursOfOperationsOutput(v **SearchH return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchHoursOfOperationsOutput + var sv *SearchContactsOutput if *v == nil { - sv = &SearchHoursOfOperationsOutput{} + sv = &SearchContactsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ApproximateTotalCount": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ApproximateTotalCount to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ApproximateTotalCount = ptr.Int64(i64) - } - - case "HoursOfOperations": - if err := awsRestjson1_deserializeDocumentHoursOfOperationList(&sv.HoursOfOperations, value); err != nil { + case "Contacts": + if err := awsRestjson1_deserializeDocumentContacts(&sv.Contacts, value); err != nil { return err } @@ -24371,11 +25291,24 @@ func awsRestjson1_deserializeOpDocumentSearchHoursOfOperationsOutput(v **SearchH if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken2500 to be of type string, got %T instead", value) + return fmt.Errorf("expected LargeNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } + case "TotalCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TotalCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalCount = ptr.Int64(i64) + } + default: _, _ = key, value @@ -24385,14 +25318,14 @@ func awsRestjson1_deserializeOpDocumentSearchHoursOfOperationsOutput(v **SearchH return nil } -type awsRestjson1_deserializeOpSearchPrompts struct { +type awsRestjson1_deserializeOpSearchHoursOfOperations struct { } -func (*awsRestjson1_deserializeOpSearchPrompts) ID() string { +func (*awsRestjson1_deserializeOpSearchHoursOfOperations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchPrompts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchHoursOfOperations) 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) @@ -24406,9 +25339,9 @@ func (m *awsRestjson1_deserializeOpSearchPrompts) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchPrompts(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchHoursOfOperations(response, &metadata) } - output := &SearchPromptsOutput{} + output := &SearchHoursOfOperationsOutput{} out.Result = output var buff [1024]byte @@ -24429,7 +25362,7 @@ func (m *awsRestjson1_deserializeOpSearchPrompts) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchPromptsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchHoursOfOperationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24442,7 +25375,7 @@ func (m *awsRestjson1_deserializeOpSearchPrompts) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchPrompts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchHoursOfOperations(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)} @@ -24508,7 +25441,7 @@ func awsRestjson1_deserializeOpErrorSearchPrompts(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentSearchPromptsOutput(v **SearchPromptsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchHoursOfOperationsOutput(v **SearchHoursOfOperationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24521,9 +25454,9 @@ func awsRestjson1_deserializeOpDocumentSearchPromptsOutput(v **SearchPromptsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchPromptsOutput + var sv *SearchHoursOfOperationsOutput if *v == nil { - sv = &SearchPromptsOutput{} + sv = &SearchHoursOfOperationsOutput{} } else { sv = *v } @@ -24543,6 +25476,11 @@ func awsRestjson1_deserializeOpDocumentSearchPromptsOutput(v **SearchPromptsOutp sv.ApproximateTotalCount = ptr.Int64(i64) } + case "HoursOfOperations": + if err := awsRestjson1_deserializeDocumentHoursOfOperationList(&sv.HoursOfOperations, value); err != nil { + return err + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -24552,11 +25490,6 @@ func awsRestjson1_deserializeOpDocumentSearchPromptsOutput(v **SearchPromptsOutp sv.NextToken = ptr.String(jtv) } - case "Prompts": - if err := awsRestjson1_deserializeDocumentPromptList(&sv.Prompts, value); err != nil { - return err - } - default: _, _ = key, value @@ -24566,14 +25499,14 @@ func awsRestjson1_deserializeOpDocumentSearchPromptsOutput(v **SearchPromptsOutp return nil } -type awsRestjson1_deserializeOpSearchQueues struct { +type awsRestjson1_deserializeOpSearchPredefinedAttributes struct { } -func (*awsRestjson1_deserializeOpSearchQueues) ID() string { +func (*awsRestjson1_deserializeOpSearchPredefinedAttributes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchPredefinedAttributes) 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) @@ -24587,9 +25520,9 @@ func (m *awsRestjson1_deserializeOpSearchQueues) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchQueues(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchPredefinedAttributes(response, &metadata) } - output := &SearchQueuesOutput{} + output := &SearchPredefinedAttributesOutput{} out.Result = output var buff [1024]byte @@ -24610,7 +25543,7 @@ func (m *awsRestjson1_deserializeOpSearchQueues) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchQueuesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchPredefinedAttributesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24623,7 +25556,7 @@ func (m *awsRestjson1_deserializeOpSearchQueues) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchPredefinedAttributes(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)} @@ -24689,7 +25622,7 @@ func awsRestjson1_deserializeOpErrorSearchQueues(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentSearchQueuesOutput(v **SearchQueuesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchPredefinedAttributesOutput(v **SearchPredefinedAttributesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24702,9 +25635,9 @@ func awsRestjson1_deserializeOpDocumentSearchQueuesOutput(v **SearchQueuesOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchQueuesOutput + var sv *SearchPredefinedAttributesOutput if *v == nil { - sv = &SearchQueuesOutput{} + sv = &SearchPredefinedAttributesOutput{} } else { sv = *v } @@ -24733,8 +25666,8 @@ func awsRestjson1_deserializeOpDocumentSearchQueuesOutput(v **SearchQueuesOutput sv.NextToken = ptr.String(jtv) } - case "Queues": - if err := awsRestjson1_deserializeDocumentQueueSearchSummaryList(&sv.Queues, value); err != nil { + case "PredefinedAttributes": + if err := awsRestjson1_deserializeDocumentPredefinedAttributeSearchSummaryList(&sv.PredefinedAttributes, value); err != nil { return err } @@ -24747,14 +25680,14 @@ func awsRestjson1_deserializeOpDocumentSearchQueuesOutput(v **SearchQueuesOutput return nil } -type awsRestjson1_deserializeOpSearchQuickConnects struct { +type awsRestjson1_deserializeOpSearchPrompts struct { } -func (*awsRestjson1_deserializeOpSearchQuickConnects) ID() string { +func (*awsRestjson1_deserializeOpSearchPrompts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchQuickConnects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchPrompts) 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) @@ -24768,9 +25701,9 @@ func (m *awsRestjson1_deserializeOpSearchQuickConnects) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchQuickConnects(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchPrompts(response, &metadata) } - output := &SearchQuickConnectsOutput{} + output := &SearchPromptsOutput{} out.Result = output var buff [1024]byte @@ -24791,7 +25724,7 @@ func (m *awsRestjson1_deserializeOpSearchQuickConnects) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchPromptsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24804,7 +25737,7 @@ func (m *awsRestjson1_deserializeOpSearchQuickConnects) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchQuickConnects(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchPrompts(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)} @@ -24870,7 +25803,7 @@ func awsRestjson1_deserializeOpErrorSearchQuickConnects(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(v **SearchQuickConnectsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchPromptsOutput(v **SearchPromptsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24883,9 +25816,9 @@ func awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(v **SearchQuick return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchQuickConnectsOutput + var sv *SearchPromptsOutput if *v == nil { - sv = &SearchQuickConnectsOutput{} + sv = &SearchPromptsOutput{} } else { sv = *v } @@ -24914,8 +25847,8 @@ func awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(v **SearchQuick sv.NextToken = ptr.String(jtv) } - case "QuickConnects": - if err := awsRestjson1_deserializeDocumentQuickConnectSearchSummaryList(&sv.QuickConnects, value); err != nil { + case "Prompts": + if err := awsRestjson1_deserializeDocumentPromptList(&sv.Prompts, value); err != nil { return err } @@ -24928,14 +25861,14 @@ func awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(v **SearchQuick return nil } -type awsRestjson1_deserializeOpSearchResourceTags struct { +type awsRestjson1_deserializeOpSearchQueues struct { } -func (*awsRestjson1_deserializeOpSearchResourceTags) ID() string { +func (*awsRestjson1_deserializeOpSearchQueues) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchResourceTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchQueues) 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) @@ -24949,9 +25882,9 @@ func (m *awsRestjson1_deserializeOpSearchResourceTags) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchResourceTags(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchQueues(response, &metadata) } - output := &SearchResourceTagsOutput{} + output := &SearchQueuesOutput{} out.Result = output var buff [1024]byte @@ -24972,7 +25905,7 @@ func (m *awsRestjson1_deserializeOpSearchResourceTags) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchQueuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24985,7 +25918,7 @@ func (m *awsRestjson1_deserializeOpSearchResourceTags) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchResourceTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchQueues(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)} @@ -25035,9 +25968,6 @@ func awsRestjson1_deserializeOpErrorSearchResourceTags(response *smithyhttp.Resp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("MaximumResultReturnedException", errorCode): - return awsRestjson1_deserializeErrorMaximumResultReturnedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -25054,7 +25984,7 @@ func awsRestjson1_deserializeOpErrorSearchResourceTags(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(v **SearchResourceTagsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchQueuesOutput(v **SearchQueuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25067,15 +25997,28 @@ func awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(v **SearchResour return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchResourceTagsOutput + var sv *SearchQueuesOutput if *v == nil { - sv = &SearchResourceTagsOutput{} + sv = &SearchQueuesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "ApproximateTotalCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ApproximateTotalCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ApproximateTotalCount = ptr.Int64(i64) + } + case "NextToken": if value != nil { jtv, ok := value.(string) @@ -25085,8 +26028,8 @@ func awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(v **SearchResour sv.NextToken = ptr.String(jtv) } - case "Tags": - if err := awsRestjson1_deserializeDocumentTagsList(&sv.Tags, value); err != nil { + case "Queues": + if err := awsRestjson1_deserializeDocumentQueueSearchSummaryList(&sv.Queues, value); err != nil { return err } @@ -25099,14 +26042,14 @@ func awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(v **SearchResour return nil } -type awsRestjson1_deserializeOpSearchRoutingProfiles struct { +type awsRestjson1_deserializeOpSearchQuickConnects struct { } -func (*awsRestjson1_deserializeOpSearchRoutingProfiles) ID() string { +func (*awsRestjson1_deserializeOpSearchQuickConnects) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchRoutingProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchQuickConnects) 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) @@ -25120,9 +26063,9 @@ func (m *awsRestjson1_deserializeOpSearchRoutingProfiles) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchRoutingProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchQuickConnects(response, &metadata) } - output := &SearchRoutingProfilesOutput{} + output := &SearchQuickConnectsOutput{} out.Result = output var buff [1024]byte @@ -25143,7 +26086,7 @@ func (m *awsRestjson1_deserializeOpSearchRoutingProfiles) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchRoutingProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25156,7 +26099,7 @@ func (m *awsRestjson1_deserializeOpSearchRoutingProfiles) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchRoutingProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchQuickConnects(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)} @@ -25222,7 +26165,7 @@ func awsRestjson1_deserializeOpErrorSearchRoutingProfiles(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentSearchRoutingProfilesOutput(v **SearchRoutingProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(v **SearchQuickConnectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25235,9 +26178,9 @@ func awsRestjson1_deserializeOpDocumentSearchRoutingProfilesOutput(v **SearchRou return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchRoutingProfilesOutput + var sv *SearchQuickConnectsOutput if *v == nil { - sv = &SearchRoutingProfilesOutput{} + sv = &SearchQuickConnectsOutput{} } else { sv = *v } @@ -25266,8 +26209,8 @@ func awsRestjson1_deserializeOpDocumentSearchRoutingProfilesOutput(v **SearchRou sv.NextToken = ptr.String(jtv) } - case "RoutingProfiles": - if err := awsRestjson1_deserializeDocumentRoutingProfileList(&sv.RoutingProfiles, value); err != nil { + case "QuickConnects": + if err := awsRestjson1_deserializeDocumentQuickConnectSearchSummaryList(&sv.QuickConnects, value); err != nil { return err } @@ -25280,14 +26223,14 @@ func awsRestjson1_deserializeOpDocumentSearchRoutingProfilesOutput(v **SearchRou return nil } -type awsRestjson1_deserializeOpSearchSecurityProfiles struct { +type awsRestjson1_deserializeOpSearchResourceTags struct { } -func (*awsRestjson1_deserializeOpSearchSecurityProfiles) ID() string { +func (*awsRestjson1_deserializeOpSearchResourceTags) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchResourceTags) 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) @@ -25301,9 +26244,9 @@ func (m *awsRestjson1_deserializeOpSearchSecurityProfiles) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchSecurityProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchResourceTags(response, &metadata) } - output := &SearchSecurityProfilesOutput{} + output := &SearchResourceTagsOutput{} out.Result = output var buff [1024]byte @@ -25324,7 +26267,7 @@ func (m *awsRestjson1_deserializeOpSearchSecurityProfiles) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchSecurityProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25337,7 +26280,7 @@ func (m *awsRestjson1_deserializeOpSearchSecurityProfiles) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchResourceTags(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)} @@ -25387,6 +26330,9 @@ func awsRestjson1_deserializeOpErrorSearchSecurityProfiles(response *smithyhttp. case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("MaximumResultReturnedException", errorCode): + return awsRestjson1_deserializeErrorMaximumResultReturnedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -25403,7 +26349,7 @@ func awsRestjson1_deserializeOpErrorSearchSecurityProfiles(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentSearchSecurityProfilesOutput(v **SearchSecurityProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(v **SearchResourceTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25416,9 +26362,358 @@ func awsRestjson1_deserializeOpDocumentSearchSecurityProfilesOutput(v **SearchSe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchSecurityProfilesOutput + var sv *SearchResourceTagsOutput if *v == nil { - sv = &SearchSecurityProfilesOutput{} + sv = &SearchResourceTagsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken2500 to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagsList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchRoutingProfiles struct { +} + +func (*awsRestjson1_deserializeOpSearchRoutingProfiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchRoutingProfiles) 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_deserializeOpErrorSearchRoutingProfiles(response, &metadata) + } + output := &SearchRoutingProfilesOutput{} + 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_deserializeOpDocumentSearchRoutingProfilesOutput(&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_deserializeOpErrorSearchRoutingProfiles(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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchRoutingProfilesOutput(v **SearchRoutingProfilesOutput, 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 *SearchRoutingProfilesOutput + if *v == nil { + sv = &SearchRoutingProfilesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApproximateTotalCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ApproximateTotalCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ApproximateTotalCount = ptr.Int64(i64) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken2500 to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "RoutingProfiles": + if err := awsRestjson1_deserializeDocumentRoutingProfileList(&sv.RoutingProfiles, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchSecurityProfiles struct { +} + +func (*awsRestjson1_deserializeOpSearchSecurityProfiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchSecurityProfiles) 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_deserializeOpErrorSearchSecurityProfiles(response, &metadata) + } + output := &SearchSecurityProfilesOutput{} + 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_deserializeOpDocumentSearchSecurityProfilesOutput(&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_deserializeOpErrorSearchSecurityProfiles(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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchSecurityProfilesOutput(v **SearchSecurityProfilesOutput, 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 *SearchSecurityProfilesOutput + if *v == nil { + sv = &SearchSecurityProfilesOutput{} } else { sv = *v } @@ -29186,6 +30481,104 @@ func awsRestjson1_deserializeOpErrorUpdateContactFlowName(response *smithyhttp.R } } +type awsRestjson1_deserializeOpUpdateContactRoutingData struct { +} + +func (*awsRestjson1_deserializeOpUpdateContactRoutingData) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateContactRoutingData) 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_deserializeOpErrorUpdateContactRoutingData(response, &metadata) + } + output := &UpdateContactRoutingDataOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateContactRoutingData(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 awsRestjson1_deserializeErrorAccessDeniedException(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("ResourceConflictException", errorCode): + return awsRestjson1_deserializeErrorResourceConflictException(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 + + } +} + type awsRestjson1_deserializeOpUpdateContactSchedule struct { } @@ -30164,14 +31557,14 @@ func awsRestjson1_deserializeOpErrorUpdatePhoneNumberMetadata(response *smithyht } } -type awsRestjson1_deserializeOpUpdatePrompt struct { +type awsRestjson1_deserializeOpUpdatePredefinedAttribute struct { } -func (*awsRestjson1_deserializeOpUpdatePrompt) ID() string { +func (*awsRestjson1_deserializeOpUpdatePredefinedAttribute) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdatePrompt) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdatePredefinedAttribute) 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) @@ -30185,43 +31578,21 @@ func (m *awsRestjson1_deserializeOpUpdatePrompt) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePrompt(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePredefinedAttribute(response, &metadata) } - output := &UpdatePromptOutput{} + output := &UpdatePredefinedAttributeOutput{} 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_deserializeOpDocumentUpdatePromptOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdatePrompt(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePredefinedAttribute(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)} @@ -30287,63 +31658,14 @@ func awsRestjson1_deserializeOpErrorUpdatePrompt(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdatePromptOutput(v **UpdatePromptOutput, 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 *UpdatePromptOutput - if *v == nil { - sv = &UpdatePromptOutput{} - } 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 "PromptId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) - } - sv.PromptId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateQueueHoursOfOperation struct { +type awsRestjson1_deserializeOpUpdatePrompt struct { } -func (*awsRestjson1_deserializeOpUpdateQueueHoursOfOperation) ID() string { +func (*awsRestjson1_deserializeOpUpdatePrompt) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateQueueHoursOfOperation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdatePrompt) 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) @@ -30357,122 +31679,43 @@ func (m *awsRestjson1_deserializeOpUpdateQueueHoursOfOperation) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateQueueHoursOfOperation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePrompt(response, &metadata) } - output := &UpdateQueueHoursOfOperationOutput{} + output := &UpdatePromptOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateQueueHoursOfOperation(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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { + 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 - } - - 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("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) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUpdateQueueMaxContacts struct { -} - -func (*awsRestjson1_deserializeOpUpdateQueueMaxContacts) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateQueueMaxContacts) 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_deserializeOpErrorUpdateQueueMaxContacts(response, &metadata) - } - output := &UpdateQueueMaxContactsOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + err = awsRestjson1_deserializeOpDocumentUpdatePromptOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateQueueMaxContacts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePrompt(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)} @@ -30538,14 +31781,63 @@ func awsRestjson1_deserializeOpErrorUpdateQueueMaxContacts(response *smithyhttp. } } -type awsRestjson1_deserializeOpUpdateQueueName struct { +func awsRestjson1_deserializeOpDocumentUpdatePromptOutput(v **UpdatePromptOutput, 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 *UpdatePromptOutput + if *v == nil { + sv = &UpdatePromptOutput{} + } 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 "PromptId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PromptId to be of type string, got %T instead", value) + } + sv.PromptId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateQueueName) ID() string { +type awsRestjson1_deserializeOpUpdateQueueHoursOfOperation struct { +} + +func (*awsRestjson1_deserializeOpUpdateQueueHoursOfOperation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateQueueName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateQueueHoursOfOperation) 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) @@ -30559,9 +31851,9 @@ func (m *awsRestjson1_deserializeOpUpdateQueueName) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateQueueName(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateQueueHoursOfOperation(response, &metadata) } - output := &UpdateQueueNameOutput{} + output := &UpdateQueueHoursOfOperationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -30573,7 +31865,7 @@ func (m *awsRestjson1_deserializeOpUpdateQueueName) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateQueueName(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateQueueHoursOfOperation(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)} @@ -30614,9 +31906,6 @@ func awsRestjson1_deserializeOpErrorUpdateQueueName(response *smithyhttp.Respons } switch { - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -30642,14 +31931,14 @@ func awsRestjson1_deserializeOpErrorUpdateQueueName(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig struct { +type awsRestjson1_deserializeOpUpdateQueueMaxContacts struct { } -func (*awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig) ID() string { +func (*awsRestjson1_deserializeOpUpdateQueueMaxContacts) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateQueueMaxContacts) 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) @@ -30663,9 +31952,9 @@ func (m *awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateQueueOutboundCallerConfig(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateQueueMaxContacts(response, &metadata) } - output := &UpdateQueueOutboundCallerConfigOutput{} + output := &UpdateQueueMaxContactsOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -30677,7 +31966,7 @@ func (m *awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateQueueOutboundCallerConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateQueueMaxContacts(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)} @@ -30743,14 +32032,14 @@ func awsRestjson1_deserializeOpErrorUpdateQueueOutboundCallerConfig(response *sm } } -type awsRestjson1_deserializeOpUpdateQueueStatus struct { +type awsRestjson1_deserializeOpUpdateQueueName struct { } -func (*awsRestjson1_deserializeOpUpdateQueueStatus) ID() string { +func (*awsRestjson1_deserializeOpUpdateQueueName) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateQueueStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateQueueName) 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) @@ -30764,9 +32053,9 @@ func (m *awsRestjson1_deserializeOpUpdateQueueStatus) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateQueueStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateQueueName(response, &metadata) } - output := &UpdateQueueStatusOutput{} + output := &UpdateQueueNameOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -30778,7 +32067,212 @@ func (m *awsRestjson1_deserializeOpUpdateQueueStatus) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateQueueStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateQueueName(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("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 + + } +} + +type awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig struct { +} + +func (*awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateQueueOutboundCallerConfig) 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_deserializeOpErrorUpdateQueueOutboundCallerConfig(response, &metadata) + } + output := &UpdateQueueOutboundCallerConfigOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateQueueOutboundCallerConfig(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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateQueueStatus struct { +} + +func (*awsRestjson1_deserializeOpUpdateQueueStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateQueueStatus) 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_deserializeOpErrorUpdateQueueStatus(response, &metadata) + } + output := &UpdateQueueStatusOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateQueueStatus(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)} @@ -32635,14 +34129,14 @@ func awsRestjson1_deserializeOpErrorUpdateUserPhoneConfig(response *smithyhttp.R } } -type awsRestjson1_deserializeOpUpdateUserRoutingProfile struct { +type awsRestjson1_deserializeOpUpdateUserProficiencies struct { } -func (*awsRestjson1_deserializeOpUpdateUserRoutingProfile) ID() string { +func (*awsRestjson1_deserializeOpUpdateUserProficiencies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateUserRoutingProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateUserProficiencies) 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) @@ -32656,9 +34150,9 @@ func (m *awsRestjson1_deserializeOpUpdateUserRoutingProfile) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserRoutingProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserProficiencies(response, &metadata) } - output := &UpdateUserRoutingProfileOutput{} + output := &UpdateUserProficienciesOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -32670,7 +34164,7 @@ func (m *awsRestjson1_deserializeOpUpdateUserRoutingProfile) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateUserRoutingProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateUserProficiencies(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)} @@ -32736,14 +34230,14 @@ func awsRestjson1_deserializeOpErrorUpdateUserRoutingProfile(response *smithyhtt } } -type awsRestjson1_deserializeOpUpdateUserSecurityProfiles struct { +type awsRestjson1_deserializeOpUpdateUserRoutingProfile struct { } -func (*awsRestjson1_deserializeOpUpdateUserSecurityProfiles) ID() string { +func (*awsRestjson1_deserializeOpUpdateUserRoutingProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateUserSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateUserRoutingProfile) 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) @@ -32757,9 +34251,9 @@ func (m *awsRestjson1_deserializeOpUpdateUserSecurityProfiles) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserSecurityProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserRoutingProfile(response, &metadata) } - output := &UpdateUserSecurityProfilesOutput{} + output := &UpdateUserRoutingProfileOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -32771,7 +34265,7 @@ func (m *awsRestjson1_deserializeOpUpdateUserSecurityProfiles) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateUserSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateUserRoutingProfile(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)} @@ -32837,14 +34331,14 @@ func awsRestjson1_deserializeOpErrorUpdateUserSecurityProfiles(response *smithyh } } -type awsRestjson1_deserializeOpUpdateViewContent struct { +type awsRestjson1_deserializeOpUpdateUserSecurityProfiles struct { } -func (*awsRestjson1_deserializeOpUpdateViewContent) ID() string { +func (*awsRestjson1_deserializeOpUpdateUserSecurityProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateViewContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateUserSecurityProfiles) 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) @@ -32858,43 +34352,144 @@ func (m *awsRestjson1_deserializeOpUpdateViewContent) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateViewContent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserSecurityProfiles(response, &metadata) } - output := &UpdateViewContentOutput{} + output := &UpdateUserSecurityProfilesOutput{} 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_deserializeOpDocumentUpdateViewContentOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateViewContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateUserSecurityProfiles(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("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) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateViewContent struct { +} + +func (*awsRestjson1_deserializeOpUpdateViewContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateViewContent) 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_deserializeOpErrorUpdateViewContent(response, &metadata) + } + output := &UpdateViewContentOutput{} + 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_deserializeOpDocumentUpdateViewContentOutput(&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_deserializeOpErrorUpdateViewContent(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)} @@ -35750,6 +37345,32 @@ func awsRestjson1_deserializeDocumentContact(v **types.Contact, value interface{ return err } + case "QueuePriority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected QueuePriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.QueuePriority = ptr.Int64(i64) + } + + case "QueueTimeAdjustmentSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected QueueTimeAdjustmentSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.QueueTimeAdjustmentSeconds = ptr.Int32(int32(i64)) + } + case "RelatedContactId": if value != nil { jtv, ok := value.(string) @@ -36344,6 +37965,295 @@ func awsRestjson1_deserializeDocumentContactReferences(v *map[string]types.Refer return nil } +func awsRestjson1_deserializeDocumentContacts(v *[]types.ContactSearchSummary, 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.ContactSearchSummary + if *v == nil { + cv = []types.ContactSearchSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ContactSearchSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentContactSearchSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentContactSearchSummary(v **types.ContactSearchSummary, 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.ContactSearchSummary + if *v == nil { + sv = &types.ContactSearchSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AgentInfo": + if err := awsRestjson1_deserializeDocumentContactSearchSummaryAgentInfo(&sv.AgentInfo, value); err != nil { + return err + } + + 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 "Channel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Channel to be of type string, got %T instead", value) + } + sv.Channel = types.Channel(jtv) + } + + case "DisconnectTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DisconnectTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContactId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "InitialContactId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContactId to be of type string, got %T instead", value) + } + sv.InitialContactId = ptr.String(jtv) + } + + case "InitiationMethod": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContactInitiationMethod to be of type string, got %T instead", value) + } + sv.InitiationMethod = types.ContactInitiationMethod(jtv) + } + + case "InitiationTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.InitiationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "PreviousContactId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContactId to be of type string, got %T instead", value) + } + sv.PreviousContactId = ptr.String(jtv) + } + + case "QueueInfo": + if err := awsRestjson1_deserializeDocumentContactSearchSummaryQueueInfo(&sv.QueueInfo, value); err != nil { + return err + } + + case "ScheduledTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ScheduledTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContactSearchSummaryAgentInfo(v **types.ContactSearchSummaryAgentInfo, 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.ContactSearchSummaryAgentInfo + if *v == nil { + sv = &types.ContactSearchSummaryAgentInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConnectedToAgentTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ConnectedToAgentTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentResourceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContactSearchSummaryQueueInfo(v **types.ContactSearchSummaryQueueInfo, 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.ContactSearchSummaryQueueInfo + if *v == nil { + sv = &types.ContactSearchSummaryQueueInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnqueueTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EnqueueTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueueId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentContactTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -37041,6 +38951,15 @@ func awsRestjson1_deserializeDocumentDimensions(v **types.Dimensions, value inte return err } + case "RoutingStepExpression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoutingExpression to be of type string, got %T instead", value) + } + sv.RoutingStepExpression = ptr.String(jtv) + } + default: _, _ = key, value @@ -43751,7 +45670,346 @@ func awsRestjson1_deserializeDocumentPermissionsList(v *[]string, value interfac if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SecurityProfilePermission to be of type string, got %T instead", value) + return fmt.Errorf("expected SecurityProfilePermission to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberQuickConnectConfig(v **types.PhoneNumberQuickConnectConfig, 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.PhoneNumberQuickConnectConfig + if *v == nil { + sv = &types.PhoneNumberQuickConnectConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + } + sv.PhoneNumber = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberStatus(v **types.PhoneNumberStatus, 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.PhoneNumberStatus + if *v == nil { + sv = &types.PhoneNumberStatus{} + } 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 PhoneNumberWorkflowMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberWorkflowStatus to be of type string, got %T instead", value) + } + sv.Status = types.PhoneNumberWorkflowStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberSummary(v **types.PhoneNumberSummary, 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.PhoneNumberSummary + if *v == nil { + sv = &types.PhoneNumberSummary{} + } 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 PhoneNumberId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + } + sv.PhoneNumber = ptr.String(jtv) + } + + case "PhoneNumberCountryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberCountryCode to be of type string, got %T instead", value) + } + sv.PhoneNumberCountryCode = types.PhoneNumberCountryCode(jtv) + } + + case "PhoneNumberType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberType to be of type string, got %T instead", value) + } + sv.PhoneNumberType = types.PhoneNumberType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberSummaryList(v *[]types.PhoneNumberSummary, 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.PhoneNumberSummary + if *v == nil { + cv = []types.PhoneNumberSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumberSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentPhoneNumberSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPredefinedAttribute(v **types.PredefinedAttribute, 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.PredefinedAttribute + if *v == nil { + sv = &types.PredefinedAttribute{} + } else { + sv = *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 "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredefinedAttributeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Values": + if err := awsRestjson1_deserializeDocumentPredefinedAttributeValues(&sv.Values, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPredefinedAttributeSearchSummaryList(v *[]types.PredefinedAttribute, 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.PredefinedAttribute + if *v == nil { + cv = []types.PredefinedAttribute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PredefinedAttribute + destAddr := &col + if err := awsRestjson1_deserializeDocumentPredefinedAttribute(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPredefinedAttributeStringValuesList(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 PredefinedAttributeStringValue to be of type string, got %T instead", value) } col = jtv } @@ -43762,7 +46020,7 @@ func awsRestjson1_deserializeDocumentPermissionsList(v *[]string, value interfac return nil } -func awsRestjson1_deserializeDocumentPhoneNumberQuickConnectConfig(v **types.PhoneNumberQuickConnectConfig, value interface{}) error { +func awsRestjson1_deserializeDocumentPredefinedAttributeSummary(v **types.PredefinedAttributeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -43775,71 +46033,47 @@ func awsRestjson1_deserializeDocumentPhoneNumberQuickConnectConfig(v **types.Pho return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PhoneNumberQuickConnectConfig + var sv *types.PredefinedAttributeSummary if *v == nil { - sv = &types.PhoneNumberQuickConnectConfig{} + sv = &types.PredefinedAttributeSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "PhoneNumber": + case "LastModifiedRegion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) } - sv.PhoneNumber = ptr.String(jtv) + sv.LastModifiedRegion = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPhoneNumberStatus(v **types.PhoneNumberStatus, 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) - } + 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)) - var sv *types.PhoneNumberStatus - if *v == nil { - sv = &types.PhoneNumberStatus{} - } 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 "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PhoneNumberWorkflowMessage to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) } - case "Status": + case "Name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PhoneNumberWorkflowStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected PredefinedAttributeName to be of type string, got %T instead", value) } - sv.Status = types.PhoneNumberWorkflowStatus(jtv) + sv.Name = ptr.String(jtv) } default: @@ -43851,7 +46085,7 @@ func awsRestjson1_deserializeDocumentPhoneNumberStatus(v **types.PhoneNumberStat return nil } -func awsRestjson1_deserializeDocumentPhoneNumberSummary(v **types.PhoneNumberSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPredefinedAttributeSummaryList(v *[]types.PredefinedAttributeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -43859,75 +46093,33 @@ func awsRestjson1_deserializeDocumentPhoneNumberSummary(v **types.PhoneNumberSum 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.PhoneNumberSummary + var cv []types.PredefinedAttributeSummary if *v == nil { - sv = &types.PhoneNumberSummary{} + cv = []types.PredefinedAttributeSummary{} } else { - sv = *v + cv = *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 PhoneNumberId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "PhoneNumber": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) - } - sv.PhoneNumber = ptr.String(jtv) - } - - case "PhoneNumberCountryCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PhoneNumberCountryCode to be of type string, got %T instead", value) - } - sv.PhoneNumberCountryCode = types.PhoneNumberCountryCode(jtv) - } - - case "PhoneNumberType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PhoneNumberType to be of type string, got %T instead", value) - } - sv.PhoneNumberType = types.PhoneNumberType(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.PredefinedAttributeSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentPredefinedAttributeSummary(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentPhoneNumberSummaryList(v *[]types.PhoneNumberSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentPredefinedAttributeValues(v *types.PredefinedAttributeValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -43935,29 +46127,33 @@ func awsRestjson1_deserializeDocumentPhoneNumberSummaryList(v *[]types.PhoneNumb 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.PhoneNumberSummary - if *v == nil { - cv = []types.PhoneNumberSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PhoneNumberSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentPhoneNumberSummary(&destAddr, value); err != nil { - return err + var uv types.PredefinedAttributeValues +loop: + for key, value := range shape { + if value == nil { + continue } - col = *destAddr - cv = append(cv, col) + switch key { + case "StringList": + var mv []string + if err := awsRestjson1_deserializeDocumentPredefinedAttributeStringValuesList(&mv, value); err != nil { + return err + } + uv = &types.PredefinedAttributeValuesMemberStringList{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + } } - *v = cv + *v = uv return nil } @@ -50630,6 +52826,123 @@ func awsRestjson1_deserializeDocumentUserPhoneConfig(v **types.UserPhoneConfig, return nil } +func awsRestjson1_deserializeDocumentUserProficiency(v **types.UserProficiency, 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.UserProficiency + if *v == nil { + sv = &types.UserProficiency{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AttributeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredefinedAttributeName to be of type string, got %T instead", value) + } + sv.AttributeName = ptr.String(jtv) + } + + case "AttributeValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredefinedAttributeStringValue to be of type string, got %T instead", value) + } + sv.AttributeValue = ptr.String(jtv) + } + + case "Level": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Level = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Level = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected ProficiencyLevel to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUserProficiencyList(v *[]types.UserProficiency, 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.UserProficiency + if *v == nil { + cv = []types.UserProficiency{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.UserProficiency + destAddr := &col + if err := awsRestjson1_deserializeDocumentUserProficiency(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentUserQuickConnectConfig(v **types.UserQuickConnectConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connect/generated.json b/service/connect/generated.json index d83dca8d57c..3d0d28ddbf2 100644 --- a/service/connect/generated.json +++ b/service/connect/generated.json @@ -23,6 +23,7 @@ "api_op_AssociateRoutingProfileQueues.go", "api_op_AssociateSecurityKey.go", "api_op_AssociateTrafficDistributionGroupUser.go", + "api_op_AssociateUserProficiencies.go", "api_op_BatchAssociateAnalyticsDataSet.go", "api_op_BatchDisassociateAnalyticsDataSet.go", "api_op_BatchGetFlowAssociation.go", @@ -37,6 +38,7 @@ "api_op_CreateIntegrationAssociation.go", "api_op_CreateParticipant.go", "api_op_CreatePersistentContactAssociation.go", + "api_op_CreatePredefinedAttribute.go", "api_op_CreatePrompt.go", "api_op_CreateQueue.go", "api_op_CreateQuickConnect.go", @@ -59,6 +61,7 @@ "api_op_DeleteHoursOfOperation.go", "api_op_DeleteInstance.go", "api_op_DeleteIntegrationAssociation.go", + "api_op_DeletePredefinedAttribute.go", "api_op_DeletePrompt.go", "api_op_DeleteQueue.go", "api_op_DeleteQuickConnect.go", @@ -84,6 +87,7 @@ "api_op_DescribeInstanceAttribute.go", "api_op_DescribeInstanceStorageConfig.go", "api_op_DescribePhoneNumber.go", + "api_op_DescribePredefinedAttribute.go", "api_op_DescribePrompt.go", "api_op_DescribeQueue.go", "api_op_DescribeQuickConnect.go", @@ -108,6 +112,7 @@ "api_op_DisassociateRoutingProfileQueues.go", "api_op_DisassociateSecurityKey.go", "api_op_DisassociateTrafficDistributionGroupUser.go", + "api_op_DisassociateUserProficiencies.go", "api_op_DismissUserContact.go", "api_op_GetContactAttributes.go", "api_op_GetCurrentMetricData.go", @@ -141,6 +146,7 @@ "api_op_ListLexBots.go", "api_op_ListPhoneNumbers.go", "api_op_ListPhoneNumbersV2.go", + "api_op_ListPredefinedAttributes.go", "api_op_ListPrompts.go", "api_op_ListQueueQuickConnects.go", "api_op_ListQueues.go", @@ -159,6 +165,7 @@ "api_op_ListTrafficDistributionGroups.go", "api_op_ListUseCases.go", "api_op_ListUserHierarchyGroups.go", + "api_op_ListUserProficiencies.go", "api_op_ListUsers.go", "api_op_ListViewVersions.go", "api_op_ListViews.go", @@ -170,7 +177,9 @@ "api_op_ResumeContact.go", "api_op_ResumeContactRecording.go", "api_op_SearchAvailablePhoneNumbers.go", + "api_op_SearchContacts.go", "api_op_SearchHoursOfOperations.go", + "api_op_SearchPredefinedAttributes.go", "api_op_SearchPrompts.go", "api_op_SearchQueues.go", "api_op_SearchQuickConnects.go", @@ -206,6 +215,7 @@ "api_op_UpdateContactFlowModuleContent.go", "api_op_UpdateContactFlowModuleMetadata.go", "api_op_UpdateContactFlowName.go", + "api_op_UpdateContactRoutingData.go", "api_op_UpdateContactSchedule.go", "api_op_UpdateEvaluationForm.go", "api_op_UpdateHoursOfOperation.go", @@ -214,6 +224,7 @@ "api_op_UpdateParticipantRoleConfig.go", "api_op_UpdatePhoneNumber.go", "api_op_UpdatePhoneNumberMetadata.go", + "api_op_UpdatePredefinedAttribute.go", "api_op_UpdatePrompt.go", "api_op_UpdateQueueHoursOfOperation.go", "api_op_UpdateQueueMaxContacts.go", @@ -236,6 +247,7 @@ "api_op_UpdateUserHierarchyStructure.go", "api_op_UpdateUserIdentityInfo.go", "api_op_UpdateUserPhoneConfig.go", + "api_op_UpdateUserProficiencies.go", "api_op_UpdateUserRoutingProfile.go", "api_op_UpdateUserSecurityProfiles.go", "api_op_UpdateViewContent.go", diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 3202b85e64d..cf1d313adfd 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -1331,6 +1331,105 @@ func awsRestjson1_serializeOpDocumentAssociateTrafficDistributionGroupUserInput( return nil } +type awsRestjson1_serializeOpAssociateUserProficiencies struct { +} + +func (*awsRestjson1_serializeOpAssociateUserProficiencies) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateUserProficiencies) 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.(*AssociateUserProficienciesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/associate-proficiencies") + 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_serializeOpHttpBindingsAssociateUserProficienciesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociateUserProficienciesInput(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_serializeOpHttpBindingsAssociateUserProficienciesInput(v *AssociateUserProficienciesInput, 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 + } + } + + if v.UserId == nil || len(*v.UserId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")} + } + if v.UserId != nil { + if err := encoder.SetURI("UserId").String(*v.UserId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateUserProficienciesInput(v *AssociateUserProficienciesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UserProficiencies != nil { + ok := object.Key("UserProficiencies") + if err := awsRestjson1_serializeDocumentUserProficiencyList(v.UserProficiencies, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpBatchAssociateAnalyticsDataSet struct { } @@ -2788,6 +2887,101 @@ func awsRestjson1_serializeOpDocumentCreatePersistentContactAssociationInput(v * return nil } +type awsRestjson1_serializeOpCreatePredefinedAttribute struct { +} + +func (*awsRestjson1_serializeOpCreatePredefinedAttribute) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreatePredefinedAttribute) 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.(*CreatePredefinedAttributeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/predefined-attributes/{InstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + 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_serializeOpHttpBindingsCreatePredefinedAttributeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreatePredefinedAttributeInput(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_serializeOpHttpBindingsCreatePredefinedAttributeInput(v *CreatePredefinedAttributeInput, 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_serializeOpDocumentCreatePredefinedAttributeInput(v *CreatePredefinedAttributeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentPredefinedAttributeValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreatePrompt struct { } @@ -4998,6 +5192,80 @@ func awsRestjson1_serializeOpHttpBindingsDeleteIntegrationAssociationInput(v *De return nil } +type awsRestjson1_serializeOpDeletePredefinedAttribute struct { +} + +func (*awsRestjson1_serializeOpDeletePredefinedAttribute) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeletePredefinedAttribute) 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.(*DeletePredefinedAttributeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/predefined-attributes/{InstanceId}/{Name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + 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_serializeOpHttpBindingsDeletePredefinedAttributeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeletePredefinedAttributeInput(v *DeletePredefinedAttributeInput, 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 + } + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeletePrompt struct { } @@ -6847,14 +7115,14 @@ func awsRestjson1_serializeOpHttpBindingsDescribePhoneNumberInput(v *DescribePho return nil } -type awsRestjson1_serializeOpDescribePrompt struct { +type awsRestjson1_serializeOpDescribePredefinedAttribute struct { } -func (*awsRestjson1_serializeOpDescribePrompt) ID() string { +func (*awsRestjson1_serializeOpDescribePredefinedAttribute) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribePrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribePredefinedAttribute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -6862,13 +7130,13 @@ func (m *awsRestjson1_serializeOpDescribePrompt) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribePromptInput) + input, ok := in.Parameters.(*DescribePredefinedAttributeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/prompts/{InstanceId}/{PromptId}") + opPath, opQuery := httpbinding.SplitURI("/predefined-attributes/{InstanceId}/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -6884,7 +7152,7 @@ func (m *awsRestjson1_serializeOpDescribePrompt) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsDescribePromptInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsDescribePredefinedAttributeInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -6895,7 +7163,7 @@ func (m *awsRestjson1_serializeOpDescribePrompt) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsDescribePromptInput(v *DescribePromptInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsDescribePredefinedAttributeInput(v *DescribePredefinedAttributeInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -6909,11 +7177,11 @@ func awsRestjson1_serializeOpHttpBindingsDescribePromptInput(v *DescribePromptIn } } - if v.PromptId == nil || len(*v.PromptId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member PromptId must not be empty")} + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } - if v.PromptId != nil { - if err := encoder.SetURI("PromptId").String(*v.PromptId); err != nil { + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } @@ -6921,14 +7189,14 @@ func awsRestjson1_serializeOpHttpBindingsDescribePromptInput(v *DescribePromptIn return nil } -type awsRestjson1_serializeOpDescribeQueue struct { +type awsRestjson1_serializeOpDescribePrompt struct { } -func (*awsRestjson1_serializeOpDescribeQueue) ID() string { +func (*awsRestjson1_serializeOpDescribePrompt) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpDescribeQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpDescribePrompt) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -6936,13 +7204,87 @@ func (m *awsRestjson1_serializeOpDescribeQueue) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeQueueInput) + input, ok := in.Parameters.(*DescribePromptInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/queues/{InstanceId}/{QueueId}") + opPath, opQuery := httpbinding.SplitURI("/prompts/{InstanceId}/{PromptId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + 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_serializeOpHttpBindingsDescribePromptInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribePromptInput(v *DescribePromptInput, 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 + } + } + + if v.PromptId == nil || len(*v.PromptId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PromptId must not be empty")} + } + if v.PromptId != nil { + if err := encoder.SetURI("PromptId").String(*v.PromptId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribeQueue struct { +} + +func (*awsRestjson1_serializeOpDescribeQueue) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeQueue) 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.(*DescribeQueueInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/queues/{InstanceId}/{QueueId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -8693,6 +9035,105 @@ func awsRestjson1_serializeOpHttpBindingsDisassociateTrafficDistributionGroupUse return nil } +type awsRestjson1_serializeOpDisassociateUserProficiencies struct { +} + +func (*awsRestjson1_serializeOpDisassociateUserProficiencies) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateUserProficiencies) 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.(*DisassociateUserProficienciesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/disassociate-proficiencies") + 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_serializeOpHttpBindingsDisassociateUserProficienciesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociateUserProficienciesInput(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_serializeOpHttpBindingsDisassociateUserProficienciesInput(v *DisassociateUserProficienciesInput, 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 + } + } + + if v.UserId == nil || len(*v.UserId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")} + } + if v.UserId != nil { + if err := encoder.SetURI("UserId").String(*v.UserId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisassociateUserProficienciesInput(v *DisassociateUserProficienciesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UserProficiencies != nil { + ok := object.Key("UserProficiencies") + if err := awsRestjson1_serializeDocumentUserProficiencyDisassociateList(v.UserProficiencies, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDismissUserContact struct { } @@ -11451,6 +11892,79 @@ func awsRestjson1_serializeOpDocumentListPhoneNumbersV2Input(v *ListPhoneNumbers return nil } +type awsRestjson1_serializeOpListPredefinedAttributes struct { +} + +func (*awsRestjson1_serializeOpListPredefinedAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPredefinedAttributes) 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.(*ListPredefinedAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/predefined-attributes/{InstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + 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_serializeOpHttpBindingsListPredefinedAttributesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListPredefinedAttributesInput(v *ListPredefinedAttributesInput, 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 + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListPrompts struct { } @@ -12866,14 +13380,14 @@ func awsRestjson1_serializeOpHttpBindingsListUserHierarchyGroupsInput(v *ListUse return nil } -type awsRestjson1_serializeOpListUsers struct { +type awsRestjson1_serializeOpListUserProficiencies struct { } -func (*awsRestjson1_serializeOpListUsers) ID() string { +func (*awsRestjson1_serializeOpListUserProficiencies) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListUserProficiencies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -12881,13 +13395,13 @@ func (m *awsRestjson1_serializeOpListUsers) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListUsersInput) + input, ok := in.Parameters.(*ListUserProficienciesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/users-summary/{InstanceId}") + opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/proficiencies") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -12903,7 +13417,7 @@ func (m *awsRestjson1_serializeOpListUsers) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListUsersInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListUserProficienciesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -12914,7 +13428,7 @@ func (m *awsRestjson1_serializeOpListUsers) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListUsersInput(v *ListUsersInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListUserProficienciesInput(v *ListUserProficienciesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -12936,17 +13450,26 @@ func awsRestjson1_serializeOpHttpBindingsListUsersInput(v *ListUsersInput, encod encoder.SetQuery("nextToken").String(*v.NextToken) } + if v.UserId == nil || len(*v.UserId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")} + } + if v.UserId != nil { + if err := encoder.SetURI("UserId").String(*v.UserId); err != nil { + return err + } + } + return nil } -type awsRestjson1_serializeOpListViews struct { +type awsRestjson1_serializeOpListUsers struct { } -func (*awsRestjson1_serializeOpListViews) ID() string { +func (*awsRestjson1_serializeOpListUsers) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListViews) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -12954,13 +13477,13 @@ func (m *awsRestjson1_serializeOpListViews) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListViewsInput) + input, ok := in.Parameters.(*ListUsersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/views/{InstanceId}") + opPath, opQuery := httpbinding.SplitURI("/users-summary/{InstanceId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -12976,7 +13499,7 @@ func (m *awsRestjson1_serializeOpListViews) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListViewsInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListUsersInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -12987,7 +13510,80 @@ func (m *awsRestjson1_serializeOpListViews) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListViewsInput(v *ListViewsInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListUsersInput(v *ListUsersInput, 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 + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListViews struct { +} + +func (*awsRestjson1_serializeOpListViews) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListViews) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListViewsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/views/{InstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + 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_serializeOpHttpBindingsListViewsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListViewsInput(v *ListViewsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -13819,6 +14415,112 @@ func awsRestjson1_serializeOpDocumentSearchAvailablePhoneNumbersInput(v *SearchA return nil } +type awsRestjson1_serializeOpSearchContacts struct { +} + +func (*awsRestjson1_serializeOpSearchContacts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchContacts) 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.(*SearchContactsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/search-contacts") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchContactsInput(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_serializeOpHttpBindingsSearchContactsInput(v *SearchContactsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchContactsInput(v *SearchContactsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InstanceId != nil { + ok := object.Key("InstanceId") + ok.String(*v.InstanceId) + } + + 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.SearchCriteria != nil { + ok := object.Key("SearchCriteria") + if err := awsRestjson1_serializeDocumentSearchCriteria(v.SearchCriteria, ok); err != nil { + return err + } + } + + if v.Sort != nil { + ok := object.Key("Sort") + if err := awsRestjson1_serializeDocumentSort(v.Sort, ok); err != nil { + return err + } + } + + if v.TimeRange != nil { + ok := object.Key("TimeRange") + if err := awsRestjson1_serializeDocumentSearchContactsTimeRange(v.TimeRange, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpSearchHoursOfOperations struct { } @@ -13918,6 +14620,98 @@ func awsRestjson1_serializeOpDocumentSearchHoursOfOperationsInput(v *SearchHours return nil } +type awsRestjson1_serializeOpSearchPredefinedAttributes struct { +} + +func (*awsRestjson1_serializeOpSearchPredefinedAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchPredefinedAttributes) 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.(*SearchPredefinedAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/search-predefined-attributes") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchPredefinedAttributesInput(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_serializeOpHttpBindingsSearchPredefinedAttributesInput(v *SearchPredefinedAttributesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchPredefinedAttributesInput(v *SearchPredefinedAttributesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InstanceId != nil { + ok := object.Key("InstanceId") + ok.String(*v.InstanceId) + } + + 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.SearchCriteria != nil { + ok := object.Key("SearchCriteria") + if err := awsRestjson1_serializeDocumentPredefinedAttributeSearchCriteria(v.SearchCriteria, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpSearchPrompts struct { } @@ -17445,14 +18239,14 @@ func awsRestjson1_serializeOpDocumentUpdateContactFlowNameInput(v *UpdateContact return nil } -type awsRestjson1_serializeOpUpdateContactSchedule struct { +type awsRestjson1_serializeOpUpdateContactRoutingData struct { } -func (*awsRestjson1_serializeOpUpdateContactSchedule) ID() string { +func (*awsRestjson1_serializeOpUpdateContactRoutingData) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateContactSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateContactRoutingData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -17460,13 +18254,115 @@ func (m *awsRestjson1_serializeOpUpdateContactSchedule) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateContactScheduleInput) + input, ok := in.Parameters.(*UpdateContactRoutingDataInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/contact/schedule") + opPath, opQuery := httpbinding.SplitURI("/contacts/{InstanceId}/{ContactId}/routing-data") + 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_serializeOpHttpBindingsUpdateContactRoutingDataInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateContactRoutingDataInput(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_serializeOpHttpBindingsUpdateContactRoutingDataInput(v *UpdateContactRoutingDataInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContactId == nil || len(*v.ContactId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ContactId must not be empty")} + } + if v.ContactId != nil { + if err := encoder.SetURI("ContactId").String(*v.ContactId); err != nil { + return err + } + } + + 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_serializeOpDocumentUpdateContactRoutingDataInput(v *UpdateContactRoutingDataInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.QueuePriority != nil { + ok := object.Key("QueuePriority") + ok.Long(*v.QueuePriority) + } + + if v.QueueTimeAdjustmentSeconds != nil { + ok := object.Key("QueueTimeAdjustmentSeconds") + ok.Integer(*v.QueueTimeAdjustmentSeconds) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateContactSchedule struct { +} + +func (*awsRestjson1_serializeOpUpdateContactSchedule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateContactSchedule) 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.(*UpdateContactScheduleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/contact/schedule") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -18265,6 +19161,105 @@ func awsRestjson1_serializeOpDocumentUpdatePhoneNumberMetadataInput(v *UpdatePho return nil } +type awsRestjson1_serializeOpUpdatePredefinedAttribute struct { +} + +func (*awsRestjson1_serializeOpUpdatePredefinedAttribute) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePredefinedAttribute) 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.(*UpdatePredefinedAttributeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/predefined-attributes/{InstanceId}/{Name}") + 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_serializeOpHttpBindingsUpdatePredefinedAttributeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePredefinedAttributeInput(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_serializeOpHttpBindingsUpdatePredefinedAttributeInput(v *UpdatePredefinedAttributeInput, 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 + } + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePredefinedAttributeInput(v *UpdatePredefinedAttributeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentPredefinedAttributeValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdatePrompt struct { } @@ -20517,14 +21512,14 @@ func awsRestjson1_serializeOpDocumentUpdateUserPhoneConfigInput(v *UpdateUserPho return nil } -type awsRestjson1_serializeOpUpdateUserRoutingProfile struct { +type awsRestjson1_serializeOpUpdateUserProficiencies struct { } -func (*awsRestjson1_serializeOpUpdateUserRoutingProfile) ID() string { +func (*awsRestjson1_serializeOpUpdateUserProficiencies) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateUserRoutingProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateUserProficiencies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -20532,13 +21527,13 @@ func (m *awsRestjson1_serializeOpUpdateUserRoutingProfile) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateUserRoutingProfileInput) + input, ok := in.Parameters.(*UpdateUserProficienciesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/routing-profile") + opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/proficiencies") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -20554,14 +21549,14 @@ func (m *awsRestjson1_serializeOpUpdateUserRoutingProfile) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateUserRoutingProfileInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateUserProficienciesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateUserRoutingProfileInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateUserProficienciesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -20576,7 +21571,7 @@ func (m *awsRestjson1_serializeOpUpdateUserRoutingProfile) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateUserRoutingProfileInput(v *UpdateUserRoutingProfileInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateUserProficienciesInput(v *UpdateUserProficienciesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -20602,26 +21597,28 @@ func awsRestjson1_serializeOpHttpBindingsUpdateUserRoutingProfileInput(v *Update return nil } -func awsRestjson1_serializeOpDocumentUpdateUserRoutingProfileInput(v *UpdateUserRoutingProfileInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateUserProficienciesInput(v *UpdateUserProficienciesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.RoutingProfileId != nil { - ok := object.Key("RoutingProfileId") - ok.String(*v.RoutingProfileId) + if v.UserProficiencies != nil { + ok := object.Key("UserProficiencies") + if err := awsRestjson1_serializeDocumentUserProficiencyList(v.UserProficiencies, ok); err != nil { + return err + } } return nil } -type awsRestjson1_serializeOpUpdateUserSecurityProfiles struct { +type awsRestjson1_serializeOpUpdateUserRoutingProfile struct { } -func (*awsRestjson1_serializeOpUpdateUserSecurityProfiles) ID() string { +func (*awsRestjson1_serializeOpUpdateUserRoutingProfile) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateUserSecurityProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateUserRoutingProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -20629,13 +21626,13 @@ func (m *awsRestjson1_serializeOpUpdateUserSecurityProfiles) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateUserSecurityProfilesInput) + input, ok := in.Parameters.(*UpdateUserRoutingProfileInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/security-profiles") + opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/routing-profile") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -20651,14 +21648,14 @@ func (m *awsRestjson1_serializeOpUpdateUserSecurityProfiles) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateUserSecurityProfilesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateUserRoutingProfileInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateUserSecurityProfilesInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateUserRoutingProfileInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -20673,7 +21670,7 @@ func (m *awsRestjson1_serializeOpUpdateUserSecurityProfiles) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateUserSecurityProfilesInput(v *UpdateUserSecurityProfilesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateUserRoutingProfileInput(v *UpdateUserRoutingProfileInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -20699,28 +21696,26 @@ func awsRestjson1_serializeOpHttpBindingsUpdateUserSecurityProfilesInput(v *Upda return nil } -func awsRestjson1_serializeOpDocumentUpdateUserSecurityProfilesInput(v *UpdateUserSecurityProfilesInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateUserRoutingProfileInput(v *UpdateUserRoutingProfileInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.SecurityProfileIds != nil { - ok := object.Key("SecurityProfileIds") - if err := awsRestjson1_serializeDocumentSecurityProfileIds(v.SecurityProfileIds, ok); err != nil { - return err - } + if v.RoutingProfileId != nil { + ok := object.Key("RoutingProfileId") + ok.String(*v.RoutingProfileId) } return nil } -type awsRestjson1_serializeOpUpdateViewContent struct { +type awsRestjson1_serializeOpUpdateUserSecurityProfiles struct { } -func (*awsRestjson1_serializeOpUpdateViewContent) ID() string { +func (*awsRestjson1_serializeOpUpdateUserSecurityProfiles) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateViewContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateUserSecurityProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -20728,13 +21723,13 @@ func (m *awsRestjson1_serializeOpUpdateViewContent) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateViewContentInput) + input, ok := in.Parameters.(*UpdateUserSecurityProfilesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/views/{InstanceId}/{ViewId}") + opPath, opQuery := httpbinding.SplitURI("/users/{InstanceId}/{UserId}/security-profiles") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -20750,14 +21745,14 @@ func (m *awsRestjson1_serializeOpUpdateViewContent) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUpdateViewContentInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsUpdateUserSecurityProfilesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateViewContentInput(input, jsonEncoder.Value); err != nil { + if err := awsRestjson1_serializeOpDocumentUpdateUserSecurityProfilesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -20772,7 +21767,7 @@ func (m *awsRestjson1_serializeOpUpdateViewContent) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUpdateViewContentInput(v *UpdateViewContentInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateUserSecurityProfilesInput(v *UpdateUserSecurityProfilesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -20786,11 +21781,11 @@ func awsRestjson1_serializeOpHttpBindingsUpdateViewContentInput(v *UpdateViewCon } } - if v.ViewId == nil || len(*v.ViewId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ViewId must not be empty")} + if v.UserId == nil || len(*v.UserId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member UserId must not be empty")} } - if v.ViewId != nil { - if err := encoder.SetURI("ViewId").String(*v.ViewId); err != nil { + if v.UserId != nil { + if err := encoder.SetURI("UserId").String(*v.UserId); err != nil { return err } } @@ -20798,33 +21793,132 @@ func awsRestjson1_serializeOpHttpBindingsUpdateViewContentInput(v *UpdateViewCon return nil } -func awsRestjson1_serializeOpDocumentUpdateViewContentInput(v *UpdateViewContentInput, value smithyjson.Value) error { +func awsRestjson1_serializeOpDocumentUpdateUserSecurityProfilesInput(v *UpdateUserSecurityProfilesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Content != nil { - ok := object.Key("Content") - if err := awsRestjson1_serializeDocumentViewInputContent(v.Content, ok); err != nil { + if v.SecurityProfileIds != nil { + ok := object.Key("SecurityProfileIds") + if err := awsRestjson1_serializeDocumentSecurityProfileIds(v.SecurityProfileIds, ok); err != nil { return err } } - if len(v.Status) > 0 { - ok := object.Key("Status") - ok.String(string(v.Status)) - } - return nil } -type awsRestjson1_serializeOpUpdateViewMetadata struct { +type awsRestjson1_serializeOpUpdateViewContent struct { } -func (*awsRestjson1_serializeOpUpdateViewMetadata) ID() string { +func (*awsRestjson1_serializeOpUpdateViewContent) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpUpdateViewMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpUpdateViewContent) 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.(*UpdateViewContentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/views/{InstanceId}/{ViewId}") + 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_serializeOpHttpBindingsUpdateViewContentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateViewContentInput(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_serializeOpHttpBindingsUpdateViewContentInput(v *UpdateViewContentInput, 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 + } + } + + if v.ViewId == nil || len(*v.ViewId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ViewId must not be empty")} + } + if v.ViewId != nil { + if err := encoder.SetURI("ViewId").String(*v.ViewId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateViewContentInput(v *UpdateViewContentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("Content") + if err := awsRestjson1_serializeDocumentViewInputContent(v.Content, ok); err != nil { + return err + } + } + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateViewMetadata struct { +} + +func (*awsRestjson1_serializeOpUpdateViewMetadata) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateViewMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -20933,6 +22027,59 @@ func awsRestjson1_serializeDocumentAgentConfig(v *types.AgentConfig, value smith return nil } +func awsRestjson1_serializeDocumentAgentHierarchyGroups(v *types.AgentHierarchyGroups, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.L1Ids != nil { + ok := object.Key("L1Ids") + if err := awsRestjson1_serializeDocumentHierarchyGroupIdList(v.L1Ids, ok); err != nil { + return err + } + } + + if v.L2Ids != nil { + ok := object.Key("L2Ids") + if err := awsRestjson1_serializeDocumentHierarchyGroupIdList(v.L2Ids, ok); err != nil { + return err + } + } + + if v.L3Ids != nil { + ok := object.Key("L3Ids") + if err := awsRestjson1_serializeDocumentHierarchyGroupIdList(v.L3Ids, ok); err != nil { + return err + } + } + + if v.L4Ids != nil { + ok := object.Key("L4Ids") + if err := awsRestjson1_serializeDocumentHierarchyGroupIdList(v.L4Ids, ok); err != nil { + return err + } + } + + if v.L5Ids != nil { + ok := object.Key("L5Ids") + if err := awsRestjson1_serializeDocumentHierarchyGroupIdList(v.L5Ids, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAgentResourceIdList(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_serializeDocumentAgentsMinOneMaxHundred(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -21077,6 +22224,17 @@ func awsRestjson1_serializeDocumentCampaign(v *types.Campaign, value smithyjson. return nil } +func awsRestjson1_serializeDocumentChannelList(v []types.Channel, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentChannels(v []types.Channel, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -21153,6 +22311,20 @@ func awsRestjson1_serializeDocumentChatStreamingConfiguration(v *types.ChatStrea return nil } +func awsRestjson1_serializeDocumentContactAnalysis(v *types.ContactAnalysis, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Transcript != nil { + ok := object.Key("Transcript") + if err := awsRestjson1_serializeDocumentTranscript(v.Transcript, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentContactDataRequest(v *types.ContactDataRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -22076,6 +23248,13 @@ func awsRestjson1_serializeDocumentFilters(v *types.Filters, value smithyjson.Va } } + if v.RoutingStepExpressions != nil { + ok := object.Key("RoutingStepExpressions") + if err := awsRestjson1_serializeDocumentRoutingExpressions(v.RoutingStepExpressions, ok); err != nil { + return err + } + } + return nil } @@ -22161,6 +23340,17 @@ func awsRestjson1_serializeDocumentHierarchyGroupCondition(v *types.HierarchyGro return nil } +func awsRestjson1_serializeDocumentHierarchyGroupIdList(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_serializeDocumentHierarchyLevelUpdate(v *types.HierarchyLevelUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -22368,6 +23558,17 @@ func awsRestjson1_serializeDocumentHoursOfOperationTimeSlice(v *types.HoursOfOpe return nil } +func awsRestjson1_serializeDocumentInitiationMethodList(v []types.ContactInitiationMethod, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentInstanceStorageConfig(v *types.InstanceStorageConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -22908,6 +24109,76 @@ func awsRestjson1_serializeDocumentPhoneNumberTypes(v []types.PhoneNumberType, v return nil } +func awsRestjson1_serializeDocumentPredefinedAttributeSearchConditionList(v []types.PredefinedAttributeSearchCriteria, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentPredefinedAttributeSearchCriteria(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPredefinedAttributeSearchCriteria(v *types.PredefinedAttributeSearchCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AndConditions != nil { + ok := object.Key("AndConditions") + if err := awsRestjson1_serializeDocumentPredefinedAttributeSearchConditionList(v.AndConditions, ok); err != nil { + return err + } + } + + if v.OrConditions != nil { + ok := object.Key("OrConditions") + if err := awsRestjson1_serializeDocumentPredefinedAttributeSearchConditionList(v.OrConditions, ok); err != nil { + return err + } + } + + if v.StringCondition != nil { + ok := object.Key("StringCondition") + if err := awsRestjson1_serializeDocumentStringCondition(v.StringCondition, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentPredefinedAttributeStringValuesList(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_serializeDocumentPredefinedAttributeValues(v types.PredefinedAttributeValues, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.PredefinedAttributeValuesMemberStringList: + av := object.Key("StringList") + if err := awsRestjson1_serializeDocumentPredefinedAttributeStringValuesList(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + func awsRestjson1_serializeDocumentPromptSearchConditionList(v []types.PromptSearchCriteria, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -22963,6 +24234,17 @@ func awsRestjson1_serializeDocumentPromptSearchFilter(v *types.PromptSearchFilte return nil } +func awsRestjson1_serializeDocumentQueueIdList(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_serializeDocumentQueueQuickConnectConfig(v *types.QueueQuickConnectConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -23268,6 +24550,17 @@ func awsRestjson1_serializeDocumentResourceTypeList(v []string, value smithyjson return nil } +func awsRestjson1_serializeDocumentRoutingExpressions(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_serializeDocumentRoutingProfileQueueConfig(v *types.RoutingProfileQueueConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -23516,6 +24809,157 @@ func awsRestjson1_serializeDocumentS3Config(v *types.S3Config, value smithyjson. return nil } +func awsRestjson1_serializeDocumentSearchableContactAttributes(v *types.SearchableContactAttributes, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Criteria != nil { + ok := object.Key("Criteria") + if err := awsRestjson1_serializeDocumentSearchableContactAttributesCriteriaList(v.Criteria, ok); err != nil { + return err + } + } + + if len(v.MatchType) > 0 { + ok := object.Key("MatchType") + ok.String(string(v.MatchType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSearchableContactAttributesCriteria(v *types.SearchableContactAttributesCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentSearchableContactAttributeValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSearchableContactAttributesCriteriaList(v []types.SearchableContactAttributesCriteria, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSearchableContactAttributesCriteria(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSearchableContactAttributeValueList(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_serializeDocumentSearchContactsTimeRange(v *types.SearchContactsTimeRange, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("EndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) + } + + if v.StartTime != nil { + ok := object.Key("StartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.StartTime)) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSearchCriteria(v *types.SearchCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AgentHierarchyGroups != nil { + ok := object.Key("AgentHierarchyGroups") + if err := awsRestjson1_serializeDocumentAgentHierarchyGroups(v.AgentHierarchyGroups, ok); err != nil { + return err + } + } + + if v.AgentIds != nil { + ok := object.Key("AgentIds") + if err := awsRestjson1_serializeDocumentAgentResourceIdList(v.AgentIds, ok); err != nil { + return err + } + } + + if v.Channels != nil { + ok := object.Key("Channels") + if err := awsRestjson1_serializeDocumentChannelList(v.Channels, ok); err != nil { + return err + } + } + + if v.ContactAnalysis != nil { + ok := object.Key("ContactAnalysis") + if err := awsRestjson1_serializeDocumentContactAnalysis(v.ContactAnalysis, ok); err != nil { + return err + } + } + + if v.InitiationMethods != nil { + ok := object.Key("InitiationMethods") + if err := awsRestjson1_serializeDocumentInitiationMethodList(v.InitiationMethods, ok); err != nil { + return err + } + } + + if v.QueueIds != nil { + ok := object.Key("QueueIds") + if err := awsRestjson1_serializeDocumentQueueIdList(v.QueueIds, ok); err != nil { + return err + } + } + + if v.SearchableContactAttributes != nil { + ok := object.Key("SearchableContactAttributes") + if err := awsRestjson1_serializeDocumentSearchableContactAttributes(v.SearchableContactAttributes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSearchTextList(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_serializeDocumentSecurityProfileIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -23719,6 +25163,23 @@ func awsRestjson1_serializeDocumentSingleSelectQuestionRuleCategoryAutomation(v return nil } +func awsRestjson1_serializeDocumentSort(v *types.Sort, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.FieldName) > 0 { + ok := object.Key("FieldName") + ok.String(string(v.FieldName)) + } + + if len(v.Order) > 0 { + ok := object.Key("Order") + ok.String(string(v.Order)) + } + + return nil +} + func awsRestjson1_serializeDocumentStringCondition(v *types.StringCondition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -24093,6 +25554,62 @@ func awsRestjson1_serializeDocumentThresholdV2(v *types.ThresholdV2, value smith return nil } +func awsRestjson1_serializeDocumentTranscript(v *types.Transcript, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Criteria != nil { + ok := object.Key("Criteria") + if err := awsRestjson1_serializeDocumentTranscriptCriteriaList(v.Criteria, ok); err != nil { + return err + } + } + + if len(v.MatchType) > 0 { + ok := object.Key("MatchType") + ok.String(string(v.MatchType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentTranscriptCriteria(v *types.TranscriptCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.MatchType) > 0 { + ok := object.Key("MatchType") + ok.String(string(v.MatchType)) + } + + if len(v.ParticipantRole) > 0 { + ok := object.Key("ParticipantRole") + ok.String(string(v.ParticipantRole)) + } + + if v.SearchText != nil { + ok := object.Key("SearchText") + if err := awsRestjson1_serializeDocumentSearchTextList(v.SearchText, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTranscriptCriteriaList(v []types.TranscriptCriteria, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTranscriptCriteria(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentUpdateCaseActionDefinition(v *types.UpdateCaseActionDefinition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -24248,6 +25765,84 @@ func awsRestjson1_serializeDocumentUserPhoneConfig(v *types.UserPhoneConfig, val return nil } +func awsRestjson1_serializeDocumentUserProficiency(v *types.UserProficiency, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttributeName != nil { + ok := object.Key("AttributeName") + ok.String(*v.AttributeName) + } + + if v.AttributeValue != nil { + ok := object.Key("AttributeValue") + ok.String(*v.AttributeValue) + } + + if v.Level != nil { + ok := object.Key("Level") + switch { + case math.IsNaN(float64(*v.Level)): + ok.String("NaN") + + case math.IsInf(float64(*v.Level), 1): + ok.String("Infinity") + + case math.IsInf(float64(*v.Level), -1): + ok.String("-Infinity") + + default: + ok.Float(*v.Level) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentUserProficiencyDisassociate(v *types.UserProficiencyDisassociate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttributeName != nil { + ok := object.Key("AttributeName") + ok.String(*v.AttributeName) + } + + if v.AttributeValue != nil { + ok := object.Key("AttributeValue") + ok.String(*v.AttributeValue) + } + + return nil +} + +func awsRestjson1_serializeDocumentUserProficiencyDisassociateList(v []types.UserProficiencyDisassociate, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentUserProficiencyDisassociate(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentUserProficiencyList(v []types.UserProficiency, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentUserProficiency(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentUserQuickConnectConfig(v *types.UserQuickConnectConfig, 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 f08bb302fd3..4c80d1025d7 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -627,9 +627,10 @@ type Grouping string // Enum values for Grouping const ( - GroupingQueue Grouping = "QUEUE" - GroupingChannel Grouping = "CHANNEL" - GroupingRoutingProfile Grouping = "ROUTING_PROFILE" + GroupingQueue Grouping = "QUEUE" + GroupingChannel Grouping = "CHANNEL" + GroupingRoutingProfile Grouping = "ROUTING_PROFILE" + GroupingRoutingStepExpression Grouping = "ROUTING_STEP_EXPRESSION" ) // Values returns all known values for Grouping. Note that this can be expanded in @@ -640,6 +641,7 @@ func (Grouping) Values() []Grouping { "QUEUE", "CHANNEL", "ROUTING_PROFILE", + "ROUTING_STEP_EXPRESSION", } } @@ -1957,6 +1959,46 @@ func (SearchableQueueType) Values() []SearchableQueueType { } } +type SearchContactsMatchType string + +// Enum values for SearchContactsMatchType +const ( + SearchContactsMatchTypeMatchAll SearchContactsMatchType = "MATCH_ALL" + SearchContactsMatchTypeMatchAny SearchContactsMatchType = "MATCH_ANY" +) + +// Values returns all known values for SearchContactsMatchType. 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 (SearchContactsMatchType) Values() []SearchContactsMatchType { + return []SearchContactsMatchType{ + "MATCH_ALL", + "MATCH_ANY", + } +} + +type SearchContactsTimeRangeType string + +// Enum values for SearchContactsTimeRangeType +const ( + SearchContactsTimeRangeTypeInitiationTimestamp SearchContactsTimeRangeType = "INITIATION_TIMESTAMP" + SearchContactsTimeRangeTypeScheduledTimestamp SearchContactsTimeRangeType = "SCHEDULED_TIMESTAMP" + SearchContactsTimeRangeTypeConnectedToAgentTimestamp SearchContactsTimeRangeType = "CONNECTED_TO_AGENT_TIMESTAMP" + SearchContactsTimeRangeTypeDisconnectTimestamp SearchContactsTimeRangeType = "DISCONNECT_TIMESTAMP" +) + +// Values returns all known values for SearchContactsTimeRangeType. 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 (SearchContactsTimeRangeType) Values() []SearchContactsTimeRangeType { + return []SearchContactsTimeRangeType{ + "INITIATION_TIMESTAMP", + "SCHEDULED_TIMESTAMP", + "CONNECTED_TO_AGENT_TIMESTAMP", + "DISCONNECT_TIMESTAMP", + } +} + type SingleSelectQuestionRuleCategoryAutomationCondition string // Enum values for SingleSelectQuestionRuleCategoryAutomationCondition @@ -1976,6 +2018,32 @@ func (SingleSelectQuestionRuleCategoryAutomationCondition) Values() []SingleSele } } +type SortableFieldName string + +// Enum values for SortableFieldName +const ( + SortableFieldNameInitiationTimestamp SortableFieldName = "INITIATION_TIMESTAMP" + SortableFieldNameScheduledTimestamp SortableFieldName = "SCHEDULED_TIMESTAMP" + SortableFieldNameConnectedToAgentTimestamp SortableFieldName = "CONNECTED_TO_AGENT_TIMESTAMP" + SortableFieldNameDisconnectTimestamp SortableFieldName = "DISCONNECT_TIMESTAMP" + SortableFieldNameInitiationMethod SortableFieldName = "INITIATION_METHOD" + SortableFieldNameChannel SortableFieldName = "CHANNEL" +) + +// Values returns all known values for SortableFieldName. 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 (SortableFieldName) Values() []SortableFieldName { + return []SortableFieldName{ + "INITIATION_TIMESTAMP", + "SCHEDULED_TIMESTAMP", + "CONNECTED_TO_AGENT_TIMESTAMP", + "DISCONNECT_TIMESTAMP", + "INITIATION_METHOD", + "CHANNEL", + } +} + type SortOrder string // Enum values for SortOrder diff --git a/service/connect/types/types.go b/service/connect/types/types.go index 4e52fb3f56d..f824b9e5b11 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -58,6 +58,30 @@ type AgentContactReference struct { noSmithyDocumentSerde } +// A structure that defines agent hierarchy group levels which can be used to +// filter search results. Important: Agent hierarchy group level information in +// search result is a snapshot, it does not represent current agent hierarchy who +// handled the contact. +type AgentHierarchyGroups struct { + + // The identifiers for level 1 hierarchy groups. + L1Ids []string + + // The identifiers for level 2 hierarchy groups. + L2Ids []string + + // The identifiers for level 3 hierarchy groups. + L3Ids []string + + // The identifiers for level 4 hierarchy groups. + L4Ids []string + + // The identifiers for level 5 hierarchy groups. + L5Ids []string + + noSmithyDocumentSerde +} + // Information about the agent who accepted the contact. type AgentInfo struct { @@ -505,6 +529,18 @@ type Contact struct { // If this contact was queued, this contains information about the queue. QueueInfo *QueueInfo + // An integer that represents the queue priority to be applied to the contact + // (lower priorities are routed preferentially). Cannot be specified if the + // QueueTimeAdjustmentSeconds is specified. Must be statically defined, must be + // larger than zero, and a valid integer value. Default Value is 5. + QueuePriority *int64 + + // An integer that represents the queue time adjust to be applied to the contact, + // in seconds (longer / larger queue time are routed preferentially). Cannot be + // specified if the QueuePriority is specified. Must be statically defined and a + // valid integer value. + QueueTimeAdjustmentSeconds *int32 + // The contactId that is related (https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html#relatedcontactid) // to this contact. RelatedContactId *string @@ -529,6 +565,17 @@ type Contact struct { noSmithyDocumentSerde } +// A structure that defines filters can be used to search within outputs analyzed +// by Amazon Connect Contact Lens in a contact. +type ContactAnalysis struct { + + // A structure that defines filters can be used to search with text within an + // Amazon Connect Contact Lens analyzed transcript. + Transcript *Transcript + + noSmithyDocumentSerde +} + // Request object with information to create a contact. type ContactDataRequest struct { @@ -676,6 +723,78 @@ type ContactFlowSummary struct { noSmithyDocumentSerde } +// Information of returned contact. +type ContactSearchSummary struct { + + // Information about the agent who accepted the contact. + AgentInfo *ContactSearchSummaryAgentInfo + + // The Amazon Resource Name (ARN) of the contact + Arn *string + + // How the contact reached your contact center. + Channel Channel + + // The timestamp when the customer endpoint disconnected from Amazon Connect. + DisconnectTimestamp *time.Time + + // The identifier of the contact summary. + Id *string + + // If this contact is related to other contacts, this is the ID of the initial + // contact. + InitialContactId *string + + // Indicates how the contact was initiated. + InitiationMethod ContactInitiationMethod + + // The date and time this contact was initiated, in UTC time. For INBOUND, this is + // when the contact arrived. For OUTBOUND, this is when the agent began dialing. + // For CALLBACK, this is when the callback contact was created. For TRANSFER and + // QUEUE_TRANSFER, this is when the transfer was initiated. For API, this is when + // the request arrived. For EXTERNAL_OUTBOUND, this is when the agent started + // dialing the external participant. For MONITOR, this is when the supervisor + // started listening to a contact. + InitiationTimestamp *time.Time + + // If this contact is not the first contact, this is the ID of the previous + // contact. + PreviousContactId *string + + // If this contact was queued, this contains information about the queue. + QueueInfo *ContactSearchSummaryQueueInfo + + // The timestamp, in Unix epoch time format, at which to start running the inbound + // flow. + ScheduledTimestamp *time.Time + + noSmithyDocumentSerde +} + +// Information about the agent who accepted the contact. +type ContactSearchSummaryAgentInfo struct { + + // The timestamp when the contact was connected to the agent. + ConnectedToAgentTimestamp *time.Time + + // The identifier of the agent who accepted the contact. + Id *string + + noSmithyDocumentSerde +} + +// If this contact was queued, this contains information about the queue. +type ContactSearchSummaryQueueInfo struct { + + // The timestamp when the contact was added to the queue. + EnqueueTimestamp *time.Time + + // The unique identifier for the queue. + Id *string + + noSmithyDocumentSerde +} + // An object that can be used to specify Tag conditions inside the SearchFilter . // This accepts an OR of AND (List of List) input where: // - Top level list specifies conditions that need to be applied with OR operator @@ -846,6 +965,9 @@ type Dimensions struct { // Information about the routing profile assigned to the user. RoutingProfile *RoutingProfileReference + // The expression of a step in a routing criteria. + RoutingStepExpression *string + noSmithyDocumentSerde } @@ -1725,6 +1847,10 @@ type Filters struct { // A list of up to 100 routing profile IDs or ARNs. RoutingProfiles []string + // A list of expressions as a filter, in which an expression is an object of a + // step in a routing criteria. + RoutingStepExpressions []string + noSmithyDocumentSerde } @@ -2876,6 +3002,73 @@ type PhoneNumberSummary struct { noSmithyDocumentSerde } +// Information about a predefined attribute. +type PredefinedAttribute struct { + + // Last modified region. + LastModifiedRegion *string + + // Last modified time. + LastModifiedTime *time.Time + + // The name of the predefined attribute. + Name *string + + // The values of the predefined attribute. + Values PredefinedAttributeValues + + noSmithyDocumentSerde +} + +// The search criteria to be used to return predefined attributes. +type PredefinedAttributeSearchCriteria struct { + + // A list of conditions which would be applied together with an AND condition. + AndConditions []PredefinedAttributeSearchCriteria + + // A list of conditions which would be applied together with an OR condition. + OrConditions []PredefinedAttributeSearchCriteria + + // A leaf node condition which can be used to specify a string condition. The + // currently supported values for FieldName are name and description . + StringCondition *StringCondition + + noSmithyDocumentSerde +} + +// Summary of a predefined attribute. +type PredefinedAttributeSummary struct { + + // Last modified region. + LastModifiedRegion *string + + // Last modified time. + LastModifiedTime *time.Time + + // The name of the predefined attribute. + Name *string + + noSmithyDocumentSerde +} + +// Information about values of a predefined attribute. +// +// The following types satisfy this interface: +// +// PredefinedAttributeValuesMemberStringList +type PredefinedAttributeValues interface { + isPredefinedAttributeValues() +} + +// Predefined attribute values of type string list. +type PredefinedAttributeValuesMemberStringList struct { + Value []string + + noSmithyDocumentSerde +} + +func (*PredefinedAttributeValuesMemberStringList) isPredefinedAttributeValues() {} + // Information about a problem detail. type ProblemDetail struct { @@ -4074,6 +4267,85 @@ type S3Config struct { noSmithyDocumentSerde } +// A structure that defines searchable contact attributes which can be used to +// filter search results. +type SearchableContactAttributes struct { + + // The array of searhale contact attribute criteria + // + // This member is required. + Criteria []SearchableContactAttributesCriteria + + // The match type of multiple searchable contact attributes criteria. + MatchType SearchContactsMatchType + + noSmithyDocumentSerde +} + +// The criteria of searchable contact attributes. +type SearchableContactAttributesCriteria struct { + + // The searchable contact attribute key + // + // This member is required. + Key *string + + // The array of contact attribute values used to filter search results. + // + // This member is required. + Values []string + + noSmithyDocumentSerde +} + +// A structure of time range that you want to search results +type SearchContactsTimeRange struct { + + // The end time of the time range. + // + // This member is required. + EndTime *time.Time + + // The start time of the time range. + // + // This member is required. + StartTime *time.Time + + // The type of timestamp to search + // + // This member is required. + Type SearchContactsTimeRangeType + + noSmithyDocumentSerde +} + +// A structure of search criteria to be used to return contacts +type SearchCriteria struct { + + // The agent hierarchy groups + AgentHierarchyGroups *AgentHierarchyGroups + + // The array of agent ids + AgentIds []string + + // The array of channels + Channels []Channel + + // The ContactAnalysis object used in search criteria + ContactAnalysis *ContactAnalysis + + // The array of initiaton methods + InitiationMethods []ContactInitiationMethod + + // The array of queue ids. + QueueIds []string + + // The SearchableContactAttributes object used in search criteria + SearchableContactAttributes *SearchableContactAttributes + + noSmithyDocumentSerde +} + // Configuration information of the security key. type SecurityKey struct { @@ -4141,7 +4413,8 @@ type SecurityProfileSearchCriteria struct { // A list of conditions which would be applied together with an OR condition. OrConditions []SecurityProfileSearchCriteria - // A leaf node condition which can be used to specify a string condition. + // A leaf node condition which can be used to specify a string condition. The + // currently supported values for FieldName are name and description . StringCondition *StringCondition noSmithyDocumentSerde @@ -4301,7 +4574,24 @@ type SingleSelectQuestionRuleCategoryAutomation struct { noSmithyDocumentSerde } -// A leaf node condition which can be used to specify a string condition. +// A structure that defines the sort by and a sort order +type Sort struct { + + // The name of the field on which to sort. + // + // This member is required. + FieldName SortableFieldName + + // An ascending or descending sort. + // + // This member is required. + Order SortOrder + + noSmithyDocumentSerde +} + +// A leaf node condition which can be used to specify a string condition. The +// currently supported values for FieldName are name and description . type StringCondition struct { // The type of comparison to be made when evaluating the string condition. @@ -4645,6 +4935,41 @@ type TrafficDistributionGroupUserSummary struct { noSmithyDocumentSerde } +// The transcript object used to search results. +type Transcript struct { + + // The array of transcript search criteria + // + // This member is required. + Criteria []TranscriptCriteria + + // The match type of multiple transcript criteira + MatchType SearchContactsMatchType + + noSmithyDocumentSerde +} + +// The transcript criteria used to search +type TranscriptCriteria struct { + + // The match type of search texts in a transcript criteria. + // + // This member is required. + MatchType SearchContactsMatchType + + // The participant role in a transcript + // + // This member is required. + ParticipantRole ParticipantRole + + // The words or phrases used to search within a transcript. + // + // This member is required. + SearchText []string + + noSmithyDocumentSerde +} + // The UpdateCase action definition. type UpdateCaseActionDefinition struct { @@ -4866,6 +5191,45 @@ type UserPhoneConfig struct { noSmithyDocumentSerde } +// Information about proficiency of a user. +type UserProficiency struct { + + // The name of user's proficiency. You must use name of predefined attribute + // present in the Amazon Connect instance. + // + // This member is required. + AttributeName *string + + // The value of user's proficiency. You must use value of predefined attribute + // present in the Amazon Connect instance. + // + // This member is required. + AttributeValue *string + + // The level of the proficiency. The valid values are 1, 2, 3, 4 and 5. + // + // This member is required. + Level *float32 + + noSmithyDocumentSerde +} + +// Information about proficiency to be disassociated from the user. +type UserProficiencyDisassociate struct { + + // The name of user's proficiency. + // + // This member is required. + AttributeName *string + + // The value of user's proficiency. + // + // This member is required. + AttributeValue *string + + noSmithyDocumentSerde +} + // Contains information about the quick connect configuration settings for a user. // The contact flow must be of type Transfer to Agent. type UserQuickConnectConfig struct { @@ -5244,6 +5608,7 @@ func (*UnknownUnionMember) isEvaluationFormNumericQuestionAutomation() func (*UnknownUnionMember) isEvaluationFormQuestionTypeProperties() {} func (*UnknownUnionMember) isEvaluationFormSingleSelectQuestionAutomationOption() {} func (*UnknownUnionMember) isParticipantTimerValue() {} +func (*UnknownUnionMember) isPredefinedAttributeValues() {} func (*UnknownUnionMember) isRealtimeContactAnalysisSegment() {} func (*UnknownUnionMember) isRealTimeContactAnalysisTimeData() {} func (*UnknownUnionMember) isReferenceSummary() {} diff --git a/service/connect/types/types_exported_test.go b/service/connect/types/types_exported_test.go index f3bcfc7d3d9..183ebf805d9 100644 --- a/service/connect/types/types_exported_test.go +++ b/service/connect/types/types_exported_test.go @@ -136,6 +136,24 @@ func ExampleParticipantTimerValue_outputUsage() { var _ *int32 var _ types.ParticipantTimerAction +func ExamplePredefinedAttributeValues_outputUsage() { + var union types.PredefinedAttributeValues + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PredefinedAttributeValuesMemberStringList: + _ = v.Value // Value is []string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ []string + func ExampleRealtimeContactAnalysisSegment_outputUsage() { var union types.RealtimeContactAnalysisSegment // type switches can be used to check the union value diff --git a/service/connect/validators.go b/service/connect/validators.go index 0c5bdc992a1..aa3c82ce4cb 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -290,6 +290,26 @@ func (m *validateOpAssociateTrafficDistributionGroupUser) HandleInitialize(ctx c return next.HandleInitialize(ctx, in) } +type validateOpAssociateUserProficiencies struct { +} + +func (*validateOpAssociateUserProficiencies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateUserProficiencies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateUserProficienciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateUserProficienciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpBatchAssociateAnalyticsDataSet struct { } @@ -570,6 +590,26 @@ func (m *validateOpCreatePersistentContactAssociation) HandleInitialize(ctx cont return next.HandleInitialize(ctx, in) } +type validateOpCreatePredefinedAttribute struct { +} + +func (*validateOpCreatePredefinedAttribute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePredefinedAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePredefinedAttributeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePredefinedAttributeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreatePrompt struct { } @@ -1010,6 +1050,26 @@ func (m *validateOpDeleteIntegrationAssociation) HandleInitialize(ctx context.Co return next.HandleInitialize(ctx, in) } +type validateOpDeletePredefinedAttribute struct { +} + +func (*validateOpDeletePredefinedAttribute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePredefinedAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePredefinedAttributeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePredefinedAttributeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeletePrompt struct { } @@ -1510,6 +1570,26 @@ func (m *validateOpDescribePhoneNumber) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDescribePredefinedAttribute struct { +} + +func (*validateOpDescribePredefinedAttribute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribePredefinedAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribePredefinedAttributeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribePredefinedAttributeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribePrompt struct { } @@ -1990,6 +2070,26 @@ func (m *validateOpDisassociateTrafficDistributionGroupUser) HandleInitialize(ct return next.HandleInitialize(ctx, in) } +type validateOpDisassociateUserProficiencies struct { +} + +func (*validateOpDisassociateUserProficiencies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateUserProficiencies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateUserProficienciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateUserProficienciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDismissUserContact struct { } @@ -2610,6 +2710,26 @@ func (m *validateOpListPhoneNumbers) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpListPredefinedAttributes struct { +} + +func (*validateOpListPredefinedAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListPredefinedAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListPredefinedAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListPredefinedAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListPrompts struct { } @@ -2950,6 +3070,26 @@ func (m *validateOpListUserHierarchyGroups) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpListUserProficiencies struct { +} + +func (*validateOpListUserProficiencies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListUserProficiencies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListUserProficienciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListUserProficienciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListUsers struct { } @@ -3170,6 +3310,26 @@ func (m *validateOpSearchAvailablePhoneNumbers) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpSearchContacts struct { +} + +func (*validateOpSearchContacts) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchContacts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchContactsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchContactsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSearchHoursOfOperations struct { } @@ -3190,6 +3350,26 @@ func (m *validateOpSearchHoursOfOperations) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpSearchPredefinedAttributes struct { +} + +func (*validateOpSearchPredefinedAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchPredefinedAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchPredefinedAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchPredefinedAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSearchPrompts struct { } @@ -3890,6 +4070,26 @@ func (m *validateOpUpdateContact) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateContactRoutingData struct { +} + +func (*validateOpUpdateContactRoutingData) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateContactRoutingData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateContactRoutingDataInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateContactRoutingDataInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateContactSchedule struct { } @@ -4050,6 +4250,26 @@ func (m *validateOpUpdatePhoneNumberMetadata) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpUpdatePredefinedAttribute struct { +} + +func (*validateOpUpdatePredefinedAttribute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePredefinedAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePredefinedAttributeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePredefinedAttributeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdatePrompt struct { } @@ -4490,6 +4710,26 @@ func (m *validateOpUpdateUserPhoneConfig) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpUpdateUserProficiencies struct { +} + +func (*validateOpUpdateUserProficiencies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateUserProficiencies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateUserProficienciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateUserProficienciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateUserRoutingProfile struct { } @@ -4626,6 +4866,10 @@ func addOpAssociateTrafficDistributionGroupUserValidationMiddleware(stack *middl return stack.Initialize.Add(&validateOpAssociateTrafficDistributionGroupUser{}, middleware.After) } +func addOpAssociateUserProficienciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateUserProficiencies{}, middleware.After) +} + func addOpBatchAssociateAnalyticsDataSetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchAssociateAnalyticsDataSet{}, middleware.After) } @@ -4682,6 +4926,10 @@ func addOpCreatePersistentContactAssociationValidationMiddleware(stack *middlewa return stack.Initialize.Add(&validateOpCreatePersistentContactAssociation{}, middleware.After) } +func addOpCreatePredefinedAttributeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePredefinedAttribute{}, middleware.After) +} + func addOpCreatePromptValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePrompt{}, middleware.After) } @@ -4770,6 +5018,10 @@ func addOpDeleteIntegrationAssociationValidationMiddleware(stack *middleware.Sta return stack.Initialize.Add(&validateOpDeleteIntegrationAssociation{}, middleware.After) } +func addOpDeletePredefinedAttributeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePredefinedAttribute{}, middleware.After) +} + func addOpDeletePromptValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePrompt{}, middleware.After) } @@ -4870,6 +5122,10 @@ func addOpDescribePhoneNumberValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDescribePhoneNumber{}, middleware.After) } +func addOpDescribePredefinedAttributeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribePredefinedAttribute{}, middleware.After) +} + func addOpDescribePromptValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribePrompt{}, middleware.After) } @@ -4966,6 +5222,10 @@ func addOpDisassociateTrafficDistributionGroupUserValidationMiddleware(stack *mi return stack.Initialize.Add(&validateOpDisassociateTrafficDistributionGroupUser{}, middleware.After) } +func addOpDisassociateUserProficienciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateUserProficiencies{}, middleware.After) +} + func addOpDismissUserContactValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDismissUserContact{}, middleware.After) } @@ -5090,6 +5350,10 @@ func addOpListPhoneNumbersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPhoneNumbers{}, middleware.After) } +func addOpListPredefinedAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListPredefinedAttributes{}, middleware.After) +} + func addOpListPromptsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListPrompts{}, middleware.After) } @@ -5158,6 +5422,10 @@ func addOpListUserHierarchyGroupsValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpListUserHierarchyGroups{}, middleware.After) } +func addOpListUserProficienciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListUserProficiencies{}, middleware.After) +} + func addOpListUsersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListUsers{}, middleware.After) } @@ -5202,10 +5470,18 @@ func addOpSearchAvailablePhoneNumbersValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpSearchAvailablePhoneNumbers{}, middleware.After) } +func addOpSearchContactsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchContacts{}, middleware.After) +} + func addOpSearchHoursOfOperationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchHoursOfOperations{}, middleware.After) } +func addOpSearchPredefinedAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchPredefinedAttributes{}, middleware.After) +} + func addOpSearchPromptsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchPrompts{}, middleware.After) } @@ -5346,6 +5622,10 @@ func addOpUpdateContactValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateContact{}, middleware.After) } +func addOpUpdateContactRoutingDataValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateContactRoutingData{}, middleware.After) +} + func addOpUpdateContactScheduleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateContactSchedule{}, middleware.After) } @@ -5378,6 +5658,10 @@ func addOpUpdatePhoneNumberMetadataValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpUpdatePhoneNumberMetadata{}, middleware.After) } +func addOpUpdatePredefinedAttributeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePredefinedAttribute{}, middleware.After) +} + func addOpUpdatePromptValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePrompt{}, middleware.After) } @@ -5466,6 +5750,10 @@ func addOpUpdateUserPhoneConfigValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpUpdateUserPhoneConfig{}, middleware.After) } +func addOpUpdateUserProficienciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateUserProficiencies{}, middleware.After) +} + func addOpUpdateUserRoutingProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateUserRoutingProfile{}, middleware.After) } @@ -5568,6 +5856,23 @@ func validateChatStreamingConfiguration(v *types.ChatStreamingConfiguration) err } } +func validateContactAnalysis(v *types.ContactAnalysis) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContactAnalysis"} + if v.Transcript != nil { + if err := validateTranscript(v.Transcript); err != nil { + invalidParams.AddNested("Transcript", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateContactReferences(v map[string]types.Reference) error { if v == nil { return nil @@ -6645,22 +6950,17 @@ func validateS3Config(v *types.S3Config) error { } } -func validateSendNotificationActionDefinition(v *types.SendNotificationActionDefinition) error { +func validateSearchableContactAttributes(v *types.SearchableContactAttributes) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "SendNotificationActionDefinition"} - if len(v.DeliveryMethod) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("DeliveryMethod")) - } - if v.Content == nil { - invalidParams.Add(smithy.NewErrParamRequired("Content")) - } - if len(v.ContentType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("ContentType")) - } - if v.Recipient == nil { - invalidParams.Add(smithy.NewErrParamRequired("Recipient")) + invalidParams := smithy.InvalidParamsError{Context: "SearchableContactAttributes"} + if v.Criteria == nil { + invalidParams.Add(smithy.NewErrParamRequired("Criteria")) + } else if v.Criteria != nil { + if err := validateSearchableContactAttributesCriteriaList(v.Criteria); err != nil { + invalidParams.AddNested("Criteria", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -6669,17 +6969,16 @@ func validateSendNotificationActionDefinition(v *types.SendNotificationActionDef } } -func validateSignInConfig(v *types.SignInConfig) error { +func validateSearchableContactAttributesCriteria(v *types.SearchableContactAttributesCriteria) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "SignInConfig"} - if v.Distributions == nil { - invalidParams.Add(smithy.NewErrParamRequired("Distributions")) - } else if v.Distributions != nil { - if err := validateSignInDistributionList(v.Distributions); err != nil { - invalidParams.AddNested("Distributions", err.(smithy.InvalidParamsError)) - } + invalidParams := smithy.InvalidParamsError{Context: "SearchableContactAttributesCriteria"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) } if invalidParams.Len() > 0 { return invalidParams @@ -6688,13 +6987,15 @@ func validateSignInConfig(v *types.SignInConfig) error { } } -func validateSignInDistribution(v *types.SignInDistribution) error { +func validateSearchableContactAttributesCriteriaList(v []types.SearchableContactAttributesCriteria) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "SignInDistribution"} - if v.Region == nil { - invalidParams.Add(smithy.NewErrParamRequired("Region")) + invalidParams := smithy.InvalidParamsError{Context: "SearchableContactAttributesCriteriaList"} + for i := range v { + if err := validateSearchableContactAttributesCriteria(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -6703,15 +7004,116 @@ func validateSignInDistribution(v *types.SignInDistribution) error { } } -func validateSignInDistributionList(v []types.SignInDistribution) error { +func validateSearchContactsTimeRange(v *types.SearchContactsTimeRange) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "SignInDistributionList"} - for i := range v { - if err := validateSignInDistribution(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } + invalidParams := smithy.InvalidParamsError{Context: "SearchContactsTimeRange"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } + if v.EndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTime")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSearchCriteria(v *types.SearchCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchCriteria"} + if v.ContactAnalysis != nil { + if err := validateContactAnalysis(v.ContactAnalysis); err != nil { + invalidParams.AddNested("ContactAnalysis", err.(smithy.InvalidParamsError)) + } + } + if v.SearchableContactAttributes != nil { + if err := validateSearchableContactAttributes(v.SearchableContactAttributes); err != nil { + invalidParams.AddNested("SearchableContactAttributes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSendNotificationActionDefinition(v *types.SendNotificationActionDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendNotificationActionDefinition"} + if len(v.DeliveryMethod) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryMethod")) + } + if v.Content == nil { + invalidParams.Add(smithy.NewErrParamRequired("Content")) + } + if len(v.ContentType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ContentType")) + } + if v.Recipient == nil { + invalidParams.Add(smithy.NewErrParamRequired("Recipient")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSignInConfig(v *types.SignInConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SignInConfig"} + if v.Distributions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Distributions")) + } else if v.Distributions != nil { + if err := validateSignInDistributionList(v.Distributions); err != nil { + invalidParams.AddNested("Distributions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSignInDistribution(v *types.SignInDistribution) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SignInDistribution"} + if v.Region == nil { + invalidParams.Add(smithy.NewErrParamRequired("Region")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSignInDistributionList(v []types.SignInDistribution) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SignInDistributionList"} + for i := range v { + if err := validateSignInDistribution(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -6741,6 +7143,24 @@ func validateSingleSelectQuestionRuleCategoryAutomation(v *types.SingleSelectQue } } +func validateSort(v *types.Sort) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Sort"} + if len(v.FieldName) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("FieldName")) + } + if len(v.Order) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Order")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTaskActionDefinition(v *types.TaskActionDefinition) error { if v == nil { return nil @@ -6815,6 +7235,63 @@ func validateTelephonyConfig(v *types.TelephonyConfig) error { } } +func validateTranscript(v *types.Transcript) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Transcript"} + if v.Criteria == nil { + invalidParams.Add(smithy.NewErrParamRequired("Criteria")) + } else if v.Criteria != nil { + if err := validateTranscriptCriteriaList(v.Criteria); err != nil { + invalidParams.AddNested("Criteria", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTranscriptCriteria(v *types.TranscriptCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TranscriptCriteria"} + if len(v.ParticipantRole) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ParticipantRole")) + } + if v.SearchText == nil { + invalidParams.Add(smithy.NewErrParamRequired("SearchText")) + } + if len(v.MatchType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("MatchType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTranscriptCriteriaList(v []types.TranscriptCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TranscriptCriteriaList"} + for i := range v { + if err := validateTranscriptCriteria(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateUpdateCaseActionDefinition(v *types.UpdateCaseActionDefinition) error { if v == nil { return nil @@ -6868,6 +7345,79 @@ func validateUserPhoneConfig(v *types.UserPhoneConfig) error { } } +func validateUserProficiency(v *types.UserProficiency) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UserProficiency"} + if v.AttributeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) + } + if v.AttributeValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeValue")) + } + if v.Level == nil { + invalidParams.Add(smithy.NewErrParamRequired("Level")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUserProficiencyDisassociate(v *types.UserProficiencyDisassociate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UserProficiencyDisassociate"} + if v.AttributeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) + } + if v.AttributeValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUserProficiencyDisassociateList(v []types.UserProficiencyDisassociate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UserProficiencyDisassociateList"} + for i := range v { + if err := validateUserProficiencyDisassociate(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUserProficiencyList(v []types.UserProficiency) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UserProficiencyList"} + for i := range v { + if err := validateUserProficiency(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateUserQuickConnectConfig(v *types.UserQuickConnectConfig) error { if v == nil { return nil @@ -7173,6 +7723,31 @@ func validateOpAssociateTrafficDistributionGroupUserInput(v *AssociateTrafficDis } } +func validateOpAssociateUserProficienciesInput(v *AssociateUserProficienciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateUserProficienciesInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if v.UserProficiencies == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserProficiencies")) + } else if v.UserProficiencies != nil { + if err := validateUserProficiencyList(v.UserProficiencies); err != nil { + invalidParams.AddNested("UserProficiencies", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchAssociateAnalyticsDataSetInput(v *BatchAssociateAnalyticsDataSetInput) error { if v == nil { return nil @@ -7471,6 +8046,27 @@ func validateOpCreatePersistentContactAssociationInput(v *CreatePersistentContac } } +func validateOpCreatePredefinedAttributeInput(v *CreatePredefinedAttributeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePredefinedAttributeInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreatePromptInput(v *CreatePromptInput) error { if v == nil { return nil @@ -7950,6 +8546,24 @@ func validateOpDeleteIntegrationAssociationInput(v *DeleteIntegrationAssociation } } +func validateOpDeletePredefinedAttributeInput(v *DeletePredefinedAttributeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePredefinedAttributeInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeletePromptInput(v *DeletePromptInput) error { if v == nil { return nil @@ -8400,6 +9014,24 @@ func validateOpDescribePhoneNumberInput(v *DescribePhoneNumberInput) error { } } +func validateOpDescribePredefinedAttributeInput(v *DescribePredefinedAttributeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribePredefinedAttributeInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribePromptInput(v *DescribePromptInput) error { if v == nil { return nil @@ -8850,6 +9482,31 @@ func validateOpDisassociateTrafficDistributionGroupUserInput(v *DisassociateTraf } } +func validateOpDisassociateUserProficienciesInput(v *DisassociateUserProficienciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateUserProficienciesInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if v.UserProficiencies == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserProficiencies")) + } else if v.UserProficiencies != nil { + if err := validateUserProficiencyDisassociateList(v.UserProficiencies); err != nil { + invalidParams.AddNested("UserProficiencies", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDismissUserContactInput(v *DismissUserContactInput) error { if v == nil { return nil @@ -9390,6 +10047,21 @@ func validateOpListPhoneNumbersInput(v *ListPhoneNumbersInput) error { } } +func validateOpListPredefinedAttributesInput(v *ListPredefinedAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListPredefinedAttributesInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListPromptsInput(v *ListPromptsInput) error { if v == nil { return nil @@ -9669,6 +10341,24 @@ func validateOpListUserHierarchyGroupsInput(v *ListUserHierarchyGroupsInput) err } } +func validateOpListUserProficienciesInput(v *ListUserProficienciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListUserProficienciesInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListUsersInput(v *ListUsersInput) error { if v == nil { return nil @@ -9870,6 +10560,38 @@ func validateOpSearchAvailablePhoneNumbersInput(v *SearchAvailablePhoneNumbersIn } } +func validateOpSearchContactsInput(v *SearchContactsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchContactsInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.TimeRange == nil { + invalidParams.Add(smithy.NewErrParamRequired("TimeRange")) + } else if v.TimeRange != nil { + if err := validateSearchContactsTimeRange(v.TimeRange); err != nil { + invalidParams.AddNested("TimeRange", err.(smithy.InvalidParamsError)) + } + } + if v.SearchCriteria != nil { + if err := validateSearchCriteria(v.SearchCriteria); err != nil { + invalidParams.AddNested("SearchCriteria", err.(smithy.InvalidParamsError)) + } + } + if v.Sort != nil { + if err := validateSort(v.Sort); err != nil { + invalidParams.AddNested("Sort", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpSearchHoursOfOperationsInput(v *SearchHoursOfOperationsInput) error { if v == nil { return nil @@ -9885,6 +10607,21 @@ func validateOpSearchHoursOfOperationsInput(v *SearchHoursOfOperationsInput) err } } +func validateOpSearchPredefinedAttributesInput(v *SearchPredefinedAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchPredefinedAttributesInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpSearchPromptsInput(v *SearchPromptsInput) error { if v == nil { return nil @@ -10591,6 +11328,24 @@ func validateOpUpdateContactInput(v *UpdateContactInput) error { } } +func validateOpUpdateContactRoutingDataInput(v *UpdateContactRoutingDataInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateContactRoutingDataInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.ContactId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContactId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateContactScheduleInput(v *UpdateContactScheduleInput) error { if v == nil { return nil @@ -10772,6 +11527,24 @@ func validateOpUpdatePhoneNumberMetadataInput(v *UpdatePhoneNumberMetadataInput) } } +func validateOpUpdatePredefinedAttributeInput(v *UpdatePredefinedAttributeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePredefinedAttributeInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdatePromptInput(v *UpdatePromptInput) error { if v == nil { return nil @@ -11254,6 +12027,31 @@ func validateOpUpdateUserPhoneConfigInput(v *UpdateUserPhoneConfigInput) error { } } +func validateOpUpdateUserProficienciesInput(v *UpdateUserProficienciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateUserProficienciesInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if v.UserProficiencies == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserProficiencies")) + } else if v.UserProficiencies != nil { + if err := validateUserProficiencyList(v.UserProficiencies); err != nil { + invalidParams.AddNested("UserProficiencies", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateUserRoutingProfileInput(v *UpdateUserRoutingProfileInput) error { if v == nil { return nil diff --git a/service/medialive/deserializers.go b/service/medialive/deserializers.go index f1e865c6479..d6566fa0b2c 100644 --- a/service/medialive/deserializers.go +++ b/service/medialive/deserializers.go @@ -12729,6 +12729,40 @@ func awsRestjson1_deserializeDocument__listOfInputDeviceSummary(v *[]types.Input return nil } +func awsRestjson1_deserializeDocument__listOfInputDeviceUhdAudioChannelPairConfig(v *[]types.InputDeviceUhdAudioChannelPairConfig, 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.InputDeviceUhdAudioChannelPairConfig + if *v == nil { + cv = []types.InputDeviceUhdAudioChannelPairConfig{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.InputDeviceUhdAudioChannelPairConfig + destAddr := &col + if err := awsRestjson1_deserializeDocumentInputDeviceUhdAudioChannelPairConfig(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocument__listOfInputSecurityGroup(v *[]types.InputSecurityGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22339,6 +22373,59 @@ func awsRestjson1_deserializeDocumentInputDeviceSummary(v **types.InputDeviceSum return nil } +func awsRestjson1_deserializeDocumentInputDeviceUhdAudioChannelPairConfig(v **types.InputDeviceUhdAudioChannelPairConfig, 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.InputDeviceUhdAudioChannelPairConfig + if *v == nil { + sv = &types.InputDeviceUhdAudioChannelPairConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Id = ptr.Int32(int32(i64)) + } + + case "profile": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InputDeviceUhdAudioChannelPairProfile to be of type string, got %T instead", value) + } + sv.Profile = types.InputDeviceUhdAudioChannelPairProfile(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentInputDeviceUhdSettings(v **types.InputDeviceUhdSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22370,6 +22457,11 @@ func awsRestjson1_deserializeDocumentInputDeviceUhdSettings(v **types.InputDevic sv.ActiveInput = types.InputDeviceActiveInput(jtv) } + case "audioChannelPairs": + if err := awsRestjson1_deserializeDocument__listOfInputDeviceUhdAudioChannelPairConfig(&sv.AudioChannelPairs, value); err != nil { + return err + } + case "codec": if value != nil { jtv, ok := value.(string) diff --git a/service/medialive/serializers.go b/service/medialive/serializers.go index f74dc8702b4..842d579ce67 100644 --- a/service/medialive/serializers.go +++ b/service/medialive/serializers.go @@ -5340,6 +5340,19 @@ func awsRestjson1_serializeDocument__listOfInputDestinationRequest(v []types.Inp return nil } +func awsRestjson1_serializeDocument__listOfInputDeviceConfigurableAudioChannelPairConfig(v []types.InputDeviceConfigurableAudioChannelPairConfig, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentInputDeviceConfigurableAudioChannelPairConfig(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocument__listOfInputDeviceRequest(v []types.InputDeviceRequest, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -8910,10 +8923,34 @@ func awsRestjson1_serializeDocumentInputDestinationRequest(v *types.InputDestina return nil } +func awsRestjson1_serializeDocumentInputDeviceConfigurableAudioChannelPairConfig(v *types.InputDeviceConfigurableAudioChannelPairConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.Integer(*v.Id) + } + + if len(v.Profile) > 0 { + ok := object.Key("profile") + ok.String(string(v.Profile)) + } + + return nil +} + func awsRestjson1_serializeDocumentInputDeviceConfigurableSettings(v *types.InputDeviceConfigurableSettings, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AudioChannelPairs != nil { + ok := object.Key("audioChannelPairs") + if err := awsRestjson1_serializeDocument__listOfInputDeviceConfigurableAudioChannelPairConfig(v.AudioChannelPairs, ok); err != nil { + return err + } + } + if len(v.Codec) > 0 { ok := object.Key("codec") ok.String(string(v.Codec)) diff --git a/service/medialive/types/enums.go b/service/medialive/types/enums.go index 59d1b5011c5..fa650e1e663 100644 --- a/service/medialive/types/enums.go +++ b/service/medialive/types/enums.go @@ -3058,6 +3058,37 @@ func (InputDeviceCodec) Values() []InputDeviceCodec { } } +type InputDeviceConfigurableAudioChannelPairProfile string + +// Enum values for InputDeviceConfigurableAudioChannelPairProfile +const ( + InputDeviceConfigurableAudioChannelPairProfileDisabled InputDeviceConfigurableAudioChannelPairProfile = "DISABLED" + InputDeviceConfigurableAudioChannelPairProfileVbrAacHhe16000 InputDeviceConfigurableAudioChannelPairProfile = "VBR-AAC_HHE-16000" + InputDeviceConfigurableAudioChannelPairProfileVbrAacHe64000 InputDeviceConfigurableAudioChannelPairProfile = "VBR-AAC_HE-64000" + InputDeviceConfigurableAudioChannelPairProfileVbrAacLc128000 InputDeviceConfigurableAudioChannelPairProfile = "VBR-AAC_LC-128000" + InputDeviceConfigurableAudioChannelPairProfileCbrAacHq192000 InputDeviceConfigurableAudioChannelPairProfile = "CBR-AAC_HQ-192000" + InputDeviceConfigurableAudioChannelPairProfileCbrAacHq256000 InputDeviceConfigurableAudioChannelPairProfile = "CBR-AAC_HQ-256000" + InputDeviceConfigurableAudioChannelPairProfileCbrAacHq384000 InputDeviceConfigurableAudioChannelPairProfile = "CBR-AAC_HQ-384000" + InputDeviceConfigurableAudioChannelPairProfileCbrAacHq512000 InputDeviceConfigurableAudioChannelPairProfile = "CBR-AAC_HQ-512000" +) + +// Values returns all known values for +// InputDeviceConfigurableAudioChannelPairProfile. 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 (InputDeviceConfigurableAudioChannelPairProfile) Values() []InputDeviceConfigurableAudioChannelPairProfile { + return []InputDeviceConfigurableAudioChannelPairProfile{ + "DISABLED", + "VBR-AAC_HHE-16000", + "VBR-AAC_HE-64000", + "VBR-AAC_LC-128000", + "CBR-AAC_HQ-192000", + "CBR-AAC_HQ-256000", + "CBR-AAC_HQ-384000", + "CBR-AAC_HQ-512000", + } +} + type InputDeviceConfiguredInput string // Enum values for InputDeviceConfiguredInput @@ -3206,6 +3237,37 @@ func (InputDeviceType) Values() []InputDeviceType { } } +type InputDeviceUhdAudioChannelPairProfile string + +// Enum values for InputDeviceUhdAudioChannelPairProfile +const ( + InputDeviceUhdAudioChannelPairProfileDisabled InputDeviceUhdAudioChannelPairProfile = "DISABLED" + InputDeviceUhdAudioChannelPairProfileVbrAacHhe16000 InputDeviceUhdAudioChannelPairProfile = "VBR-AAC_HHE-16000" + InputDeviceUhdAudioChannelPairProfileVbrAacHe64000 InputDeviceUhdAudioChannelPairProfile = "VBR-AAC_HE-64000" + InputDeviceUhdAudioChannelPairProfileVbrAacLc128000 InputDeviceUhdAudioChannelPairProfile = "VBR-AAC_LC-128000" + InputDeviceUhdAudioChannelPairProfileCbrAacHq192000 InputDeviceUhdAudioChannelPairProfile = "CBR-AAC_HQ-192000" + InputDeviceUhdAudioChannelPairProfileCbrAacHq256000 InputDeviceUhdAudioChannelPairProfile = "CBR-AAC_HQ-256000" + InputDeviceUhdAudioChannelPairProfileCbrAacHq384000 InputDeviceUhdAudioChannelPairProfile = "CBR-AAC_HQ-384000" + InputDeviceUhdAudioChannelPairProfileCbrAacHq512000 InputDeviceUhdAudioChannelPairProfile = "CBR-AAC_HQ-512000" +) + +// Values returns all known values for InputDeviceUhdAudioChannelPairProfile. 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 (InputDeviceUhdAudioChannelPairProfile) Values() []InputDeviceUhdAudioChannelPairProfile { + return []InputDeviceUhdAudioChannelPairProfile{ + "DISABLED", + "VBR-AAC_HHE-16000", + "VBR-AAC_HE-64000", + "VBR-AAC_LC-128000", + "CBR-AAC_HQ-192000", + "CBR-AAC_HQ-256000", + "CBR-AAC_HQ-384000", + "CBR-AAC_HQ-512000", + } +} + type InputFilter string // Enum values for InputFilter diff --git a/service/medialive/types/types.go b/service/medialive/types/types.go index 2b0d4c47ae8..d08b4a5165a 100644 --- a/service/medialive/types/types.go +++ b/service/medialive/types/types.go @@ -1560,7 +1560,7 @@ type EncoderSettings struct { // Settings for caption decriptions CaptionDescriptions []CaptionDescription - // Color correction settings + // Color Correction Settings ColorCorrectionSettings *ColorCorrectionSettings // Feature Activations @@ -2949,9 +2949,34 @@ type InputDestinationVpc struct { noSmithyDocumentSerde } +// One audio configuration that specifies the format for one audio pair that the +// device produces as output. +type InputDeviceConfigurableAudioChannelPairConfig struct { + + // The ID for one audio pair configuration, a value from 1 to 8. + Id *int32 + + // The profile to set for one audio pair configuration. Choose an enumeration + // value. Each value describes one audio configuration using the format (rate + // control algorithm)-(codec)_(quality)-(bitrate in bytes). For example, + // CBR-AAC_HQ-192000. Or choose DISABLED, in which case the device won't produce + // audio for this pair. + Profile InputDeviceConfigurableAudioChannelPairProfile + + noSmithyDocumentSerde +} + // Configurable settings for the input device. type InputDeviceConfigurableSettings struct { + // An array of eight audio configurations, one for each audio pair in the source. + // Set up each audio configuration either to exclude the pair, or to format it and + // include it in the output from the device. This parameter applies only to UHD + // devices, and only when the device is configured as the source for a MediaConnect + // flow. For an HD device, you configure the audio by setting up audio selectors in + // the channel configuration. + AudioChannelPairs []InputDeviceConfigurableAudioChannelPairConfig + // Choose the codec for the video that the device produces. Only UHD devices can // specify this parameter. Codec InputDeviceCodec @@ -3156,6 +3181,22 @@ type InputDeviceSummary struct { noSmithyDocumentSerde } +// One audio configuration that specifies the format for one audio pair that the +// device produces as output. +type InputDeviceUhdAudioChannelPairConfig struct { + + // The ID for one audio pair configuration, a value from 1 to 8. + Id *int32 + + // The profile for one audio pair configuration. This property describes one audio + // configuration in the format (rate control algorithm)-(codec)_(quality)-(bitrate + // in bytes). For example, CBR-AAC_HQ-192000. Or DISABLED, in which case the device + // won't produce audio for this pair. + Profile InputDeviceUhdAudioChannelPairProfile + + noSmithyDocumentSerde +} + // Settings that describe the active source from the input device, and the video // characteristics of that source. type InputDeviceUhdSettings struct { @@ -3164,6 +3205,12 @@ type InputDeviceUhdSettings struct { // is currently active (SDI or HDMI). ActiveInput InputDeviceActiveInput + // An array of eight audio configurations, one for each audio pair in the source. + // Each audio configuration specifies either to exclude the pair, or to format it + // and include it in the output from the UHD device. Applies only when the device + // is configured as the source for a MediaConnect flow. + AudioChannelPairs []InputDeviceUhdAudioChannelPairConfig + // The codec for the video that the device produces. Codec InputDeviceCodec diff --git a/service/medialive/validators.go b/service/medialive/validators.go index 310e394891b..d6db13f041a 100644 --- a/service/medialive/validators.go +++ b/service/medialive/validators.go @@ -2181,11 +2181,6 @@ func validateEncoderSettings(v *types.EncoderSettings) error { invalidParams.AddNested("CaptionDescriptions", err.(smithy.InvalidParamsError)) } } - if v.ColorCorrectionSettings != nil { - if err := validateColorCorrectionSettings(v.ColorCorrectionSettings); err != nil { - invalidParams.AddNested("ColorCorrectionSettings", err.(smithy.InvalidParamsError)) - } - } if v.GlobalConfiguration != nil { if err := validateGlobalConfiguration(v.GlobalConfiguration); err != nil { invalidParams.AddNested("GlobalConfiguration", err.(smithy.InvalidParamsError)) @@ -2222,6 +2217,11 @@ func validateEncoderSettings(v *types.EncoderSettings) error { invalidParams.AddNested("ThumbnailConfiguration", err.(smithy.InvalidParamsError)) } } + if v.ColorCorrectionSettings != nil { + if err := validateColorCorrectionSettings(v.ColorCorrectionSettings); err != nil { + invalidParams.AddNested("ColorCorrectionSettings", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/neptunegraph/api_op_GetGraph.go b/service/neptunegraph/api_op_GetGraph.go index f85ae21ce0c..a8184c51221 100644 --- a/service/neptunegraph/api_op_GetGraph.go +++ b/service/neptunegraph/api_op_GetGraph.go @@ -4,13 +4,18 @@ package neptunegraph import ( "context" + "errors" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptunegraph/types" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "strconv" "time" ) @@ -186,6 +191,377 @@ func (c *Client) addOperationGetGraphMiddlewares(stack *middleware.Stack, option return nil } +// GetGraphAPIClient is a client that implements the GetGraph operation. +type GetGraphAPIClient interface { + GetGraph(context.Context, *GetGraphInput, ...func(*Options)) (*GetGraphOutput, error) +} + +var _ GetGraphAPIClient = (*Client)(nil) + +// GraphAvailableWaiterOptions are waiter options for GraphAvailableWaiter +type GraphAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // GraphAvailableWaiter will use default minimum delay of 60 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, GraphAvailableWaiter will use default max delay of 28800 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetGraphInput, *GetGraphOutput, error) (bool, error) +} + +// GraphAvailableWaiter defines the waiters for GraphAvailable +type GraphAvailableWaiter struct { + client GetGraphAPIClient + + options GraphAvailableWaiterOptions +} + +// NewGraphAvailableWaiter constructs a GraphAvailableWaiter. +func NewGraphAvailableWaiter(client GetGraphAPIClient, optFns ...func(*GraphAvailableWaiterOptions)) *GraphAvailableWaiter { + options := GraphAvailableWaiterOptions{} + options.MinDelay = 60 * time.Second + options.MaxDelay = 28800 * time.Second + options.Retryable = graphAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &GraphAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for GraphAvailable waiter. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *GraphAvailableWaiter) Wait(ctx context.Context, params *GetGraphInput, maxWaitDur time.Duration, optFns ...func(*GraphAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for GraphAvailable waiter and returns +// the output of the successful operation. The maxWaitDur is the maximum wait +// duration the waiter will wait. The maxWaitDur is required and must be greater +// than zero. +func (w *GraphAvailableWaiter) WaitForOutput(ctx context.Context, params *GetGraphInput, maxWaitDur time.Duration, optFns ...func(*GraphAvailableWaiterOptions)) (*GetGraphOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 28800 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetGraph(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for GraphAvailable waiter") +} + +func graphAvailableStateRetryable(ctx context.Context, input *GetGraphInput, output *GetGraphOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "DELETING" + value, ok := pathValue.(types.GraphStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.GraphStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "FAILED" + value, ok := pathValue.(types.GraphStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.GraphStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "AVAILABLE" + value, ok := pathValue.(types.GraphStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.GraphStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + return true, nil +} + +// GraphDeletedWaiterOptions are waiter options for GraphDeletedWaiter +type GraphDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // GraphDeletedWaiter will use default minimum delay of 60 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, GraphDeletedWaiter will use default max delay of 3600 seconds. Note + // that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetGraphInput, *GetGraphOutput, error) (bool, error) +} + +// GraphDeletedWaiter defines the waiters for GraphDeleted +type GraphDeletedWaiter struct { + client GetGraphAPIClient + + options GraphDeletedWaiterOptions +} + +// NewGraphDeletedWaiter constructs a GraphDeletedWaiter. +func NewGraphDeletedWaiter(client GetGraphAPIClient, optFns ...func(*GraphDeletedWaiterOptions)) *GraphDeletedWaiter { + options := GraphDeletedWaiterOptions{} + options.MinDelay = 60 * time.Second + options.MaxDelay = 3600 * time.Second + options.Retryable = graphDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &GraphDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for GraphDeleted waiter. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *GraphDeletedWaiter) Wait(ctx context.Context, params *GetGraphInput, maxWaitDur time.Duration, optFns ...func(*GraphDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for GraphDeleted waiter and returns the +// output of the successful operation. The maxWaitDur is the maximum wait duration +// the waiter will wait. The maxWaitDur is required and must be greater than zero. +func (w *GraphDeletedWaiter) WaitForOutput(ctx context.Context, params *GetGraphInput, maxWaitDur time.Duration, optFns ...func(*GraphDeletedWaiterOptions)) (*GetGraphOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 3600 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetGraph(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for GraphDeleted waiter") +} + +func graphDeletedStateRetryable(ctx context.Context, input *GetGraphInput, output *GetGraphOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status != 'DELETING'", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err != nil { + var errorType *types.ResourceNotFoundException + if errors.As(err, &errorType) { + return false, nil + } + } + + return true, nil +} + func newServiceMetadataMiddleware_opGetGraph(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptunegraph/api_op_GetGraphSnapshot.go b/service/neptunegraph/api_op_GetGraphSnapshot.go index 63cd6416302..42e3735c916 100644 --- a/service/neptunegraph/api_op_GetGraphSnapshot.go +++ b/service/neptunegraph/api_op_GetGraphSnapshot.go @@ -4,13 +4,18 @@ package neptunegraph import ( "context" + "errors" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptunegraph/types" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "strconv" "time" ) @@ -161,6 +166,383 @@ func (c *Client) addOperationGetGraphSnapshotMiddlewares(stack *middleware.Stack return nil } +// GetGraphSnapshotAPIClient is a client that implements the GetGraphSnapshot +// operation. +type GetGraphSnapshotAPIClient interface { + GetGraphSnapshot(context.Context, *GetGraphSnapshotInput, ...func(*Options)) (*GetGraphSnapshotOutput, error) +} + +var _ GetGraphSnapshotAPIClient = (*Client)(nil) + +// GraphSnapshotAvailableWaiterOptions are waiter options for +// GraphSnapshotAvailableWaiter +type GraphSnapshotAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // GraphSnapshotAvailableWaiter will use default minimum delay of 60 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, GraphSnapshotAvailableWaiter will use default max delay of 7200 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetGraphSnapshotInput, *GetGraphSnapshotOutput, error) (bool, error) +} + +// GraphSnapshotAvailableWaiter defines the waiters for GraphSnapshotAvailable +type GraphSnapshotAvailableWaiter struct { + client GetGraphSnapshotAPIClient + + options GraphSnapshotAvailableWaiterOptions +} + +// NewGraphSnapshotAvailableWaiter constructs a GraphSnapshotAvailableWaiter. +func NewGraphSnapshotAvailableWaiter(client GetGraphSnapshotAPIClient, optFns ...func(*GraphSnapshotAvailableWaiterOptions)) *GraphSnapshotAvailableWaiter { + options := GraphSnapshotAvailableWaiterOptions{} + options.MinDelay = 60 * time.Second + options.MaxDelay = 7200 * time.Second + options.Retryable = graphSnapshotAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &GraphSnapshotAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for GraphSnapshotAvailable waiter. The +// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is +// required and must be greater than zero. +func (w *GraphSnapshotAvailableWaiter) Wait(ctx context.Context, params *GetGraphSnapshotInput, maxWaitDur time.Duration, optFns ...func(*GraphSnapshotAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for GraphSnapshotAvailable waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *GraphSnapshotAvailableWaiter) WaitForOutput(ctx context.Context, params *GetGraphSnapshotInput, maxWaitDur time.Duration, optFns ...func(*GraphSnapshotAvailableWaiterOptions)) (*GetGraphSnapshotOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 7200 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetGraphSnapshot(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for GraphSnapshotAvailable waiter") +} + +func graphSnapshotAvailableStateRetryable(ctx context.Context, input *GetGraphSnapshotInput, output *GetGraphSnapshotOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "DELETING" + value, ok := pathValue.(types.SnapshotStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.SnapshotStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "FAILED" + value, ok := pathValue.(types.SnapshotStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.SnapshotStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "AVAILABLE" + value, ok := pathValue.(types.SnapshotStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.SnapshotStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + return true, nil +} + +// GraphSnapshotDeletedWaiterOptions are waiter options for +// GraphSnapshotDeletedWaiter +type GraphSnapshotDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // GraphSnapshotDeletedWaiter will use default minimum delay of 60 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, GraphSnapshotDeletedWaiter will use default max delay of 3600 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetGraphSnapshotInput, *GetGraphSnapshotOutput, error) (bool, error) +} + +// GraphSnapshotDeletedWaiter defines the waiters for GraphSnapshotDeleted +type GraphSnapshotDeletedWaiter struct { + client GetGraphSnapshotAPIClient + + options GraphSnapshotDeletedWaiterOptions +} + +// NewGraphSnapshotDeletedWaiter constructs a GraphSnapshotDeletedWaiter. +func NewGraphSnapshotDeletedWaiter(client GetGraphSnapshotAPIClient, optFns ...func(*GraphSnapshotDeletedWaiterOptions)) *GraphSnapshotDeletedWaiter { + options := GraphSnapshotDeletedWaiterOptions{} + options.MinDelay = 60 * time.Second + options.MaxDelay = 3600 * time.Second + options.Retryable = graphSnapshotDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &GraphSnapshotDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for GraphSnapshotDeleted waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *GraphSnapshotDeletedWaiter) Wait(ctx context.Context, params *GetGraphSnapshotInput, maxWaitDur time.Duration, optFns ...func(*GraphSnapshotDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for GraphSnapshotDeleted waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *GraphSnapshotDeletedWaiter) WaitForOutput(ctx context.Context, params *GetGraphSnapshotInput, maxWaitDur time.Duration, optFns ...func(*GraphSnapshotDeletedWaiterOptions)) (*GetGraphSnapshotOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 3600 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetGraphSnapshot(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for GraphSnapshotDeleted waiter") +} + +func graphSnapshotDeletedStateRetryable(ctx context.Context, input *GetGraphSnapshotInput, output *GetGraphSnapshotOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status != 'DELETING'", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err != nil { + var errorType *types.ResourceNotFoundException + if errors.As(err, &errorType) { + return false, nil + } + } + + return true, nil +} + func newServiceMetadataMiddleware_opGetGraphSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptunegraph/api_op_GetImportTask.go b/service/neptunegraph/api_op_GetImportTask.go index 7705dfcd1e8..3d4addb4527 100644 --- a/service/neptunegraph/api_op_GetImportTask.go +++ b/service/neptunegraph/api_op_GetImportTask.go @@ -10,7 +10,12 @@ import ( "github.com/aws/aws-sdk-go-v2/service/neptunegraph/types" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "strconv" + "time" ) // Retrieves a specified import task. @@ -194,6 +199,426 @@ func (c *Client) addOperationGetImportTaskMiddlewares(stack *middleware.Stack, o return nil } +// GetImportTaskAPIClient is a client that implements the GetImportTask operation. +type GetImportTaskAPIClient interface { + GetImportTask(context.Context, *GetImportTaskInput, ...func(*Options)) (*GetImportTaskOutput, error) +} + +var _ GetImportTaskAPIClient = (*Client)(nil) + +// ImportTaskSuccessfulWaiterOptions are waiter options for +// ImportTaskSuccessfulWaiter +type ImportTaskSuccessfulWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // ImportTaskSuccessfulWaiter will use default minimum delay of 60 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, ImportTaskSuccessfulWaiter will use default max delay of 28800 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetImportTaskInput, *GetImportTaskOutput, error) (bool, error) +} + +// ImportTaskSuccessfulWaiter defines the waiters for ImportTaskSuccessful +type ImportTaskSuccessfulWaiter struct { + client GetImportTaskAPIClient + + options ImportTaskSuccessfulWaiterOptions +} + +// NewImportTaskSuccessfulWaiter constructs a ImportTaskSuccessfulWaiter. +func NewImportTaskSuccessfulWaiter(client GetImportTaskAPIClient, optFns ...func(*ImportTaskSuccessfulWaiterOptions)) *ImportTaskSuccessfulWaiter { + options := ImportTaskSuccessfulWaiterOptions{} + options.MinDelay = 60 * time.Second + options.MaxDelay = 28800 * time.Second + options.Retryable = importTaskSuccessfulStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &ImportTaskSuccessfulWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for ImportTaskSuccessful waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *ImportTaskSuccessfulWaiter) Wait(ctx context.Context, params *GetImportTaskInput, maxWaitDur time.Duration, optFns ...func(*ImportTaskSuccessfulWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for ImportTaskSuccessful waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *ImportTaskSuccessfulWaiter) WaitForOutput(ctx context.Context, params *GetImportTaskInput, maxWaitDur time.Duration, optFns ...func(*ImportTaskSuccessfulWaiterOptions)) (*GetImportTaskOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 28800 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetImportTask(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for ImportTaskSuccessful waiter") +} + +func importTaskSuccessfulStateRetryable(ctx context.Context, input *GetImportTaskInput, output *GetImportTaskOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "CANCELLING" + value, ok := pathValue.(types.ImportTaskStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ImportTaskStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "CANCELLED" + value, ok := pathValue.(types.ImportTaskStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ImportTaskStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "ROLLING_BACK" + value, ok := pathValue.(types.ImportTaskStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ImportTaskStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "FAILED" + value, ok := pathValue.(types.ImportTaskStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ImportTaskStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "SUCCEEDED" + value, ok := pathValue.(types.ImportTaskStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ImportTaskStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + return true, nil +} + +// ImportTaskCancelledWaiterOptions are waiter options for +// ImportTaskCancelledWaiter +type ImportTaskCancelledWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // ImportTaskCancelledWaiter will use default minimum delay of 60 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, ImportTaskCancelledWaiter will use default max delay of 3600 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetImportTaskInput, *GetImportTaskOutput, error) (bool, error) +} + +// ImportTaskCancelledWaiter defines the waiters for ImportTaskCancelled +type ImportTaskCancelledWaiter struct { + client GetImportTaskAPIClient + + options ImportTaskCancelledWaiterOptions +} + +// NewImportTaskCancelledWaiter constructs a ImportTaskCancelledWaiter. +func NewImportTaskCancelledWaiter(client GetImportTaskAPIClient, optFns ...func(*ImportTaskCancelledWaiterOptions)) *ImportTaskCancelledWaiter { + options := ImportTaskCancelledWaiterOptions{} + options.MinDelay = 60 * time.Second + options.MaxDelay = 3600 * time.Second + options.Retryable = importTaskCancelledStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &ImportTaskCancelledWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for ImportTaskCancelled waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *ImportTaskCancelledWaiter) Wait(ctx context.Context, params *GetImportTaskInput, maxWaitDur time.Duration, optFns ...func(*ImportTaskCancelledWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for ImportTaskCancelled waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *ImportTaskCancelledWaiter) WaitForOutput(ctx context.Context, params *GetImportTaskInput, maxWaitDur time.Duration, optFns ...func(*ImportTaskCancelledWaiterOptions)) (*GetImportTaskOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 3600 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetImportTask(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for ImportTaskCancelled waiter") +} + +func importTaskCancelledStateRetryable(ctx context.Context, input *GetImportTaskInput, output *GetImportTaskOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status != 'CANCELLING'", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "CANCELLED" + value, ok := pathValue.(types.ImportTaskStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.ImportTaskStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + return true, nil +} + func newServiceMetadataMiddleware_opGetImportTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptunegraph/api_op_GetPrivateGraphEndpoint.go b/service/neptunegraph/api_op_GetPrivateGraphEndpoint.go index 6234c9f7d52..65eea3f760a 100644 --- a/service/neptunegraph/api_op_GetPrivateGraphEndpoint.go +++ b/service/neptunegraph/api_op_GetPrivateGraphEndpoint.go @@ -4,13 +4,19 @@ package neptunegraph import ( "context" + "errors" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptunegraph/types" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + "github.com/jmespath/go-jmespath" + "strconv" + "time" ) // Retrieves information about a specified private endpoint. @@ -154,6 +160,388 @@ func (c *Client) addOperationGetPrivateGraphEndpointMiddlewares(stack *middlewar return nil } +// GetPrivateGraphEndpointAPIClient is a client that implements the +// GetPrivateGraphEndpoint operation. +type GetPrivateGraphEndpointAPIClient interface { + GetPrivateGraphEndpoint(context.Context, *GetPrivateGraphEndpointInput, ...func(*Options)) (*GetPrivateGraphEndpointOutput, error) +} + +var _ GetPrivateGraphEndpointAPIClient = (*Client)(nil) + +// PrivateGraphEndpointAvailableWaiterOptions are waiter options for +// PrivateGraphEndpointAvailableWaiter +type PrivateGraphEndpointAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // PrivateGraphEndpointAvailableWaiter will use default minimum delay of 10 + // seconds. Note that MinDelay must resolve to a value lesser than or equal to the + // MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, PrivateGraphEndpointAvailableWaiter will use default max delay of + // 1800 seconds. Note that MaxDelay must resolve to value greater than or equal to + // the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetPrivateGraphEndpointInput, *GetPrivateGraphEndpointOutput, error) (bool, error) +} + +// PrivateGraphEndpointAvailableWaiter defines the waiters for +// PrivateGraphEndpointAvailable +type PrivateGraphEndpointAvailableWaiter struct { + client GetPrivateGraphEndpointAPIClient + + options PrivateGraphEndpointAvailableWaiterOptions +} + +// NewPrivateGraphEndpointAvailableWaiter constructs a +// PrivateGraphEndpointAvailableWaiter. +func NewPrivateGraphEndpointAvailableWaiter(client GetPrivateGraphEndpointAPIClient, optFns ...func(*PrivateGraphEndpointAvailableWaiterOptions)) *PrivateGraphEndpointAvailableWaiter { + options := PrivateGraphEndpointAvailableWaiterOptions{} + options.MinDelay = 10 * time.Second + options.MaxDelay = 1800 * time.Second + options.Retryable = privateGraphEndpointAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &PrivateGraphEndpointAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for PrivateGraphEndpointAvailable waiter. The +// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is +// required and must be greater than zero. +func (w *PrivateGraphEndpointAvailableWaiter) Wait(ctx context.Context, params *GetPrivateGraphEndpointInput, maxWaitDur time.Duration, optFns ...func(*PrivateGraphEndpointAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for PrivateGraphEndpointAvailable +// waiter and returns the output of the successful operation. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *PrivateGraphEndpointAvailableWaiter) WaitForOutput(ctx context.Context, params *GetPrivateGraphEndpointInput, maxWaitDur time.Duration, optFns ...func(*PrivateGraphEndpointAvailableWaiterOptions)) (*GetPrivateGraphEndpointOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 1800 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetPrivateGraphEndpoint(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for PrivateGraphEndpointAvailable waiter") +} + +func privateGraphEndpointAvailableStateRetryable(ctx context.Context, input *GetPrivateGraphEndpointInput, output *GetPrivateGraphEndpointOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "DELETING" + value, ok := pathValue.(types.PrivateGraphEndpointStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.PrivateGraphEndpointStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "FAILED" + value, ok := pathValue.(types.PrivateGraphEndpointStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.PrivateGraphEndpointStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err == nil { + pathValue, err := jmespath.Search("status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "AVAILABLE" + value, ok := pathValue.(types.PrivateGraphEndpointStatus) + if !ok { + return false, fmt.Errorf("waiter comparator expected types.PrivateGraphEndpointStatus value, got %T", pathValue) + } + + if string(value) == expectedValue { + return false, nil + } + } + + return true, nil +} + +// PrivateGraphEndpointDeletedWaiterOptions are waiter options for +// PrivateGraphEndpointDeletedWaiter +type PrivateGraphEndpointDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // PrivateGraphEndpointDeletedWaiter will use default minimum delay of 10 seconds. + // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, PrivateGraphEndpointDeletedWaiter will use default max delay of + // 1800 seconds. Note that MaxDelay must resolve to value greater than or equal to + // the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. By + // default service-modeled logic will populate this option. This option can thus be + // used to define a custom waiter state with fall-back to service-modeled waiter + // state mutators.The function returns an error in case of a failure state. In case + // of retry state, this function returns a bool value of true and nil error, while + // in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *GetPrivateGraphEndpointInput, *GetPrivateGraphEndpointOutput, error) (bool, error) +} + +// PrivateGraphEndpointDeletedWaiter defines the waiters for +// PrivateGraphEndpointDeleted +type PrivateGraphEndpointDeletedWaiter struct { + client GetPrivateGraphEndpointAPIClient + + options PrivateGraphEndpointDeletedWaiterOptions +} + +// NewPrivateGraphEndpointDeletedWaiter constructs a +// PrivateGraphEndpointDeletedWaiter. +func NewPrivateGraphEndpointDeletedWaiter(client GetPrivateGraphEndpointAPIClient, optFns ...func(*PrivateGraphEndpointDeletedWaiterOptions)) *PrivateGraphEndpointDeletedWaiter { + options := PrivateGraphEndpointDeletedWaiterOptions{} + options.MinDelay = 10 * time.Second + options.MaxDelay = 1800 * time.Second + options.Retryable = privateGraphEndpointDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &PrivateGraphEndpointDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for PrivateGraphEndpointDeleted waiter. The +// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is +// required and must be greater than zero. +func (w *PrivateGraphEndpointDeletedWaiter) Wait(ctx context.Context, params *GetPrivateGraphEndpointInput, maxWaitDur time.Duration, optFns ...func(*PrivateGraphEndpointDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for PrivateGraphEndpointDeleted waiter +// and returns the output of the successful operation. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *PrivateGraphEndpointDeletedWaiter) WaitForOutput(ctx context.Context, params *GetPrivateGraphEndpointInput, maxWaitDur time.Duration, optFns ...func(*PrivateGraphEndpointDeletedWaiterOptions)) (*GetPrivateGraphEndpointOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 1800 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.GetPrivateGraphEndpoint(ctx, params, func(o *Options) { + o.APIOptions = append(o.APIOptions, apiOptions...) + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for PrivateGraphEndpointDeleted waiter") +} + +func privateGraphEndpointDeletedStateRetryable(ctx context.Context, input *GetPrivateGraphEndpointInput, output *GetPrivateGraphEndpointOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("status != 'DELETING'", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + + if err != nil { + var errorType *types.ResourceNotFoundException + if errors.As(err, &errorType) { + return false, nil + } + } + + return true, nil +} + func newServiceMetadataMiddleware_opGetPrivateGraphEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptunegraph/generated.json b/service/neptunegraph/generated.json index 226053fa2e5..dd11ab33d6c 100644 --- a/service/neptunegraph/generated.json +++ b/service/neptunegraph/generated.json @@ -4,7 +4,8 @@ "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", "github.com/aws/smithy-go": "v1.4.0", - "github.com/google/go-cmp": "v0.5.4" + "github.com/google/go-cmp": "v0.5.4", + "github.com/jmespath/go-jmespath": "v0.4.0" }, "files": [ "api_client.go", diff --git a/service/neptunegraph/go.mod b/service/neptunegraph/go.mod index 08634dfdddb..7be967e3ff0 100644 --- a/service/neptunegraph/go.mod +++ b/service/neptunegraph/go.mod @@ -8,6 +8,7 @@ require ( github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 github.com/aws/smithy-go v1.19.0 github.com/google/go-cmp v0.5.8 + github.com/jmespath/go-jmespath v0.4.0 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/neptunegraph/go.sum b/service/neptunegraph/go.sum index 5795dbe697e..d4be677c786 100644 --- a/service/neptunegraph/go.sum +++ b/service/neptunegraph/go.sum @@ -1,4 +1,16 @@ github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/rds/api_op_CreateDBCluster.go b/service/rds/api_op_CreateDBCluster.go index a5ba302693c..97a073fb950 100644 --- a/service/rds/api_op_CreateDBCluster.go +++ b/service/rds/api_op_CreateDBCluster.go @@ -173,12 +173,14 @@ type CreateDBClusterInput struct { // then. Valid for Cluster Type: Aurora DB clusters only EnableGlobalWriteForwarding *bool - // Specifies whether to enable the HTTP endpoint for an Aurora Serverless v1 DB - // cluster. By default, the HTTP endpoint is disabled. When enabled, the HTTP - // endpoint provides a connectionless web service API for running SQL queries on - // the Aurora Serverless v1 DB cluster. You can also query your database from - // inside the RDS console with the query editor. For more information, see Using - // the Data API for Aurora Serverless v1 (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) + // Specifies whether to enable the HTTP endpoint for the DB cluster. By default, + // the HTTP endpoint isn't enabled. When enabled, the HTTP endpoint provides a + // connectionless web service API (RDS Data API) for running SQL queries on the DB + // cluster. You can also query your database from inside the RDS console with the + // RDS query editor. RDS Data API is supported with the following DB clusters: + // - Aurora PostgreSQL Serverless v2 and provisioned + // - Aurora PostgreSQL and Aurora MySQL Serverless v1 + // For more information, see Using RDS Data API (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) // in the Amazon Aurora User Guide. Valid for Cluster Type: Aurora DB clusters only EnableHttpEndpoint *bool diff --git a/service/rds/api_op_DisableHttpEndpoint.go b/service/rds/api_op_DisableHttpEndpoint.go new file mode 100644 index 00000000000..f4dd173aa35 --- /dev/null +++ b/service/rds/api_op_DisableHttpEndpoint.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disables the HTTP endpoint for the specified DB cluster. Disabling this +// endpoint disables RDS Data API. For more information, see Using RDS Data API (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) +// in the Amazon Aurora User Guide. This operation applies only to Aurora +// PostgreSQL Serverless v2 and provisioned DB clusters. To disable the HTTP +// endpoint for Aurora Serverless v1 DB clusters, use the EnableHttpEndpoint +// parameter of the ModifyDBCluster operation. +func (c *Client) DisableHttpEndpoint(ctx context.Context, params *DisableHttpEndpointInput, optFns ...func(*Options)) (*DisableHttpEndpointOutput, error) { + if params == nil { + params = &DisableHttpEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisableHttpEndpoint", params, optFns, c.addOperationDisableHttpEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisableHttpEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisableHttpEndpointInput struct { + + // The Amazon Resource Name (ARN) of the DB cluster. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type DisableHttpEndpointOutput struct { + + // Indicates whether the HTTP endpoint is enabled or disabled for the DB cluster. + HttpEndpointEnabled *bool + + // The ARN of the DB cluster. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisableHttpEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDisableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDisableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisableHttpEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDisableHttpEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableHttpEndpoint(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisableHttpEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisableHttpEndpoint", + } +} diff --git a/service/rds/api_op_EnableHttpEndpoint.go b/service/rds/api_op_EnableHttpEndpoint.go new file mode 100644 index 00000000000..5f66fb51e35 --- /dev/null +++ b/service/rds/api_op_EnableHttpEndpoint.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables the HTTP endpoint for the DB cluster. By default, the HTTP endpoint +// isn't enabled. When enabled, this endpoint provides a connectionless web service +// API (RDS Data API) for running SQL queries on the Aurora DB cluster. You can +// also query your database from inside the RDS console with the RDS query editor. +// For more information, see Using RDS Data API (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) +// in the Amazon Aurora User Guide. This operation applies only to Aurora +// PostgreSQL Serverless v2 and provisioned DB clusters. To enable the HTTP +// endpoint for Aurora Serverless v1 DB clusters, use the EnableHttpEndpoint +// parameter of the ModifyDBCluster operation. +func (c *Client) EnableHttpEndpoint(ctx context.Context, params *EnableHttpEndpointInput, optFns ...func(*Options)) (*EnableHttpEndpointOutput, error) { + if params == nil { + params = &EnableHttpEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EnableHttpEndpoint", params, optFns, c.addOperationEnableHttpEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EnableHttpEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type EnableHttpEndpointInput struct { + + // The Amazon Resource Name (ARN) of the DB cluster. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type EnableHttpEndpointOutput struct { + + // Indicates whether the HTTP endpoint is enabled or disabled for the DB cluster. + HttpEndpointEnabled *bool + + // The ARN of the DB cluster. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationEnableHttpEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpEnableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpEnableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "EnableHttpEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = 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 = 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpEnableHttpEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableHttpEndpoint(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 = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opEnableHttpEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "EnableHttpEndpoint", + } +} diff --git a/service/rds/api_op_ModifyDBCluster.go b/service/rds/api_op_ModifyDBCluster.go index 0910546661f..41c8331a03f 100644 --- a/service/rds/api_op_ModifyDBCluster.go +++ b/service/rds/api_op_ModifyDBCluster.go @@ -167,12 +167,16 @@ type ModifyDBClusterInput struct { EnableGlobalWriteForwarding *bool // Specifies whether to enable the HTTP endpoint for an Aurora Serverless v1 DB - // cluster. By default, the HTTP endpoint is disabled. When enabled, the HTTP - // endpoint provides a connectionless web service API for running SQL queries on - // the Aurora Serverless v1 DB cluster. You can also query your database from - // inside the RDS console with the query editor. For more information, see Using - // the Data API for Aurora Serverless v1 (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) - // in the Amazon Aurora User Guide. Valid for Cluster Type: Aurora DB clusters only + // cluster. By default, the HTTP endpoint isn't enabled. When enabled, the HTTP + // endpoint provides a connectionless web service API (RDS Data API) for running + // SQL queries on the Aurora Serverless v1 DB cluster. You can also query your + // database from inside the RDS console with the RDS query editor. For more + // information, see Using RDS Data API (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) + // in the Amazon Aurora User Guide. This parameter applies only to Aurora + // Serverless v1 DB clusters. To enable or disable the HTTP endpoint for an Aurora + // PostgreSQL Serverless v2 or provisioned DB cluster, use the EnableHttpEndpoint + // and DisableHttpEndpoint operations. Valid for Cluster Type: Aurora DB clusters + // only EnableHttpEndpoint *bool // Specifies whether to enable mapping of Amazon Web Services Identity and Access diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index 619b5a822cd..de77135e71f 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -10792,6 +10792,117 @@ func awsAwsquery_deserializeOpErrorDescribeValidDBInstanceModifications(response } } +type awsAwsquery_deserializeOpDisableHttpEndpoint struct { +} + +func (*awsAwsquery_deserializeOpDisableHttpEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDisableHttpEndpoint) 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_deserializeOpErrorDisableHttpEndpoint(response, &metadata) + } + output := &DisableHttpEndpointOutput{} + 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("DisableHttpEndpointResult") + 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_deserializeOpDocumentDisableHttpEndpointOutput(&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_deserializeOpErrorDisableHttpEndpoint(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("InvalidResourceStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidResourceStateFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpDownloadDBLogFilePortion struct { } @@ -10903,6 +11014,117 @@ func awsAwsquery_deserializeOpErrorDownloadDBLogFilePortion(response *smithyhttp } } +type awsAwsquery_deserializeOpEnableHttpEndpoint struct { +} + +func (*awsAwsquery_deserializeOpEnableHttpEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpEnableHttpEndpoint) 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_deserializeOpErrorEnableHttpEndpoint(response, &metadata) + } + output := &EnableHttpEndpointOutput{} + 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("EnableHttpEndpointResult") + 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_deserializeOpDocumentEnableHttpEndpointOutput(&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_deserializeOpErrorEnableHttpEndpoint(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("InvalidResourceStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidResourceStateFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpFailoverDBCluster struct { } @@ -22250,6 +22472,50 @@ func awsAwsquery_deserializeErrorInvalidOptionGroupStateFault(response *smithyht return output } +func awsAwsquery_deserializeErrorInvalidResourceStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidResourceStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidResourceStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + func awsAwsquery_deserializeErrorInvalidRestoreFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidRestoreFault{} var buff [1024]byte @@ -42577,6 +42843,55 @@ func awsAwsquery_deserializeDocumentInvalidOptionGroupStateFault(v **types.Inval return nil } +func awsAwsquery_deserializeDocumentInvalidResourceStateFault(v **types.InvalidResourceStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidResourceStateFault + if *v == nil { + sv = &types.InvalidResourceStateFault{} + } 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("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = 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_deserializeDocumentInvalidRestoreFault(v **types.InvalidRestoreFault, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -58522,6 +58837,71 @@ func awsAwsquery_deserializeOpDocumentDescribeValidDBInstanceModificationsOutput return nil } +func awsAwsquery_deserializeOpDocumentDisableHttpEndpointOutput(v **DisableHttpEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DisableHttpEndpointOutput + if *v == nil { + sv = &DisableHttpEndpointOutput{} + } 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("HttpEndpointEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.HttpEndpointEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("ResourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceArn = 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_deserializeOpDocumentDownloadDBLogFilePortionOutput(v **DownloadDBLogFilePortionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -58600,6 +58980,71 @@ func awsAwsquery_deserializeOpDocumentDownloadDBLogFilePortionOutput(v **Downloa return nil } +func awsAwsquery_deserializeOpDocumentEnableHttpEndpointOutput(v **EnableHttpEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *EnableHttpEndpointOutput + if *v == nil { + sv = &EnableHttpEndpointOutput{} + } 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("HttpEndpointEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.HttpEndpointEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("ResourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceArn = 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_deserializeOpDocumentFailoverDBClusterOutput(v **FailoverDBClusterOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/rds/generated.json b/service/rds/generated.json index 7cbde19e0a5..60151831b39 100644 --- a/service/rds/generated.json +++ b/service/rds/generated.json @@ -113,7 +113,9 @@ "api_op_DescribeSourceRegions.go", "api_op_DescribeTenantDatabases.go", "api_op_DescribeValidDBInstanceModifications.go", + "api_op_DisableHttpEndpoint.go", "api_op_DownloadDBLogFilePortion.go", + "api_op_EnableHttpEndpoint.go", "api_op_FailoverDBCluster.go", "api_op_FailoverGlobalCluster.go", "api_op_ListTagsForResource.go", diff --git a/service/rds/serializers.go b/service/rds/serializers.go index e3de14c66fd..b1935acc445 100644 --- a/service/rds/serializers.go +++ b/service/rds/serializers.go @@ -6222,6 +6222,70 @@ func (m *awsAwsquery_serializeOpDescribeValidDBInstanceModifications) HandleSeri return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpDisableHttpEndpoint struct { +} + +func (*awsAwsquery_serializeOpDisableHttpEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDisableHttpEndpoint) 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.(*DisableHttpEndpointInput) + _ = 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("DisableHttpEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDisableHttpEndpointInput(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_serializeOpDownloadDBLogFilePortion struct { } @@ -6286,6 +6350,70 @@ func (m *awsAwsquery_serializeOpDownloadDBLogFilePortion) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpEnableHttpEndpoint struct { +} + +func (*awsAwsquery_serializeOpEnableHttpEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpEnableHttpEndpoint) 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.(*EnableHttpEndpointInput) + _ = 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("EnableHttpEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentEnableHttpEndpointInput(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_serializeOpFailoverDBCluster struct { } @@ -14227,6 +14355,18 @@ func awsAwsquery_serializeOpDocumentDescribeValidDBInstanceModificationsInput(v return nil } +func awsAwsquery_serializeOpDocumentDisableHttpEndpointInput(v *DisableHttpEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentDownloadDBLogFilePortionInput(v *DownloadDBLogFilePortionInput, value query.Value) error { object := value.Object() _ = object @@ -14254,6 +14394,18 @@ func awsAwsquery_serializeOpDocumentDownloadDBLogFilePortionInput(v *DownloadDBL return nil } +func awsAwsquery_serializeOpDocumentEnableHttpEndpointInput(v *EnableHttpEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + func awsAwsquery_serializeOpDocumentFailoverDBClusterInput(v *FailoverDBClusterInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/rds/types/errors.go b/service/rds/types/errors.go index 956b815af5c..cf585d227a7 100644 --- a/service/rds/types/errors.go +++ b/service/rds/types/errors.go @@ -2830,6 +2830,32 @@ func (e *InvalidOptionGroupStateFault) ErrorCode() string { } func (e *InvalidOptionGroupStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The operation can't be performed because another operation is in progress. +type InvalidResourceStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidResourceStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidResourceStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidResourceStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidResourceStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidResourceStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Cannot restore from VPC backup to non-VPC DB instance. type InvalidRestoreFault struct { Message *string diff --git a/service/rds/types/types.go b/service/rds/types/types.go index b8ca772f98e..33d82461c2a 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -614,11 +614,11 @@ type DBCluster struct { // The ID that Amazon Route 53 assigns when you create a hosted zone. HostedZoneId *string - // Indicates whether the HTTP endpoint for an Aurora Serverless v1 DB cluster is - // enabled. When enabled, the HTTP endpoint provides a connectionless web service - // API for running SQL queries on the Aurora Serverless v1 DB cluster. You can also - // query your database from inside the RDS console with the query editor. For more - // information, see Using the Data API for Aurora Serverless v1 (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) + // Indicates whether the HTTP endpoint is enabled for an Aurora DB cluster. When + // enabled, the HTTP endpoint provides a connectionless web service API (RDS Data + // API) for running SQL queries on the DB cluster. You can also query your database + // from inside the RDS console with the RDS query editor. For more information, see + // Using RDS Data API (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) // in the Amazon Aurora User Guide. HttpEndpointEnabled *bool diff --git a/service/rds/validators.go b/service/rds/validators.go index caaaeebb6f7..7fda8ce8885 100644 --- a/service/rds/validators.go +++ b/service/rds/validators.go @@ -1890,6 +1890,26 @@ func (m *validateOpDescribeValidDBInstanceModifications) HandleInitialize(ctx co return next.HandleInitialize(ctx, in) } +type validateOpDisableHttpEndpoint struct { +} + +func (*validateOpDisableHttpEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisableHttpEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisableHttpEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisableHttpEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDownloadDBLogFilePortion struct { } @@ -1910,6 +1930,26 @@ func (m *validateOpDownloadDBLogFilePortion) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpEnableHttpEndpoint struct { +} + +func (*validateOpEnableHttpEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEnableHttpEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EnableHttpEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEnableHttpEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpFailoverDBCluster struct { } @@ -3326,10 +3366,18 @@ func addOpDescribeValidDBInstanceModificationsValidationMiddleware(stack *middle return stack.Initialize.Add(&validateOpDescribeValidDBInstanceModifications{}, middleware.After) } +func addOpDisableHttpEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisableHttpEndpoint{}, middleware.After) +} + func addOpDownloadDBLogFilePortionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDownloadDBLogFilePortion{}, middleware.After) } +func addOpEnableHttpEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEnableHttpEndpoint{}, middleware.After) +} + func addOpFailoverDBClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpFailoverDBCluster{}, middleware.After) } @@ -5307,6 +5355,21 @@ func validateOpDescribeValidDBInstanceModificationsInput(v *DescribeValidDBInsta } } +func validateOpDisableHttpEndpointInput(v *DisableHttpEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisableHttpEndpointInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDownloadDBLogFilePortionInput(v *DownloadDBLogFilePortionInput) error { if v == nil { return nil @@ -5325,6 +5388,21 @@ func validateOpDownloadDBLogFilePortionInput(v *DownloadDBLogFilePortionInput) e } } +func validateOpEnableHttpEndpointInput(v *EnableHttpEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EnableHttpEndpointInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpFailoverDBClusterInput(v *FailoverDBClusterInput) error { if v == nil { return nil diff --git a/service/rdsdata/api_op_ExecuteSql.go b/service/rdsdata/api_op_ExecuteSql.go index 08fef584747..e426061f13c 100644 --- a/service/rdsdata/api_op_ExecuteSql.go +++ b/service/rdsdata/api_op_ExecuteSql.go @@ -12,8 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Runs one or more SQL statements. This operation is deprecated. Use the -// BatchExecuteStatement or ExecuteStatement operation. +// Runs one or more SQL statements. This operation isn't supported for Aurora +// PostgreSQL Serverless v2 and provisioned DB clusters, and for Aurora Serverless +// v1 DB clusters, the operation is deprecated. Use the BatchExecuteStatement or +// ExecuteStatement operation. // // Deprecated: The ExecuteSql API is deprecated, please use the ExecuteStatement // API. diff --git a/service/rdsdata/deserializers.go b/service/rdsdata/deserializers.go index d36ae24e2b8..533124d129f 100644 --- a/service/rdsdata/deserializers.go +++ b/service/rdsdata/deserializers.go @@ -124,18 +124,39 @@ func awsRestjson1_deserializeOpErrorBatchExecuteStatement(response *smithyhttp.R case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("DatabaseErrorException", errorCode): + return awsRestjson1_deserializeErrorDatabaseErrorException(response, errorBody) + + case strings.EqualFold("DatabaseNotFoundException", errorCode): + return awsRestjson1_deserializeErrorDatabaseNotFoundException(response, errorBody) + + case strings.EqualFold("DatabaseUnavailableException", errorCode): + return awsRestjson1_deserializeErrorDatabaseUnavailableException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + case strings.EqualFold("HttpEndpointNotEnabledException", errorCode): + return awsRestjson1_deserializeErrorHttpEndpointNotEnabledException(response, errorBody) + case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + case strings.EqualFold("InvalidSecretException", errorCode): + return awsRestjson1_deserializeErrorInvalidSecretException(response, errorBody) + + case strings.EqualFold("SecretsErrorException", errorCode): + return awsRestjson1_deserializeErrorSecretsErrorException(response, errorBody) + case strings.EqualFold("ServiceUnavailableError", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableError(response, errorBody) case strings.EqualFold("StatementTimeoutException", errorCode): return awsRestjson1_deserializeErrorStatementTimeoutException(response, errorBody) + case strings.EqualFold("TransactionNotFoundException", errorCode): + return awsRestjson1_deserializeErrorTransactionNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -286,18 +307,39 @@ func awsRestjson1_deserializeOpErrorBeginTransaction(response *smithyhttp.Respon case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("DatabaseErrorException", errorCode): + return awsRestjson1_deserializeErrorDatabaseErrorException(response, errorBody) + + case strings.EqualFold("DatabaseNotFoundException", errorCode): + return awsRestjson1_deserializeErrorDatabaseNotFoundException(response, errorBody) + + case strings.EqualFold("DatabaseUnavailableException", errorCode): + return awsRestjson1_deserializeErrorDatabaseUnavailableException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + case strings.EqualFold("HttpEndpointNotEnabledException", errorCode): + return awsRestjson1_deserializeErrorHttpEndpointNotEnabledException(response, errorBody) + case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + case strings.EqualFold("InvalidSecretException", errorCode): + return awsRestjson1_deserializeErrorInvalidSecretException(response, errorBody) + + case strings.EqualFold("SecretsErrorException", errorCode): + return awsRestjson1_deserializeErrorSecretsErrorException(response, errorBody) + case strings.EqualFold("ServiceUnavailableError", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableError(response, errorBody) case strings.EqualFold("StatementTimeoutException", errorCode): return awsRestjson1_deserializeErrorStatementTimeoutException(response, errorBody) + case strings.EqualFold("TransactionNotFoundException", errorCode): + return awsRestjson1_deserializeErrorTransactionNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -452,21 +494,42 @@ func awsRestjson1_deserializeOpErrorCommitTransaction(response *smithyhttp.Respo case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("DatabaseErrorException", errorCode): + return awsRestjson1_deserializeErrorDatabaseErrorException(response, errorBody) + + case strings.EqualFold("DatabaseNotFoundException", errorCode): + return awsRestjson1_deserializeErrorDatabaseNotFoundException(response, errorBody) + + case strings.EqualFold("DatabaseUnavailableException", errorCode): + return awsRestjson1_deserializeErrorDatabaseUnavailableException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + case strings.EqualFold("HttpEndpointNotEnabledException", errorCode): + return awsRestjson1_deserializeErrorHttpEndpointNotEnabledException(response, errorBody) + case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + case strings.EqualFold("InvalidSecretException", errorCode): + return awsRestjson1_deserializeErrorInvalidSecretException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("SecretsErrorException", errorCode): + return awsRestjson1_deserializeErrorSecretsErrorException(response, errorBody) + case strings.EqualFold("ServiceUnavailableError", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableError(response, errorBody) case strings.EqualFold("StatementTimeoutException", errorCode): return awsRestjson1_deserializeErrorStatementTimeoutException(response, errorBody) + case strings.EqualFold("TransactionNotFoundException", errorCode): + return awsRestjson1_deserializeErrorTransactionNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -780,18 +843,42 @@ func awsRestjson1_deserializeOpErrorExecuteStatement(response *smithyhttp.Respon case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("DatabaseErrorException", errorCode): + return awsRestjson1_deserializeErrorDatabaseErrorException(response, errorBody) + + case strings.EqualFold("DatabaseNotFoundException", errorCode): + return awsRestjson1_deserializeErrorDatabaseNotFoundException(response, errorBody) + + case strings.EqualFold("DatabaseUnavailableException", errorCode): + return awsRestjson1_deserializeErrorDatabaseUnavailableException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + case strings.EqualFold("HttpEndpointNotEnabledException", errorCode): + return awsRestjson1_deserializeErrorHttpEndpointNotEnabledException(response, errorBody) + case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + case strings.EqualFold("InvalidSecretException", errorCode): + return awsRestjson1_deserializeErrorInvalidSecretException(response, errorBody) + + case strings.EqualFold("SecretsErrorException", errorCode): + return awsRestjson1_deserializeErrorSecretsErrorException(response, errorBody) + case strings.EqualFold("ServiceUnavailableError", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableError(response, errorBody) case strings.EqualFold("StatementTimeoutException", errorCode): return awsRestjson1_deserializeErrorStatementTimeoutException(response, errorBody) + case strings.EqualFold("TransactionNotFoundException", errorCode): + return awsRestjson1_deserializeErrorTransactionNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedResultException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedResultException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -974,21 +1061,42 @@ func awsRestjson1_deserializeOpErrorRollbackTransaction(response *smithyhttp.Res case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("DatabaseErrorException", errorCode): + return awsRestjson1_deserializeErrorDatabaseErrorException(response, errorBody) + + case strings.EqualFold("DatabaseNotFoundException", errorCode): + return awsRestjson1_deserializeErrorDatabaseNotFoundException(response, errorBody) + + case strings.EqualFold("DatabaseUnavailableException", errorCode): + return awsRestjson1_deserializeErrorDatabaseUnavailableException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + case strings.EqualFold("HttpEndpointNotEnabledException", errorCode): + return awsRestjson1_deserializeErrorHttpEndpointNotEnabledException(response, errorBody) + case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) + case strings.EqualFold("InvalidSecretException", errorCode): + return awsRestjson1_deserializeErrorInvalidSecretException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("SecretsErrorException", errorCode): + return awsRestjson1_deserializeErrorSecretsErrorException(response, errorBody) + case strings.EqualFold("ServiceUnavailableError", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableError(response, errorBody) case strings.EqualFold("StatementTimeoutException", errorCode): return awsRestjson1_deserializeErrorStatementTimeoutException(response, errorBody) + case strings.EqualFold("TransactionNotFoundException", errorCode): + return awsRestjson1_deserializeErrorTransactionNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1111,8 +1219,8 @@ func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Respo return output } -func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ForbiddenException{} +func awsRestjson1_deserializeErrorDatabaseErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DatabaseErrorException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1130,7 +1238,7 @@ func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Respon return err } - err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) + err := awsRestjson1_deserializeDocumentDatabaseErrorException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -1147,13 +1255,8 @@ func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Respon return output } -func awsRestjson1_deserializeErrorInternalServerErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerErrorException{} - return output -} - -func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NotFoundException{} +func awsRestjson1_deserializeErrorDatabaseNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DatabaseNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1171,7 +1274,7 @@ func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Respons return err } - err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) + err := awsRestjson1_deserializeDocumentDatabaseNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -1188,13 +1291,13 @@ func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Respons return output } -func awsRestjson1_deserializeErrorServiceUnavailableError(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceUnavailableError{} +func awsRestjson1_deserializeErrorDatabaseUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DatabaseUnavailableException{} return output } -func awsRestjson1_deserializeErrorStatementTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.StatementTimeoutException{} +func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ForbiddenException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -1212,7 +1315,7 @@ func awsRestjson1_deserializeErrorStatementTimeoutException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentStatementTimeoutException(&output, shape) + err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -1229,150 +1332,412 @@ func awsRestjson1_deserializeErrorStatementTimeoutException(response *smithyhttp return output } -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessDeniedException - if *v == nil { - sv = &types.AccessDeniedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value +func awsRestjson1_deserializeErrorHttpEndpointNotEnabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HttpEndpointNotEnabledException{} + 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 } - *v = sv - return nil -} -func awsRestjson1_deserializeDocumentArrayOfArray(v *[]types.ArrayValue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + err := awsRestjson1_deserializeDocumentHttpEndpointNotEnabledException(&output, shape) - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + 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 } - var cv []types.ArrayValue - if *v == nil { - cv = []types.ArrayValue{} - } else { - cv = *v - } + errorBody.Seek(0, io.SeekStart) - for _, value := range shape { - var col types.ArrayValue - if err := awsRestjson1_deserializeDocumentArrayValue(&col, value); err != nil { - return err - } - cv = append(cv, col) + return output +} - } - *v = cv - return nil +func awsRestjson1_deserializeErrorInternalServerErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerErrorException{} + return output } -func awsRestjson1_deserializeDocumentArrayValue(v *types.ArrayValue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } +func awsRestjson1_deserializeErrorInvalidSecretException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSecretException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + 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 } - var uv types.ArrayValue -loop: - for key, value := range shape { - if value == nil { - continue + err := awsRestjson1_deserializeDocumentInvalidSecretException(&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(), } - switch key { - case "arrayValues": - var mv []types.ArrayValue - if err := awsRestjson1_deserializeDocumentArrayOfArray(&mv, value); err != nil { - return err - } - uv = &types.ArrayValueMemberArrayValues{Value: mv} - break loop + return err + } - case "booleanValues": - var mv []bool - if err := awsRestjson1_deserializeDocumentBooleanArray(&mv, value); err != nil { - return err - } - uv = &types.ArrayValueMemberBooleanValues{Value: mv} - break loop + errorBody.Seek(0, io.SeekStart) - case "doubleValues": - var mv []float64 - if err := awsRestjson1_deserializeDocumentDoubleArray(&mv, value); err != nil { - return err - } - uv = &types.ArrayValueMemberDoubleValues{Value: mv} - break loop + return output +} - case "longValues": - var mv []int64 - if err := awsRestjson1_deserializeDocumentLongArray(&mv, value); err != nil { - return err - } - uv = &types.ArrayValueMemberLongValues{Value: mv} - break loop +func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) - case "stringValues": - var mv []string - if err := awsRestjson1_deserializeDocumentStringArray(&mv, value); err != nil { - return err - } - uv = &types.ArrayValueMemberStringValues{Value: mv} - break loop + 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 + } - default: - uv = &types.UnknownUnionMember{Tag: key} - break loop + err := awsRestjson1_deserializeDocumentNotFoundException(&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 } - *v = uv - return nil + + errorBody.Seek(0, io.SeekStart) + + return output } -func awsRestjson1_deserializeDocumentArrayValueList(v *[]types.Value, value interface{}) error { - if v == nil { +func awsRestjson1_deserializeErrorSecretsErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SecretsErrorException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentSecretsErrorException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceUnavailableError(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceUnavailableError{} + return output +} + +func awsRestjson1_deserializeErrorStatementTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.StatementTimeoutException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentStatementTimeoutException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorTransactionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TransactionNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentTransactionNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorUnsupportedResultException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnsupportedResultException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentUnsupportedResultException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentArrayOfArray(v *[]types.ArrayValue, 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.ArrayValue + if *v == nil { + cv = []types.ArrayValue{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ArrayValue + if err := awsRestjson1_deserializeDocumentArrayValue(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentArrayValue(v *types.ArrayValue, 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 uv types.ArrayValue +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "arrayValues": + var mv []types.ArrayValue + if err := awsRestjson1_deserializeDocumentArrayOfArray(&mv, value); err != nil { + return err + } + uv = &types.ArrayValueMemberArrayValues{Value: mv} + break loop + + case "booleanValues": + var mv []bool + if err := awsRestjson1_deserializeDocumentBooleanArray(&mv, value); err != nil { + return err + } + uv = &types.ArrayValueMemberBooleanValues{Value: mv} + break loop + + case "doubleValues": + var mv []float64 + if err := awsRestjson1_deserializeDocumentDoubleArray(&mv, value); err != nil { + return err + } + uv = &types.ArrayValueMemberDoubleValues{Value: mv} + break loop + + case "longValues": + var mv []int64 + if err := awsRestjson1_deserializeDocumentLongArray(&mv, value); err != nil { + return err + } + uv = &types.ArrayValueMemberLongValues{Value: mv} + break loop + + case "stringValues": + var mv []string + if err := awsRestjson1_deserializeDocumentStringArray(&mv, value); err != nil { + return err + } + uv = &types.ArrayValueMemberStringValues{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentArrayValueList(v *[]types.Value, value interface{}) error { + if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { @@ -1629,22 +1994,102 @@ func awsRestjson1_deserializeDocumentColumnMetadata(v **types.ColumnMetadata, va if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Type = int32(i64) + } + + case "typeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TypeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDatabaseErrorException(v **types.DatabaseErrorException, 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.DatabaseErrorException + if *v == nil { + sv = &types.DatabaseErrorException{} + } 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.Type = int32(i64) + sv.Message = ptr.String(jtv) } - case "typeName": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDatabaseNotFoundException(v **types.DatabaseNotFoundException, 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.DatabaseNotFoundException + if *v == nil { + sv = &types.DatabaseNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.TypeName = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -1656,6 +2101,37 @@ func awsRestjson1_deserializeDocumentColumnMetadata(v **types.ColumnMetadata, va return nil } +func awsRestjson1_deserializeDocumentDatabaseUnavailableException(v **types.DatabaseUnavailableException, 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.DatabaseUnavailableException + if *v == nil { + sv = &types.DatabaseUnavailableException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDoubleArray(v *[]float64, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1932,6 +2408,46 @@ func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenExcep return nil } +func awsRestjson1_deserializeDocumentHttpEndpointNotEnabledException(v **types.HttpEndpointNotEnabledException, 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.HttpEndpointNotEnabledException + if *v == nil { + sv = &types.HttpEndpointNotEnabledException{} + } 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 awsRestjson1_deserializeDocumentInternalServerErrorException(v **types.InternalServerErrorException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1963,6 +2479,46 @@ func awsRestjson1_deserializeDocumentInternalServerErrorException(v **types.Inte return nil } +func awsRestjson1_deserializeDocumentInvalidSecretException(v **types.InvalidSecretException, 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.InvalidSecretException + if *v == nil { + sv = &types.InvalidSecretException{} + } 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 awsRestjson1_deserializeDocumentLongArray(v *[]int64, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2269,6 +2825,46 @@ func awsRestjson1_deserializeDocumentRow(v *[]types.Value, value interface{}) er return nil } +func awsRestjson1_deserializeDocumentSecretsErrorException(v **types.SecretsErrorException, 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.SecretsErrorException + if *v == nil { + sv = &types.SecretsErrorException{} + } 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 awsRestjson1_deserializeDocumentServiceUnavailableError(v **types.ServiceUnavailableError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2540,6 +3136,86 @@ func awsRestjson1_deserializeDocumentStructValue(v **types.StructValue, value in return nil } +func awsRestjson1_deserializeDocumentTransactionNotFoundException(v **types.TransactionNotFoundException, 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.TransactionNotFoundException + if *v == nil { + sv = &types.TransactionNotFoundException{} + } 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 awsRestjson1_deserializeDocumentUnsupportedResultException(v **types.UnsupportedResultException, 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.UnsupportedResultException + if *v == nil { + sv = &types.UnsupportedResultException{} + } 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 awsRestjson1_deserializeDocumentUpdateResult(v **types.UpdateResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/rdsdata/doc.go b/service/rdsdata/doc.go index 7d1c28aa9f5..cc183cd6e2e 100644 --- a/service/rdsdata/doc.go +++ b/service/rdsdata/doc.go @@ -3,10 +3,12 @@ // Package rdsdata provides the API client, operations, and parameter types for // AWS RDS DataService. // -// Amazon RDS Data Service Amazon RDS provides an HTTP endpoint to run SQL -// statements on an Amazon Aurora Serverless v1 DB cluster. To run these -// statements, you work with the Data Service API. The Data Service API isn't -// supported on Amazon Aurora Serverless v2 DB clusters. For more information about -// the Data Service API, see Using the Data API (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) +// RDS Data API Amazon RDS provides an HTTP endpoint to run SQL statements on an +// Amazon Aurora DB cluster. To run these statements, you use the RDS Data API +// (Data API). Data API is available with the following types of Aurora databases: +// - Aurora PostgreSQL - Serverless v2, Serverless v1, and provisioned +// - Aurora MySQL - Serverless v1 only +// +// For more information about the Data API, see Using RDS Data API (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) // in the Amazon Aurora User Guide. package rdsdata diff --git a/service/rdsdata/endpoints.go b/service/rdsdata/endpoints.go index e04aa41102b..b8c5ae9530e 100644 --- a/service/rdsdata/endpoints.go +++ b/service/rdsdata/endpoints.go @@ -366,7 +366,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://rds-data-fips.") diff --git a/service/rdsdata/types/errors.go b/service/rdsdata/types/errors.go index e46d71870f2..0a34dec653f 100644 --- a/service/rdsdata/types/errors.go +++ b/service/rdsdata/types/errors.go @@ -7,7 +7,7 @@ import ( smithy "github.com/aws/smithy-go" ) -// You do not have sufficient access to perform this action. +// You don't have sufficient access to perform this action. type AccessDeniedException struct { Message *string @@ -33,7 +33,8 @@ func (e *AccessDeniedException) ErrorCode() string { } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// There is an error in the call or in a SQL statement. +// There is an error in the call or in a SQL statement. (This error only appears +// in calls from Aurora Serverless v1 databases.) type BadRequestException struct { Message *string @@ -59,6 +60,84 @@ func (e *BadRequestException) ErrorCode() string { } func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// There was an error in processing the SQL statement. +type DatabaseErrorException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DatabaseErrorException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DatabaseErrorException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DatabaseErrorException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DatabaseErrorException" + } + return *e.ErrorCodeOverride +} +func (e *DatabaseErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB cluster doesn't have a DB instance. +type DatabaseNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DatabaseNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DatabaseNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DatabaseNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DatabaseNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *DatabaseNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The writer instance in the DB cluster isn't available. +type DatabaseUnavailableException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DatabaseUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DatabaseUnavailableException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DatabaseUnavailableException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DatabaseUnavailableException" + } + return *e.ErrorCodeOverride +} +func (e *DatabaseUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + // There are insufficient privileges to make the call. type ForbiddenException struct { Message *string @@ -85,6 +164,32 @@ func (e *ForbiddenException) ErrorCode() string { } func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The HTTP endpoint for using RDS Data API isn't enabled for the DB cluster. +type HttpEndpointNotEnabledException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *HttpEndpointNotEnabledException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *HttpEndpointNotEnabledException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *HttpEndpointNotEnabledException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "HttpEndpointNotEnabledException" + } + return *e.ErrorCodeOverride +} +func (e *HttpEndpointNotEnabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // An internal error occurred. type InternalServerErrorException struct { Message *string @@ -111,6 +216,32 @@ func (e *InternalServerErrorException) ErrorCode() string { } func (e *InternalServerErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The Secrets Manager secret used with the request isn't valid. +type InvalidSecretException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidSecretException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSecretException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSecretException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSecretException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSecretException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The resourceArn , secretArn , or transactionId value can't be found. type NotFoundException struct { Message *string @@ -137,7 +268,37 @@ func (e *NotFoundException) ErrorCode() string { } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The service specified by the resourceArn parameter is not available. +// There was a problem with the Secrets Manager secret used with the request, +// caused by one of the following conditions: +// - RDS Data API timed out retrieving the secret. +// - The secret provided wasn't found. +// - The secret couldn't be decrypted. +type SecretsErrorException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SecretsErrorException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SecretsErrorException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SecretsErrorException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SecretsErrorException" + } + return *e.ErrorCodeOverride +} +func (e *SecretsErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The service specified by the resourceArn parameter isn't available. type ServiceUnavailableError struct { Message *string @@ -190,3 +351,58 @@ func (e *StatementTimeoutException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *StatementTimeoutException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The transaction ID wasn't found. +type TransactionNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TransactionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TransactionNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TransactionNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TransactionNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *TransactionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// There was a problem with the result because of one of the following conditions: +// - It contained an unsupported data type. +// - It contained a multidimensional array. +// - The size was too large. +type UnsupportedResultException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedResultException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedResultException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedResultException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedResultException" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedResultException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/sagemaker/api_op_CreateTrainingJob.go b/service/sagemaker/api_op_CreateTrainingJob.go index 6d0076b51f9..d8152933a04 100644 --- a/service/sagemaker/api_op_CreateTrainingJob.go +++ b/service/sagemaker/api_op_CreateTrainingJob.go @@ -214,6 +214,12 @@ type CreateTrainingJobInput struct { // system and framework metrics. ProfilerRuleConfigurations []types.ProfilerRuleConfiguration + // Configuration for remote debugging. To learn more about the remote debugging + // functionality of SageMaker, see Access a training container through Amazon Web + // Services Systems Manager (SSM) for remote debugging (https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html) + // . + RemoteDebugConfig *types.RemoteDebugConfig + // The number of times to retry the job when the job fails due to an // InternalServerError . RetryStrategy *types.RetryStrategy diff --git a/service/sagemaker/api_op_DescribeTrainingJob.go b/service/sagemaker/api_op_DescribeTrainingJob.go index 1c418376c9d..856fad00cd0 100644 --- a/service/sagemaker/api_op_DescribeTrainingJob.go +++ b/service/sagemaker/api_op_DescribeTrainingJob.go @@ -245,6 +245,12 @@ type DescribeTrainingJobOutput struct { // Profiling status of a training job. ProfilingStatus types.ProfilingStatus + // Configuration for remote debugging. To learn more about the remote debugging + // functionality of SageMaker, see Access a training container through Amazon Web + // Services Systems Manager (SSM) for remote debugging (https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html) + // . + RemoteDebugConfig *types.RemoteDebugConfig + // The number of times to retry the job when the job fails due to an // InternalServerError . RetryStrategy *types.RetryStrategy diff --git a/service/sagemaker/api_op_Search.go b/service/sagemaker/api_op_Search.go index c1847a71fe2..c07565b34dc 100644 --- a/service/sagemaker/api_op_Search.go +++ b/service/sagemaker/api_op_Search.go @@ -73,6 +73,9 @@ type SearchInput struct { // default is Descending . SortOrder types.SearchSortOrder + // Limits the results of your search request to the resources that you can access. + VisibilityConditions []types.VisibilityConditions + noSmithyDocumentSerde } diff --git a/service/sagemaker/api_op_UpdateTrainingJob.go b/service/sagemaker/api_op_UpdateTrainingJob.go index 33277066992..74e7663d1c5 100644 --- a/service/sagemaker/api_op_UpdateTrainingJob.go +++ b/service/sagemaker/api_op_UpdateTrainingJob.go @@ -44,6 +44,14 @@ type UpdateTrainingJobInput struct { // system and framework metrics. ProfilerRuleConfigurations []types.ProfilerRuleConfiguration + // Configuration for remote debugging while the training job is running. You can + // update the remote debugging configuration when the SecondaryStatus of the job + // is Downloading or Training .To learn more about the remote debugging + // functionality of SageMaker, see Access a training container through Amazon Web + // Services Systems Manager (SSM) for remote debugging (https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html) + // . + RemoteDebugConfig *types.RemoteDebugConfigForUpdate + // The training job ResourceConfig to update warm pool retention length. ResourceConfig *types.ResourceConfigForUpdate diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index 3db5814706a..c3ea88f9872 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -69786,6 +69786,46 @@ func awsAwsjson11_deserializeDocumentRegisterModelStepMetadata(v **types.Registe return nil } +func awsAwsjson11_deserializeDocumentRemoteDebugConfig(v **types.RemoteDebugConfig, 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.RemoteDebugConfig + if *v == nil { + sv = &types.RemoteDebugConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnableRemoteDebug": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected EnableRemoteDebug to be of type *bool, got %T instead", value) + } + sv.EnableRemoteDebug = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentRenderingError(v **types.RenderingError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -89288,6 +89328,11 @@ func awsAwsjson11_deserializeOpDocumentDescribeTrainingJobOutput(v **DescribeTra sv.ProfilingStatus = types.ProfilingStatus(jtv) } + case "RemoteDebugConfig": + if err := awsAwsjson11_deserializeDocumentRemoteDebugConfig(&sv.RemoteDebugConfig, value); err != nil { + return err + } + case "ResourceConfig": if err := awsAwsjson11_deserializeDocumentResourceConfig(&sv.ResourceConfig, value); err != nil { return err diff --git a/service/sagemaker/serializers.go b/service/sagemaker/serializers.go index 2f0c5e4b2d0..218d4a347cb 100644 --- a/service/sagemaker/serializers.go +++ b/service/sagemaker/serializers.go @@ -25807,6 +25807,30 @@ func awsAwsjson11_serializeDocumentRedshiftDatasetDefinition(v *types.RedshiftDa return nil } +func awsAwsjson11_serializeDocumentRemoteDebugConfig(v *types.RemoteDebugConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnableRemoteDebug != nil { + ok := object.Key("EnableRemoteDebug") + ok.Boolean(*v.EnableRemoteDebug) + } + + return nil +} + +func awsAwsjson11_serializeDocumentRemoteDebugConfigForUpdate(v *types.RemoteDebugConfigForUpdate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnableRemoteDebug != nil { + ok := object.Key("EnableRemoteDebug") + ok.Boolean(*v.EnableRemoteDebug) + } + + return nil +} + func awsAwsjson11_serializeDocumentRenderableTask(v *types.RenderableTask, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -27846,6 +27870,36 @@ func awsAwsjson11_serializeDocumentVectorConfig(v *types.VectorConfig, value smi return nil } +func awsAwsjson11_serializeDocumentVisibilityConditions(v *types.VisibilityConditions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentVisibilityConditionsList(v []types.VisibilityConditions, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentVisibilityConditions(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentVpcConfig(v *types.VpcConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -30591,6 +30645,13 @@ func awsAwsjson11_serializeOpDocumentCreateTrainingJobInput(v *CreateTrainingJob } } + if v.RemoteDebugConfig != nil { + ok := object.Key("RemoteDebugConfig") + if err := awsAwsjson11_serializeDocumentRemoteDebugConfig(v.RemoteDebugConfig, ok); err != nil { + return err + } + } + if v.ResourceConfig != nil { ok := object.Key("ResourceConfig") if err := awsAwsjson11_serializeDocumentResourceConfig(v.ResourceConfig, ok); err != nil { @@ -36365,6 +36426,13 @@ func awsAwsjson11_serializeOpDocumentSearchInput(v *SearchInput, value smithyjso ok.String(string(v.SortOrder)) } + if v.VisibilityConditions != nil { + ok := object.Key("VisibilityConditions") + if err := awsAwsjson11_serializeDocumentVisibilityConditionsList(v.VisibilityConditions, ok); err != nil { + return err + } + } + return nil } @@ -37723,6 +37791,13 @@ func awsAwsjson11_serializeOpDocumentUpdateTrainingJobInput(v *UpdateTrainingJob } } + if v.RemoteDebugConfig != nil { + ok := object.Key("RemoteDebugConfig") + if err := awsAwsjson11_serializeDocumentRemoteDebugConfigForUpdate(v.RemoteDebugConfig, ok); err != nil { + return err + } + } + if v.ResourceConfig != nil { ok := object.Key("ResourceConfig") if err := awsAwsjson11_serializeDocumentResourceConfigForUpdate(v.ResourceConfig, ok); err != nil { diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index a2b85aff151..b207846e7f2 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -12902,6 +12902,32 @@ type RegisterModelStepMetadata struct { noSmithyDocumentSerde } +// Configuration for remote debugging for the CreateTrainingJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html) +// API. To learn more about the remote debugging functionality of SageMaker, see +// Access a training container through Amazon Web Services Systems Manager (SSM) +// for remote debugging (https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html) +// . +type RemoteDebugConfig struct { + + // If set to True, enables remote debugging. + EnableRemoteDebug *bool + + noSmithyDocumentSerde +} + +// Configuration for remote debugging for the UpdateTrainingJob (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateTrainingJob.html) +// API. To learn more about the remote debugging functionality of SageMaker, see +// Access a training container through Amazon Web Services Systems Manager (SSM) +// for remote debugging (https://docs.aws.amazon.com/sagemaker/latest/dg/train-remote-debugging.html) +// . +type RemoteDebugConfigForUpdate struct { + + // If set to True, enables remote debugging. + EnableRemoteDebug *bool + + noSmithyDocumentSerde +} + // Contains input values for a task. type RenderableTask struct { @@ -13662,7 +13688,6 @@ type SecondaryStatusTransition struct { // - Launched instance was unhealthy, replacing it! // - Preparing the instances for training. // Training - // - Downloading the training image. // - Training image download completed. Training in progress. // Status messages are subject to change. Therefore, we recommend not including // them in code that programmatically initiates actions. For examples, don't use @@ -16093,6 +16118,19 @@ type Vertex struct { noSmithyDocumentSerde } +// The list of key-value pairs that you specify for your resources. +type VisibilityConditions struct { + + // The key for that specifies the tag that you're using to filter the search + // results. The key must start with Tags. . + Key *string + + // The value for the tag that you're using to filter the search results. + Value *string + + noSmithyDocumentSerde +} + // Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, // hosted models, and compute resources have access to. You can control access to // and from your resources by configuring a VPC. For more information, see Give diff --git a/service/sagemakermetrics/internal/endpoints/endpoints.go b/service/sagemakermetrics/internal/endpoints/endpoints.go index 7b759afa7ad..a0df18e42b3 100644 --- a/service/sagemakermetrics/internal/endpoints/endpoints.go +++ b/service/sagemakermetrics/internal/endpoints/endpoints.go @@ -175,6 +175,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, diff --git a/service/sagemakerruntime/internal/endpoints/endpoints.go b/service/sagemakerruntime/internal/endpoints/endpoints.go index 6ef0a8cbc44..2f245613c1c 100644 --- a/service/sagemakerruntime/internal/endpoints/endpoints.go +++ b/service/sagemakerruntime/internal/endpoints/endpoints.go @@ -175,6 +175,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{},