diff --git a/.changelog/020510a9828a4c4d8e96d917714e2c13.json b/.changelog/020510a9828a4c4d8e96d917714e2c13.json new file mode 100644 index 00000000000..2eefd050f10 --- /dev/null +++ b/.changelog/020510a9828a4c4d8e96d917714e2c13.json @@ -0,0 +1,8 @@ +{ + "id": "020510a9-828a-4c4d-8e96-d917714e2c13", + "type": "feature", + "description": "Add MacOs ec2 platform support", + "modules": [ + "service/inspector2" + ] +} \ No newline at end of file diff --git a/.changelog/14b18d8e28244a0aa6c8e383e86a7ad1.json b/.changelog/14b18d8e28244a0aa6c8e383e86a7ad1.json new file mode 100644 index 00000000000..d0de4d7a0a0 --- /dev/null +++ b/.changelog/14b18d8e28244a0aa6c8e383e86a7ad1.json @@ -0,0 +1,8 @@ +{ + "id": "14b18d8e-2824-4a0a-a6c8-e383e86a7ad1", + "type": "feature", + "description": "This release introduces a new limit to the awsAccounts parameter. When you create or update an assessment, there is now a limit of 200 AWS accounts that can be specified in the assessment scope.", + "modules": [ + "service/auditmanager" + ] +} \ No newline at end of file diff --git a/.changelog/2f2403fb26b745efaeed6b5d11fd8b19.json b/.changelog/2f2403fb26b745efaeed6b5d11fd8b19.json new file mode 100644 index 00000000000..67217ec57fe --- /dev/null +++ b/.changelog/2f2403fb26b745efaeed6b5d11fd8b19.json @@ -0,0 +1,8 @@ +{ + "id": "2f2403fb-26b7-45ef-aeed-6b5d11fd8b19", + "type": "feature", + "description": "Add enums for resource types supported by Config", + "modules": [ + "service/configservice" + ] +} \ No newline at end of file diff --git a/.changelog/33962bb83c4242aeac6570dd033ecc63.json b/.changelog/33962bb83c4242aeac6570dd033ecc63.json new file mode 100644 index 00000000000..60c6be55669 --- /dev/null +++ b/.changelog/33962bb83c4242aeac6570dd033ecc63.json @@ -0,0 +1,8 @@ +{ + "id": "33962bb8-3c42-42ae-ac65-70dd033ecc63", + "type": "feature", + "description": "Amazon Rekognition introduces support for Custom Moderation. This allows the enhancement of accuracy for detect moderation labels operations by creating custom adapters tuned on customer data.", + "modules": [ + "service/rekognition" + ] +} \ No newline at end of file diff --git a/.changelog/563630bf014945ac97cf959327844ce4.json b/.changelog/563630bf014945ac97cf959327844ce4.json new file mode 100644 index 00000000000..0c56041e33b --- /dev/null +++ b/.changelog/563630bf014945ac97cf959327844ce4.json @@ -0,0 +1,8 @@ +{ + "id": "563630bf-0149-45ac-97cf-959327844ce4", + "type": "feature", + "description": "This release adds endpoint updates for all AWS Location resource operations.", + "modules": [ + "service/location" + ] +} \ No newline at end of file diff --git a/.changelog/6200f0f3fd61492283529d6caada8def.json b/.changelog/6200f0f3fd61492283529d6caada8def.json new file mode 100644 index 00000000000..c34b83268b4 --- /dev/null +++ b/.changelog/6200f0f3fd61492283529d6caada8def.json @@ -0,0 +1,8 @@ +{ + "id": "6200f0f3-fd61-4922-8352-9d6caada8def", + "type": "documentation", + "description": "This release enables routing policies with Availability Zone affinity for Network Load Balancers.", + "modules": [ + "service/elasticloadbalancingv2" + ] +} \ No newline at end of file diff --git a/.changelog/62b8ff6443064351ae6f9788e89549f0.json b/.changelog/62b8ff6443064351ae6f9788e89549f0.json new file mode 100644 index 00000000000..d9daaefe0ec --- /dev/null +++ b/.changelog/62b8ff6443064351ae6f9788e89549f0.json @@ -0,0 +1,8 @@ +{ + "id": "62b8ff64-4306-4351-ae6f-9788e89549f0", + "type": "feature", + "description": "Amazon SageMaker Canvas adds KendraSettings and DirectDeploySettings support for CanvasAppSettings", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/6f4218b9d9b347bd893314aa6819ad28.json b/.changelog/6f4218b9d9b347bd893314aa6819ad28.json new file mode 100644 index 00000000000..ea55a71f104 --- /dev/null +++ b/.changelog/6f4218b9d9b347bd893314aa6819ad28.json @@ -0,0 +1,8 @@ +{ + "id": "6f4218b9-d9b3-47bd-8933-14aa6819ad28", + "type": "feature", + "description": "Update GetParticipant to return additional metadata.", + "modules": [ + "service/ivsrealtime" + ] +} \ No newline at end of file diff --git a/.changelog/741e609d12634fe2af549ba2eb80147a.json b/.changelog/741e609d12634fe2af549ba2eb80147a.json new file mode 100644 index 00000000000..244a36e2e52 --- /dev/null +++ b/.changelog/741e609d12634fe2af549ba2eb80147a.json @@ -0,0 +1,8 @@ +{ + "id": "741e609d-1263-4fe2-af54-9ba2eb80147a", + "type": "feature", + "description": "Adds support for Lambda functions to access Dual-Stack subnets over IPv6, via an opt-in flag in CreateFunction and UpdateFunctionConfiguration APIs", + "modules": [ + "service/lambda" + ] +} \ No newline at end of file diff --git a/.changelog/9b06a5f2ff214634950db8a6f0959e95.json b/.changelog/9b06a5f2ff214634950db8a6f0959e95.json new file mode 100644 index 00000000000..be24be25d6a --- /dev/null +++ b/.changelog/9b06a5f2ff214634950db8a6f0959e95.json @@ -0,0 +1,8 @@ +{ + "id": "9b06a5f2-ff21-4634-950d-b8a6f0959e95", + "type": "documentation", + "description": "Documentation updates for Price List", + "modules": [ + "service/pricing" + ] +} \ No newline at end of file diff --git a/.changelog/af2983f094bc482a8aba18a93b1084d9.json b/.changelog/af2983f094bc482a8aba18a93b1084d9.json new file mode 100644 index 00000000000..270d504ef02 --- /dev/null +++ b/.changelog/af2983f094bc482a8aba18a93b1084d9.json @@ -0,0 +1,8 @@ +{ + "id": "af2983f0-94bc-482a-8aba-18a93b1084d9", + "type": "documentation", + "description": "Updated the CreateWorkspaces action documentation to clarify that the PCoIP protocol is only available for Windows bundles.", + "modules": [ + "service/workspaces" + ] +} \ No newline at end of file diff --git a/.changelog/b459875f87e044c28b35ee4b98742ac9.json b/.changelog/b459875f87e044c28b35ee4b98742ac9.json new file mode 100644 index 00000000000..0d88a659553 --- /dev/null +++ b/.changelog/b459875f87e044c28b35ee4b98742ac9.json @@ -0,0 +1,8 @@ +{ + "id": "b459875f-87e0-44c2-8b35-ee4b98742ac9", + "type": "feature", + "description": "This release adds Ubuntu Pro as a supported platform for On-Demand Capacity Reservations and adds support for setting an Amazon Machine Image (AMI) to disabled state. Disabling the AMI makes it private if it was previously shared, and prevents new EC2 instance launches from it.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/cc06cd42b25c426ea1467517706e9281.json b/.changelog/cc06cd42b25c426ea1467517706e9281.json new file mode 100644 index 00000000000..02632fcd630 --- /dev/null +++ b/.changelog/cc06cd42b25c426ea1467517706e9281.json @@ -0,0 +1,8 @@ +{ + "id": "cc06cd42-b25c-426e-a146-7517706e9281", + "type": "feature", + "description": "Adds sensitive trait to various shapes in Customer Profiles Calculated Attribute API model.", + "modules": [ + "service/customerprofiles" + ] +} \ No newline at end of file diff --git a/.changelog/e694a5378b4e423cb7bea234b0f0e459.json b/.changelog/e694a5378b4e423cb7bea234b0f0e459.json new file mode 100644 index 00000000000..57b7d43bf36 --- /dev/null +++ b/.changelog/e694a5378b4e423cb7bea234b0f0e459.json @@ -0,0 +1,8 @@ +{ + "id": "e694a537-8b4e-423c-b7be-a234b0f0e459", + "type": "feature", + "description": "This release marks Password field as sensitive", + "modules": [ + "service/machinelearning" + ] +} \ No newline at end of file diff --git a/.changelog/e9aa0ec6ad524f57a72d7aa9a2176871.json b/.changelog/e9aa0ec6ad524f57a72d7aa9a2176871.json new file mode 100644 index 00000000000..42fc880c63d --- /dev/null +++ b/.changelog/e9aa0ec6ad524f57a72d7aa9a2176871.json @@ -0,0 +1,8 @@ +{ + "id": "e9aa0ec6-ad52-4f57-a72d-7aa9a2176871", + "type": "feature", + "description": "This release adds 9 new APIs for adapter and adapter version management, 3 new APIs for tagging, and updates AnalyzeDocument and StartDocumentAnalysis API parameters for using adapters.", + "modules": [ + "service/textract" + ] +} \ No newline at end of file diff --git a/.changelog/ead6e6add5fa4815a5009f173eaf5270.json b/.changelog/ead6e6add5fa4815a5009f173eaf5270.json new file mode 100644 index 00000000000..4083d101c45 --- /dev/null +++ b/.changelog/ead6e6add5fa4815a5009f173eaf5270.json @@ -0,0 +1,8 @@ +{ + "id": "ead6e6ad-d5fa-4815-a500-9f173eaf5270", + "type": "feature", + "description": "Added new EnabledControl resource details to ListEnabledControls API and added new GetEnabledControl API.", + "modules": [ + "service/controltower" + ] +} \ No newline at end of file diff --git a/.changelog/eb528be1a99e41d79727573d30f590cd.json b/.changelog/eb528be1a99e41d79727573d30f590cd.json new file mode 100644 index 00000000000..00fc379cf19 --- /dev/null +++ b/.changelog/eb528be1a99e41d79727573d30f590cd.json @@ -0,0 +1,8 @@ +{ + "id": "eb528be1-a99e-41d7-9727-573d30f590cd", + "type": "feature", + "description": "Update the NotificationMetadata field to only allow visible ascii characters. Add paginators to DescribeInstanceRefreshes, DescribeLoadBalancers, and DescribeLoadBalancerTargetGroups", + "modules": [ + "service/autoscaling" + ] +} \ No newline at end of file diff --git a/.changelog/ee0ea304cbf14b1ab5381b72e72f36e2.json b/.changelog/ee0ea304cbf14b1ab5381b72e72f36e2.json new file mode 100644 index 00000000000..89da46406b5 --- /dev/null +++ b/.changelog/ee0ea304cbf14b1ab5381b72e72f36e2.json @@ -0,0 +1,8 @@ +{ + "id": "ee0ea304-cbf1-4b1a-b538-1b72e72f36e2", + "type": "feature", + "description": "Extending version control support to GitLab and Bitbucket from AWSGlue", + "modules": [ + "service/glue" + ] +} \ No newline at end of file diff --git a/.changelog/f0798e08f0ca4e9f947d89fc10e6390a.json b/.changelog/f0798e08f0ca4e9f947d89fc10e6390a.json new file mode 100644 index 00000000000..bcc3101668c --- /dev/null +++ b/.changelog/f0798e08f0ca4e9f947d89fc10e6390a.json @@ -0,0 +1,8 @@ +{ + "id": "f0798e08-f0ca-4e9f-947d-89fc10e6390a", + "type": "feature", + "description": "This release adds support for adding a dedicated log volume to open-source RDS instances.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/.changelog/f7451f668c6a4ef18eb45dd71dc324ee.json b/.changelog/f7451f668c6a4ef18eb45dd71dc324ee.json new file mode 100644 index 00000000000..acf9245e306 --- /dev/null +++ b/.changelog/f7451f668c6a4ef18eb45dd71dc324ee.json @@ -0,0 +1,8 @@ +{ + "id": "f7451f66-8c6a-4ef1-8eb4-5dd71dc324ee", + "type": "feature", + "description": "This release is to enable m4a format to customers", + "modules": [ + "service/transcribe" + ] +} \ No newline at end of file diff --git a/service/autoscaling/api_op_DescribeInstanceRefreshes.go b/service/autoscaling/api_op_DescribeInstanceRefreshes.go index a1ad04fc2f4..4d49fcee034 100644 --- a/service/autoscaling/api_op_DescribeInstanceRefreshes.go +++ b/service/autoscaling/api_op_DescribeInstanceRefreshes.go @@ -156,6 +156,99 @@ func (c *Client) addOperationDescribeInstanceRefreshesMiddlewares(stack *middlew return nil } +// DescribeInstanceRefreshesAPIClient is a client that implements the +// DescribeInstanceRefreshes operation. +type DescribeInstanceRefreshesAPIClient interface { + DescribeInstanceRefreshes(context.Context, *DescribeInstanceRefreshesInput, ...func(*Options)) (*DescribeInstanceRefreshesOutput, error) +} + +var _ DescribeInstanceRefreshesAPIClient = (*Client)(nil) + +// DescribeInstanceRefreshesPaginatorOptions is the paginator options for +// DescribeInstanceRefreshes +type DescribeInstanceRefreshesPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100 . + 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 +} + +// DescribeInstanceRefreshesPaginator is a paginator for DescribeInstanceRefreshes +type DescribeInstanceRefreshesPaginator struct { + options DescribeInstanceRefreshesPaginatorOptions + client DescribeInstanceRefreshesAPIClient + params *DescribeInstanceRefreshesInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceRefreshesPaginator returns a new +// DescribeInstanceRefreshesPaginator +func NewDescribeInstanceRefreshesPaginator(client DescribeInstanceRefreshesAPIClient, params *DescribeInstanceRefreshesInput, optFns ...func(*DescribeInstanceRefreshesPaginatorOptions)) *DescribeInstanceRefreshesPaginator { + if params == nil { + params = &DescribeInstanceRefreshesInput{} + } + + options := DescribeInstanceRefreshesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeInstanceRefreshesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceRefreshesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeInstanceRefreshes page. +func (p *DescribeInstanceRefreshesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceRefreshesOutput, 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.MaxRecords = limit + + result, err := p.client.DescribeInstanceRefreshes(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_opDescribeInstanceRefreshes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go b/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go index d4c398d1c08..1d8626ab7b0 100644 --- a/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go +++ b/service/autoscaling/api_op_DescribeLoadBalancerTargetGroups.go @@ -170,6 +170,100 @@ func (c *Client) addOperationDescribeLoadBalancerTargetGroupsMiddlewares(stack * return nil } +// DescribeLoadBalancerTargetGroupsAPIClient is a client that implements the +// DescribeLoadBalancerTargetGroups operation. +type DescribeLoadBalancerTargetGroupsAPIClient interface { + DescribeLoadBalancerTargetGroups(context.Context, *DescribeLoadBalancerTargetGroupsInput, ...func(*Options)) (*DescribeLoadBalancerTargetGroupsOutput, error) +} + +var _ DescribeLoadBalancerTargetGroupsAPIClient = (*Client)(nil) + +// DescribeLoadBalancerTargetGroupsPaginatorOptions is the paginator options for +// DescribeLoadBalancerTargetGroups +type DescribeLoadBalancerTargetGroupsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 100 + // and the maximum value is 100 . + 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 +} + +// DescribeLoadBalancerTargetGroupsPaginator is a paginator for +// DescribeLoadBalancerTargetGroups +type DescribeLoadBalancerTargetGroupsPaginator struct { + options DescribeLoadBalancerTargetGroupsPaginatorOptions + client DescribeLoadBalancerTargetGroupsAPIClient + params *DescribeLoadBalancerTargetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeLoadBalancerTargetGroupsPaginator returns a new +// DescribeLoadBalancerTargetGroupsPaginator +func NewDescribeLoadBalancerTargetGroupsPaginator(client DescribeLoadBalancerTargetGroupsAPIClient, params *DescribeLoadBalancerTargetGroupsInput, optFns ...func(*DescribeLoadBalancerTargetGroupsPaginatorOptions)) *DescribeLoadBalancerTargetGroupsPaginator { + if params == nil { + params = &DescribeLoadBalancerTargetGroupsInput{} + } + + options := DescribeLoadBalancerTargetGroupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeLoadBalancerTargetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLoadBalancerTargetGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeLoadBalancerTargetGroups page. +func (p *DescribeLoadBalancerTargetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLoadBalancerTargetGroupsOutput, 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.MaxRecords = limit + + result, err := p.client.DescribeLoadBalancerTargetGroups(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_opDescribeLoadBalancerTargetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeLoadBalancers.go b/service/autoscaling/api_op_DescribeLoadBalancers.go index 91d958e668c..6fd9e8ebcb6 100644 --- a/service/autoscaling/api_op_DescribeLoadBalancers.go +++ b/service/autoscaling/api_op_DescribeLoadBalancers.go @@ -168,6 +168,98 @@ func (c *Client) addOperationDescribeLoadBalancersMiddlewares(stack *middleware. return nil } +// DescribeLoadBalancersAPIClient is a client that implements the +// DescribeLoadBalancers operation. +type DescribeLoadBalancersAPIClient interface { + DescribeLoadBalancers(context.Context, *DescribeLoadBalancersInput, ...func(*Options)) (*DescribeLoadBalancersOutput, error) +} + +var _ DescribeLoadBalancersAPIClient = (*Client)(nil) + +// DescribeLoadBalancersPaginatorOptions is the paginator options for +// DescribeLoadBalancers +type DescribeLoadBalancersPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 100 + // and the maximum value is 100 . + 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 +} + +// DescribeLoadBalancersPaginator is a paginator for DescribeLoadBalancers +type DescribeLoadBalancersPaginator struct { + options DescribeLoadBalancersPaginatorOptions + client DescribeLoadBalancersAPIClient + params *DescribeLoadBalancersInput + nextToken *string + firstPage bool +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + if params == nil { + params = &DescribeLoadBalancersInput{} + } + + options := DescribeLoadBalancersPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeLoadBalancersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLoadBalancersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeLoadBalancers page. +func (p *DescribeLoadBalancersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLoadBalancersOutput, 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.MaxRecords = limit + + result, err := p.client.DescribeLoadBalancers(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_opDescribeLoadBalancers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/api_op_GetResourceConfigHistory.go b/service/configservice/api_op_GetResourceConfigHistory.go index 381840d2ffd..d5df2c5252b 100644 --- a/service/configservice/api_op_GetResourceConfigHistory.go +++ b/service/configservice/api_op_GetResourceConfigHistory.go @@ -17,7 +17,10 @@ import ( "time" ) -// Returns a list of ConfigurationItems for the specified resource. The list +// For accurate reporting on the compliance status, you must record the +// AWS::Config::ResourceCompliance resource type. For more information, see +// Selecting Which Resources Config Records (https://docs.aws.amazon.com/config/latest/developerguide/select-resources.html) +// . Returns a list of ConfigurationItems for the specified resource. The list // contains details about each state of the resource during the specified time // interval. If you specified a retention period to retain your ConfigurationItems // between a minimum of 30 days and a maximum of 7 years (2557 days), Config @@ -61,13 +64,13 @@ type GetResourceConfigHistoryInput struct { // are listed in reverse chronological order. ChronologicalOrder types.ChronologicalOrder - // The time stamp that indicates an earlier time. If not specified, the action - // returns paginated results that contain configuration items that start when the - // first configuration item was recorded. + // The chronologically earliest time in the time range for which the history + // requested. If not specified, the action returns paginated results that contain + // configuration items that start when the first configuration item was recorded. EarlierTime *time.Time - // The time stamp that indicates a later time. If not specified, current time is - // taken. + // The chronologically latest time in the time range for which the history + // requested. If not specified, current time is taken. LaterTime *time.Time // The maximum number of configuration items returned on each page. The default is diff --git a/service/configservice/api_op_PutConformancePack.go b/service/configservice/api_op_PutConformancePack.go index 8f3322512ef..8ed8b000c55 100644 --- a/service/configservice/api_op_PutConformancePack.go +++ b/service/configservice/api_op_PutConformancePack.go @@ -67,7 +67,10 @@ type PutConformancePackInput struct { // The location of the file containing the template body ( s3://bucketname/prefix // ). The uri must point to a conformance pack template (max size: 300 KB) that is // located in an Amazon S3 bucket in the same Region as the conformance pack. You - // must have access to read Amazon S3 bucket. + // must have access to read Amazon S3 bucket. In addition, in order to ensure a + // successful deployment, the template object must not be in an archived storage + // class (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html) + // if this parameter is passed. TemplateS3Uri *string // An object of type TemplateSSMDocumentDetails , which contains the name or the diff --git a/service/configservice/api_op_PutDeliveryChannel.go b/service/configservice/api_op_PutDeliveryChannel.go index 2d9553caabe..884263d090e 100644 --- a/service/configservice/api_op_PutDeliveryChannel.go +++ b/service/configservice/api_op_PutDeliveryChannel.go @@ -16,15 +16,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a delivery channel object to deliver configuration information to an -// Amazon S3 bucket and Amazon SNS topic. Before you can create a delivery channel, -// you must create a configuration recorder. You can use this action to change the -// Amazon S3 bucket or an Amazon SNS topic of the existing delivery channel. To -// change the Amazon S3 bucket or an Amazon SNS topic, call this action and specify -// the changed values for the S3 bucket and the SNS topic. If you specify a -// different value for either the S3 bucket or the SNS topic, this action will keep -// the existing value for the parameter that is not changed. You can have only one -// delivery channel per region in your account. +// Creates a delivery channel object to deliver configuration information and +// other compliance information to an Amazon S3 bucket and Amazon SNS topic. For +// more information, see Notifications that Config Sends to an Amazon SNS topic (https://docs.aws.amazon.com/config/latest/developerguide/notifications-for-AWS-Config.html) +// . Before you can create a delivery channel, you must create a configuration +// recorder. You can use this action to change the Amazon S3 bucket or an Amazon +// SNS topic of the existing delivery channel. To change the Amazon S3 bucket or an +// Amazon SNS topic, call this action and specify the changed values for the S3 +// bucket and the SNS topic. If you specify a different value for either the S3 +// bucket or the SNS topic, this action will keep the existing value for the +// parameter that is not changed. You can have only one delivery channel per region +// in your account. func (c *Client) PutDeliveryChannel(ctx context.Context, params *PutDeliveryChannelInput, optFns ...func(*Options)) (*PutDeliveryChannelOutput, error) { if params == nil { params = &PutDeliveryChannelInput{} diff --git a/service/configservice/api_op_PutOrganizationConformancePack.go b/service/configservice/api_op_PutOrganizationConformancePack.go index 001480c43e5..994e77168c8 100644 --- a/service/configservice/api_op_PutOrganizationConformancePack.go +++ b/service/configservice/api_op_PutOrganizationConformancePack.go @@ -82,7 +82,9 @@ type PutOrganizationConformancePackInput struct { // Location of file containing the template body. The uri must point to the // conformance pack template (max size: 300 KB). You must have access to read - // Amazon S3 bucket. + // Amazon S3 bucket. In addition, in order to ensure a successful deployment, the + // template object must not be in an archived storage class (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html) + // if this parameter is passed. TemplateS3Uri *string noSmithyDocumentSerde diff --git a/service/configservice/types/enums.go b/service/configservice/types/enums.go index 296b7ecdbdd..b2d5451c6e8 100644 --- a/service/configservice/types/enums.go +++ b/service/configservice/types/enums.go @@ -658,359 +658,378 @@ type ResourceType string // Enum values for ResourceType const ( - ResourceTypeCustomerGateway ResourceType = "AWS::EC2::CustomerGateway" - ResourceTypeEip ResourceType = "AWS::EC2::EIP" - ResourceTypeHost ResourceType = "AWS::EC2::Host" - ResourceTypeInstance ResourceType = "AWS::EC2::Instance" - ResourceTypeInternetGateway ResourceType = "AWS::EC2::InternetGateway" - ResourceTypeNetworkAcl ResourceType = "AWS::EC2::NetworkAcl" - ResourceTypeNetworkInterface ResourceType = "AWS::EC2::NetworkInterface" - ResourceTypeRouteTable ResourceType = "AWS::EC2::RouteTable" - ResourceTypeSecurityGroup ResourceType = "AWS::EC2::SecurityGroup" - ResourceTypeSubnet ResourceType = "AWS::EC2::Subnet" - ResourceTypeTrail ResourceType = "AWS::CloudTrail::Trail" - ResourceTypeVolume ResourceType = "AWS::EC2::Volume" - ResourceTypeVpc ResourceType = "AWS::EC2::VPC" - ResourceTypeVPNConnection ResourceType = "AWS::EC2::VPNConnection" - ResourceTypeVPNGateway ResourceType = "AWS::EC2::VPNGateway" - ResourceTypeRegisteredHAInstance ResourceType = "AWS::EC2::RegisteredHAInstance" - ResourceTypeNatGateway ResourceType = "AWS::EC2::NatGateway" - ResourceTypeEgressOnlyInternetGateway ResourceType = "AWS::EC2::EgressOnlyInternetGateway" - ResourceTypeVPCEndpoint ResourceType = "AWS::EC2::VPCEndpoint" - ResourceTypeVPCEndpointService ResourceType = "AWS::EC2::VPCEndpointService" - ResourceTypeFlowLog ResourceType = "AWS::EC2::FlowLog" - ResourceTypeVPCPeeringConnection ResourceType = "AWS::EC2::VPCPeeringConnection" - ResourceTypeDomain ResourceType = "AWS::Elasticsearch::Domain" - ResourceTypeGroup ResourceType = "AWS::IAM::Group" - ResourceTypePolicy ResourceType = "AWS::IAM::Policy" - ResourceTypeRole ResourceType = "AWS::IAM::Role" - ResourceTypeUser ResourceType = "AWS::IAM::User" - ResourceTypeLoadBalancerV2 ResourceType = "AWS::ElasticLoadBalancingV2::LoadBalancer" - ResourceTypeCertificate ResourceType = "AWS::ACM::Certificate" - ResourceTypeDBInstance ResourceType = "AWS::RDS::DBInstance" - ResourceTypeDBSubnetGroup ResourceType = "AWS::RDS::DBSubnetGroup" - ResourceTypeDBSecurityGroup ResourceType = "AWS::RDS::DBSecurityGroup" - ResourceTypeDBSnapshot ResourceType = "AWS::RDS::DBSnapshot" - ResourceTypeDBCluster ResourceType = "AWS::RDS::DBCluster" - ResourceTypeDBClusterSnapshot ResourceType = "AWS::RDS::DBClusterSnapshot" - ResourceTypeEventSubscription ResourceType = "AWS::RDS::EventSubscription" - ResourceTypeBucket ResourceType = "AWS::S3::Bucket" - ResourceTypeAccountPublicAccessBlock ResourceType = "AWS::S3::AccountPublicAccessBlock" - ResourceTypeCluster ResourceType = "AWS::Redshift::Cluster" - ResourceTypeClusterSnapshot ResourceType = "AWS::Redshift::ClusterSnapshot" - ResourceTypeClusterParameterGroup ResourceType = "AWS::Redshift::ClusterParameterGroup" - ResourceTypeClusterSecurityGroup ResourceType = "AWS::Redshift::ClusterSecurityGroup" - ResourceTypeClusterSubnetGroup ResourceType = "AWS::Redshift::ClusterSubnetGroup" - ResourceTypeRedshiftEventSubscription ResourceType = "AWS::Redshift::EventSubscription" - ResourceTypeManagedInstanceInventory ResourceType = "AWS::SSM::ManagedInstanceInventory" - ResourceTypeAlarm ResourceType = "AWS::CloudWatch::Alarm" - ResourceTypeStack ResourceType = "AWS::CloudFormation::Stack" - ResourceTypeLoadBalancer ResourceType = "AWS::ElasticLoadBalancing::LoadBalancer" - ResourceTypeAutoScalingGroup ResourceType = "AWS::AutoScaling::AutoScalingGroup" - ResourceTypeLaunchConfiguration ResourceType = "AWS::AutoScaling::LaunchConfiguration" - ResourceTypeScalingPolicy ResourceType = "AWS::AutoScaling::ScalingPolicy" - ResourceTypeScheduledAction ResourceType = "AWS::AutoScaling::ScheduledAction" - ResourceTypeTable ResourceType = "AWS::DynamoDB::Table" - ResourceTypeProject ResourceType = "AWS::CodeBuild::Project" - ResourceTypeRateBasedRule ResourceType = "AWS::WAF::RateBasedRule" - ResourceTypeRule ResourceType = "AWS::WAF::Rule" - ResourceTypeRuleGroup ResourceType = "AWS::WAF::RuleGroup" - ResourceTypeWebACL ResourceType = "AWS::WAF::WebACL" - ResourceTypeRegionalRateBasedRule ResourceType = "AWS::WAFRegional::RateBasedRule" - ResourceTypeRegionalRule ResourceType = "AWS::WAFRegional::Rule" - ResourceTypeRegionalRuleGroup ResourceType = "AWS::WAFRegional::RuleGroup" - ResourceTypeRegionalWebACL ResourceType = "AWS::WAFRegional::WebACL" - ResourceTypeDistribution ResourceType = "AWS::CloudFront::Distribution" - ResourceTypeStreamingDistribution ResourceType = "AWS::CloudFront::StreamingDistribution" - ResourceTypeFunction ResourceType = "AWS::Lambda::Function" - ResourceTypeNetworkFirewallFirewall ResourceType = "AWS::NetworkFirewall::Firewall" - ResourceTypeNetworkFirewallFirewallPolicy ResourceType = "AWS::NetworkFirewall::FirewallPolicy" - ResourceTypeNetworkFirewallRuleGroup ResourceType = "AWS::NetworkFirewall::RuleGroup" - ResourceTypeApplication ResourceType = "AWS::ElasticBeanstalk::Application" - ResourceTypeApplicationVersion ResourceType = "AWS::ElasticBeanstalk::ApplicationVersion" - ResourceTypeEnvironment ResourceType = "AWS::ElasticBeanstalk::Environment" - ResourceTypeWebACLV2 ResourceType = "AWS::WAFv2::WebACL" - ResourceTypeRuleGroupV2 ResourceType = "AWS::WAFv2::RuleGroup" - ResourceTypeIPSetV2 ResourceType = "AWS::WAFv2::IPSet" - ResourceTypeRegexPatternSetV2 ResourceType = "AWS::WAFv2::RegexPatternSet" - ResourceTypeManagedRuleSetV2 ResourceType = "AWS::WAFv2::ManagedRuleSet" - ResourceTypeEncryptionConfig ResourceType = "AWS::XRay::EncryptionConfig" - ResourceTypeAssociationCompliance ResourceType = "AWS::SSM::AssociationCompliance" - ResourceTypePatchCompliance ResourceType = "AWS::SSM::PatchCompliance" - ResourceTypeProtection ResourceType = "AWS::Shield::Protection" - ResourceTypeRegionalProtection ResourceType = "AWS::ShieldRegional::Protection" - ResourceTypeConformancePackCompliance ResourceType = "AWS::Config::ConformancePackCompliance" - ResourceTypeResourceCompliance ResourceType = "AWS::Config::ResourceCompliance" - ResourceTypeStage ResourceType = "AWS::ApiGateway::Stage" - ResourceTypeRestApi ResourceType = "AWS::ApiGateway::RestApi" - ResourceTypeStageV2 ResourceType = "AWS::ApiGatewayV2::Stage" - ResourceTypeApi ResourceType = "AWS::ApiGatewayV2::Api" - ResourceTypePipeline ResourceType = "AWS::CodePipeline::Pipeline" - ResourceTypeCloudFormationProvisionedProduct ResourceType = "AWS::ServiceCatalog::CloudFormationProvisionedProduct" - ResourceTypeCloudFormationProduct ResourceType = "AWS::ServiceCatalog::CloudFormationProduct" - ResourceTypePortfolio ResourceType = "AWS::ServiceCatalog::Portfolio" - ResourceTypeQueue ResourceType = "AWS::SQS::Queue" - ResourceTypeKey ResourceType = "AWS::KMS::Key" - ResourceTypeQLDBLedger ResourceType = "AWS::QLDB::Ledger" - ResourceTypeSecret ResourceType = "AWS::SecretsManager::Secret" - ResourceTypeTopic ResourceType = "AWS::SNS::Topic" - ResourceTypeFileData ResourceType = "AWS::SSM::FileData" - ResourceTypeBackupPlan ResourceType = "AWS::Backup::BackupPlan" - ResourceTypeBackupSelection ResourceType = "AWS::Backup::BackupSelection" - ResourceTypeBackupVault ResourceType = "AWS::Backup::BackupVault" - ResourceTypeBackupRecoveryPoint ResourceType = "AWS::Backup::RecoveryPoint" - ResourceTypeECRRepository ResourceType = "AWS::ECR::Repository" - ResourceTypeECSCluster ResourceType = "AWS::ECS::Cluster" - ResourceTypeECSService ResourceType = "AWS::ECS::Service" - ResourceTypeECSTaskDefinition ResourceType = "AWS::ECS::TaskDefinition" - ResourceTypeEFSAccessPoint ResourceType = "AWS::EFS::AccessPoint" - ResourceTypeEFSFileSystem ResourceType = "AWS::EFS::FileSystem" - ResourceTypeEKSCluster ResourceType = "AWS::EKS::Cluster" - ResourceTypeOpenSearchDomain ResourceType = "AWS::OpenSearch::Domain" - ResourceTypeTransitGateway ResourceType = "AWS::EC2::TransitGateway" - ResourceTypeKinesisStream ResourceType = "AWS::Kinesis::Stream" - ResourceTypeKinesisStreamConsumer ResourceType = "AWS::Kinesis::StreamConsumer" - ResourceTypeCodeDeployApplication ResourceType = "AWS::CodeDeploy::Application" - ResourceTypeCodeDeployDeploymentConfig ResourceType = "AWS::CodeDeploy::DeploymentConfig" - ResourceTypeCodeDeployDeploymentGroup ResourceType = "AWS::CodeDeploy::DeploymentGroup" - ResourceTypeLaunchTemplate ResourceType = "AWS::EC2::LaunchTemplate" - ResourceTypeECRPublicRepository ResourceType = "AWS::ECR::PublicRepository" - ResourceTypeGuardDutyDetector ResourceType = "AWS::GuardDuty::Detector" - ResourceTypeEMRSecurityConfiguration ResourceType = "AWS::EMR::SecurityConfiguration" - ResourceTypeSageMakerCodeRepository ResourceType = "AWS::SageMaker::CodeRepository" - ResourceTypeRoute53ResolverResolverEndpoint ResourceType = "AWS::Route53Resolver::ResolverEndpoint" - ResourceTypeRoute53ResolverResolverRule ResourceType = "AWS::Route53Resolver::ResolverRule" - ResourceTypeRoute53ResolverResolverRuleAssociation ResourceType = "AWS::Route53Resolver::ResolverRuleAssociation" - ResourceTypeDMSReplicationSubnetGroup ResourceType = "AWS::DMS::ReplicationSubnetGroup" - ResourceTypeDMSEventSubscription ResourceType = "AWS::DMS::EventSubscription" - ResourceTypeMSKCluster ResourceType = "AWS::MSK::Cluster" - ResourceTypeStepFunctionsActivity ResourceType = "AWS::StepFunctions::Activity" - ResourceTypeWorkSpacesWorkspace ResourceType = "AWS::WorkSpaces::Workspace" - ResourceTypeWorkSpacesConnectionAlias ResourceType = "AWS::WorkSpaces::ConnectionAlias" - ResourceTypeSageMakerModel ResourceType = "AWS::SageMaker::Model" - ResourceTypeListenerV2 ResourceType = "AWS::ElasticLoadBalancingV2::Listener" - ResourceTypeStepFunctionsStateMachine ResourceType = "AWS::StepFunctions::StateMachine" - ResourceTypeBatchJobQueue ResourceType = "AWS::Batch::JobQueue" - ResourceTypeBatchComputeEnvironment ResourceType = "AWS::Batch::ComputeEnvironment" - ResourceTypeAccessAnalyzerAnalyzer ResourceType = "AWS::AccessAnalyzer::Analyzer" - ResourceTypeAthenaWorkGroup ResourceType = "AWS::Athena::WorkGroup" - ResourceTypeAthenaDataCatalog ResourceType = "AWS::Athena::DataCatalog" - ResourceTypeDetectiveGraph ResourceType = "AWS::Detective::Graph" - ResourceTypeGlobalAcceleratorAccelerator ResourceType = "AWS::GlobalAccelerator::Accelerator" - ResourceTypeGlobalAcceleratorEndpointGroup ResourceType = "AWS::GlobalAccelerator::EndpointGroup" - ResourceTypeGlobalAcceleratorListener ResourceType = "AWS::GlobalAccelerator::Listener" - ResourceTypeTransitGatewayAttachment ResourceType = "AWS::EC2::TransitGatewayAttachment" - ResourceTypeTransitGatewayRouteTable ResourceType = "AWS::EC2::TransitGatewayRouteTable" - ResourceTypeDMSCertificate ResourceType = "AWS::DMS::Certificate" - ResourceTypeAppConfigApplication ResourceType = "AWS::AppConfig::Application" - ResourceTypeAppSyncGraphQLApi ResourceType = "AWS::AppSync::GraphQLApi" - ResourceTypeDataSyncLocationSMB ResourceType = "AWS::DataSync::LocationSMB" - ResourceTypeDataSyncLocationFSxLustre ResourceType = "AWS::DataSync::LocationFSxLustre" - ResourceTypeDataSyncLocationS3 ResourceType = "AWS::DataSync::LocationS3" - ResourceTypeDataSyncLocationEFS ResourceType = "AWS::DataSync::LocationEFS" - ResourceTypeDataSyncTask ResourceType = "AWS::DataSync::Task" - ResourceTypeDataSyncLocationNFS ResourceType = "AWS::DataSync::LocationNFS" - ResourceTypeNetworkInsightsAccessScopeAnalysis ResourceType = "AWS::EC2::NetworkInsightsAccessScopeAnalysis" - ResourceTypeEKSFargateProfile ResourceType = "AWS::EKS::FargateProfile" - ResourceTypeGlueJob ResourceType = "AWS::Glue::Job" - ResourceTypeGuardDutyThreatIntelSet ResourceType = "AWS::GuardDuty::ThreatIntelSet" - ResourceTypeGuardDutyIPSet ResourceType = "AWS::GuardDuty::IPSet" - ResourceTypeSageMakerWorkteam ResourceType = "AWS::SageMaker::Workteam" - ResourceTypeSageMakerNotebookInstanceLifecycleConfig ResourceType = "AWS::SageMaker::NotebookInstanceLifecycleConfig" - ResourceTypeServiceDiscoveryService ResourceType = "AWS::ServiceDiscovery::Service" - ResourceTypeServiceDiscoveryPublicDnsNamespace ResourceType = "AWS::ServiceDiscovery::PublicDnsNamespace" - ResourceTypeSESContactList ResourceType = "AWS::SES::ContactList" - ResourceTypeSESConfigurationSet ResourceType = "AWS::SES::ConfigurationSet" - ResourceTypeRoute53HostedZone ResourceType = "AWS::Route53::HostedZone" - ResourceTypeIoTEventsInput ResourceType = "AWS::IoTEvents::Input" - ResourceTypeIoTEventsDetectorModel ResourceType = "AWS::IoTEvents::DetectorModel" - ResourceTypeIoTEventsAlarmModel ResourceType = "AWS::IoTEvents::AlarmModel" - ResourceTypeServiceDiscoveryHttpNamespace ResourceType = "AWS::ServiceDiscovery::HttpNamespace" - ResourceTypeEventsEventBus ResourceType = "AWS::Events::EventBus" - ResourceTypeImageBuilderContainerRecipe ResourceType = "AWS::ImageBuilder::ContainerRecipe" - ResourceTypeImageBuilderDistributionConfiguration ResourceType = "AWS::ImageBuilder::DistributionConfiguration" - ResourceTypeImageBuilderInfrastructureConfiguration ResourceType = "AWS::ImageBuilder::InfrastructureConfiguration" - ResourceTypeDataSyncLocationObjectStorage ResourceType = "AWS::DataSync::LocationObjectStorage" - ResourceTypeDataSyncLocationHDFS ResourceType = "AWS::DataSync::LocationHDFS" - ResourceTypeGlueClassifier ResourceType = "AWS::Glue::Classifier" - ResourceTypeRoute53RecoveryReadinessCell ResourceType = "AWS::Route53RecoveryReadiness::Cell" - ResourceTypeRoute53RecoveryReadinessReadinessCheck ResourceType = "AWS::Route53RecoveryReadiness::ReadinessCheck" - ResourceTypeECRRegistryPolicy ResourceType = "AWS::ECR::RegistryPolicy" - ResourceTypeBackupReportPlan ResourceType = "AWS::Backup::ReportPlan" - ResourceTypeLightsailCertificate ResourceType = "AWS::Lightsail::Certificate" - ResourceTypeRUMAppMonitor ResourceType = "AWS::RUM::AppMonitor" - ResourceTypeEventsEndpoint ResourceType = "AWS::Events::Endpoint" - ResourceTypeSESReceiptRuleSet ResourceType = "AWS::SES::ReceiptRuleSet" - ResourceTypeEventsArchive ResourceType = "AWS::Events::Archive" - ResourceTypeEventsApiDestination ResourceType = "AWS::Events::ApiDestination" - ResourceTypeLightsailDisk ResourceType = "AWS::Lightsail::Disk" - ResourceTypeFISExperimentTemplate ResourceType = "AWS::FIS::ExperimentTemplate" - ResourceTypeDataSyncLocationFSxWindows ResourceType = "AWS::DataSync::LocationFSxWindows" - ResourceTypeSESReceiptFilter ResourceType = "AWS::SES::ReceiptFilter" - ResourceTypeGuardDutyFilter ResourceType = "AWS::GuardDuty::Filter" - ResourceTypeSESTemplate ResourceType = "AWS::SES::Template" - ResourceTypeAmazonMQBroker ResourceType = "AWS::AmazonMQ::Broker" - ResourceTypeAppConfigEnvironment ResourceType = "AWS::AppConfig::Environment" - ResourceTypeAppConfigConfigurationProfile ResourceType = "AWS::AppConfig::ConfigurationProfile" - ResourceTypeCloud9EnvironmentEC2 ResourceType = "AWS::Cloud9::EnvironmentEC2" - ResourceTypeEventSchemasRegistry ResourceType = "AWS::EventSchemas::Registry" - ResourceTypeEventSchemasRegistryPolicy ResourceType = "AWS::EventSchemas::RegistryPolicy" - ResourceTypeEventSchemasDiscoverer ResourceType = "AWS::EventSchemas::Discoverer" - ResourceTypeFraudDetectorLabel ResourceType = "AWS::FraudDetector::Label" - ResourceTypeFraudDetectorEntityType ResourceType = "AWS::FraudDetector::EntityType" - ResourceTypeFraudDetectorVariable ResourceType = "AWS::FraudDetector::Variable" - ResourceTypeFraudDetectorOutcome ResourceType = "AWS::FraudDetector::Outcome" - ResourceTypeIoTAuthorizer ResourceType = "AWS::IoT::Authorizer" - ResourceTypeIoTSecurityProfile ResourceType = "AWS::IoT::SecurityProfile" - ResourceTypeIoTRoleAlias ResourceType = "AWS::IoT::RoleAlias" - ResourceTypeIoTDimension ResourceType = "AWS::IoT::Dimension" - ResourceTypeIoTAnalyticsDatastore ResourceType = "AWS::IoTAnalytics::Datastore" - ResourceTypeLightsailBucket ResourceType = "AWS::Lightsail::Bucket" - ResourceTypeLightsailStaticIp ResourceType = "AWS::Lightsail::StaticIp" - ResourceTypeMediaPackagePackagingGroup ResourceType = "AWS::MediaPackage::PackagingGroup" - ResourceTypeRoute53RecoveryReadinessRecoveryGroup ResourceType = "AWS::Route53RecoveryReadiness::RecoveryGroup" - ResourceTypeResilienceHubResiliencyPolicy ResourceType = "AWS::ResilienceHub::ResiliencyPolicy" - ResourceTypeTransferWorkflow ResourceType = "AWS::Transfer::Workflow" - ResourceTypeEKSIdentityProviderConfig ResourceType = "AWS::EKS::IdentityProviderConfig" - ResourceTypeEKSAddon ResourceType = "AWS::EKS::Addon" - ResourceTypeGlueMLTransform ResourceType = "AWS::Glue::MLTransform" - ResourceTypeIoTPolicy ResourceType = "AWS::IoT::Policy" - ResourceTypeIoTMitigationAction ResourceType = "AWS::IoT::MitigationAction" - ResourceTypeIoTTwinMakerWorkspace ResourceType = "AWS::IoTTwinMaker::Workspace" - ResourceTypeIoTTwinMakerEntity ResourceType = "AWS::IoTTwinMaker::Entity" - ResourceTypeIoTAnalyticsDataset ResourceType = "AWS::IoTAnalytics::Dataset" - ResourceTypeIoTAnalyticsPipeline ResourceType = "AWS::IoTAnalytics::Pipeline" - ResourceTypeIoTAnalyticsChannel ResourceType = "AWS::IoTAnalytics::Channel" - ResourceTypeIoTSiteWiseDashboard ResourceType = "AWS::IoTSiteWise::Dashboard" - ResourceTypeIoTSiteWiseProject ResourceType = "AWS::IoTSiteWise::Project" - ResourceTypeIoTSiteWisePortal ResourceType = "AWS::IoTSiteWise::Portal" - ResourceTypeIoTSiteWiseAssetModel ResourceType = "AWS::IoTSiteWise::AssetModel" - ResourceTypeIVSChannel ResourceType = "AWS::IVS::Channel" - ResourceTypeIVSRecordingConfiguration ResourceType = "AWS::IVS::RecordingConfiguration" - ResourceTypeIVSPlaybackKeyPair ResourceType = "AWS::IVS::PlaybackKeyPair" - ResourceTypeKinesisAnalyticsV2Application ResourceType = "AWS::KinesisAnalyticsV2::Application" - ResourceTypeRDSGlobalCluster ResourceType = "AWS::RDS::GlobalCluster" - ResourceTypeS3MultiRegionAccessPoint ResourceType = "AWS::S3::MultiRegionAccessPoint" - ResourceTypeDeviceFarmTestGridProject ResourceType = "AWS::DeviceFarm::TestGridProject" - ResourceTypeBudgetsBudgetsAction ResourceType = "AWS::Budgets::BudgetsAction" - ResourceTypeLexBot ResourceType = "AWS::Lex::Bot" - ResourceTypeCodeGuruReviewerRepositoryAssociation ResourceType = "AWS::CodeGuruReviewer::RepositoryAssociation" - ResourceTypeIoTCustomMetric ResourceType = "AWS::IoT::CustomMetric" - ResourceTypeRoute53ResolverFirewallDomainList ResourceType = "AWS::Route53Resolver::FirewallDomainList" - ResourceTypeRoboMakerRobotApplicationVersion ResourceType = "AWS::RoboMaker::RobotApplicationVersion" - ResourceTypeEC2TrafficMirrorSession ResourceType = "AWS::EC2::TrafficMirrorSession" - ResourceTypeIoTSiteWiseGateway ResourceType = "AWS::IoTSiteWise::Gateway" - ResourceTypeLexBotAlias ResourceType = "AWS::Lex::BotAlias" - ResourceTypeLookoutMetricsAlert ResourceType = "AWS::LookoutMetrics::Alert" - ResourceTypeIoTAccountAuditConfiguration ResourceType = "AWS::IoT::AccountAuditConfiguration" - ResourceTypeEC2TrafficMirrorTarget ResourceType = "AWS::EC2::TrafficMirrorTarget" - ResourceTypeS3StorageLens ResourceType = "AWS::S3::StorageLens" - ResourceTypeIoTScheduledAudit ResourceType = "AWS::IoT::ScheduledAudit" - ResourceTypeEventsConnection ResourceType = "AWS::Events::Connection" - ResourceTypeEventSchemasSchema ResourceType = "AWS::EventSchemas::Schema" - ResourceTypeMediaPackagePackagingConfiguration ResourceType = "AWS::MediaPackage::PackagingConfiguration" - ResourceTypeKinesisVideoSignalingChannel ResourceType = "AWS::KinesisVideo::SignalingChannel" - ResourceTypeAppStreamDirectoryConfig ResourceType = "AWS::AppStream::DirectoryConfig" - ResourceTypeLookoutVisionProject ResourceType = "AWS::LookoutVision::Project" - ResourceTypeRoute53RecoveryControlCluster ResourceType = "AWS::Route53RecoveryControl::Cluster" - ResourceTypeRoute53RecoveryControlSafetyRule ResourceType = "AWS::Route53RecoveryControl::SafetyRule" - ResourceTypeRoute53RecoveryControlControlPanel ResourceType = "AWS::Route53RecoveryControl::ControlPanel" - ResourceTypeRoute53RecoveryControlRoutingControl ResourceType = "AWS::Route53RecoveryControl::RoutingControl" - ResourceTypeRoute53RecoveryReadinessResourceSet ResourceType = "AWS::Route53RecoveryReadiness::ResourceSet" - ResourceTypeRoboMakerSimulationApplication ResourceType = "AWS::RoboMaker::SimulationApplication" - ResourceTypeRoboMakerRobotApplication ResourceType = "AWS::RoboMaker::RobotApplication" - ResourceTypeHealthLakeFHIRDatastore ResourceType = "AWS::HealthLake::FHIRDatastore" - ResourceTypePinpointSegment ResourceType = "AWS::Pinpoint::Segment" - ResourceTypePinpointApplicationSettings ResourceType = "AWS::Pinpoint::ApplicationSettings" - ResourceTypeEventsRule ResourceType = "AWS::Events::Rule" - ResourceTypeEC2DHCPOptions ResourceType = "AWS::EC2::DHCPOptions" - ResourceTypeEC2NetworkInsightsPath ResourceType = "AWS::EC2::NetworkInsightsPath" - ResourceTypeEC2TrafficMirrorFilter ResourceType = "AWS::EC2::TrafficMirrorFilter" - ResourceTypeEc2ipam ResourceType = "AWS::EC2::IPAM" - ResourceTypeIoTTwinMakerScene ResourceType = "AWS::IoTTwinMaker::Scene" - ResourceTypeNetworkManagerTransitGatewayRegistration ResourceType = "AWS::NetworkManager::TransitGatewayRegistration" - ResourceTypeCustomerProfilesDomain ResourceType = "AWS::CustomerProfiles::Domain" - ResourceTypeAutoScalingWarmPool ResourceType = "AWS::AutoScaling::WarmPool" - ResourceTypeConnectPhoneNumber ResourceType = "AWS::Connect::PhoneNumber" - ResourceTypeAppConfigDeploymentStrategy ResourceType = "AWS::AppConfig::DeploymentStrategy" - ResourceTypeAppFlowFlow ResourceType = "AWS::AppFlow::Flow" - ResourceTypeAuditManagerAssessment ResourceType = "AWS::AuditManager::Assessment" - ResourceTypeCloudWatchMetricStream ResourceType = "AWS::CloudWatch::MetricStream" - ResourceTypeDeviceFarmInstanceProfile ResourceType = "AWS::DeviceFarm::InstanceProfile" - ResourceTypeDeviceFarmProject ResourceType = "AWS::DeviceFarm::Project" - ResourceTypeEC2EC2Fleet ResourceType = "AWS::EC2::EC2Fleet" - ResourceTypeEC2SubnetRouteTableAssociation ResourceType = "AWS::EC2::SubnetRouteTableAssociation" - ResourceTypeECRPullThroughCacheRule ResourceType = "AWS::ECR::PullThroughCacheRule" - ResourceTypeGroundStationConfig ResourceType = "AWS::GroundStation::Config" - ResourceTypeImageBuilderImagePipeline ResourceType = "AWS::ImageBuilder::ImagePipeline" - ResourceTypeIoTFleetMetric ResourceType = "AWS::IoT::FleetMetric" - ResourceTypeIoTWirelessServiceProfile ResourceType = "AWS::IoTWireless::ServiceProfile" - ResourceTypeNetworkManagerDevice ResourceType = "AWS::NetworkManager::Device" - ResourceTypeNetworkManagerGlobalNetwork ResourceType = "AWS::NetworkManager::GlobalNetwork" - ResourceTypeNetworkManagerLink ResourceType = "AWS::NetworkManager::Link" - ResourceTypeNetworkManagerSite ResourceType = "AWS::NetworkManager::Site" - ResourceTypePanoramaPackage ResourceType = "AWS::Panorama::Package" - ResourceTypePinpointApp ResourceType = "AWS::Pinpoint::App" - ResourceTypeRedshiftScheduledAction ResourceType = "AWS::Redshift::ScheduledAction" - ResourceTypeRoute53ResolverFirewallRuleGroupAssociation ResourceType = "AWS::Route53Resolver::FirewallRuleGroupAssociation" - ResourceTypeSageMakerAppImageConfig ResourceType = "AWS::SageMaker::AppImageConfig" - ResourceTypeSageMakerImage ResourceType = "AWS::SageMaker::Image" - ResourceTypeECSTaskSet ResourceType = "AWS::ECS::TaskSet" - ResourceTypeCassandraKeyspace ResourceType = "AWS::Cassandra::Keyspace" - ResourceTypeSignerSigningProfile ResourceType = "AWS::Signer::SigningProfile" - ResourceTypeAmplifyApp ResourceType = "AWS::Amplify::App" - ResourceTypeAppMeshVirtualNode ResourceType = "AWS::AppMesh::VirtualNode" - ResourceTypeAppMeshVirtualService ResourceType = "AWS::AppMesh::VirtualService" - ResourceTypeAppRunnerVpcConnector ResourceType = "AWS::AppRunner::VpcConnector" - ResourceTypeAppStreamApplication ResourceType = "AWS::AppStream::Application" - ResourceTypeCodeArtifactRepository ResourceType = "AWS::CodeArtifact::Repository" - ResourceTypeEC2PrefixList ResourceType = "AWS::EC2::PrefixList" - ResourceTypeEC2SpotFleet ResourceType = "AWS::EC2::SpotFleet" - ResourceTypeEvidentlyProject ResourceType = "AWS::Evidently::Project" - ResourceTypeForecastDataset ResourceType = "AWS::Forecast::Dataset" - ResourceTypeIAMSAMLProvider ResourceType = "AWS::IAM::SAMLProvider" - ResourceTypeIAMServerCertificate ResourceType = "AWS::IAM::ServerCertificate" - ResourceTypePinpointCampaign ResourceType = "AWS::Pinpoint::Campaign" - ResourceTypePinpointInAppTemplate ResourceType = "AWS::Pinpoint::InAppTemplate" - ResourceTypeSageMakerDomain ResourceType = "AWS::SageMaker::Domain" - ResourceTypeTransferAgreement ResourceType = "AWS::Transfer::Agreement" - ResourceTypeTransferConnector ResourceType = "AWS::Transfer::Connector" - ResourceTypeKinesisFirehoseDeliveryStream ResourceType = "AWS::KinesisFirehose::DeliveryStream" - ResourceTypeAmplifyBranch ResourceType = "AWS::Amplify::Branch" - ResourceTypeAppIntegrationsEventIntegration ResourceType = "AWS::AppIntegrations::EventIntegration" - ResourceTypeAppMeshRoute ResourceType = "AWS::AppMesh::Route" - ResourceTypeAthenaPreparedStatement ResourceType = "AWS::Athena::PreparedStatement" - ResourceTypeEC2IPAMScope ResourceType = "AWS::EC2::IPAMScope" - ResourceTypeEvidentlyLaunch ResourceType = "AWS::Evidently::Launch" - ResourceTypeForecastDatasetGroup ResourceType = "AWS::Forecast::DatasetGroup" - ResourceTypeGreengrassV2ComponentVersion ResourceType = "AWS::GreengrassV2::ComponentVersion" - ResourceTypeGroundStationMissionProfile ResourceType = "AWS::GroundStation::MissionProfile" - ResourceTypeMediaConnectFlowEntitlement ResourceType = "AWS::MediaConnect::FlowEntitlement" - ResourceTypeMediaConnectFlowVpcInterface ResourceType = "AWS::MediaConnect::FlowVpcInterface" - ResourceTypeMediaTailorPlaybackConfiguration ResourceType = "AWS::MediaTailor::PlaybackConfiguration" - ResourceTypeMSKConfiguration ResourceType = "AWS::MSK::Configuration" - ResourceTypePersonalizeDataset ResourceType = "AWS::Personalize::Dataset" - ResourceTypePersonalizeSchema ResourceType = "AWS::Personalize::Schema" - ResourceTypePersonalizeSolution ResourceType = "AWS::Personalize::Solution" - ResourceTypePinpointEmailTemplate ResourceType = "AWS::Pinpoint::EmailTemplate" - ResourceTypePinpointEventStream ResourceType = "AWS::Pinpoint::EventStream" - ResourceTypeResilienceHubApp ResourceType = "AWS::ResilienceHub::App" - ResourceTypeACMPCACertificateAuthority ResourceType = "AWS::ACMPCA::CertificateAuthority" - ResourceTypeAppConfigHostedConfigurationVersion ResourceType = "AWS::AppConfig::HostedConfigurationVersion" - ResourceTypeAppMeshVirtualGateway ResourceType = "AWS::AppMesh::VirtualGateway" - ResourceTypeAppMeshVirtualRouter ResourceType = "AWS::AppMesh::VirtualRouter" - ResourceTypeAppRunnerService ResourceType = "AWS::AppRunner::Service" - ResourceTypeCustomerProfilesObjectType ResourceType = "AWS::CustomerProfiles::ObjectType" - ResourceTypeDMSEndpoint ResourceType = "AWS::DMS::Endpoint" - ResourceTypeEC2CapacityReservation ResourceType = "AWS::EC2::CapacityReservation" - ResourceTypeEC2ClientVpnEndpoint ResourceType = "AWS::EC2::ClientVpnEndpoint" - ResourceTypeKendraIndex ResourceType = "AWS::Kendra::Index" - ResourceTypeKinesisVideoStream ResourceType = "AWS::KinesisVideo::Stream" - ResourceTypeLogsDestination ResourceType = "AWS::Logs::Destination" - ResourceTypePinpointEmailChannel ResourceType = "AWS::Pinpoint::EmailChannel" - ResourceTypeS3AccessPoint ResourceType = "AWS::S3::AccessPoint" - ResourceTypeNetworkManagerCustomerGatewayAssociation ResourceType = "AWS::NetworkManager::CustomerGatewayAssociation" - ResourceTypeNetworkManagerLinkAssociation ResourceType = "AWS::NetworkManager::LinkAssociation" + ResourceTypeCustomerGateway ResourceType = "AWS::EC2::CustomerGateway" + ResourceTypeEip ResourceType = "AWS::EC2::EIP" + ResourceTypeHost ResourceType = "AWS::EC2::Host" + ResourceTypeInstance ResourceType = "AWS::EC2::Instance" + ResourceTypeInternetGateway ResourceType = "AWS::EC2::InternetGateway" + ResourceTypeNetworkAcl ResourceType = "AWS::EC2::NetworkAcl" + ResourceTypeNetworkInterface ResourceType = "AWS::EC2::NetworkInterface" + ResourceTypeRouteTable ResourceType = "AWS::EC2::RouteTable" + ResourceTypeSecurityGroup ResourceType = "AWS::EC2::SecurityGroup" + ResourceTypeSubnet ResourceType = "AWS::EC2::Subnet" + ResourceTypeTrail ResourceType = "AWS::CloudTrail::Trail" + ResourceTypeVolume ResourceType = "AWS::EC2::Volume" + ResourceTypeVpc ResourceType = "AWS::EC2::VPC" + ResourceTypeVPNConnection ResourceType = "AWS::EC2::VPNConnection" + ResourceTypeVPNGateway ResourceType = "AWS::EC2::VPNGateway" + ResourceTypeRegisteredHAInstance ResourceType = "AWS::EC2::RegisteredHAInstance" + ResourceTypeNatGateway ResourceType = "AWS::EC2::NatGateway" + ResourceTypeEgressOnlyInternetGateway ResourceType = "AWS::EC2::EgressOnlyInternetGateway" + ResourceTypeVPCEndpoint ResourceType = "AWS::EC2::VPCEndpoint" + ResourceTypeVPCEndpointService ResourceType = "AWS::EC2::VPCEndpointService" + ResourceTypeFlowLog ResourceType = "AWS::EC2::FlowLog" + ResourceTypeVPCPeeringConnection ResourceType = "AWS::EC2::VPCPeeringConnection" + ResourceTypeDomain ResourceType = "AWS::Elasticsearch::Domain" + ResourceTypeGroup ResourceType = "AWS::IAM::Group" + ResourceTypePolicy ResourceType = "AWS::IAM::Policy" + ResourceTypeRole ResourceType = "AWS::IAM::Role" + ResourceTypeUser ResourceType = "AWS::IAM::User" + ResourceTypeLoadBalancerV2 ResourceType = "AWS::ElasticLoadBalancingV2::LoadBalancer" + ResourceTypeCertificate ResourceType = "AWS::ACM::Certificate" + ResourceTypeDBInstance ResourceType = "AWS::RDS::DBInstance" + ResourceTypeDBSubnetGroup ResourceType = "AWS::RDS::DBSubnetGroup" + ResourceTypeDBSecurityGroup ResourceType = "AWS::RDS::DBSecurityGroup" + ResourceTypeDBSnapshot ResourceType = "AWS::RDS::DBSnapshot" + ResourceTypeDBCluster ResourceType = "AWS::RDS::DBCluster" + ResourceTypeDBClusterSnapshot ResourceType = "AWS::RDS::DBClusterSnapshot" + ResourceTypeEventSubscription ResourceType = "AWS::RDS::EventSubscription" + ResourceTypeBucket ResourceType = "AWS::S3::Bucket" + ResourceTypeAccountPublicAccessBlock ResourceType = "AWS::S3::AccountPublicAccessBlock" + ResourceTypeCluster ResourceType = "AWS::Redshift::Cluster" + ResourceTypeClusterSnapshot ResourceType = "AWS::Redshift::ClusterSnapshot" + ResourceTypeClusterParameterGroup ResourceType = "AWS::Redshift::ClusterParameterGroup" + ResourceTypeClusterSecurityGroup ResourceType = "AWS::Redshift::ClusterSecurityGroup" + ResourceTypeClusterSubnetGroup ResourceType = "AWS::Redshift::ClusterSubnetGroup" + ResourceTypeRedshiftEventSubscription ResourceType = "AWS::Redshift::EventSubscription" + ResourceTypeManagedInstanceInventory ResourceType = "AWS::SSM::ManagedInstanceInventory" + ResourceTypeAlarm ResourceType = "AWS::CloudWatch::Alarm" + ResourceTypeStack ResourceType = "AWS::CloudFormation::Stack" + ResourceTypeLoadBalancer ResourceType = "AWS::ElasticLoadBalancing::LoadBalancer" + ResourceTypeAutoScalingGroup ResourceType = "AWS::AutoScaling::AutoScalingGroup" + ResourceTypeLaunchConfiguration ResourceType = "AWS::AutoScaling::LaunchConfiguration" + ResourceTypeScalingPolicy ResourceType = "AWS::AutoScaling::ScalingPolicy" + ResourceTypeScheduledAction ResourceType = "AWS::AutoScaling::ScheduledAction" + ResourceTypeTable ResourceType = "AWS::DynamoDB::Table" + ResourceTypeProject ResourceType = "AWS::CodeBuild::Project" + ResourceTypeRateBasedRule ResourceType = "AWS::WAF::RateBasedRule" + ResourceTypeRule ResourceType = "AWS::WAF::Rule" + ResourceTypeRuleGroup ResourceType = "AWS::WAF::RuleGroup" + ResourceTypeWebACL ResourceType = "AWS::WAF::WebACL" + ResourceTypeRegionalRateBasedRule ResourceType = "AWS::WAFRegional::RateBasedRule" + ResourceTypeRegionalRule ResourceType = "AWS::WAFRegional::Rule" + ResourceTypeRegionalRuleGroup ResourceType = "AWS::WAFRegional::RuleGroup" + ResourceTypeRegionalWebACL ResourceType = "AWS::WAFRegional::WebACL" + ResourceTypeDistribution ResourceType = "AWS::CloudFront::Distribution" + ResourceTypeStreamingDistribution ResourceType = "AWS::CloudFront::StreamingDistribution" + ResourceTypeFunction ResourceType = "AWS::Lambda::Function" + ResourceTypeNetworkFirewallFirewall ResourceType = "AWS::NetworkFirewall::Firewall" + ResourceTypeNetworkFirewallFirewallPolicy ResourceType = "AWS::NetworkFirewall::FirewallPolicy" + ResourceTypeNetworkFirewallRuleGroup ResourceType = "AWS::NetworkFirewall::RuleGroup" + ResourceTypeApplication ResourceType = "AWS::ElasticBeanstalk::Application" + ResourceTypeApplicationVersion ResourceType = "AWS::ElasticBeanstalk::ApplicationVersion" + ResourceTypeEnvironment ResourceType = "AWS::ElasticBeanstalk::Environment" + ResourceTypeWebACLV2 ResourceType = "AWS::WAFv2::WebACL" + ResourceTypeRuleGroupV2 ResourceType = "AWS::WAFv2::RuleGroup" + ResourceTypeIPSetV2 ResourceType = "AWS::WAFv2::IPSet" + ResourceTypeRegexPatternSetV2 ResourceType = "AWS::WAFv2::RegexPatternSet" + ResourceTypeManagedRuleSetV2 ResourceType = "AWS::WAFv2::ManagedRuleSet" + ResourceTypeEncryptionConfig ResourceType = "AWS::XRay::EncryptionConfig" + ResourceTypeAssociationCompliance ResourceType = "AWS::SSM::AssociationCompliance" + ResourceTypePatchCompliance ResourceType = "AWS::SSM::PatchCompliance" + ResourceTypeProtection ResourceType = "AWS::Shield::Protection" + ResourceTypeRegionalProtection ResourceType = "AWS::ShieldRegional::Protection" + ResourceTypeConformancePackCompliance ResourceType = "AWS::Config::ConformancePackCompliance" + ResourceTypeResourceCompliance ResourceType = "AWS::Config::ResourceCompliance" + ResourceTypeStage ResourceType = "AWS::ApiGateway::Stage" + ResourceTypeRestApi ResourceType = "AWS::ApiGateway::RestApi" + ResourceTypeStageV2 ResourceType = "AWS::ApiGatewayV2::Stage" + ResourceTypeApi ResourceType = "AWS::ApiGatewayV2::Api" + ResourceTypePipeline ResourceType = "AWS::CodePipeline::Pipeline" + ResourceTypeCloudFormationProvisionedProduct ResourceType = "AWS::ServiceCatalog::CloudFormationProvisionedProduct" + ResourceTypeCloudFormationProduct ResourceType = "AWS::ServiceCatalog::CloudFormationProduct" + ResourceTypePortfolio ResourceType = "AWS::ServiceCatalog::Portfolio" + ResourceTypeQueue ResourceType = "AWS::SQS::Queue" + ResourceTypeKey ResourceType = "AWS::KMS::Key" + ResourceTypeQLDBLedger ResourceType = "AWS::QLDB::Ledger" + ResourceTypeSecret ResourceType = "AWS::SecretsManager::Secret" + ResourceTypeTopic ResourceType = "AWS::SNS::Topic" + ResourceTypeFileData ResourceType = "AWS::SSM::FileData" + ResourceTypeBackupPlan ResourceType = "AWS::Backup::BackupPlan" + ResourceTypeBackupSelection ResourceType = "AWS::Backup::BackupSelection" + ResourceTypeBackupVault ResourceType = "AWS::Backup::BackupVault" + ResourceTypeBackupRecoveryPoint ResourceType = "AWS::Backup::RecoveryPoint" + ResourceTypeECRRepository ResourceType = "AWS::ECR::Repository" + ResourceTypeECSCluster ResourceType = "AWS::ECS::Cluster" + ResourceTypeECSService ResourceType = "AWS::ECS::Service" + ResourceTypeECSTaskDefinition ResourceType = "AWS::ECS::TaskDefinition" + ResourceTypeEFSAccessPoint ResourceType = "AWS::EFS::AccessPoint" + ResourceTypeEFSFileSystem ResourceType = "AWS::EFS::FileSystem" + ResourceTypeEKSCluster ResourceType = "AWS::EKS::Cluster" + ResourceTypeOpenSearchDomain ResourceType = "AWS::OpenSearch::Domain" + ResourceTypeTransitGateway ResourceType = "AWS::EC2::TransitGateway" + ResourceTypeKinesisStream ResourceType = "AWS::Kinesis::Stream" + ResourceTypeKinesisStreamConsumer ResourceType = "AWS::Kinesis::StreamConsumer" + ResourceTypeCodeDeployApplication ResourceType = "AWS::CodeDeploy::Application" + ResourceTypeCodeDeployDeploymentConfig ResourceType = "AWS::CodeDeploy::DeploymentConfig" + ResourceTypeCodeDeployDeploymentGroup ResourceType = "AWS::CodeDeploy::DeploymentGroup" + ResourceTypeLaunchTemplate ResourceType = "AWS::EC2::LaunchTemplate" + ResourceTypeECRPublicRepository ResourceType = "AWS::ECR::PublicRepository" + ResourceTypeGuardDutyDetector ResourceType = "AWS::GuardDuty::Detector" + ResourceTypeEMRSecurityConfiguration ResourceType = "AWS::EMR::SecurityConfiguration" + ResourceTypeSageMakerCodeRepository ResourceType = "AWS::SageMaker::CodeRepository" + ResourceTypeRoute53ResolverResolverEndpoint ResourceType = "AWS::Route53Resolver::ResolverEndpoint" + ResourceTypeRoute53ResolverResolverRule ResourceType = "AWS::Route53Resolver::ResolverRule" + ResourceTypeRoute53ResolverResolverRuleAssociation ResourceType = "AWS::Route53Resolver::ResolverRuleAssociation" + ResourceTypeDMSReplicationSubnetGroup ResourceType = "AWS::DMS::ReplicationSubnetGroup" + ResourceTypeDMSEventSubscription ResourceType = "AWS::DMS::EventSubscription" + ResourceTypeMSKCluster ResourceType = "AWS::MSK::Cluster" + ResourceTypeStepFunctionsActivity ResourceType = "AWS::StepFunctions::Activity" + ResourceTypeWorkSpacesWorkspace ResourceType = "AWS::WorkSpaces::Workspace" + ResourceTypeWorkSpacesConnectionAlias ResourceType = "AWS::WorkSpaces::ConnectionAlias" + ResourceTypeSageMakerModel ResourceType = "AWS::SageMaker::Model" + ResourceTypeListenerV2 ResourceType = "AWS::ElasticLoadBalancingV2::Listener" + ResourceTypeStepFunctionsStateMachine ResourceType = "AWS::StepFunctions::StateMachine" + ResourceTypeBatchJobQueue ResourceType = "AWS::Batch::JobQueue" + ResourceTypeBatchComputeEnvironment ResourceType = "AWS::Batch::ComputeEnvironment" + ResourceTypeAccessAnalyzerAnalyzer ResourceType = "AWS::AccessAnalyzer::Analyzer" + ResourceTypeAthenaWorkGroup ResourceType = "AWS::Athena::WorkGroup" + ResourceTypeAthenaDataCatalog ResourceType = "AWS::Athena::DataCatalog" + ResourceTypeDetectiveGraph ResourceType = "AWS::Detective::Graph" + ResourceTypeGlobalAcceleratorAccelerator ResourceType = "AWS::GlobalAccelerator::Accelerator" + ResourceTypeGlobalAcceleratorEndpointGroup ResourceType = "AWS::GlobalAccelerator::EndpointGroup" + ResourceTypeGlobalAcceleratorListener ResourceType = "AWS::GlobalAccelerator::Listener" + ResourceTypeTransitGatewayAttachment ResourceType = "AWS::EC2::TransitGatewayAttachment" + ResourceTypeTransitGatewayRouteTable ResourceType = "AWS::EC2::TransitGatewayRouteTable" + ResourceTypeDMSCertificate ResourceType = "AWS::DMS::Certificate" + ResourceTypeAppConfigApplication ResourceType = "AWS::AppConfig::Application" + ResourceTypeAppSyncGraphQLApi ResourceType = "AWS::AppSync::GraphQLApi" + ResourceTypeDataSyncLocationSMB ResourceType = "AWS::DataSync::LocationSMB" + ResourceTypeDataSyncLocationFSxLustre ResourceType = "AWS::DataSync::LocationFSxLustre" + ResourceTypeDataSyncLocationS3 ResourceType = "AWS::DataSync::LocationS3" + ResourceTypeDataSyncLocationEFS ResourceType = "AWS::DataSync::LocationEFS" + ResourceTypeDataSyncTask ResourceType = "AWS::DataSync::Task" + ResourceTypeDataSyncLocationNFS ResourceType = "AWS::DataSync::LocationNFS" + ResourceTypeNetworkInsightsAccessScopeAnalysis ResourceType = "AWS::EC2::NetworkInsightsAccessScopeAnalysis" + ResourceTypeEKSFargateProfile ResourceType = "AWS::EKS::FargateProfile" + ResourceTypeGlueJob ResourceType = "AWS::Glue::Job" + ResourceTypeGuardDutyThreatIntelSet ResourceType = "AWS::GuardDuty::ThreatIntelSet" + ResourceTypeGuardDutyIPSet ResourceType = "AWS::GuardDuty::IPSet" + ResourceTypeSageMakerWorkteam ResourceType = "AWS::SageMaker::Workteam" + ResourceTypeSageMakerNotebookInstanceLifecycleConfig ResourceType = "AWS::SageMaker::NotebookInstanceLifecycleConfig" + ResourceTypeServiceDiscoveryService ResourceType = "AWS::ServiceDiscovery::Service" + ResourceTypeServiceDiscoveryPublicDnsNamespace ResourceType = "AWS::ServiceDiscovery::PublicDnsNamespace" + ResourceTypeSESContactList ResourceType = "AWS::SES::ContactList" + ResourceTypeSESConfigurationSet ResourceType = "AWS::SES::ConfigurationSet" + ResourceTypeRoute53HostedZone ResourceType = "AWS::Route53::HostedZone" + ResourceTypeIoTEventsInput ResourceType = "AWS::IoTEvents::Input" + ResourceTypeIoTEventsDetectorModel ResourceType = "AWS::IoTEvents::DetectorModel" + ResourceTypeIoTEventsAlarmModel ResourceType = "AWS::IoTEvents::AlarmModel" + ResourceTypeServiceDiscoveryHttpNamespace ResourceType = "AWS::ServiceDiscovery::HttpNamespace" + ResourceTypeEventsEventBus ResourceType = "AWS::Events::EventBus" + ResourceTypeImageBuilderContainerRecipe ResourceType = "AWS::ImageBuilder::ContainerRecipe" + ResourceTypeImageBuilderDistributionConfiguration ResourceType = "AWS::ImageBuilder::DistributionConfiguration" + ResourceTypeImageBuilderInfrastructureConfiguration ResourceType = "AWS::ImageBuilder::InfrastructureConfiguration" + ResourceTypeDataSyncLocationObjectStorage ResourceType = "AWS::DataSync::LocationObjectStorage" + ResourceTypeDataSyncLocationHDFS ResourceType = "AWS::DataSync::LocationHDFS" + ResourceTypeGlueClassifier ResourceType = "AWS::Glue::Classifier" + ResourceTypeRoute53RecoveryReadinessCell ResourceType = "AWS::Route53RecoveryReadiness::Cell" + ResourceTypeRoute53RecoveryReadinessReadinessCheck ResourceType = "AWS::Route53RecoveryReadiness::ReadinessCheck" + ResourceTypeECRRegistryPolicy ResourceType = "AWS::ECR::RegistryPolicy" + ResourceTypeBackupReportPlan ResourceType = "AWS::Backup::ReportPlan" + ResourceTypeLightsailCertificate ResourceType = "AWS::Lightsail::Certificate" + ResourceTypeRUMAppMonitor ResourceType = "AWS::RUM::AppMonitor" + ResourceTypeEventsEndpoint ResourceType = "AWS::Events::Endpoint" + ResourceTypeSESReceiptRuleSet ResourceType = "AWS::SES::ReceiptRuleSet" + ResourceTypeEventsArchive ResourceType = "AWS::Events::Archive" + ResourceTypeEventsApiDestination ResourceType = "AWS::Events::ApiDestination" + ResourceTypeLightsailDisk ResourceType = "AWS::Lightsail::Disk" + ResourceTypeFISExperimentTemplate ResourceType = "AWS::FIS::ExperimentTemplate" + ResourceTypeDataSyncLocationFSxWindows ResourceType = "AWS::DataSync::LocationFSxWindows" + ResourceTypeSESReceiptFilter ResourceType = "AWS::SES::ReceiptFilter" + ResourceTypeGuardDutyFilter ResourceType = "AWS::GuardDuty::Filter" + ResourceTypeSESTemplate ResourceType = "AWS::SES::Template" + ResourceTypeAmazonMQBroker ResourceType = "AWS::AmazonMQ::Broker" + ResourceTypeAppConfigEnvironment ResourceType = "AWS::AppConfig::Environment" + ResourceTypeAppConfigConfigurationProfile ResourceType = "AWS::AppConfig::ConfigurationProfile" + ResourceTypeCloud9EnvironmentEC2 ResourceType = "AWS::Cloud9::EnvironmentEC2" + ResourceTypeEventSchemasRegistry ResourceType = "AWS::EventSchemas::Registry" + ResourceTypeEventSchemasRegistryPolicy ResourceType = "AWS::EventSchemas::RegistryPolicy" + ResourceTypeEventSchemasDiscoverer ResourceType = "AWS::EventSchemas::Discoverer" + ResourceTypeFraudDetectorLabel ResourceType = "AWS::FraudDetector::Label" + ResourceTypeFraudDetectorEntityType ResourceType = "AWS::FraudDetector::EntityType" + ResourceTypeFraudDetectorVariable ResourceType = "AWS::FraudDetector::Variable" + ResourceTypeFraudDetectorOutcome ResourceType = "AWS::FraudDetector::Outcome" + ResourceTypeIoTAuthorizer ResourceType = "AWS::IoT::Authorizer" + ResourceTypeIoTSecurityProfile ResourceType = "AWS::IoT::SecurityProfile" + ResourceTypeIoTRoleAlias ResourceType = "AWS::IoT::RoleAlias" + ResourceTypeIoTDimension ResourceType = "AWS::IoT::Dimension" + ResourceTypeIoTAnalyticsDatastore ResourceType = "AWS::IoTAnalytics::Datastore" + ResourceTypeLightsailBucket ResourceType = "AWS::Lightsail::Bucket" + ResourceTypeLightsailStaticIp ResourceType = "AWS::Lightsail::StaticIp" + ResourceTypeMediaPackagePackagingGroup ResourceType = "AWS::MediaPackage::PackagingGroup" + ResourceTypeRoute53RecoveryReadinessRecoveryGroup ResourceType = "AWS::Route53RecoveryReadiness::RecoveryGroup" + ResourceTypeResilienceHubResiliencyPolicy ResourceType = "AWS::ResilienceHub::ResiliencyPolicy" + ResourceTypeTransferWorkflow ResourceType = "AWS::Transfer::Workflow" + ResourceTypeEKSIdentityProviderConfig ResourceType = "AWS::EKS::IdentityProviderConfig" + ResourceTypeEKSAddon ResourceType = "AWS::EKS::Addon" + ResourceTypeGlueMLTransform ResourceType = "AWS::Glue::MLTransform" + ResourceTypeIoTPolicy ResourceType = "AWS::IoT::Policy" + ResourceTypeIoTMitigationAction ResourceType = "AWS::IoT::MitigationAction" + ResourceTypeIoTTwinMakerWorkspace ResourceType = "AWS::IoTTwinMaker::Workspace" + ResourceTypeIoTTwinMakerEntity ResourceType = "AWS::IoTTwinMaker::Entity" + ResourceTypeIoTAnalyticsDataset ResourceType = "AWS::IoTAnalytics::Dataset" + ResourceTypeIoTAnalyticsPipeline ResourceType = "AWS::IoTAnalytics::Pipeline" + ResourceTypeIoTAnalyticsChannel ResourceType = "AWS::IoTAnalytics::Channel" + ResourceTypeIoTSiteWiseDashboard ResourceType = "AWS::IoTSiteWise::Dashboard" + ResourceTypeIoTSiteWiseProject ResourceType = "AWS::IoTSiteWise::Project" + ResourceTypeIoTSiteWisePortal ResourceType = "AWS::IoTSiteWise::Portal" + ResourceTypeIoTSiteWiseAssetModel ResourceType = "AWS::IoTSiteWise::AssetModel" + ResourceTypeIVSChannel ResourceType = "AWS::IVS::Channel" + ResourceTypeIVSRecordingConfiguration ResourceType = "AWS::IVS::RecordingConfiguration" + ResourceTypeIVSPlaybackKeyPair ResourceType = "AWS::IVS::PlaybackKeyPair" + ResourceTypeKinesisAnalyticsV2Application ResourceType = "AWS::KinesisAnalyticsV2::Application" + ResourceTypeRDSGlobalCluster ResourceType = "AWS::RDS::GlobalCluster" + ResourceTypeS3MultiRegionAccessPoint ResourceType = "AWS::S3::MultiRegionAccessPoint" + ResourceTypeDeviceFarmTestGridProject ResourceType = "AWS::DeviceFarm::TestGridProject" + ResourceTypeBudgetsBudgetsAction ResourceType = "AWS::Budgets::BudgetsAction" + ResourceTypeLexBot ResourceType = "AWS::Lex::Bot" + ResourceTypeCodeGuruReviewerRepositoryAssociation ResourceType = "AWS::CodeGuruReviewer::RepositoryAssociation" + ResourceTypeIoTCustomMetric ResourceType = "AWS::IoT::CustomMetric" + ResourceTypeRoute53ResolverFirewallDomainList ResourceType = "AWS::Route53Resolver::FirewallDomainList" + ResourceTypeRoboMakerRobotApplicationVersion ResourceType = "AWS::RoboMaker::RobotApplicationVersion" + ResourceTypeEC2TrafficMirrorSession ResourceType = "AWS::EC2::TrafficMirrorSession" + ResourceTypeIoTSiteWiseGateway ResourceType = "AWS::IoTSiteWise::Gateway" + ResourceTypeLexBotAlias ResourceType = "AWS::Lex::BotAlias" + ResourceTypeLookoutMetricsAlert ResourceType = "AWS::LookoutMetrics::Alert" + ResourceTypeIoTAccountAuditConfiguration ResourceType = "AWS::IoT::AccountAuditConfiguration" + ResourceTypeEC2TrafficMirrorTarget ResourceType = "AWS::EC2::TrafficMirrorTarget" + ResourceTypeS3StorageLens ResourceType = "AWS::S3::StorageLens" + ResourceTypeIoTScheduledAudit ResourceType = "AWS::IoT::ScheduledAudit" + ResourceTypeEventsConnection ResourceType = "AWS::Events::Connection" + ResourceTypeEventSchemasSchema ResourceType = "AWS::EventSchemas::Schema" + ResourceTypeMediaPackagePackagingConfiguration ResourceType = "AWS::MediaPackage::PackagingConfiguration" + ResourceTypeKinesisVideoSignalingChannel ResourceType = "AWS::KinesisVideo::SignalingChannel" + ResourceTypeAppStreamDirectoryConfig ResourceType = "AWS::AppStream::DirectoryConfig" + ResourceTypeLookoutVisionProject ResourceType = "AWS::LookoutVision::Project" + ResourceTypeRoute53RecoveryControlCluster ResourceType = "AWS::Route53RecoveryControl::Cluster" + ResourceTypeRoute53RecoveryControlSafetyRule ResourceType = "AWS::Route53RecoveryControl::SafetyRule" + ResourceTypeRoute53RecoveryControlControlPanel ResourceType = "AWS::Route53RecoveryControl::ControlPanel" + ResourceTypeRoute53RecoveryControlRoutingControl ResourceType = "AWS::Route53RecoveryControl::RoutingControl" + ResourceTypeRoute53RecoveryReadinessResourceSet ResourceType = "AWS::Route53RecoveryReadiness::ResourceSet" + ResourceTypeRoboMakerSimulationApplication ResourceType = "AWS::RoboMaker::SimulationApplication" + ResourceTypeRoboMakerRobotApplication ResourceType = "AWS::RoboMaker::RobotApplication" + ResourceTypeHealthLakeFHIRDatastore ResourceType = "AWS::HealthLake::FHIRDatastore" + ResourceTypePinpointSegment ResourceType = "AWS::Pinpoint::Segment" + ResourceTypePinpointApplicationSettings ResourceType = "AWS::Pinpoint::ApplicationSettings" + ResourceTypeEventsRule ResourceType = "AWS::Events::Rule" + ResourceTypeEC2DHCPOptions ResourceType = "AWS::EC2::DHCPOptions" + ResourceTypeEC2NetworkInsightsPath ResourceType = "AWS::EC2::NetworkInsightsPath" + ResourceTypeEC2TrafficMirrorFilter ResourceType = "AWS::EC2::TrafficMirrorFilter" + ResourceTypeEc2ipam ResourceType = "AWS::EC2::IPAM" + ResourceTypeIoTTwinMakerScene ResourceType = "AWS::IoTTwinMaker::Scene" + ResourceTypeNetworkManagerTransitGatewayRegistration ResourceType = "AWS::NetworkManager::TransitGatewayRegistration" + ResourceTypeCustomerProfilesDomain ResourceType = "AWS::CustomerProfiles::Domain" + ResourceTypeAutoScalingWarmPool ResourceType = "AWS::AutoScaling::WarmPool" + ResourceTypeConnectPhoneNumber ResourceType = "AWS::Connect::PhoneNumber" + ResourceTypeAppConfigDeploymentStrategy ResourceType = "AWS::AppConfig::DeploymentStrategy" + ResourceTypeAppFlowFlow ResourceType = "AWS::AppFlow::Flow" + ResourceTypeAuditManagerAssessment ResourceType = "AWS::AuditManager::Assessment" + ResourceTypeCloudWatchMetricStream ResourceType = "AWS::CloudWatch::MetricStream" + ResourceTypeDeviceFarmInstanceProfile ResourceType = "AWS::DeviceFarm::InstanceProfile" + ResourceTypeDeviceFarmProject ResourceType = "AWS::DeviceFarm::Project" + ResourceTypeEC2EC2Fleet ResourceType = "AWS::EC2::EC2Fleet" + ResourceTypeEC2SubnetRouteTableAssociation ResourceType = "AWS::EC2::SubnetRouteTableAssociation" + ResourceTypeECRPullThroughCacheRule ResourceType = "AWS::ECR::PullThroughCacheRule" + ResourceTypeGroundStationConfig ResourceType = "AWS::GroundStation::Config" + ResourceTypeImageBuilderImagePipeline ResourceType = "AWS::ImageBuilder::ImagePipeline" + ResourceTypeIoTFleetMetric ResourceType = "AWS::IoT::FleetMetric" + ResourceTypeIoTWirelessServiceProfile ResourceType = "AWS::IoTWireless::ServiceProfile" + ResourceTypeNetworkManagerDevice ResourceType = "AWS::NetworkManager::Device" + ResourceTypeNetworkManagerGlobalNetwork ResourceType = "AWS::NetworkManager::GlobalNetwork" + ResourceTypeNetworkManagerLink ResourceType = "AWS::NetworkManager::Link" + ResourceTypeNetworkManagerSite ResourceType = "AWS::NetworkManager::Site" + ResourceTypePanoramaPackage ResourceType = "AWS::Panorama::Package" + ResourceTypePinpointApp ResourceType = "AWS::Pinpoint::App" + ResourceTypeRedshiftScheduledAction ResourceType = "AWS::Redshift::ScheduledAction" + ResourceTypeRoute53ResolverFirewallRuleGroupAssociation ResourceType = "AWS::Route53Resolver::FirewallRuleGroupAssociation" + ResourceTypeSageMakerAppImageConfig ResourceType = "AWS::SageMaker::AppImageConfig" + ResourceTypeSageMakerImage ResourceType = "AWS::SageMaker::Image" + ResourceTypeECSTaskSet ResourceType = "AWS::ECS::TaskSet" + ResourceTypeCassandraKeyspace ResourceType = "AWS::Cassandra::Keyspace" + ResourceTypeSignerSigningProfile ResourceType = "AWS::Signer::SigningProfile" + ResourceTypeAmplifyApp ResourceType = "AWS::Amplify::App" + ResourceTypeAppMeshVirtualNode ResourceType = "AWS::AppMesh::VirtualNode" + ResourceTypeAppMeshVirtualService ResourceType = "AWS::AppMesh::VirtualService" + ResourceTypeAppRunnerVpcConnector ResourceType = "AWS::AppRunner::VpcConnector" + ResourceTypeAppStreamApplication ResourceType = "AWS::AppStream::Application" + ResourceTypeCodeArtifactRepository ResourceType = "AWS::CodeArtifact::Repository" + ResourceTypeEC2PrefixList ResourceType = "AWS::EC2::PrefixList" + ResourceTypeEC2SpotFleet ResourceType = "AWS::EC2::SpotFleet" + ResourceTypeEvidentlyProject ResourceType = "AWS::Evidently::Project" + ResourceTypeForecastDataset ResourceType = "AWS::Forecast::Dataset" + ResourceTypeIAMSAMLProvider ResourceType = "AWS::IAM::SAMLProvider" + ResourceTypeIAMServerCertificate ResourceType = "AWS::IAM::ServerCertificate" + ResourceTypePinpointCampaign ResourceType = "AWS::Pinpoint::Campaign" + ResourceTypePinpointInAppTemplate ResourceType = "AWS::Pinpoint::InAppTemplate" + ResourceTypeSageMakerDomain ResourceType = "AWS::SageMaker::Domain" + ResourceTypeTransferAgreement ResourceType = "AWS::Transfer::Agreement" + ResourceTypeTransferConnector ResourceType = "AWS::Transfer::Connector" + ResourceTypeKinesisFirehoseDeliveryStream ResourceType = "AWS::KinesisFirehose::DeliveryStream" + ResourceTypeAmplifyBranch ResourceType = "AWS::Amplify::Branch" + ResourceTypeAppIntegrationsEventIntegration ResourceType = "AWS::AppIntegrations::EventIntegration" + ResourceTypeAppMeshRoute ResourceType = "AWS::AppMesh::Route" + ResourceTypeAthenaPreparedStatement ResourceType = "AWS::Athena::PreparedStatement" + ResourceTypeEC2IPAMScope ResourceType = "AWS::EC2::IPAMScope" + ResourceTypeEvidentlyLaunch ResourceType = "AWS::Evidently::Launch" + ResourceTypeForecastDatasetGroup ResourceType = "AWS::Forecast::DatasetGroup" + ResourceTypeGreengrassV2ComponentVersion ResourceType = "AWS::GreengrassV2::ComponentVersion" + ResourceTypeGroundStationMissionProfile ResourceType = "AWS::GroundStation::MissionProfile" + ResourceTypeMediaConnectFlowEntitlement ResourceType = "AWS::MediaConnect::FlowEntitlement" + ResourceTypeMediaConnectFlowVpcInterface ResourceType = "AWS::MediaConnect::FlowVpcInterface" + ResourceTypeMediaTailorPlaybackConfiguration ResourceType = "AWS::MediaTailor::PlaybackConfiguration" + ResourceTypeMSKConfiguration ResourceType = "AWS::MSK::Configuration" + ResourceTypePersonalizeDataset ResourceType = "AWS::Personalize::Dataset" + ResourceTypePersonalizeSchema ResourceType = "AWS::Personalize::Schema" + ResourceTypePersonalizeSolution ResourceType = "AWS::Personalize::Solution" + ResourceTypePinpointEmailTemplate ResourceType = "AWS::Pinpoint::EmailTemplate" + ResourceTypePinpointEventStream ResourceType = "AWS::Pinpoint::EventStream" + ResourceTypeResilienceHubApp ResourceType = "AWS::ResilienceHub::App" + ResourceTypeACMPCACertificateAuthority ResourceType = "AWS::ACMPCA::CertificateAuthority" + ResourceTypeAppConfigHostedConfigurationVersion ResourceType = "AWS::AppConfig::HostedConfigurationVersion" + ResourceTypeAppMeshVirtualGateway ResourceType = "AWS::AppMesh::VirtualGateway" + ResourceTypeAppMeshVirtualRouter ResourceType = "AWS::AppMesh::VirtualRouter" + ResourceTypeAppRunnerService ResourceType = "AWS::AppRunner::Service" + ResourceTypeCustomerProfilesObjectType ResourceType = "AWS::CustomerProfiles::ObjectType" + ResourceTypeDMSEndpoint ResourceType = "AWS::DMS::Endpoint" + ResourceTypeEC2CapacityReservation ResourceType = "AWS::EC2::CapacityReservation" + ResourceTypeEC2ClientVpnEndpoint ResourceType = "AWS::EC2::ClientVpnEndpoint" + ResourceTypeKendraIndex ResourceType = "AWS::Kendra::Index" + ResourceTypeKinesisVideoStream ResourceType = "AWS::KinesisVideo::Stream" + ResourceTypeLogsDestination ResourceType = "AWS::Logs::Destination" + ResourceTypePinpointEmailChannel ResourceType = "AWS::Pinpoint::EmailChannel" + ResourceTypeS3AccessPoint ResourceType = "AWS::S3::AccessPoint" + ResourceTypeNetworkManagerCustomerGatewayAssociation ResourceType = "AWS::NetworkManager::CustomerGatewayAssociation" + ResourceTypeNetworkManagerLinkAssociation ResourceType = "AWS::NetworkManager::LinkAssociation" + ResourceTypeIoTWirelessMulticastGroup ResourceType = "AWS::IoTWireless::MulticastGroup" + ResourceTypePersonalizeDatasetGroup ResourceType = "AWS::Personalize::DatasetGroup" + ResourceTypeIoTTwinMakerComponentType ResourceType = "AWS::IoTTwinMaker::ComponentType" + ResourceTypeCodeBuildReportGroup ResourceType = "AWS::CodeBuild::ReportGroup" + ResourceTypeSageMakerFeatureGroup ResourceType = "AWS::SageMaker::FeatureGroup" + ResourceTypeMSKBatchScramSecret ResourceType = "AWS::MSK::BatchScramSecret" + ResourceTypeAppStreamStack ResourceType = "AWS::AppStream::Stack" + ResourceTypeIoTJobTemplate ResourceType = "AWS::IoT::JobTemplate" + ResourceTypeIoTWirelessFuotaTask ResourceType = "AWS::IoTWireless::FuotaTask" + ResourceTypeIoTProvisioningTemplate ResourceType = "AWS::IoT::ProvisioningTemplate" + ResourceTypeInspectorV2Filter ResourceType = "AWS::InspectorV2::Filter" + ResourceTypeRoute53ResolverResolverQueryLoggingConfigAssociation ResourceType = "AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation" + ResourceTypeServiceDiscoveryInstance ResourceType = "AWS::ServiceDiscovery::Instance" + ResourceTypeTransferCertificate ResourceType = "AWS::Transfer::Certificate" + ResourceTypeMediaConnectFlowSource ResourceType = "AWS::MediaConnect::FlowSource" + ResourceTypeAPSRuleGroupsNamespace ResourceType = "AWS::APS::RuleGroupsNamespace" + ResourceTypeCodeGuruProfilerProfilingGroup ResourceType = "AWS::CodeGuruProfiler::ProfilingGroup" + ResourceTypeRoute53ResolverResolverQueryLoggingConfig ResourceType = "AWS::Route53Resolver::ResolverQueryLoggingConfig" + ResourceTypeBatchSchedulingPolicy ResourceType = "AWS::Batch::SchedulingPolicy" ) // Values returns all known values for ResourceType. Note that this can be @@ -1371,6 +1390,25 @@ func (ResourceType) Values() []ResourceType { "AWS::S3::AccessPoint", "AWS::NetworkManager::CustomerGatewayAssociation", "AWS::NetworkManager::LinkAssociation", + "AWS::IoTWireless::MulticastGroup", + "AWS::Personalize::DatasetGroup", + "AWS::IoTTwinMaker::ComponentType", + "AWS::CodeBuild::ReportGroup", + "AWS::SageMaker::FeatureGroup", + "AWS::MSK::BatchScramSecret", + "AWS::AppStream::Stack", + "AWS::IoT::JobTemplate", + "AWS::IoTWireless::FuotaTask", + "AWS::IoT::ProvisioningTemplate", + "AWS::InspectorV2::Filter", + "AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation", + "AWS::ServiceDiscovery::Instance", + "AWS::Transfer::Certificate", + "AWS::MediaConnect::FlowSource", + "AWS::APS::RuleGroupsNamespace", + "AWS::CodeGuruProfiler::ProfilingGroup", + "AWS::Route53Resolver::ResolverQueryLoggingConfig", + "AWS::Batch::SchedulingPolicy", } } diff --git a/service/configservice/types/types.go b/service/configservice/types/types.go index 1f1764ad8bb..652a70b82ac 100644 --- a/service/configservice/types/types.go +++ b/service/configservice/types/types.go @@ -314,7 +314,6 @@ type BaseConfigurationItem struct { // - ResourceDeletedNotRecorded – The resource was deleted but its configuration // was not recorded since the recorder excludes the recording of resources of this // type - // The CIs do not incur any cost. ConfigurationItemStatus ConfigurationItemStatus // An identifier that indicates the ordering of the configuration items of a @@ -778,7 +777,6 @@ type ConfigurationItem struct { // - ResourceDeletedNotRecorded – The resource was deleted but its configuration // was not recorded since the recorder excludes the recording of resources of this // type - // The CIs do not incur any cost. ConfigurationItemStatus ConfigurationItemStatus // An identifier that indicates the ordering of the configuration items of a @@ -1299,7 +1297,7 @@ type EvaluationContext struct { noSmithyDocumentSerde } -// The configuration object for Config rule evaluation mode. The Supported valid +// The configuration object for Config rule evaluation mode. The supported valid // values are Detective or Proactive. type EvaluationModeConfiguration struct { @@ -1393,9 +1391,27 @@ type EvaluationStatus struct { noSmithyDocumentSerde } -// Specifies whether the configuration recorder excludes resource types from being -// recorded. Use the resourceTypes field to enter a comma-separated list of -// resource types to exclude as exemptions. +// Specifies whether the configuration recorder excludes certain resource types +// from being recorded. Use the resourceTypes field to enter a comma-separated +// list of resource types you want to exclude from recording. By default, when +// Config adds support for a new resource type in the Region where you set up the +// configuration recorder, including global resource types, Config starts recording +// resources of that type automatically. How to use To use this option, you must +// set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) +// to EXCLUSION_BY_RESOURCE_TYPES . Config will then record configuration changes +// for all supported resource types, except the resource types that you specify to +// exclude from being recorded. Globally recorded resources Unless specifically +// listed as exclusions, AWS::RDS::GlobalCluster will be recorded automatically in +// all supported Config Regions were the configuration recorder is enabled. IAM +// users, groups, roles, and customer managed policies will be recorded +// automatically in all enabled Config Regions where Config was available before +// February 2022. This list does not include the following Regions: +// - Asia Pacific (Hyderabad) +// - Asia Pacific (Melbourne) +// - Europe (Spain) +// - Europe (Zurich) +// - Israel (Tel Aviv) +// - Middle East (UAE) type ExclusionByResourceTypes struct { // A comma-separated list of resource types to exclude from recording by the @@ -1942,11 +1958,11 @@ type OrganizationCustomPolicyRuleMetadataNoPolicy struct { noSmithyDocumentSerde } -// organization custom rule metadata such as resource type, resource ID of Amazon -// Web Services resource, Lambda function ARN, and organization trigger types that -// trigger Config to evaluate your Amazon Web Services resources against a rule. It -// also provides the frequency with which you want Config to run evaluations for -// the rule if the trigger type is periodic. +// An object that specifies organization custom rule metadata such as resource +// type, resource ID of Amazon Web Services resource, Lambda function ARN, and +// organization trigger types that trigger Config to evaluate your Amazon Web +// Services resources against a rule. It also provides the frequency with which you +// want Config to run evaluations for the rule if the trigger type is periodic. type OrganizationCustomRuleMetadata struct { // The lambda function ARN. @@ -1999,10 +2015,10 @@ type OrganizationCustomRuleMetadata struct { noSmithyDocumentSerde } -// organization managed rule metadata such as resource type and ID of Amazon Web -// Services resource along with the rule identifier. It also provides the frequency -// with which you want Config to run evaluations for the rule if the trigger type -// is periodic. +// An object that specifies organization managed rule metadata such as resource +// type and ID of Amazon Web Services resource along with the rule identifier. It +// also provides the frequency with which you want Config to run evaluations for +// the rule if the trigger type is periodic. type OrganizationManagedRuleMetadata struct { // For organization config managed rules, a predefined identifier from a list. For @@ -2105,37 +2121,38 @@ type QueryInfo struct { noSmithyDocumentSerde } -// Specifies which resource types Config records for configuration changes. In the -// recording group, you specify whether you want to record all supported resource -// types or to include or exclude specific types of resources. By default, Config -// records configuration changes for all supported types of Regional resources that -// Config discovers in the Amazon Web Services Region in which it is running. -// Regional resources are tied to a Region and can be used only in that Region. -// Examples of Regional resources are Amazon EC2 instances and Amazon EBS volumes. -// You can also have Config record supported types of global resources. Global -// resources are not tied to a specific Region and can be used in all Regions. The -// global resource types that Config supports include IAM users, groups, roles, and -// customer managed policies. Global resource types onboarded to Config recording -// after February 2022 will be recorded only in the service's home Region for the -// commercial partition and Amazon Web Services GovCloud (US-West) for the Amazon -// Web Services GovCloud (US) partition. You can view the Configuration Items for -// these new global resource types only in their home Region and Amazon Web -// Services GovCloud (US-West). If you don't want Config to record all resources, -// you can specify which types of resources Config records with the resourceTypes -// parameter. For a list of supported resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) -// in the Config developer guide. For more information and a table of the Home -// Regions for Global Resource Types Onboarded after February 2022, see Selecting -// Which Resources Config Records (https://docs.aws.amazon.com/config/latest/developerguide/select-resources.html) -// in the Config developer guide. +// Specifies which resource types Config records for configuration changes. By +// default, Config records configuration changes for all current and future +// supported resource types in the Amazon Web Services Region where you have +// enabled Config (excluding the globally recorded IAM resource types: IAM users, +// groups, roles, and customer managed policies). In the recording group, you +// specify whether you want to record all supported current and future supported +// resource types or to include or exclude specific resources types. For a list of +// supported resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) +// in the Config developer guide. If you don't want Config to record all current +// and future supported resource types, use one of the following recording +// strategies: +// - Record all current and future resource types with exclusions ( +// EXCLUSION_BY_RESOURCE_TYPES ), or +// - Record specific resource types ( INCLUSION_BY_RESOURCE_TYPES ). +// +// Aurora global clusters are automatically globally recorded The +// AWS::RDS::GlobalCluster resource type will be recorded in all supported Config +// Regions where the configuration recorder is enabled. If you do not want to +// record AWS::RDS::GlobalCluster in all enabled Regions, use the +// EXCLUSION_BY_RESOURCE_TYPES or INCLUSION_BY_RESOURCE_TYPES recording strategy. type RecordingGroup struct { // Specifies whether Config records configuration changes for all supported - // regional resource types. If you set this field to true , when Config adds - // support for a new type of regional resource, Config starts recording resources - // of that type automatically. If you set this field to true , you cannot enumerate - // specific resource types to record in the resourceTypes field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // regionally recorded resource types. If you set this field to true , when Config + // adds support for a new regionally recorded resource type, Config starts + // recording resources of that type automatically. If you set this field to true , + // you cannot enumerate specific resource types to record in the resourceTypes + // field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // , or to exclude in the resourceTypes field of ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) - // . + // . Region Availability Check Resource Coverage by Region Availability (https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html) + // to see if a resource type is supported in the Amazon Web Services Region where + // you set up Config. AllSupported bool // An object that specifies how Config excludes resource types from being recorded @@ -2144,55 +2161,86 @@ type RecordingGroup struct { // to EXCLUSION_BY_RESOURCE_TYPES . ExclusionByResourceTypes *ExclusionByResourceTypes - // Specifies whether Config records configuration changes for all supported global - // resources. Before you set this field to true , set the allSupported field of - // RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // A legacy field which only applies to the globally recorded IAM resource types: + // IAM users, groups, roles, and customer managed policies. If you select this + // option, these resource types will be recorded in all enabled Config regions + // where Config was available before February 2022. This list does not include the + // following Regions: + // - Asia Pacific (Hyderabad) + // - Asia Pacific (Melbourne) + // - Europe (Spain) + // - Europe (Zurich) + // - Israel (Tel Aviv) + // - Middle East (UAE) + // Aurora global clusters are automatically globally recorded The + // AWS::RDS::GlobalCluster resource type will be recorded in all supported Config + // Regions where the configuration recorder is enabled, even if + // includeGlobalResourceTypes is not set to true . includeGlobalResourceTypes is a + // legacy field which only applies to IAM users, groups, roles, and customer + // managed policies. If you do not want to record AWS::RDS::GlobalCluster in all + // enabled Regions, use one of the following recording strategies: + // - Record all current and future resource types with exclusions ( + // EXCLUSION_BY_RESOURCE_TYPES ), or + // - Record specific resource types ( INCLUSION_BY_RESOURCE_TYPES ). + // For more information, see Selecting Which Resources are Recorded (https://docs.aws.amazon.com/config/latest/developerguide/select-resources.html#select-resources-all) + // in the Config developer guide. Required and optional fields Before you set this + // field to true , set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // to true . Optionally, you can set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) - // to ALL_SUPPORTED_RESOURCE_TYPES . If you set this field to true , when Config - // adds support for a new type of global resource in the Region where you set up - // the configuration recorder, Config starts recording resources of that type - // automatically. If you set this field to false but list global resource types in - // the resourceTypes field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // to ALL_SUPPORTED_RESOURCE_TYPES . Overriding fields If you set this field to + // false but list globally recorded IAM resource types in the resourceTypes field + // of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // , Config will still record configuration changes for those specified resource // types regardless of if you set the includeGlobalResourceTypes field to false. - // If you do not want to record configuration changes to global resource types, - // make sure to not list them in the resourceTypes field in addition to setting - // the includeGlobalResourceTypes field to false. + // If you do not want to record configuration changes to the globally recorded IAM + // resource types (IAM users, groups, roles, and customer managed policies), make + // sure to not list them in the resourceTypes field in addition to setting the + // includeGlobalResourceTypes field to false. IncludeGlobalResourceTypes bool // An object that specifies the recording strategy for the configuration recorder. // - If you set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to ALL_SUPPORTED_RESOURCE_TYPES , Config records configuration changes for all - // supported regional resource types. You also must set the allSupported field of - // RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) - // to true . When Config adds support for a new type of regional resource, Config - // automatically starts recording resources of that type. + // supported regionally recorded resource types. You also must set the + // allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // to true . When Config adds support for a new regionally recorded resource + // type, Config automatically starts recording resources of that type. // - If you set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to INCLUSION_BY_RESOURCE_TYPES , Config records configuration changes for only // the resource types you specify in the resourceTypes field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // . // - If you set the useOnly field of RecordingStrategy (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html) // to EXCLUSION_BY_RESOURCE_TYPES , Config records configuration changes for all - // supported resource types except the resource types that you specify as - // exemptions to exclude from being recorded in the resourceTypes field of - // ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) + // supported resource types except the resource types that you specify to exclude + // from being recorded in the resourceTypes field of ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) // . - // The recordingStrategy field is optional when you set the allSupported field of - // RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // Required and optional fields The recordingStrategy field is optional when you + // set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // to true . The recordingStrategy field is optional when you list resource types // in the resourceTypes field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // . The recordingStrategy field is required if you list resource types to exclude // from recording in the resourceTypes field of ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) - // . If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording strategy, the - // exclusionByResourceTypes field will override other properties in the request. - // For example, even if you set includeGlobalResourceTypes to false, global - // resource types will still be automatically recorded in this option unless those - // resource types are specifically listed as exemptions in the resourceTypes field - // of exclusionByResourceTypes . By default, if you choose the + // . Overriding fields If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording + // strategy, the exclusionByResourceTypes field will override other properties in + // the request. For example, even if you set includeGlobalResourceTypes to false, + // globally recorded IAM resource types will still be automatically recorded in + // this option unless those resource types are specifically listed as exclusions in + // the resourceTypes field of exclusionByResourceTypes . Global resources types and + // the resource exclusion recording strategy By default, if you choose the // EXCLUSION_BY_RESOURCE_TYPES recording strategy, when Config adds support for a // new resource type in the Region where you set up the configuration recorder, // including global resource types, Config starts recording resources of that type - // automatically. + // automatically. In addition, unless specifically listed as exclusions, + // AWS::RDS::GlobalCluster will be recorded automatically in all supported Config + // Regions were the configuration recorder is enabled. IAM users, groups, roles, + // and customer managed policies will be recorded automatically in all enabled + // Config Regions where Config was available before February 2022. This list does + // not include the following Regions: + // - Asia Pacific (Hyderabad) + // - Asia Pacific (Melbourne) + // - Europe (Spain) + // - Europe (Zurich) + // - Israel (Tel Aviv) + // - Middle East (UAE) RecordingStrategy *RecordingStrategy // A comma-separated list that specifies which resource types Config records. @@ -2222,11 +2270,11 @@ type RecordingStrategy struct { // The recording strategy for the configuration recorder. // - If you set this option to ALL_SUPPORTED_RESOURCE_TYPES , Config records - // configuration changes for all supported regional resource types. You also must - // set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) - // to true . When Config adds support for a new type of regional resource, Config - // automatically starts recording resources of that type. For a list of supported - // resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) + // configuration changes for all supported regionally recorded resource types. You + // also must set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // to true . When Config adds support for a new regionally recorded resource + // type, Config automatically starts recording resources of that type. For a list + // of supported resource types, see Supported Resource Types (https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources) // in the Config developer guide. // - If you set this option to INCLUSION_BY_RESOURCE_TYPES , Config records // configuration changes for only the resource types that you specify in the @@ -2234,25 +2282,37 @@ type RecordingStrategy struct { // . // - If you set this option to EXCLUSION_BY_RESOURCE_TYPES , Config records // configuration changes for all supported resource types, except the resource - // types that you specify as exemptions to exclude from being recorded in the - // resourceTypes field of ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) + // types that you specify to exclude from being recorded in the resourceTypes + // field of ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) // . - // The recordingStrategy field is optional when you set the allSupported field of - // RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) + // Required and optional fields The recordingStrategy field is optional when you + // set the allSupported field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // to true . The recordingStrategy field is optional when you list resource types // in the resourceTypes field of RecordingGroup (https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html) // . The recordingStrategy field is required if you list resource types to exclude // from recording in the resourceTypes field of ExclusionByResourceTypes (https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html) - // . If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording strategy, the - // exclusionByResourceTypes field will override other properties in the request. - // For example, even if you set includeGlobalResourceTypes to false, global - // resource types will still be automatically recorded in this option unless those - // resource types are specifically listed as exemptions in the resourceTypes field - // of exclusionByResourceTypes . By default, if you choose the + // . Overriding fields If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording + // strategy, the exclusionByResourceTypes field will override other properties in + // the request. For example, even if you set includeGlobalResourceTypes to false, + // globally recorded IAM resource types will still be automatically recorded in + // this option unless those resource types are specifically listed as exclusions in + // the resourceTypes field of exclusionByResourceTypes . Global resource types and + // the exclusion recording strategy By default, if you choose the // EXCLUSION_BY_RESOURCE_TYPES recording strategy, when Config adds support for a // new resource type in the Region where you set up the configuration recorder, // including global resource types, Config starts recording resources of that type - // automatically. + // automatically. In addition, unless specifically listed as exclusions, + // AWS::RDS::GlobalCluster will be recorded automatically in all supported Config + // Regions were the configuration recorder is enabled. IAM users, groups, roles, + // and customer managed policies will be recorded automatically in all enabled + // Config Regions where Config was available before February 2022. This list does + // not include the following Regions: + // - Asia Pacific (Hyderabad) + // - Asia Pacific (Melbourne) + // - Europe (Spain) + // - Europe (Zurich) + // - Israel (Tel Aviv) + // - Middle East (UAE) UseOnly RecordingStrategyType noSmithyDocumentSerde diff --git a/service/controltower/api_op_DisableControl.go b/service/controltower/api_op_DisableControl.go index d94fa4e24f3..89a939fbd54 100644 --- a/service/controltower/api_op_DisableControl.go +++ b/service/controltower/api_op_DisableControl.go @@ -17,7 +17,9 @@ import ( // This API call turns off a control. It starts an asynchronous operation that // deletes AWS resources on the specified organizational unit and the accounts it -// contains. The resources will vary according to the control that you specify. +// contains. The resources will vary according to the control that you specify. For +// usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . func (c *Client) DisableControl(ctx context.Context, params *DisableControlInput, optFns ...func(*Options)) (*DisableControlOutput, error) { if params == nil { params = &DisableControlInput{} @@ -36,12 +38,16 @@ func (c *Client) DisableControl(ctx context.Context, params *DisableControlInput type DisableControlInput struct { // The ARN of the control. Only Strongly recommended and Elective controls are - // permitted, with the exception of the Region deny guardrail. + // permitted, with the exception of the Region deny control. For information on how + // to find the controlIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . // // This member is required. ControlIdentifier *string - // The ARN of the organizational unit. + // The ARN of the organizational unit. For information on how to find the + // targetIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . // // This member is required. TargetIdentifier *string diff --git a/service/controltower/api_op_EnableControl.go b/service/controltower/api_op_EnableControl.go index 45fd5d255a9..ce558aa8959 100644 --- a/service/controltower/api_op_EnableControl.go +++ b/service/controltower/api_op_EnableControl.go @@ -18,7 +18,7 @@ import ( // This API call activates a control. It starts an asynchronous operation that // creates AWS resources on the specified organizational unit and the accounts it // contains. The resources created will vary according to the control that you -// specify. +// specify. For usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) func (c *Client) EnableControl(ctx context.Context, params *EnableControlInput, optFns ...func(*Options)) (*EnableControlOutput, error) { if params == nil { params = &EnableControlInput{} @@ -37,12 +37,16 @@ func (c *Client) EnableControl(ctx context.Context, params *EnableControlInput, type EnableControlInput struct { // The ARN of the control. Only Strongly recommended and Elective controls are - // permitted, with the exception of the Region deny guardrail. + // permitted, with the exception of the Region deny control. For information on how + // to find the controlIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . // // This member is required. ControlIdentifier *string - // The ARN of the organizational unit. + // The ARN of the organizational unit. For information on how to find the + // targetIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . // // This member is required. TargetIdentifier *string diff --git a/service/controltower/api_op_GetControlOperation.go b/service/controltower/api_op_GetControlOperation.go index cb8769af8ec..a3327b2a8b3 100644 --- a/service/controltower/api_op_GetControlOperation.go +++ b/service/controltower/api_op_GetControlOperation.go @@ -18,7 +18,7 @@ import ( // Returns the status of a particular EnableControl or DisableControl operation. // Displays a message in case of error. Details for an operation are available for -// 90 days. +// 90 days. For usage examples, see the AWS Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) func (c *Client) GetControlOperation(ctx context.Context, params *GetControlOperationInput, optFns ...func(*Options)) (*GetControlOperationOutput, error) { if params == nil { params = &GetControlOperationInput{} @@ -47,7 +47,7 @@ type GetControlOperationInput struct { type GetControlOperationOutput struct { - // + // An operation performed by the control. // // This member is required. ControlOperation *types.ControlOperation diff --git a/service/controltower/api_op_GetEnabledControl.go b/service/controltower/api_op_GetEnabledControl.go new file mode 100644 index 00000000000..33c290eba53 --- /dev/null +++ b/service/controltower/api_op_GetEnabledControl.go @@ -0,0 +1,269 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/controltower/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides details about the enabled control. For usage examples, see the AWS +// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// . Returned values +// - TargetRegions: Shows target AWS Regions where the enabled control is +// available to be deployed. +// - StatusSummary: Provides a detailed summary of the deployment status. +// - DriftSummary: Provides a detailed summary of the drifted status. +func (c *Client) GetEnabledControl(ctx context.Context, params *GetEnabledControlInput, optFns ...func(*Options)) (*GetEnabledControlOutput, error) { + if params == nil { + params = &GetEnabledControlInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetEnabledControl", params, optFns, c.addOperationGetEnabledControlMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetEnabledControlOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetEnabledControlInput struct { + + // The ARN of the enabled control. + // + // This member is required. + EnabledControlIdentifier *string + + noSmithyDocumentSerde +} + +type GetEnabledControlOutput struct { + + // Information about the enabled control. + // + // This member is required. + EnabledControlDetails *types.EnabledControlDetails + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetEnabledControlMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEnabledControl{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEnabledControl{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addGetEnabledControlResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetEnabledControlValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEnabledControl(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetEnabledControl(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "controltower", + OperationName: "GetEnabledControl", + } +} + +type opGetEnabledControlResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetEnabledControlResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetEnabledControlResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "controltower" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "controltower" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("controltower") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetEnabledControlResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetEnabledControlResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/controltower/api_op_ListEnabledControls.go b/service/controltower/api_op_ListEnabledControls.go index 67b98a8f376..c31a1e8d20c 100644 --- a/service/controltower/api_op_ListEnabledControls.go +++ b/service/controltower/api_op_ListEnabledControls.go @@ -17,7 +17,8 @@ import ( ) // Lists the controls enabled by AWS Control Tower on the specified organizational -// unit and the accounts it contains. +// unit and the accounts it contains. For usage examples, see the AWS Control +// Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) func (c *Client) ListEnabledControls(ctx context.Context, params *ListEnabledControlsInput, optFns ...func(*Options)) (*ListEnabledControlsOutput, error) { if params == nil { params = &ListEnabledControlsInput{} @@ -35,7 +36,9 @@ func (c *Client) ListEnabledControls(ctx context.Context, params *ListEnabledCon type ListEnabledControlsInput struct { - // The ARN of the organizational unit. + // The ARN of the organizational unit. For information on how to find the + // targetIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . // // This member is required. TargetIdentifier *string diff --git a/service/controltower/deserializers.go b/service/controltower/deserializers.go index 4202b3ec4ae..28b8952ac88 100644 --- a/service/controltower/deserializers.go +++ b/service/controltower/deserializers.go @@ -517,6 +517,165 @@ func awsRestjson1_deserializeOpDocumentGetControlOperationOutput(v **GetControlO return nil } +type awsRestjson1_deserializeOpGetEnabledControl struct { +} + +func (*awsRestjson1_deserializeOpGetEnabledControl) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetEnabledControl) 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_deserializeOpErrorGetEnabledControl(response, &metadata) + } + output := &GetEnabledControlOutput{} + 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_deserializeOpDocumentGetEnabledControlOutput(&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_deserializeOpErrorGetEnabledControl(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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetEnabledControlOutput(v **GetEnabledControlOutput, 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 *GetEnabledControlOutput + if *v == nil { + sv = &GetEnabledControlOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabledControlDetails": + if err := awsRestjson1_deserializeDocumentEnabledControlDetails(&sv.EnabledControlDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListEnabledControls struct { } @@ -1121,6 +1280,119 @@ func awsRestjson1_deserializeDocumentControlOperation(v **types.ControlOperation return nil } +func awsRestjson1_deserializeDocumentDriftStatusSummary(v **types.DriftStatusSummary, 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.DriftStatusSummary + if *v == nil { + sv = &types.DriftStatusSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "driftStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DriftStatus to be of type string, got %T instead", value) + } + sv.DriftStatus = types.DriftStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEnabledControlDetails(v **types.EnabledControlDetails, 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.EnabledControlDetails + if *v == nil { + sv = &types.EnabledControlDetails{} + } 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 "controlIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ControlIdentifier to be of type string, got %T instead", value) + } + sv.ControlIdentifier = ptr.String(jtv) + } + + case "driftStatusSummary": + if err := awsRestjson1_deserializeDocumentDriftStatusSummary(&sv.DriftStatusSummary, value); err != nil { + return err + } + + case "statusSummary": + if err := awsRestjson1_deserializeDocumentEnablementStatusSummary(&sv.StatusSummary, value); err != nil { + return err + } + + case "targetIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetIdentifier to be of type string, got %T instead", value) + } + sv.TargetIdentifier = ptr.String(jtv) + } + + case "targetRegions": + if err := awsRestjson1_deserializeDocumentTargetRegions(&sv.TargetRegions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentEnabledControls(v *[]types.EnabledControlSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1177,6 +1449,15 @@ func awsRestjson1_deserializeDocumentEnabledControlSummary(v **types.EnabledCont 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 "controlIdentifier": if value != nil { jtv, ok := value.(string) @@ -1186,6 +1467,74 @@ func awsRestjson1_deserializeDocumentEnabledControlSummary(v **types.EnabledCont sv.ControlIdentifier = ptr.String(jtv) } + case "driftStatusSummary": + if err := awsRestjson1_deserializeDocumentDriftStatusSummary(&sv.DriftStatusSummary, value); err != nil { + return err + } + + case "statusSummary": + if err := awsRestjson1_deserializeDocumentEnablementStatusSummary(&sv.StatusSummary, value); err != nil { + return err + } + + case "targetIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetIdentifier to be of type string, got %T instead", value) + } + sv.TargetIdentifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEnablementStatusSummary(v **types.EnablementStatusSummary, 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.EnablementStatusSummary + if *v == nil { + sv = &types.EnablementStatusSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lastOperationIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OperationIdentifier to be of type string, got %T instead", value) + } + sv.LastOperationIdentifier = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnablementStatus to be of type string, got %T instead", value) + } + sv.Status = types.EnablementStatus(jtv) + } + default: _, _ = key, value @@ -1235,6 +1584,46 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return nil } +func awsRestjson1_deserializeDocumentRegion(v **types.Region, 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.Region + if *v == nil { + sv = &types.Region{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1315,6 +1704,40 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } +func awsRestjson1_deserializeDocumentTargetRegions(v *[]types.Region, 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.Region + if *v == nil { + cv = []types.Region{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Region + destAddr := &col + if err := awsRestjson1_deserializeDocumentRegion(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/controltower/doc.go b/service/controltower/doc.go index 07c8d70904f..51619d6debd 100644 --- a/service/controltower/doc.go +++ b/service/controltower/doc.go @@ -4,28 +4,38 @@ // for AWS Control Tower. // // These interfaces allow you to apply the AWS library of pre-defined controls to -// your organizational units, programmatically. In this context, controls are the -// same as AWS Control Tower guardrails. To call these APIs, you'll need to know: -// - the ControlARN for the control--that is, the guardrail--you are targeting, -// - and the ARN associated with the target organizational unit (OU). +// your organizational units, programmatically. In AWS Control Tower, the terms +// "control" and "guardrail" are synonyms. . To call these APIs, you'll need to +// know: +// - the controlIdentifier for the control--or guardrail--you are targeting. +// - the ARN associated with the target organizational unit (OU), which we call +// the targetIdentifier . // -// To get the ControlARN for your AWS Control Tower guardrail: The ControlARN -// contains the control name which is specified in each guardrail. For a list of -// control names for Strongly recommended and Elective guardrails, see Resource -// identifiers for APIs and guardrails (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html) -// in the Automating tasks section (https://docs.aws.amazon.com/controltower/latest/userguide/automating-tasks.html) -// of the AWS Control Tower User Guide. Remember that Mandatory guardrails cannot -// be added or removed. ARN format: +// To get the controlIdentifier for your AWS Control Tower control: The +// controlIdentifier is an ARN that is specified for each control. You can view the +// controlIdentifier in the console on the Control details page, as well as in the +// documentation. The controlIdentifier is unique in each AWS Region for each +// control. You can find the controlIdentifier for each Region and control in the +// Tables of control metadata (https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html) +// in the AWS Control Tower User Guide. A quick-reference list of control +// identifers for the AWS Control Tower legacy Strongly recommended and Elective +// controls is given in Resource identifiers for APIs and guardrails (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html) +// in the Controls reference guide section (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) +// of the AWS Control Tower User Guide. Remember that Mandatory controls cannot be +// added or removed. ARN format: // arn:aws:controltower:{REGION}::control/{CONTROL_NAME} Example: // arn:aws:controltower:us-west-2::control/AWS-GR_AUTOSCALING_LAUNCH_CONFIG_PUBLIC_IP_DISABLED -// To get the ARN for an OU: In the AWS Organizations console, you can find the ARN -// for the OU on the Organizational unit details page associated with that OU. OU -// ARN format: +// To get the targetIdentifier : The targetIdentifier is the ARN for an OU. In the +// AWS Organizations console, you can find the ARN for the OU on the Organizational +// unit details page associated with that OU. OU ARN format: // arn:${Partition}:organizations::${MasterAccountId}:ou/o-${OrganizationId}/ou-${OrganizationalUnitId} // Details and examples -// - List of resource identifiers for APIs and guardrails (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) -// - Guardrail API examples (CLI) (https://docs.aws.amazon.com/controltower/latest/userguide/guardrail-api-examples-short.html) -// - Enable controls with AWS CloudFormation (https://docs.aws.amazon.com/controltower/latest/userguide/enable-controls.html) +// - Control API input and output examples with CLI (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) +// - Enable controls with CloudFormation (https://docs.aws.amazon.com/controltower/latest/userguide/enable-controls.html) +// - Control metadata tables (https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html) +// - List of identifiers for legacy controls (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) +// - Controls reference guide (https://docs.aws.amazon.com/controltower/latest/userguide/controls.html) +// - Controls library groupings (https://docs.aws.amazon.com/controltower/latest/userguide/controls-reference.html) // - Creating AWS Control Tower resources with AWS CloudFormation (https://docs.aws.amazon.com/controltower/latest/userguide/creating-resources-with-cloudformation.html) // // To view the open source resource repository on GitHub, see diff --git a/service/controltower/generated.json b/service/controltower/generated.json index 4afbef84a50..08405c0865d 100644 --- a/service/controltower/generated.json +++ b/service/controltower/generated.json @@ -12,6 +12,7 @@ "api_op_DisableControl.go", "api_op_EnableControl.go", "api_op_GetControlOperation.go", + "api_op_GetEnabledControl.go", "api_op_ListEnabledControls.go", "deserializers.go", "doc.go", diff --git a/service/controltower/serializers.go b/service/controltower/serializers.go index 54bf076af42..7b4f9d84f6b 100644 --- a/service/controltower/serializers.go +++ b/service/controltower/serializers.go @@ -248,6 +248,81 @@ func awsRestjson1_serializeOpDocumentGetControlOperationInput(v *GetControlOpera return nil } +type awsRestjson1_serializeOpGetEnabledControl struct { +} + +func (*awsRestjson1_serializeOpGetEnabledControl) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEnabledControl) 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.(*GetEnabledControlInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/get-enabled-control") + 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_serializeOpDocumentGetEnabledControlInput(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_serializeOpHttpBindingsGetEnabledControlInput(v *GetEnabledControlInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetEnabledControlInput(v *GetEnabledControlInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnabledControlIdentifier != nil { + ok := object.Key("enabledControlIdentifier") + ok.String(*v.EnabledControlIdentifier) + } + + return nil +} + type awsRestjson1_serializeOpListEnabledControls struct { } diff --git a/service/controltower/types/enums.go b/service/controltower/types/enums.go index 9e0560288df..aba92d20f71 100644 --- a/service/controltower/types/enums.go +++ b/service/controltower/types/enums.go @@ -39,3 +39,45 @@ func (ControlOperationType) Values() []ControlOperationType { "DISABLE_CONTROL", } } + +type DriftStatus string + +// Enum values for DriftStatus +const ( + DriftStatusDrifted DriftStatus = "DRIFTED" + DriftStatusInSync DriftStatus = "IN_SYNC" + DriftStatusNotChecking DriftStatus = "NOT_CHECKING" + DriftStatusUnknown DriftStatus = "UNKNOWN" +) + +// Values returns all known values for DriftStatus. 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 (DriftStatus) Values() []DriftStatus { + return []DriftStatus{ + "DRIFTED", + "IN_SYNC", + "NOT_CHECKING", + "UNKNOWN", + } +} + +type EnablementStatus string + +// Enum values for EnablementStatus +const ( + EnablementStatusSucceeded EnablementStatus = "SUCCEEDED" + EnablementStatusFailed EnablementStatus = "FAILED" + EnablementStatusUnderChange EnablementStatus = "UNDER_CHANGE" +) + +// Values returns all known values for EnablementStatus. 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 (EnablementStatus) Values() []EnablementStatus { + return []EnablementStatus{ + "SUCCEEDED", + "FAILED", + "UNDER_CHANGE", + } +} diff --git a/service/controltower/types/types.go b/service/controltower/types/types.go index b9c771e19e1..d5c387cdd22 100644 --- a/service/controltower/types/types.go +++ b/service/controltower/types/types.go @@ -29,13 +29,103 @@ type ControlOperation struct { noSmithyDocumentSerde } +// The drift summary of the enabled control. AWS Control Tower expects the enabled +// control configuration to include all supported and governed Regions. If the +// enabled control differs from the expected configuration, it is defined to be in +// a state of drift. You can repair this drift by resetting the enabled control. +type DriftStatusSummary struct { + + // The drift status of the enabled control. Valid values: + // - DRIFTED : The enabledControl deployed in this configuration doesn’t match + // the configuration that AWS Control Tower expected. + // - IN_SYNC : The enabledControl deployed in this configuration matches the + // configuration that AWS Control Tower expected. + // - NOT_CHECKING : AWS Control Tower does not check drift for this enabled + // control. Drift is not supported for the control type. + // - UNKNOWN : AWS Control Tower is not able to check the drift status for the + // enabled control. + DriftStatus DriftStatus + + noSmithyDocumentSerde +} + +// Information about the enabled control. +type EnabledControlDetails struct { + + // The ARN of the enabled control. + Arn *string + + // The control identifier of the enabled control. For information on how to find + // the controlIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . + ControlIdentifier *string + + // The drift status of the enabled control. + DriftStatusSummary *DriftStatusSummary + + // The deployment summary of the enabled control. + StatusSummary *EnablementStatusSummary + + // The ARN of the organizational unit. For information on how to find the + // targetIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . + TargetIdentifier *string + + // Target AWS Regions for the enabled control. + TargetRegions []Region + + noSmithyDocumentSerde +} + // A summary of enabled controls. type EnabledControlSummary struct { + // The ARN of the enabled control. + Arn *string + // The ARN of the control. Only Strongly recommended and Elective controls are - // permitted, with the exception of the Region deny guardrail. + // permitted, with the exception of the Region deny control. For information on how + // to find the controlIdentifier , see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) + // . ControlIdentifier *string + // The drift status of the enabled control. + DriftStatusSummary *DriftStatusSummary + + // + StatusSummary *EnablementStatusSummary + + // The ARN of the organizational unit. + TargetIdentifier *string + + noSmithyDocumentSerde +} + +// The deployment summary of the enabled control. +type EnablementStatusSummary struct { + + // The last operation identifier for the enabled control. + LastOperationIdentifier *string + + // The deployment status of the enabled control. Valid values: + // - SUCCEEDED : The enabledControl configuration was deployed successfully. + // - UNDER_CHANGE : The enabledControl configuration is changing. + // - FAILED : The enabledControl configuration failed to deploy. + Status EnablementStatus + + noSmithyDocumentSerde +} + +// An AWS Region in which AWS Control Tower expects to find the control deployed. +// The expected Regions are based on the Regions that are governed by the landing +// zone. In certain cases, a control is not actually enabled in the Region as +// expected, such as during drift, or mixed governance (https://docs.aws.amazon.com/controltower/latest/userguide/region-how.html#mixed-governance) +// . +type Region struct { + + // The AWS Region name. + Name *string + noSmithyDocumentSerde } diff --git a/service/controltower/validators.go b/service/controltower/validators.go index f9508749798..a9d74503317 100644 --- a/service/controltower/validators.go +++ b/service/controltower/validators.go @@ -69,6 +69,26 @@ func (m *validateOpGetControlOperation) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetEnabledControl struct { +} + +func (*validateOpGetEnabledControl) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetEnabledControl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetEnabledControlInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetEnabledControlInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListEnabledControls struct { } @@ -101,6 +121,10 @@ func addOpGetControlOperationValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetControlOperation{}, middleware.After) } +func addOpGetEnabledControlValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetEnabledControl{}, middleware.After) +} + func addOpListEnabledControlsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListEnabledControls{}, middleware.After) } @@ -156,6 +180,21 @@ func validateOpGetControlOperationInput(v *GetControlOperationInput) error { } } +func validateOpGetEnabledControlInput(v *GetEnabledControlInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetEnabledControlInput"} + if v.EnabledControlIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("EnabledControlIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListEnabledControlsInput(v *ListEnabledControlsInput) error { if v == nil { return nil diff --git a/service/customerprofiles/deserializers.go b/service/customerprofiles/deserializers.go index 0e133880806..03d45916266 100644 --- a/service/customerprofiles/deserializers.go +++ b/service/customerprofiles/deserializers.go @@ -372,7 +372,7 @@ func awsRestjson1_deserializeOpDocumentCreateCalculatedAttributeDefinitionOutput if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected text to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveText to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } @@ -2818,7 +2818,7 @@ func awsRestjson1_deserializeOpDocumentGetCalculatedAttributeDefinitionOutput(v if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected text to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveText to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } @@ -8896,7 +8896,7 @@ func awsRestjson1_deserializeOpDocumentUpdateCalculatedAttributeDefinitionOutput if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected text to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveText to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } @@ -11582,7 +11582,7 @@ func awsRestjson1_deserializeDocumentListCalculatedAttributeDefinitionItem(v **t if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected text to be of type string, got %T instead", value) + return fmt.Errorf("expected sensitiveText to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } diff --git a/service/ec2/api_op_DescribeImages.go b/service/ec2/api_op_DescribeImages.go index 068ebd758c1..9f3b2217419 100644 --- a/service/ec2/api_op_DescribeImages.go +++ b/service/ec2/api_op_DescribeImages.go @@ -109,6 +109,10 @@ type DescribeImagesInput struct { // /dev/sda1 ). // - root-device-type - The type of the root device volume ( ebs | instance-store // ). + // - source-instance-id - The ID of the instance that the AMI was created from if + // the AMI was created using CreateImage. This filter is applicable only if the AMI + // was created using CreateImage (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html) + // . // - state - The state of the image ( available | pending | failed ). // - state-reason-code - The reason code for the state change. // - state-reason-message - The message for the state change. @@ -131,6 +135,10 @@ type DescribeImagesInput struct { // in the response regardless of what you specify for this parameter. IncludeDeprecated *bool + // Specifies whether to include disabled AMIs. Default: No disabled AMIs are + // included in the response. + IncludeDisabled *bool + // The maximum number of items to return for this request. To get the next page of // items, make another request with the token returned in the output. For more // information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination) diff --git a/service/ec2/api_op_DescribeStoreImageTasks.go b/service/ec2/api_op_DescribeStoreImageTasks.go index 5a75e7f1d1a..de602ddf601 100644 --- a/service/ec2/api_op_DescribeStoreImageTasks.go +++ b/service/ec2/api_op_DescribeStoreImageTasks.go @@ -59,6 +59,8 @@ type DescribeStoreImageTasksInput struct { // Failed ) // - bucket - Returns task information for tasks that targeted a specific bucket. // For the filter value, specify the bucket name. + // When you specify the ImageIds parameter, any filters that you specify are + // ignored. To use the filters, you must remove the ImageIds parameter. Filters []types.Filter // The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a @@ -68,7 +70,7 @@ type DescribeStoreImageTasksInput struct { // The maximum number of items to return for this request. To get the next page of // items, make another request with the token returned in the output. For more // information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination) - // . You cannot specify this parameter and the ImageIDs parameter in the same call. + // . You cannot specify this parameter and the ImageIds parameter in the same call. MaxResults *int32 // The token returned from a previous paginated request. Pagination continues from @@ -179,7 +181,7 @@ type DescribeStoreImageTasksPaginatorOptions struct { // The maximum number of items to return for this request. To get the next page of // items, make another request with the token returned in the output. For more // information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination) - // . You cannot specify this parameter and the ImageIDs parameter in the same call. + // . You cannot specify this parameter and the ImageIds parameter in the same call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/ec2/api_op_DisableImage.go b/service/ec2/api_op_DisableImage.go new file mode 100644 index 00000000000..67022c9d269 --- /dev/null +++ b/service/ec2/api_op_DisableImage.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sets the AMI state to disabled and removes all launch permissions from the AMI. +// A disabled AMI can't be used for instance launches. A disabled AMI can't be +// shared. If a public or shared AMI was previously shared, it is made private. If +// an AMI was shared with an Amazon Web Services account, organization, or +// Organizational Unit, they lose access to the disabled AMI. A disabled AMI does +// not appear in DescribeImages (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html) +// API calls by default. Only the AMI owner can disable an AMI. You can re-enable a +// disabled AMI using EnableImage (http://amazonaws.com/AWSEC2/latest/APIReference/API_EnableImage.html) +// . For more information, see Disable an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disable-an-ami.html) +// in the Amazon EC2 User Guide. +func (c *Client) DisableImage(ctx context.Context, params *DisableImageInput, optFns ...func(*Options)) (*DisableImageOutput, error) { + if params == nil { + params = &DisableImageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisableImage", params, optFns, c.addOperationDisableImageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisableImageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisableImageInput struct { + + // The ID of the AMI. + // + // This member is required. + ImageId *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type DisableImageOutput struct { + + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisableImageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpDisableImage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableImage{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addDisableImageResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDisableImageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableImage(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisableImage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "DisableImage", + } +} + +type opDisableImageResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDisableImageResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDisableImageResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "ec2" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "ec2" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("ec2") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDisableImageResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDisableImageResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/ec2/api_op_EnableImage.go b/service/ec2/api_op_EnableImage.go new file mode 100644 index 00000000000..063b402c425 --- /dev/null +++ b/service/ec2/api_op_EnableImage.go @@ -0,0 +1,272 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Re-enables a disabled AMI. The re-enabled AMI is marked as available and can be +// used for instance launches, appears in describe operations, and can be shared. +// Amazon Web Services accounts, organizations, and Organizational Units that lost +// access to the AMI when it was disabled do not regain access automatically. Once +// the AMI is available, it can be shared with them again. Only the AMI owner can +// re-enable a disabled AMI. For more information, see Disable an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disable-an-ami.html) +// in the Amazon EC2 User Guide. +func (c *Client) EnableImage(ctx context.Context, params *EnableImageInput, optFns ...func(*Options)) (*EnableImageOutput, error) { + if params == nil { + params = &EnableImageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EnableImage", params, optFns, c.addOperationEnableImageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EnableImageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type EnableImageInput struct { + + // The ID of the AMI. + // + // This member is required. + ImageId *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type EnableImageOutput struct { + + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationEnableImageMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpEnableImage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableImage{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addEnableImageResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpEnableImageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableImage(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opEnableImage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "EnableImage", + } +} + +type opEnableImageResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opEnableImageResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opEnableImageResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "ec2" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "ec2" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("ec2") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addEnableImageResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opEnableImageResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 077daa27557..5eb6781bbd2 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -33277,6 +33277,97 @@ func awsEc2query_deserializeOpErrorDisableFastSnapshotRestores(response *smithyh } } +type awsEc2query_deserializeOpDisableImage struct { +} + +func (*awsEc2query_deserializeOpDisableImage) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDisableImage) 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, awsEc2query_deserializeOpErrorDisableImage(response, &metadata) + } + output := &DisableImageOutput{} + 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) + err = awsEc2query_deserializeOpDocumentDisableImageOutput(&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 awsEc2query_deserializeOpErrorDisableImage(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 := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpDisableImageBlockPublicAccess struct { } @@ -35665,6 +35756,97 @@ func awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(response *smithyht } } +type awsEc2query_deserializeOpEnableImage struct { +} + +func (*awsEc2query_deserializeOpEnableImage) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpEnableImage) 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, awsEc2query_deserializeOpErrorEnableImage(response, &metadata) + } + output := &EnableImageOutput{} + 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) + err = awsEc2query_deserializeOpDocumentEnableImageOutput(&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 awsEc2query_deserializeOpErrorEnableImage(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 := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpEnableImageBlockPublicAccess struct { } @@ -77006,6 +77188,19 @@ func awsEc2query_deserializeDocumentImage(v **types.Image, decoder smithyxml.Nod sv.RootDeviceType = types.DeviceType(xtv) } + case strings.EqualFold("sourceInstanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceInstanceId = ptr.String(xtv) + } + case strings.EqualFold("sriovNetSupport", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -152153,6 +152348,58 @@ func awsEc2query_deserializeOpDocumentDisableImageDeprecationOutput(v **DisableI return nil } +func awsEc2query_deserializeOpDocumentDisableImageOutput(v **DisableImageOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DisableImageOutput + if *v == nil { + sv = &DisableImageOutput{} + } 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("return", 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.Return = ptr.Bool(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 awsEc2query_deserializeOpDocumentDisableIpamOrganizationAdminAccountOutput(v **DisableIpamOrganizationAdminAccountOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -153440,6 +153687,58 @@ func awsEc2query_deserializeOpDocumentEnableImageDeprecationOutput(v **EnableIma return nil } +func awsEc2query_deserializeOpDocumentEnableImageOutput(v **EnableImageOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *EnableImageOutput + if *v == nil { + sv = &EnableImageOutput{} + } 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("return", 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.Return = ptr.Bool(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 awsEc2query_deserializeOpDocumentEnableIpamOrganizationAdminAccountOutput(v **EnableIpamOrganizationAdminAccountOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/generated.json b/service/ec2/generated.json index 6d77e060390..2b8971d4634 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -385,6 +385,7 @@ "api_op_DisableEbsEncryptionByDefault.go", "api_op_DisableFastLaunch.go", "api_op_DisableFastSnapshotRestores.go", + "api_op_DisableImage.go", "api_op_DisableImageBlockPublicAccess.go", "api_op_DisableImageDeprecation.go", "api_op_DisableIpamOrganizationAdminAccount.go", @@ -412,6 +413,7 @@ "api_op_EnableEbsEncryptionByDefault.go", "api_op_EnableFastLaunch.go", "api_op_EnableFastSnapshotRestores.go", + "api_op_EnableImage.go", "api_op_EnableImageBlockPublicAccess.go", "api_op_EnableImageDeprecation.go", "api_op_EnableIpamOrganizationAdminAccount.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 66e576b5500..367c059d35d 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -23889,6 +23889,70 @@ func (m *awsEc2query_serializeOpDisableFastSnapshotRestores) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDisableImage struct { +} + +func (*awsEc2query_serializeOpDisableImage) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDisableImage) 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.(*DisableImageInput) + _ = 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("DisableImage") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDisableImageInput(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 awsEc2query_serializeOpDisableImageBlockPublicAccess struct { } @@ -25617,6 +25681,70 @@ func (m *awsEc2query_serializeOpEnableFastSnapshotRestores) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpEnableImage struct { +} + +func (*awsEc2query_serializeOpEnableImage) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpEnableImage) 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.(*EnableImageInput) + _ = 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("EnableImage") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentEnableImageInput(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 awsEc2query_serializeOpEnableImageBlockPublicAccess struct { } @@ -55247,6 +55375,11 @@ func awsEc2query_serializeOpDocumentDescribeImagesInput(v *DescribeImagesInput, objectKey.Boolean(*v.IncludeDeprecated) } + if v.IncludeDisabled != nil { + objectKey := object.Key("IncludeDisabled") + objectKey.Boolean(*v.IncludeDisabled) + } + if v.MaxResults != nil { objectKey := object.Key("MaxResults") objectKey.Integer(*v.MaxResults) @@ -59186,6 +59319,23 @@ func awsEc2query_serializeOpDocumentDisableImageDeprecationInput(v *DisableImage return nil } +func awsEc2query_serializeOpDocumentDisableImageInput(v *DisableImageInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.ImageId != nil { + objectKey := object.Key("ImageId") + objectKey.String(*v.ImageId) + } + + return nil +} + func awsEc2query_serializeOpDocumentDisableIpamOrganizationAdminAccountInput(v *DisableIpamOrganizationAdminAccountInput, value query.Value) error { object := value.Object() _ = object @@ -59749,6 +59899,23 @@ func awsEc2query_serializeOpDocumentEnableImageDeprecationInput(v *EnableImageDe return nil } +func awsEc2query_serializeOpDocumentEnableImageInput(v *EnableImageInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.ImageId != nil { + objectKey := object.Key("ImageId") + objectKey.String(*v.ImageId) + } + + return nil +} + func awsEc2query_serializeOpDocumentEnableIpamOrganizationAdminAccountInput(v *EnableIpamOrganizationAdminAccountInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index d8413390f79..c7b83b44b55 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -819,6 +819,7 @@ const ( CapacityReservationInstancePlatformRhelWithHa CapacityReservationInstancePlatform = "RHEL with HA" CapacityReservationInstancePlatformRhelWithHaAndSqlServerStandard CapacityReservationInstancePlatform = "RHEL with HA and SQL Server Standard" CapacityReservationInstancePlatformRhelWithHaAndSqlServerEnterprise CapacityReservationInstancePlatform = "RHEL with HA and SQL Server Enterprise" + CapacityReservationInstancePlatformUbuntuProLinux CapacityReservationInstancePlatform = "Ubuntu Pro" ) // Values returns all known values for CapacityReservationInstancePlatform. Note @@ -844,6 +845,7 @@ func (CapacityReservationInstancePlatform) Values() []CapacityReservationInstanc "RHEL with HA", "RHEL with HA and SQL Server Standard", "RHEL with HA and SQL Server Enterprise", + "Ubuntu Pro", } } @@ -2430,6 +2432,7 @@ const ( ImageStateTransient ImageState = "transient" ImageStateFailed ImageState = "failed" ImageStateError ImageState = "error" + ImageStateDisabled ImageState = "disabled" ) // Values returns all known values for ImageState. Note that this can be expanded @@ -2444,6 +2447,7 @@ func (ImageState) Values() []ImageState { "transient", "failed", "error", + "disabled", } } diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index bbeee42cf5a..350eb850764 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -5006,7 +5006,7 @@ type Image struct { // Specifies whether enhanced networking with ENA is enabled. EnaSupport *bool - // The hypervisor type of the image. + // The hypervisor type of the image. Only xen is supported. ovm is not supported. Hypervisor HypervisorType // The ID of the AMI. @@ -5067,6 +5067,11 @@ type Image struct { // or an instance store volume. RootDeviceType DeviceType + // The ID of the instance that the AMI was created from if the AMI was created + // using CreateImage (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html) + // . This field only appears if the AMI was created using CreateImage. + SourceInstanceId *string + // Specifies whether enhanced networking with the Intel 82599 Virtual Function // interface is enabled. SriovNetSupport *string diff --git a/service/ec2/validators.go b/service/ec2/validators.go index 354d5aecb8f..e243948a768 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -4490,6 +4490,26 @@ func (m *validateOpDisableImageDeprecation) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpDisableImage struct { +} + +func (*validateOpDisableImage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisableImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisableImageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisableImageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisableIpamOrganizationAdminAccount struct { } @@ -4930,6 +4950,26 @@ func (m *validateOpEnableImageDeprecation) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpEnableImage struct { +} + +func (*validateOpEnableImage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEnableImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EnableImageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEnableImageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpEnableIpamOrganizationAdminAccount struct { } @@ -9326,6 +9366,10 @@ func addOpDisableImageDeprecationValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpDisableImageDeprecation{}, middleware.After) } +func addOpDisableImageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisableImage{}, middleware.After) +} + func addOpDisableIpamOrganizationAdminAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisableIpamOrganizationAdminAccount{}, middleware.After) } @@ -9414,6 +9458,10 @@ func addOpEnableImageDeprecationValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpEnableImageDeprecation{}, middleware.After) } +func addOpEnableImageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEnableImage{}, middleware.After) +} + func addOpEnableIpamOrganizationAdminAccountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableIpamOrganizationAdminAccount{}, middleware.After) } @@ -14746,6 +14794,21 @@ func validateOpDisableImageDeprecationInput(v *DisableImageDeprecationInput) err } } +func validateOpDisableImageInput(v *DisableImageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisableImageInput"} + if v.ImageId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImageId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisableIpamOrganizationAdminAccountInput(v *DisableIpamOrganizationAdminAccountInput) error { if v == nil { return nil @@ -15117,6 +15180,21 @@ func validateOpEnableImageDeprecationInput(v *EnableImageDeprecationInput) error } } +func validateOpEnableImageInput(v *EnableImageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EnableImageInput"} + if v.ImageId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImageId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpEnableIpamOrganizationAdminAccountInput(v *EnableIpamOrganizationAdminAccountInput) error { if v == nil { return nil diff --git a/service/elasticloadbalancingv2/api_op_SetSubnets.go b/service/elasticloadbalancingv2/api_op_SetSubnets.go index abd8dc5fba9..afb06ea0db8 100644 --- a/service/elasticloadbalancingv2/api_op_SetSubnets.go +++ b/service/elasticloadbalancingv2/api_op_SetSubnets.go @@ -17,10 +17,11 @@ import ( ) // Enables the Availability Zones for the specified public subnets for the -// specified Application Load Balancer or Network Load Balancer. The specified -// subnets replace the previously enabled subnets. When you specify subnets for a -// Network Load Balancer, you must include all subnets that were enabled -// previously, with their existing configurations, plus any additional subnets. +// specified Application Load Balancer, Network Load Balancer or Gateway Load +// Balancer. The specified subnets replace the previously enabled subnets. When you +// specify subnets for a Network Load Balancer, or Gateway Load Balancer you must +// include all subnets that were enabled previously, with their existing +// configurations, plus any additional subnets. func (c *Client) SetSubnets(ctx context.Context, params *SetSubnetsInput, optFns ...func(*Options)) (*SetSubnetsOutput, error) { if params == nil { params = &SetSubnetsInput{} @@ -46,7 +47,9 @@ type SetSubnetsInput struct { // [Network Load Balancers] The type of IP addresses used by the subnets for your // load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack // (for IPv4 and IPv6 addresses). You can’t specify dualstack for a load balancer - // with a UDP or TCP_UDP listener. + // with a UDP or TCP_UDP listener. [Gateway Load Balancers] The type of IP + // addresses used by the subnets for your load balancer. The possible values are + // ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses). IpAddressType types.IpAddressType // The IDs of the public subnets. You can specify only one subnet per Availability @@ -60,7 +63,8 @@ type SetSubnetsInput struct { // addresses for your internet-facing load balancer. For internal load balancers, // you can specify one private IP address per subnet from the IPv4 range of the // subnet. For internet-facing load balancer, you can specify one IPv6 address per - // subnet. + // subnet. [Gateway Load Balancers] You can specify subnets from one or more + // Availability Zones. SubnetMappings []types.SubnetMapping // The IDs of the public subnets. You can specify only one subnet per Availability @@ -69,7 +73,8 @@ type SetSubnetsInput struct { // [Application Load Balancers on Outposts] You must specify one Outpost subnet. // [Application Load Balancers on Local Zones] You can specify subnets from one or // more Local Zones. [Network Load Balancers] You can specify subnets from one or - // more Availability Zones. + // more Availability Zones. [Gateway Load Balancers] You can specify subnets from + // one or more Availability Zones. Subnets []string noSmithyDocumentSerde @@ -80,7 +85,8 @@ type SetSubnetsOutput struct { // Information about the subnets. AvailabilityZones []types.AvailabilityZone - // [Network Load Balancers] The IP address type. + // [Network Load Balancers] The IP address type. [Gateway Load Balancers] The IP + // address type. IpAddressType types.IpAddressType // Metadata pertaining to the operation's result. diff --git a/service/elasticloadbalancingv2/types/types.go b/service/elasticloadbalancingv2/types/types.go index b79db7571d0..d40559e418a 100644 --- a/service/elasticloadbalancingv2/types/types.go +++ b/service/elasticloadbalancingv2/types/types.go @@ -518,6 +518,12 @@ type LoadBalancerAttribute struct { // balancer to route requests to targets if it is unable to forward the request to // Amazon Web Services WAF. The possible values are true and false . The default // is false . + // The following attributes are supported by only Network Load Balancers: + // - dns_record.client_routing_policy - Indicates how traffic is distributed + // among the load balancer Availability Zones. The possible values are + // availability_zone_affinity with 100 percent zonal affinity, + // partial_availability_zone_affinity with 85 percent zonal affinity, and + // any_availability_zone with 0 percent zonal affinity. Key *string // The value of the attribute. diff --git a/service/glue/api_op_UpdateJobFromSourceControl.go b/service/glue/api_op_UpdateJobFromSourceControl.go index 3696a78c027..574569489fe 100644 --- a/service/glue/api_op_UpdateJobFromSourceControl.go +++ b/service/glue/api_op_UpdateJobFromSourceControl.go @@ -56,10 +56,13 @@ type UpdateJobFromSourceControlInput struct { // The name of the Glue job to be synchronized to or from the remote repository. JobName *string - // The provider for the remote repository. + // The provider for the remote repository. Possible values: GITHUB, + // AWS_CODE_COMMIT, GITLAB, BITBUCKET. Provider types.SourceControlProvider - // The name of the remote repository that contains the job artifacts. + // The name of the remote repository that contains the job artifacts. For + // BitBucket providers, RepositoryName should include WorkspaceName . Use the + // format / . RepositoryName *string // The owner of the remote repository that contains the job artifacts. diff --git a/service/glue/api_op_UpdateSourceControlFromJob.go b/service/glue/api_op_UpdateSourceControlFromJob.go index aa5ad4b6681..e9836cda0b4 100644 --- a/service/glue/api_op_UpdateSourceControlFromJob.go +++ b/service/glue/api_op_UpdateSourceControlFromJob.go @@ -56,10 +56,13 @@ type UpdateSourceControlFromJobInput struct { // The name of the Glue job to be synchronized to or from the remote repository. JobName *string - // The provider for the remote repository. + // The provider for the remote repository. Possible values: GITHUB, + // AWS_CODE_COMMIT, GITLAB, BITBUCKET. Provider types.SourceControlProvider - // The name of the remote repository that contains the job artifacts. + // The name of the remote repository that contains the job artifacts. For + // BitBucket providers, RepositoryName should include WorkspaceName . Use the + // format / . RepositoryName *string // The owner of the remote repository that contains the job artifacts. diff --git a/service/glue/types/enums.go b/service/glue/types/enums.go index 64ead39b719..e57c56616fc 100644 --- a/service/glue/types/enums.go +++ b/service/glue/types/enums.go @@ -1690,6 +1690,8 @@ type SourceControlProvider string // Enum values for SourceControlProvider const ( SourceControlProviderGithub SourceControlProvider = "GITHUB" + SourceControlProviderGitlab SourceControlProvider = "GITLAB" + SourceControlProviderBitbucket SourceControlProvider = "BITBUCKET" SourceControlProviderAwsCodeCommit SourceControlProvider = "AWS_CODE_COMMIT" ) @@ -1699,6 +1701,8 @@ const ( func (SourceControlProvider) Values() []SourceControlProvider { return []SourceControlProvider{ "GITHUB", + "GITLAB", + "BITBUCKET", "AWS_CODE_COMMIT", } } diff --git a/service/inspector2/api_op_CreateFilter.go b/service/inspector2/api_op_CreateFilter.go index 2a2d3882992..7d59c829118 100644 --- a/service/inspector2/api_op_CreateFilter.go +++ b/service/inspector2/api_op_CreateFilter.go @@ -16,7 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a filter resource using specified filter criteria. +// Creates a filter resource using specified filter criteria. When the filter +// action is set to SUPPRESS this action creates a suppression rule. func (c *Client) CreateFilter(ctx context.Context, params *CreateFilterInput, optFns ...func(*Options)) (*CreateFilterOutput, error) { if params == nil { params = &CreateFilterInput{} diff --git a/service/inspector2/api_op_ListAccountPermissions.go b/service/inspector2/api_op_ListAccountPermissions.go index 6770fc6a2c4..7cd1e1126a0 100644 --- a/service/inspector2/api_op_ListAccountPermissions.go +++ b/service/inspector2/api_op_ListAccountPermissions.go @@ -34,13 +34,17 @@ func (c *Client) ListAccountPermissions(ctx context.Context, params *ListAccount type ListAccountPermissionsInput struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the NextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string // The service scan type to check permissions for. @@ -152,7 +156,9 @@ var _ ListAccountPermissionsAPIClient = (*Client)(nil) // ListAccountPermissionsPaginatorOptions is the paginator options for // ListAccountPermissions type ListAccountPermissionsPaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/api_op_ListCoverage.go b/service/inspector2/api_op_ListCoverage.go index 8574631246b..a7b922129bc 100644 --- a/service/inspector2/api_op_ListCoverage.go +++ b/service/inspector2/api_op_ListCoverage.go @@ -38,13 +38,17 @@ type ListCoverageInput struct { // for your environment. FilterCriteria *types.CoverageFilterCriteria - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the nextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string noSmithyDocumentSerde @@ -151,7 +155,9 @@ var _ ListCoverageAPIClient = (*Client)(nil) // ListCoveragePaginatorOptions is the paginator options for ListCoverage type ListCoveragePaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/api_op_ListDelegatedAdminAccounts.go b/service/inspector2/api_op_ListDelegatedAdminAccounts.go index ae175e59818..8fdfe430c45 100644 --- a/service/inspector2/api_op_ListDelegatedAdminAccounts.go +++ b/service/inspector2/api_op_ListDelegatedAdminAccounts.go @@ -35,13 +35,17 @@ func (c *Client) ListDelegatedAdminAccounts(ctx context.Context, params *ListDel type ListDelegatedAdminAccountsInput struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the nextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string noSmithyDocumentSerde @@ -147,7 +151,9 @@ var _ ListDelegatedAdminAccountsAPIClient = (*Client)(nil) // ListDelegatedAdminAccountsPaginatorOptions is the paginator options for // ListDelegatedAdminAccounts type ListDelegatedAdminAccountsPaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/api_op_ListFilters.go b/service/inspector2/api_op_ListFilters.go index c9d2c5a56b8..213eec59c2f 100644 --- a/service/inspector2/api_op_ListFilters.go +++ b/service/inspector2/api_op_ListFilters.go @@ -40,13 +40,17 @@ type ListFiltersInput struct { // The Amazon resource number (ARN) of the filter. Arns []string - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the nextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string noSmithyDocumentSerde @@ -152,7 +156,9 @@ var _ ListFiltersAPIClient = (*Client)(nil) // ListFiltersPaginatorOptions is the paginator options for ListFilters type ListFiltersPaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/api_op_ListFindingAggregations.go b/service/inspector2/api_op_ListFindingAggregations.go index 64e2c619411..6f7019d4825 100644 --- a/service/inspector2/api_op_ListFindingAggregations.go +++ b/service/inspector2/api_op_ListFindingAggregations.go @@ -46,13 +46,17 @@ type ListFindingAggregationsInput struct { // results. AggregationRequest types.AggregationRequest - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the nextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string noSmithyDocumentSerde @@ -166,7 +170,9 @@ var _ ListFindingAggregationsAPIClient = (*Client)(nil) // ListFindingAggregationsPaginatorOptions is the paginator options for // ListFindingAggregations type ListFindingAggregationsPaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/api_op_ListFindings.go b/service/inspector2/api_op_ListFindings.go index 72dcabe50c6..12f244903f0 100644 --- a/service/inspector2/api_op_ListFindings.go +++ b/service/inspector2/api_op_ListFindings.go @@ -37,13 +37,17 @@ type ListFindingsInput struct { // Details on the filters to apply to your finding results. FilterCriteria *types.FilterCriteria - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the nextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string // Details on the sort criteria to apply to your finding results. @@ -153,7 +157,9 @@ var _ ListFindingsAPIClient = (*Client)(nil) // ListFindingsPaginatorOptions is the paginator options for ListFindings type ListFindingsPaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/api_op_ListMembers.go b/service/inspector2/api_op_ListMembers.go index 81370d056d3..d0879861954 100644 --- a/service/inspector2/api_op_ListMembers.go +++ b/service/inspector2/api_op_ListMembers.go @@ -35,13 +35,17 @@ func (c *Client) ListMembers(ctx context.Context, params *ListMembersInput, optF type ListMembersInput struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the nextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string // Specifies whether to list only currently associated members if True or to list @@ -147,7 +151,9 @@ var _ ListMembersAPIClient = (*Client)(nil) // ListMembersPaginatorOptions is the paginator options for ListMembers type ListMembersPaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/api_op_ListUsageTotals.go b/service/inspector2/api_op_ListUsageTotals.go index 573c55f62b1..2a26ecf172f 100644 --- a/service/inspector2/api_op_ListUsageTotals.go +++ b/service/inspector2/api_op_ListUsageTotals.go @@ -37,13 +37,17 @@ type ListUsageTotalsInput struct { // The Amazon Web Services account IDs to retrieve usage totals for. AccountIds []string - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. MaxResults *int32 // A token to use for paginating results that are returned in the response. Set - // the value of this parameter to null for the first request to a list action. For - // subsequent calls, use the NextToken value returned from the previous request to - // continue listing results after the first page. + // the value of this parameter to null for the first request to a list action. If + // your response returns more than the maxResults maximum value it will also + // return a nextToken value. For subsequent calls, use the nextToken value + // returned from the previous request to continue listing results after the first + // page. NextToken *string noSmithyDocumentSerde @@ -146,7 +150,9 @@ var _ ListUsageTotalsAPIClient = (*Client)(nil) // ListUsageTotalsPaginatorOptions is the paginator options for ListUsageTotals type ListUsageTotalsPaginatorOptions struct { - // The maximum number of results to return in the response. + // The maximum number of results the response can return. If your request would + // return more than the maximum the response will return a nextToken value, use + // this value when you call the action again to get the remaining results. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/inspector2/doc.go b/service/inspector2/doc.go index 4ae387099e5..548c5ee2d1c 100644 --- a/service/inspector2/doc.go +++ b/service/inspector2/doc.go @@ -4,6 +4,6 @@ // Inspector2. // // Amazon Inspector is a vulnerability discovery service that automates continuous -// scanning for security vulnerabilities within your Amazon EC2 and Amazon ECR -// environments. +// scanning for security vulnerabilities within your Amazon EC2, Amazon ECR, and +// Amazon Web Services Lambda environments. package inspector2 diff --git a/service/inspector2/types/enums.go b/service/inspector2/types/enums.go index 50b076d4a69..6a6e07d38a7 100644 --- a/service/inspector2/types/enums.go +++ b/service/inspector2/types/enums.go @@ -321,6 +321,7 @@ const ( Ec2PlatformWindows Ec2Platform = "WINDOWS" Ec2PlatformLinux Ec2Platform = "LINUX" Ec2PlatformUnknown Ec2Platform = "UNKNOWN" + Ec2PlatformMacos Ec2Platform = "MACOS" ) // Values returns all known values for Ec2Platform. Note that this can be expanded @@ -331,6 +332,7 @@ func (Ec2Platform) Values() []Ec2Platform { "WINDOWS", "LINUX", "UNKNOWN", + "MACOS", } } diff --git a/service/inspector2/types/types.go b/service/inspector2/types/types.go index 8a181c85a8a..56d81549fe8 100644 --- a/service/inspector2/types/types.go +++ b/service/inspector2/types/types.go @@ -810,7 +810,9 @@ type CoverageFilterCriteria struct { // AWS_ECR_REPOSITORY . ResourceType []CoverageStringFilter - // The scan status code to filter on. + // The scan status code to filter on. Valid values are: ValidationException , + // InternalServerException , ResourceNotFoundException , BadRequestException , and + // ThrottlingException . ScanStatusCode []CoverageStringFilter // The scan status reason to filter on. @@ -1519,12 +1521,18 @@ type Finding struct { // This member is required. Remediation *Remediation - // Contains information on the resources involved in a finding. + // Contains information on the resources involved in a finding. The resource value + // determines the valid values for type in your request. For more information, see + // Finding types (https://docs.aws.amazon.com/inspector/latest/user/findings-types.html) + // in the Amazon Inspector user guide. // // This member is required. Resources []Resource - // The severity of the finding. + // The severity of the finding. UNTRIAGED applies to PACKAGE_VULNERABILITY type + // findings that the vendor has not assigned a severity yet. For more information, + // see Severity levels for findings (https://docs.aws.amazon.com/inspector/latest/user/findings-understanding-severity.html) + // in the Amazon Inspector user guide. // // This member is required. Severity Severity @@ -1534,7 +1542,9 @@ type Finding struct { // This member is required. Status FindingStatus - // The type of the finding. + // The type of the finding. The type value determines the valid values for resource + // in your request. For more information, see Finding types (https://docs.aws.amazon.com/inspector/latest/user/findings-types.html) + // in the Amazon Inspector user guide. // // This member is required. Type FindingType @@ -2446,7 +2456,63 @@ type ResourceStringFilter struct { // The status of the scan. type ScanStatus struct { - // The reason for the scan. + // The scan status. Possible return values and descriptions are: + // PENDING_INITIAL_SCAN - This resource has been identified for scanning, results + // will be available soon. ACCESS_DENIED - Resource access policy restricting + // Amazon Inspector access. Please update the IAM policy. INTERNAL_ERROR - Amazon + // Inspector has encountered an internal error for this resource. Amazon Inspector + // service will automatically resolve the issue and resume the scanning. No action + // required from the user. UNMANAGED_EC2_INSTANCE - The EC2 instance is not + // managed by SSM, please use the following SSM automation to remediate the issue: + // https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-awssupport-troubleshoot-managed-instance.html (https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-awssupport-troubleshoot-managed-instance.html) + // . Once the instance becomes managed by SSM, Inspector will automatically begin + // scanning this instance. UNSUPPORTED_OS - Amazon Inspector does not support this + // OS, architecture, or image manifest type at this time. To see a complete list of + // supported operating systems see: + // https://docs.aws.amazon.com/inspector/latest/user/supported.html (https://docs.aws.amazon.com/inspector/latest/user/supported.html) + // . SCAN_ELIGIBILITY_EXPIRED - The configured scan duration has lapsed for this + // image. RESOURCE_TERMINATED - This resource has been terminated. The findings + // and coverage associated with this resource are in the process of being cleaned + // up. SUCCESSFUL - The scan was successful. NO_RESOURCES_FOUND - Reserved for + // future use. IMAGE_SIZE_EXCEEDED - Reserved for future use. SCAN_FREQUENCY_MANUAL + // - This image will not be covered by Amazon Inspector due to the repository scan + // frequency configuration. SCAN_FREQUENCY_SCAN_ON_PUSH - This image will be + // scanned one time and will not new findings because of the scan frequency + // configuration. EC2_INSTANCE_STOPPED - This EC2 instance is in a stopped state, + // therefore, Amazon Inspector will pause scanning. The existing findings will + // continue to exist until the instance is terminated. Once the instance is + // re-started, Inspector will automatically start scanning the instance again. + // Please note that you will not be charged for this instance while it’s in a + // stopped state. PENDING_DISABLE - This resource is pending cleanup during + // disablement. The customer will not be billed while a resource is in the pending + // disable status. NO INVENTORY - Amazon Inspector couldn’t find software + // application inventory to scan for vulnerabilities. This might be caused due to + // required Amazon Inspector associations being deleted or failing to run on your + // resource. Please verify the status of InspectorInventoryCollection-do-not-delete + // association in the SSM console for the resource. Additionally, you can verify + // the instance’s inventory in the SSM Fleet Manager console. STALE_INVENTORY - + // Amazon Inspector wasn’t able to collect an updated software application + // inventory in the last 7 days. Please confirm the required Amazon Inspector + // associations still exist and you can still see an updated inventory in the SSM + // console. EXCLUDED_BY_TAG - This resource was not scanned because it has been + // excluded by a tag. UNSUPPORTED_RUNTIME - The function was not scanned because + // it has an unsupported runtime. To see a complete list of supported runtimes see: + // https://docs.aws.amazon.com/inspector/latest/user/supported.html (https://docs.aws.amazon.com/inspector/latest/user/supported.html) + // . UNSUPPORTED_MEDIA_TYPE - The ECR image has an unsupported media type. + // UNSUPPORTED_CONFIG_FILE - Reserved for future use. + // DEEP_INSPECTION_PACKAGE_COLLECTION_LIMIT_EXCEEDED - The instance has exceeded + // the 5000 package limit for Amazon Inspector Deep inspection. To resume Deep + // inspection for this instance you can try to adjust the custom paths associated + // with the account. DEEP_INSPECTION_DAILY_SSM_INVENTORY_LIMIT_EXCEEDED - The SSM + // agent couldn't send inventory to Amazon Inspector because the SSM quota for + // Inventory data collected per instance per day has already been reached for this + // instance. DEEP_INSPECTION_COLLECTION_TIME_LIMIT_EXCEEDED - Amazon Inspector + // failed to extract the package inventory because the package collection time + // exceeding the maximum threshold of 15 minutes. DEEP_INSPECTION_NO_INVENTORY The + // Amazon Inspector plugin hasn't yet been able to collect an inventory of packages + // for this instance. This is usually the result of a pending scan, however, if + // this status persists after 6 hours, use SSM to ensure that the required Amazon + // Inspector associations exist and are running for the instance. // // This member is required. Reason ScanStatusReason @@ -2706,7 +2772,8 @@ type Vulnerability struct { // A list of related vulnerabilities. RelatedVulnerabilities []string - // The source of the vulnerability information. + // The source of the vulnerability information. Possible results are RHEL , + // AMAZON_CVE , DEBIAN or NVD . Source VulnerabilitySource // A link to the official source material for this vulnerability. diff --git a/service/ivsrealtime/deserializers.go b/service/ivsrealtime/deserializers.go index a0e8b4cb2da..cccd99ee103 100644 --- a/service/ivsrealtime/deserializers.go +++ b/service/ivsrealtime/deserializers.go @@ -2627,6 +2627,24 @@ func awsRestjson1_deserializeDocumentParticipant(v **types.Participant, value in return err } + case "browserName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParticipantClientAttribute to be of type string, got %T instead", value) + } + sv.BrowserName = ptr.String(jtv) + } + + case "browserVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParticipantClientAttribute to be of type string, got %T instead", value) + } + sv.BrowserVersion = ptr.String(jtv) + } + case "firstJoinTime": if value != nil { jtv, ok := value.(string) @@ -2640,6 +2658,33 @@ func awsRestjson1_deserializeDocumentParticipant(v **types.Participant, value in sv.FirstJoinTime = ptr.Time(t) } + case "ispName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParticipantClientAttribute to be of type string, got %T instead", value) + } + sv.IspName = ptr.String(jtv) + } + + case "osName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParticipantClientAttribute to be of type string, got %T instead", value) + } + sv.OsName = ptr.String(jtv) + } + + case "osVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParticipantClientAttribute to be of type string, got %T instead", value) + } + sv.OsVersion = ptr.String(jtv) + } + case "participantId": if value != nil { jtv, ok := value.(string) @@ -2658,6 +2703,15 @@ func awsRestjson1_deserializeDocumentParticipant(v **types.Participant, value in sv.Published = jtv } + case "sdkVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParticipantClientAttribute to be of type string, got %T instead", value) + } + sv.SdkVersion = ptr.String(jtv) + } + case "state": if value != nil { jtv, ok := value.(string) diff --git a/service/ivsrealtime/types/types.go b/service/ivsrealtime/types/types.go index d73e6a642da..d50e0988956 100644 --- a/service/ivsrealtime/types/types.go +++ b/service/ivsrealtime/types/types.go @@ -49,16 +49,34 @@ type Participant struct { // not be used for personally identifying, confidential, or sensitive information. Attributes map[string]string + // The participant’s browser. + BrowserName *string + + // The participant’s browser version. + BrowserVersion *string + // ISO 8601 timestamp (returned as a string) when the participant first joined the // stage session. FirstJoinTime *time.Time + // The participant’s Internet Service Provider. + IspName *string + + // The participant’s operating system. + OsName *string + + // The participant’s operating system version. + OsVersion *string + // Unique identifier for this participant, assigned by IVS. ParticipantId *string // Whether the participant ever published to the stage session. Published bool + // The participant’s SDK version. + SdkVersion *string + // Whether the participant is connected to or disconnected from the stage. State ParticipantState diff --git a/service/lambda/deserializers.go b/service/lambda/deserializers.go index d5f8d0ab990..9593a72c712 100644 --- a/service/lambda/deserializers.go +++ b/service/lambda/deserializers.go @@ -20485,6 +20485,15 @@ func awsRestjson1_deserializeDocumentVpcConfigResponse(v **types.VpcConfigRespon for key, value := range shape { switch key { + case "Ipv6AllowedForDualStack": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.Ipv6AllowedForDualStack = ptr.Bool(jtv) + } + case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { return err diff --git a/service/lambda/serializers.go b/service/lambda/serializers.go index 3d429710844..fc45a1efadc 100644 --- a/service/lambda/serializers.go +++ b/service/lambda/serializers.go @@ -6461,6 +6461,11 @@ func awsRestjson1_serializeDocumentVpcConfig(v *types.VpcConfig, value smithyjso object := value.Object() defer object.Close() + if v.Ipv6AllowedForDualStack != nil { + ok := object.Key("Ipv6AllowedForDualStack") + ok.Boolean(*v.Ipv6AllowedForDualStack) + } + if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsRestjson1_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil { diff --git a/service/lambda/types/types.go b/service/lambda/types/types.go index 53f49c0609e..16ebedc6698 100644 --- a/service/lambda/types/types.go +++ b/service/lambda/types/types.go @@ -1134,6 +1134,10 @@ type TracingConfigResponse struct { // . type VpcConfig struct { + // Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack + // subnets. + Ipv6AllowedForDualStack *bool + // A list of VPC security group IDs. SecurityGroupIds []string @@ -1146,6 +1150,10 @@ type VpcConfig struct { // The VPC security groups and subnets that are attached to a Lambda function. type VpcConfigResponse struct { + // Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack + // subnets. + Ipv6AllowedForDualStack *bool + // A list of VPC security group IDs. SecurityGroupIds []string diff --git a/service/location/api_op_AssociateTrackerConsumer.go b/service/location/api_op_AssociateTrackerConsumer.go index 5b2b65570e9..40fa9a2d0c3 100644 --- a/service/location/api_op_AssociateTrackerConsumer.go +++ b/service/location/api_op_AssociateTrackerConsumer.go @@ -159,7 +159,7 @@ func (m *endpointPrefix_opAssociateTrackerConsumerMiddleware) HandleSerialize(ct return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_CreateGeofenceCollection.go b/service/location/api_op_CreateGeofenceCollection.go index 03da205e0ab..38ed9f166d0 100644 --- a/service/location/api_op_CreateGeofenceCollection.go +++ b/service/location/api_op_CreateGeofenceCollection.go @@ -201,7 +201,7 @@ func (m *endpointPrefix_opCreateGeofenceCollectionMiddleware) HandleSerialize(ct return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "geofencing." + req.URL.Host + req.URL.Host = "cp.geofencing." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_CreateKey.go b/service/location/api_op_CreateKey.go index e1c4623b97b..c433ce7ca6d 100644 --- a/service/location/api_op_CreateKey.go +++ b/service/location/api_op_CreateKey.go @@ -208,7 +208,7 @@ func (m *endpointPrefix_opCreateKeyMiddleware) HandleSerialize(ctx context.Conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_CreateMap.go b/service/location/api_op_CreateMap.go index cd4101802b3..b1fe54c956a 100644 --- a/service/location/api_op_CreateMap.go +++ b/service/location/api_op_CreateMap.go @@ -203,7 +203,7 @@ func (m *endpointPrefix_opCreateMapMiddleware) HandleSerialize(ctx context.Conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "maps." + req.URL.Host + req.URL.Host = "cp.maps." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_CreatePlaceIndex.go b/service/location/api_op_CreatePlaceIndex.go index d92ee08761a..10ae2656080 100644 --- a/service/location/api_op_CreatePlaceIndex.go +++ b/service/location/api_op_CreatePlaceIndex.go @@ -225,7 +225,7 @@ func (m *endpointPrefix_opCreatePlaceIndexMiddleware) HandleSerialize(ctx contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "places." + req.URL.Host + req.URL.Host = "cp.places." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_CreateRouteCalculator.go b/service/location/api_op_CreateRouteCalculator.go index c3d02f398d0..3a1a1c0a3d9 100644 --- a/service/location/api_op_CreateRouteCalculator.go +++ b/service/location/api_op_CreateRouteCalculator.go @@ -225,7 +225,7 @@ func (m *endpointPrefix_opCreateRouteCalculatorMiddleware) HandleSerialize(ctx c return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "routes." + req.URL.Host + req.URL.Host = "cp.routes." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_CreateTracker.go b/service/location/api_op_CreateTracker.go index 40db1fde6e3..c94cff6cac6 100644 --- a/service/location/api_op_CreateTracker.go +++ b/service/location/api_op_CreateTracker.go @@ -240,7 +240,7 @@ func (m *endpointPrefix_opCreateTrackerMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DeleteGeofenceCollection.go b/service/location/api_op_DeleteGeofenceCollection.go index 0a28c6d2588..24bb6a4c52d 100644 --- a/service/location/api_op_DeleteGeofenceCollection.go +++ b/service/location/api_op_DeleteGeofenceCollection.go @@ -147,7 +147,7 @@ func (m *endpointPrefix_opDeleteGeofenceCollectionMiddleware) HandleSerialize(ct return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "geofencing." + req.URL.Host + req.URL.Host = "cp.geofencing." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DeleteKey.go b/service/location/api_op_DeleteKey.go index 4fb21325434..810233800f9 100644 --- a/service/location/api_op_DeleteKey.go +++ b/service/location/api_op_DeleteKey.go @@ -146,7 +146,7 @@ func (m *endpointPrefix_opDeleteKeyMiddleware) HandleSerialize(ctx context.Conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DeleteMap.go b/service/location/api_op_DeleteMap.go index fe8144c53fe..f06b7f4ad6c 100644 --- a/service/location/api_op_DeleteMap.go +++ b/service/location/api_op_DeleteMap.go @@ -147,7 +147,7 @@ func (m *endpointPrefix_opDeleteMapMiddleware) HandleSerialize(ctx context.Conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "maps." + req.URL.Host + req.URL.Host = "cp.maps." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DeletePlaceIndex.go b/service/location/api_op_DeletePlaceIndex.go index df9e98de103..aeedc3a13cc 100644 --- a/service/location/api_op_DeletePlaceIndex.go +++ b/service/location/api_op_DeletePlaceIndex.go @@ -146,7 +146,7 @@ func (m *endpointPrefix_opDeletePlaceIndexMiddleware) HandleSerialize(ctx contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "places." + req.URL.Host + req.URL.Host = "cp.places." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DeleteRouteCalculator.go b/service/location/api_op_DeleteRouteCalculator.go index aaf9096e711..1ef46561655 100644 --- a/service/location/api_op_DeleteRouteCalculator.go +++ b/service/location/api_op_DeleteRouteCalculator.go @@ -146,7 +146,7 @@ func (m *endpointPrefix_opDeleteRouteCalculatorMiddleware) HandleSerialize(ctx c return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "routes." + req.URL.Host + req.URL.Host = "cp.routes." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DeleteTracker.go b/service/location/api_op_DeleteTracker.go index ada5f86cf42..60de5376a8d 100644 --- a/service/location/api_op_DeleteTracker.go +++ b/service/location/api_op_DeleteTracker.go @@ -148,7 +148,7 @@ func (m *endpointPrefix_opDeleteTrackerMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DescribeGeofenceCollection.go b/service/location/api_op_DescribeGeofenceCollection.go index f1ebf235038..82702308668 100644 --- a/service/location/api_op_DescribeGeofenceCollection.go +++ b/service/location/api_op_DescribeGeofenceCollection.go @@ -198,7 +198,7 @@ func (m *endpointPrefix_opDescribeGeofenceCollectionMiddleware) HandleSerialize( return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "geofencing." + req.URL.Host + req.URL.Host = "cp.geofencing." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DescribeKey.go b/service/location/api_op_DescribeKey.go index a8f7f75cbc3..88116cca365 100644 --- a/service/location/api_op_DescribeKey.go +++ b/service/location/api_op_DescribeKey.go @@ -195,7 +195,7 @@ func (m *endpointPrefix_opDescribeKeyMiddleware) HandleSerialize(ctx context.Con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DescribeMap.go b/service/location/api_op_DescribeMap.go index 382f0b6d912..88e26f3c622 100644 --- a/service/location/api_op_DescribeMap.go +++ b/service/location/api_op_DescribeMap.go @@ -195,7 +195,7 @@ func (m *endpointPrefix_opDescribeMapMiddleware) HandleSerialize(ctx context.Con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "maps." + req.URL.Host + req.URL.Host = "cp.maps." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DescribePlaceIndex.go b/service/location/api_op_DescribePlaceIndex.go index 14dea5d0941..78193279acd 100644 --- a/service/location/api_op_DescribePlaceIndex.go +++ b/service/location/api_op_DescribePlaceIndex.go @@ -201,7 +201,7 @@ func (m *endpointPrefix_opDescribePlaceIndexMiddleware) HandleSerialize(ctx cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "places." + req.URL.Host + req.URL.Host = "cp.places." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DescribeRouteCalculator.go b/service/location/api_op_DescribeRouteCalculator.go index a1171e37c03..34b2fbe5bfa 100644 --- a/service/location/api_op_DescribeRouteCalculator.go +++ b/service/location/api_op_DescribeRouteCalculator.go @@ -200,7 +200,7 @@ func (m *endpointPrefix_opDescribeRouteCalculatorMiddleware) HandleSerialize(ctx return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "routes." + req.URL.Host + req.URL.Host = "cp.routes." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DescribeTracker.go b/service/location/api_op_DescribeTracker.go index a7ef31202b8..bc732b583cc 100644 --- a/service/location/api_op_DescribeTracker.go +++ b/service/location/api_op_DescribeTracker.go @@ -214,7 +214,7 @@ func (m *endpointPrefix_opDescribeTrackerMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_DisassociateTrackerConsumer.go b/service/location/api_op_DisassociateTrackerConsumer.go index 7ec6235066e..c1d41f0df99 100644 --- a/service/location/api_op_DisassociateTrackerConsumer.go +++ b/service/location/api_op_DisassociateTrackerConsumer.go @@ -156,7 +156,7 @@ func (m *endpointPrefix_opDisassociateTrackerConsumerMiddleware) HandleSerialize return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListGeofenceCollections.go b/service/location/api_op_ListGeofenceCollections.go index 3b0ac1d2505..133b04e1619 100644 --- a/service/location/api_op_ListGeofenceCollections.go +++ b/service/location/api_op_ListGeofenceCollections.go @@ -157,7 +157,7 @@ func (m *endpointPrefix_opListGeofenceCollectionsMiddleware) HandleSerialize(ctx return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "geofencing." + req.URL.Host + req.URL.Host = "cp.geofencing." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListKeys.go b/service/location/api_op_ListKeys.go index 99fc1159571..5c088496eff 100644 --- a/service/location/api_op_ListKeys.go +++ b/service/location/api_op_ListKeys.go @@ -161,7 +161,7 @@ func (m *endpointPrefix_opListKeysMiddleware) HandleSerialize(ctx context.Contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListMaps.go b/service/location/api_op_ListMaps.go index de88fd6ae8f..e5b95f2a1db 100644 --- a/service/location/api_op_ListMaps.go +++ b/service/location/api_op_ListMaps.go @@ -157,7 +157,7 @@ func (m *endpointPrefix_opListMapsMiddleware) HandleSerialize(ctx context.Contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "maps." + req.URL.Host + req.URL.Host = "cp.maps." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListPlaceIndexes.go b/service/location/api_op_ListPlaceIndexes.go index b07562725b2..4154f35c6a6 100644 --- a/service/location/api_op_ListPlaceIndexes.go +++ b/service/location/api_op_ListPlaceIndexes.go @@ -157,7 +157,7 @@ func (m *endpointPrefix_opListPlaceIndexesMiddleware) HandleSerialize(ctx contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "places." + req.URL.Host + req.URL.Host = "cp.places." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListRouteCalculators.go b/service/location/api_op_ListRouteCalculators.go index 7c53c703ea2..748a9154197 100644 --- a/service/location/api_op_ListRouteCalculators.go +++ b/service/location/api_op_ListRouteCalculators.go @@ -158,7 +158,7 @@ func (m *endpointPrefix_opListRouteCalculatorsMiddleware) HandleSerialize(ctx co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "routes." + req.URL.Host + req.URL.Host = "cp.routes." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListTagsForResource.go b/service/location/api_op_ListTagsForResource.go index 08bb2d99d26..e1f1bcef31b 100644 --- a/service/location/api_op_ListTagsForResource.go +++ b/service/location/api_op_ListTagsForResource.go @@ -153,7 +153,7 @@ func (m *endpointPrefix_opListTagsForResourceMiddleware) HandleSerialize(ctx con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListTrackerConsumers.go b/service/location/api_op_ListTrackerConsumers.go index 08f6894cb2e..1d0acebf084 100644 --- a/service/location/api_op_ListTrackerConsumers.go +++ b/service/location/api_op_ListTrackerConsumers.go @@ -165,7 +165,7 @@ func (m *endpointPrefix_opListTrackerConsumersMiddleware) HandleSerialize(ctx co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_ListTrackers.go b/service/location/api_op_ListTrackers.go index bf6ed04dd54..2c526805fc3 100644 --- a/service/location/api_op_ListTrackers.go +++ b/service/location/api_op_ListTrackers.go @@ -159,7 +159,7 @@ func (m *endpointPrefix_opListTrackersMiddleware) HandleSerialize(ctx context.Co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_TagResource.go b/service/location/api_op_TagResource.go index c172a7c97d7..969f70012e8 100644 --- a/service/location/api_op_TagResource.go +++ b/service/location/api_op_TagResource.go @@ -169,7 +169,7 @@ func (m *endpointPrefix_opTagResourceMiddleware) HandleSerialize(ctx context.Con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_UntagResource.go b/service/location/api_op_UntagResource.go index 7f7bf8f2a46..13d44f417d3 100644 --- a/service/location/api_op_UntagResource.go +++ b/service/location/api_op_UntagResource.go @@ -152,7 +152,7 @@ func (m *endpointPrefix_opUntagResourceMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_UpdateGeofenceCollection.go b/service/location/api_op_UpdateGeofenceCollection.go index 3dd0cccd9d8..b79b67d3324 100644 --- a/service/location/api_op_UpdateGeofenceCollection.go +++ b/service/location/api_op_UpdateGeofenceCollection.go @@ -181,7 +181,7 @@ func (m *endpointPrefix_opUpdateGeofenceCollectionMiddleware) HandleSerialize(ct return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "geofencing." + req.URL.Host + req.URL.Host = "cp.geofencing." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_UpdateKey.go b/service/location/api_op_UpdateKey.go index f705c01f15e..516a6ac3db8 100644 --- a/service/location/api_op_UpdateKey.go +++ b/service/location/api_op_UpdateKey.go @@ -185,7 +185,7 @@ func (m *endpointPrefix_opUpdateKeyMiddleware) HandleSerialize(ctx context.Conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "metadata." + req.URL.Host + req.URL.Host = "cp.metadata." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_UpdateMap.go b/service/location/api_op_UpdateMap.go index 9b23299810d..f350a3c19f8 100644 --- a/service/location/api_op_UpdateMap.go +++ b/service/location/api_op_UpdateMap.go @@ -179,7 +179,7 @@ func (m *endpointPrefix_opUpdateMapMiddleware) HandleSerialize(ctx context.Conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "maps." + req.URL.Host + req.URL.Host = "cp.maps." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_UpdatePlaceIndex.go b/service/location/api_op_UpdatePlaceIndex.go index ca521a84d8c..da7f3e066ec 100644 --- a/service/location/api_op_UpdatePlaceIndex.go +++ b/service/location/api_op_UpdatePlaceIndex.go @@ -178,7 +178,7 @@ func (m *endpointPrefix_opUpdatePlaceIndexMiddleware) HandleSerialize(ctx contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "places." + req.URL.Host + req.URL.Host = "cp.places." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_UpdateRouteCalculator.go b/service/location/api_op_UpdateRouteCalculator.go index 3e00bea3400..5fe0a18d4e7 100644 --- a/service/location/api_op_UpdateRouteCalculator.go +++ b/service/location/api_op_UpdateRouteCalculator.go @@ -176,7 +176,7 @@ func (m *endpointPrefix_opUpdateRouteCalculatorMiddleware) HandleSerialize(ctx c return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "routes." + req.URL.Host + req.URL.Host = "cp.routes." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/location/api_op_UpdateTracker.go b/service/location/api_op_UpdateTracker.go index 25c61f84041..0e6bd653ee2 100644 --- a/service/location/api_op_UpdateTracker.go +++ b/service/location/api_op_UpdateTracker.go @@ -210,7 +210,7 @@ func (m *endpointPrefix_opUpdateTrackerMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL.Host = "tracking." + req.URL.Host + req.URL.Host = "cp.tracking." + req.URL.Host return next.HandleSerialize(ctx, in) } diff --git a/service/pricing/api_op_ListPriceLists.go b/service/pricing/api_op_ListPriceLists.go index 6b6b6c912c8..058d1a7c456 100644 --- a/service/pricing/api_op_ListPriceLists.go +++ b/service/pricing/api_op_ListPriceLists.go @@ -60,9 +60,9 @@ type ListPriceListsInput struct { // want to retrieve. For example, to get the list of applicable Amazon EC2 price // lists, use AmazonEC2 . For a full list of service codes containing On-Demand and // Reserved Instance (RI) pricing, use the DescribeServices (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_DescribeServices.html#awscostmanagement-pricing_DescribeServices-request-FormatVersion) - // API. To retrieve the Compute Savings Plan price lists, use ComputeSavingsPlans . - // To retrieve Machine Learning Savings Plans price lists, use - // MachineLearningSavingsPlans . + // API. To retrieve the Reserved Instance and Compute Savings Plan price lists, use + // ComputeSavingsPlans . To retrieve Machine Learning Savings Plans price lists, + // use MachineLearningSavingsPlans . // // This member is required. ServiceCode *string diff --git a/service/pricing/doc.go b/service/pricing/doc.go index f293831f91b..8dcea6f283b 100644 --- a/service/pricing/doc.go +++ b/service/pricing/doc.go @@ -21,8 +21,7 @@ // names, you can use GetAttributeValues to see what values are available for an // attribute. With the service code and an attribute name and value, you can use // GetProducts to find specific products that you're interested in, such as an -// AmazonEC2 instance, with a Provisioned IOPS volumeType . You can use the -// following endpoints for the Amazon Web Services Price List API: -// - https://api.pricing.us-east-1.amazonaws.com -// - https://api.pricing.ap-south-1.amazonaws.com +// AmazonEC2 instance, with a Provisioned IOPS volumeType . For more information, +// see Using the Amazon Web Services Price List API (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html) +// in the Billing User Guide. package pricing diff --git a/service/rds/api_op_CreateDBInstance.go b/service/rds/api_op_CreateDBInstance.go index c829da6ca33..039d71dfb7a 100644 --- a/service/rds/api_op_CreateDBInstance.go +++ b/service/rds/api_op_CreateDBInstance.go @@ -286,6 +286,9 @@ type CreateDBInstanceInput struct { // The Oracle SID is also the name of your CDB. DBSystemId *string + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + // Specifies whether the DB instance has deletion protection enabled. The database // can't be deleted when deletion protection is enabled. By default, deletion // protection isn't enabled. For more information, see Deleting a DB Instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html) diff --git a/service/rds/api_op_CreateDBInstanceReadReplica.go b/service/rds/api_op_CreateDBInstanceReadReplica.go index 90d6f0ee827..edef14731e4 100644 --- a/service/rds/api_op_CreateDBInstanceReadReplica.go +++ b/service/rds/api_op_CreateDBInstanceReadReplica.go @@ -123,6 +123,9 @@ type CreateDBInstanceReadReplicaInput struct { // Example: mydbsubnetgroup DBSubnetGroupName *string + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + // Specifies whether to enable deletion protection for the DB instance. The // database can't be deleted when deletion protection is enabled. By default, // deletion protection isn't enabled. For more information, see Deleting a DB diff --git a/service/rds/api_op_ModifyDBInstance.go b/service/rds/api_op_ModifyDBInstance.go index 5bdefcd3e56..3fb7c7ba5d3 100644 --- a/service/rds/api_op_ModifyDBInstance.go +++ b/service/rds/api_op_ModifyDBInstance.go @@ -211,6 +211,9 @@ type ModifyDBInstanceInput struct { // Example: mydbsubnetgroup DBSubnetGroupName *string + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + // Specifies whether the DB instance has deletion protection enabled. The database // can't be deleted when deletion protection is enabled. By default, deletion // protection isn't enabled. For more information, see Deleting a DB Instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html) diff --git a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go index 8cc957586fd..47f14587ebe 100644 --- a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go +++ b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go @@ -156,6 +156,9 @@ type RestoreDBInstanceFromDBSnapshotInput struct { // must match the name of an existing DBSubnetGroup. Example: mydbsubnetgroup DBSubnetGroupName *string + // Specifies whether to enable a dedicated log volume (DLV) for the DB instance. + DedicatedLogVolume *bool + // Specifies whether to enable deletion protection for the DB instance. The // database can't be deleted when deletion protection is enabled. By default, // deletion protection isn't enabled. For more information, see Deleting a DB diff --git a/service/rds/api_op_RestoreDBInstanceFromS3.go b/service/rds/api_op_RestoreDBInstanceFromS3.go index 166dbaf1b00..e1f8f983341 100644 --- a/service/rds/api_op_RestoreDBInstanceFromS3.go +++ b/service/rds/api_op_RestoreDBInstanceFromS3.go @@ -134,6 +134,9 @@ type RestoreDBInstanceFromS3Input struct { // must match the name of an existing DBSubnetGroup. Example: mydbsubnetgroup DBSubnetGroupName *string + // Specifies whether to enable a dedicated log volume (DLV) for the DB instance. + DedicatedLogVolume *bool + // Specifies whether to enable deletion protection for the DB instance. The // database can't be deleted when deletion protection is enabled. By default, // deletion protection isn't enabled. For more information, see Deleting a DB diff --git a/service/rds/api_op_RestoreDBInstanceToPointInTime.go b/service/rds/api_op_RestoreDBInstanceToPointInTime.go index 1fb68f038b3..c79f0541676 100644 --- a/service/rds/api_op_RestoreDBInstanceToPointInTime.go +++ b/service/rds/api_op_RestoreDBInstanceToPointInTime.go @@ -122,6 +122,9 @@ type RestoreDBInstanceToPointInTimeInput struct { // Example: mydbsubnetgroup DBSubnetGroupName *string + // Specifies whether to enable a dedicated log volume (DLV) for the DB instance. + DedicatedLogVolume *bool + // Specifies whether the DB instance has deletion protection enabled. The database // can't be deleted when deletion protection is enabled. By default, deletion // protection isn't enabled. For more information, see Deleting a DB Instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html) diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index 0243c6b714f..ec58ea95eb9 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -29310,6 +29310,22 @@ func awsAwsquery_deserializeDocumentDBInstance(v **types.DBInstance, decoder smi sv.DBSystemId = ptr.String(xtv) } + case strings.EqualFold("DedicatedLogVolume", 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.DedicatedLogVolume = xtv + } + case strings.EqualFold("DeletionProtection", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -30113,6 +30129,22 @@ func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackup(v **types.DBInstan sv.DbiResourceId = ptr.String(xtv) } + case strings.EqualFold("DedicatedLogVolume", 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 BooleanOptional to be of type *bool, got %T instead", val) + } + sv.DedicatedLogVolume = ptr.Bool(xtv) + } + case strings.EqualFold("Encrypted", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -33602,6 +33634,22 @@ func awsAwsquery_deserializeDocumentDBSnapshot(v **types.DBSnapshot, decoder smi sv.DBSystemId = ptr.String(xtv) } + case strings.EqualFold("DedicatedLogVolume", 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.DedicatedLogVolume = xtv + } + case strings.EqualFold("Encrypted", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -41942,6 +41990,22 @@ func awsAwsquery_deserializeDocumentOrderableDBInstanceOption(v **types.Orderabl sv.SupportsClusters = xtv } + case strings.EqualFold("SupportsDedicatedLogVolume", 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.SupportsDedicatedLogVolume = xtv + } + case strings.EqualFold("SupportsEnhancedMonitoring", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -42907,6 +42971,22 @@ func awsAwsquery_deserializeDocumentPendingModifiedValues(v **types.PendingModif sv.DBSubnetGroupName = ptr.String(xtv) } + case strings.EqualFold("DedicatedLogVolume", 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 BooleanOptional to be of type *bool, got %T instead", val) + } + sv.DedicatedLogVolume = ptr.Bool(xtv) + } + case strings.EqualFold("Engine", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -47330,6 +47410,22 @@ func awsAwsquery_deserializeDocumentValidDBInstanceModificationsMessage(v **type return err } + case strings.EqualFold("SupportsDedicatedLogVolume", 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.SupportsDedicatedLogVolume = xtv + } + case strings.EqualFold("ValidProcessorFeatures", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsAwsquery_deserializeDocumentAvailableProcessorFeatureList(&sv.ValidProcessorFeatures, nodeDecoder); err != nil { diff --git a/service/rds/serializers.go b/service/rds/serializers.go index b38a6dee067..bd1874c5861 100644 --- a/service/rds/serializers.go +++ b/service/rds/serializers.go @@ -10753,6 +10753,11 @@ func awsAwsquery_serializeOpDocumentCreateDBInstanceInput(v *CreateDBInstanceInp objectKey.String(*v.DBSystemId) } + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + if v.DeletionProtection != nil { objectKey := object.Key("DeletionProtection") objectKey.Boolean(*v.DeletionProtection) @@ -11030,6 +11035,11 @@ func awsAwsquery_serializeOpDocumentCreateDBInstanceReadReplicaInput(v *CreateDB objectKey.String(*v.DBSubnetGroupName) } + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + if v.DeletionProtection != nil { objectKey := object.Key("DeletionProtection") objectKey.Boolean(*v.DeletionProtection) @@ -13791,6 +13801,11 @@ func awsAwsquery_serializeOpDocumentModifyDBInstanceInput(v *ModifyDBInstanceInp objectKey.String(*v.DBSubnetGroupName) } + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + if v.DeletionProtection != nil { objectKey := object.Key("DeletionProtection") objectKey.Boolean(*v.DeletionProtection) @@ -15152,6 +15167,11 @@ func awsAwsquery_serializeOpDocumentRestoreDBInstanceFromDBSnapshotInput(v *Rest objectKey.String(*v.DBSubnetGroupName) } + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + if v.DeletionProtection != nil { objectKey := object.Key("DeletionProtection") objectKey.Boolean(*v.DeletionProtection) @@ -15356,6 +15376,11 @@ func awsAwsquery_serializeOpDocumentRestoreDBInstanceFromS3Input(v *RestoreDBIns objectKey.String(*v.DBSubnetGroupName) } + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + if v.DeletionProtection != nil { objectKey := object.Key("DeletionProtection") objectKey.Boolean(*v.DeletionProtection) @@ -15606,6 +15631,11 @@ func awsAwsquery_serializeOpDocumentRestoreDBInstanceToPointInTimeInput(v *Resto objectKey.String(*v.DBSubnetGroupName) } + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + if v.DeletionProtection != nil { objectKey := object.Key("DeletionProtection") objectKey.Boolean(*v.DeletionProtection) diff --git a/service/rds/types/types.go b/service/rds/types/types.go index b91fdcd2a6d..9d0b8d3cd61 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -1458,6 +1458,9 @@ type DBInstance struct { // whenever the Amazon Web Services KMS key for the DB instance is accessed. DbiResourceId *string + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume bool + // Indicates whether the DB instance has deletion protection enabled. The database // can't be deleted when deletion protection is enabled. For more information, see // Deleting a DB Instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html) @@ -1719,6 +1722,9 @@ type DBInstanceAutomatedBackup struct { // unique to an Amazon Web Services Region. DbiResourceId *string + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + // Indicates whether the automated backup is encrypted. Encrypted bool @@ -2168,6 +2174,9 @@ type DBSnapshot struct { // unique to an Amazon Web Services Region. DbiResourceId *string + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume bool + // Indicates whether the DB snapshot is encrypted. Encrypted bool @@ -3169,6 +3178,9 @@ type OrderableDBInstanceOption struct { // in the Amazon RDS User Guide. SupportsClusters bool + // Indicates whether a DB instance supports using a dedicated log volume (DLV). + SupportsDedicatedLogVolume bool + // Indicates whether a DB instance supports Enhanced Monitoring at intervals from // 1 to 60 seconds. SupportsEnhancedMonitoring bool @@ -3341,6 +3353,9 @@ type PendingModifiedValues struct { // The DB subnet group for the DB instance. DBSubnetGroupName *string + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled.> + DedicatedLogVolume *bool + // The database engine of the DB instance. Engine *string @@ -3939,6 +3954,9 @@ type ValidDBInstanceModificationsMessage struct { // Valid storage options for your DB instance. Storage []ValidStorageOptions + // Indicates whether a DB instance supports using a dedicated log volume (DLV). + SupportsDedicatedLogVolume bool + // Valid processor features for your DB instance. ValidProcessorFeatures []AvailableProcessorFeature diff --git a/service/rekognition/api_op_CopyProjectVersion.go b/service/rekognition/api_op_CopyProjectVersion.go index 03a0c33d80b..46ab9123dc3 100644 --- a/service/rekognition/api_op_CopyProjectVersion.go +++ b/service/rekognition/api_op_CopyProjectVersion.go @@ -16,23 +16,25 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Copies a version of an Amazon Rekognition Custom Labels model from a source -// project to a destination project. The source and destination projects can be in -// different AWS accounts but must be in the same AWS Region. You can't copy a -// model to another AWS service. To copy a model version to a different AWS -// account, you need to create a resource-based policy known as a project policy. -// You attach the project policy to the source project by calling PutProjectPolicy -// . The project policy gives permission to copy the model version from a trusting -// AWS account to a trusted account. For more information creating and attaching a -// project policy, see Attaching a project policy (SDK) in the Amazon Rekognition -// Custom Labels Developer Guide. If you are copying a model version to a project -// in the same AWS account, you don't need to create a project policy. To copy a -// model, the destination project, source project, and source model version must -// already exist. Copying a model version takes a while to complete. To get the -// current status, call DescribeProjectVersions and check the value of Status in -// the ProjectVersionDescription object. The copy operation has finished when the -// value of Status is COPYING_COMPLETED . This operation requires permissions to -// perform the rekognition:CopyProjectVersion action. +// This operation applies only to Amazon Rekognition Custom Labels. Copies a +// version of an Amazon Rekognition Custom Labels model from a source project to a +// destination project. The source and destination projects can be in different AWS +// accounts but must be in the same AWS Region. You can't copy a model to another +// AWS service. To copy a model version to a different AWS account, you need to +// create a resource-based policy known as a project policy. You attach the project +// policy to the source project by calling PutProjectPolicy . The project policy +// gives permission to copy the model version from a trusting AWS account to a +// trusted account. For more information creating and attaching a project policy, +// see Attaching a project policy (SDK) in the Amazon Rekognition Custom Labels +// Developer Guide. If you are copying a model version to a project in the same AWS +// account, you don't need to create a project policy. Copying project versions is +// supported only for Custom Labels models. To copy a model, the destination +// project, source project, and source model version must already exist. Copying a +// model version takes a while to complete. To get the current status, call +// DescribeProjectVersions and check the value of Status in the +// ProjectVersionDescription object. The copy operation has finished when the value +// of Status is COPYING_COMPLETED . This operation requires permissions to perform +// the rekognition:CopyProjectVersion action. func (c *Client) CopyProjectVersion(ctx context.Context, params *CopyProjectVersionInput, optFns ...func(*Options)) (*CopyProjectVersionOutput, error) { if params == nil { params = &CopyProjectVersionInput{} diff --git a/service/rekognition/api_op_CreateDataset.go b/service/rekognition/api_op_CreateDataset.go index b40ceceaba0..f8e676a5487 100644 --- a/service/rekognition/api_op_CreateDataset.go +++ b/service/rekognition/api_op_CreateDataset.go @@ -16,13 +16,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new Amazon Rekognition Custom Labels dataset. You can create a -// dataset by using an Amazon Sagemaker format manifest file or by copying an -// existing Amazon Rekognition Custom Labels dataset. To create a training dataset -// for a project, specify TRAIN for the value of DatasetType . To create the test -// dataset for a project, specify TEST for the value of DatasetType . The response -// from CreateDataset is the Amazon Resource Name (ARN) for the dataset. Creating -// a dataset takes a while to complete. Use DescribeDataset to check the current +// This operation applies only to Amazon Rekognition Custom Labels. Creates a new +// Amazon Rekognition Custom Labels dataset. You can create a dataset by using an +// Amazon Sagemaker format manifest file or by copying an existing Amazon +// Rekognition Custom Labels dataset. To create a training dataset for a project, +// specify TRAIN for the value of DatasetType . To create the test dataset for a +// project, specify TEST for the value of DatasetType . The response from +// CreateDataset is the Amazon Resource Name (ARN) for the dataset. Creating a +// dataset takes a while to complete. Use DescribeDataset to check the current // status. The dataset created successfully if the value of Status is // CREATE_COMPLETE . To check if any non-terminal errors occurred, call // ListDatasetEntries and check for the presence of errors lists in the JSON diff --git a/service/rekognition/api_op_CreateProject.go b/service/rekognition/api_op_CreateProject.go index 3507ef094cf..fe8d63cb748 100644 --- a/service/rekognition/api_op_CreateProject.go +++ b/service/rekognition/api_op_CreateProject.go @@ -10,15 +10,19 @@ import ( awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/rekognition/types" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new Amazon Rekognition Custom Labels project. A project is a group of -// resources (datasets, model versions) that you use to create and manage Amazon -// Rekognition Custom Labels models. This operation requires permissions to perform -// the rekognition:CreateProject action. +// Creates a new Amazon Rekognition project. A project is a group of resources +// (datasets, model versions) that you use to create and manage a Amazon +// Rekognition Custom Labels Model or custom adapter. You can specify a feature to +// create the project with, if no feature is specified then Custom Labels is used +// by default. For adapters, you can also choose whether or not to have the project +// auto update by using the AutoUpdate argument. This operation requires +// permissions to perform the rekognition:CreateProject action. func (c *Client) CreateProject(ctx context.Context, params *CreateProjectInput, optFns ...func(*Options)) (*CreateProjectOutput, error) { if params == nil { params = &CreateProjectInput{} @@ -41,6 +45,15 @@ type CreateProjectInput struct { // This member is required. ProjectName *string + // Specifies whether automatic retraining should be attempted for the versions of + // the project. Automatic retraining is done as a best effort. Required argument + // for Content Moderation. Applicable only to adapters. + AutoUpdate types.ProjectAutoUpdate + + // Specifies feature that is being customized. If no value is provided + // CUSTOM_LABELS is used as a default. + Feature types.CustomizationFeature + noSmithyDocumentSerde } diff --git a/service/rekognition/api_op_CreateProjectVersion.go b/service/rekognition/api_op_CreateProjectVersion.go index 9fefa9122b8..e1c0319bad7 100644 --- a/service/rekognition/api_op_CreateProjectVersion.go +++ b/service/rekognition/api_op_CreateProjectVersion.go @@ -16,29 +16,26 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new version of a model and begins training. Models are managed as -// part of an Amazon Rekognition Custom Labels project. The response from -// CreateProjectVersion is an Amazon Resource Name (ARN) for the version of the -// model. Training uses the training and test datasets associated with the project. -// For more information, see Creating training and test dataset in the Amazon -// Rekognition Custom Labels Developer Guide. You can train a model in a project -// that doesn't have associated datasets by specifying manifest files in the -// TrainingData and TestingData fields. If you open the console after training a -// model with manifest files, Amazon Rekognition Custom Labels creates the datasets -// for you using the most recent manifest files. You can no longer train a model -// version for the project by specifying manifest files. Instead of training with a -// project without associated datasets, we recommend that you use the manifest -// files to create training and test datasets for the project. Training takes a -// while to complete. You can get the current status by calling -// DescribeProjectVersions . Training completed successfully if the value of the -// Status field is TRAINING_COMPLETED . If training fails, see Debugging a failed -// model training in the Amazon Rekognition Custom Labels developer guide. Once -// training has successfully completed, call DescribeProjectVersions to get the -// training results and evaluate the model. For more information, see Improving a -// trained Amazon Rekognition Custom Labels model in the Amazon Rekognition Custom -// Labels developers guide. After evaluating the model, you start the model by -// calling StartProjectVersion . This operation requires permissions to perform the -// rekognition:CreateProjectVersion action. +// Creates a new version of Amazon Rekognition project (like a Custom Labels model +// or a custom adapter) and begins training. Models and adapters are managed as +// part of a Rekognition project. The response from CreateProjectVersion is an +// Amazon Resource Name (ARN) for the project version. The FeatureConfig operation +// argument allows you to configure specific model or adapter settings. You can +// provide a description to the project version by using the VersionDescription +// argment. Training can take a while to complete. You can get the current status +// by calling DescribeProjectVersions . Training completed successfully if the +// value of the Status field is TRAINING_COMPLETED . Once training has successfully +// completed, call DescribeProjectVersions to get the training results and +// evaluate the model. This operation requires permissions to perform the +// rekognition:CreateProjectVersion action. The following applies only to projects +// with Amazon Rekognition Custom Labels as the chosen feature: You can train a +// model in a project that doesn't have associated datasets by specifying manifest +// files in the TrainingData and TestingData fields. If you open the console after +// training a model with manifest files, Amazon Rekognition Custom Labels creates +// the datasets for you using the most recent manifest files. You can no longer +// train a model version for the project by specifying manifest files. Instead of +// training with a project without associated datasets, we recommend that you use +// the manifest files to create training and test datasets for the project. func (c *Client) CreateProjectVersion(ctx context.Context, params *CreateProjectVersionInput, optFns ...func(*Options)) (*CreateProjectVersionOutput, error) { if params == nil { params = &CreateProjectVersionInput{} @@ -56,31 +53,37 @@ func (c *Client) CreateProjectVersion(ctx context.Context, params *CreateProject type CreateProjectVersionInput struct { - // The Amazon S3 bucket location to store the results of training. The S3 bucket - // can be in any AWS account as long as the caller has s3:PutObject permissions on - // the S3 bucket. + // The Amazon S3 bucket location to store the results of training. The bucket can + // be any S3 bucket in your AWS account. You need s3:PutObject permission on the + // bucket. // // This member is required. OutputConfig *types.OutputConfig - // The ARN of the Amazon Rekognition Custom Labels project that manages the model - // that you want to train. + // The ARN of the Amazon Rekognition project that will manage the project version + // you want to train. // // This member is required. ProjectArn *string - // A name for the version of the model. This value must be unique. + // A name for the version of the project version. This value must be unique. // // This member is required. VersionName *string + // Feature-specific configuration of the training job. If the job configuration + // does not match the feature type associated with the project, an + // InvalidParameterException is returned. + FeatureConfig *types.CustomizationFeatureConfig + // The identifier for your AWS Key Management Service key (AWS KMS key). You can // supply the Amazon Resource Name (ARN) of your KMS key, the ID of your KMS key, // an alias for your KMS key, or an alias ARN. The key is used to encrypt training - // and test images copied into the service for model training. Your source images - // are unaffected. The key is also used to encrypt training results and manifest - // files written to the output Amazon S3 bucket ( OutputConfig ). If you choose to - // use your own KMS key, you need the following permissions on the KMS key. + // images, test images, and manifest files copied into the service for the project + // version. Your source images are unaffected. The key is also used to encrypt + // training results and manifest files written to the output Amazon S3 bucket ( + // OutputConfig ). If you choose to use your own KMS key, you need the following + // permissions on the KMS key. // - kms:CreateGrant // - kms:DescribeKey // - kms:GenerateDataKey @@ -89,26 +92,29 @@ type CreateProjectVersionInput struct { // encrypted using a key that AWS owns and manages. KmsKeyId *string - // A set of tags (key-value pairs) that you want to attach to the model. + // A set of tags (key-value pairs) that you want to attach to the project version. Tags map[string]string - // Specifies an external manifest that the service uses to test the model. If you - // specify TestingData you must also specify TrainingData . The project must not - // have any associated datasets. + // Specifies an external manifest that the service uses to test the project + // version. If you specify TestingData you must also specify TrainingData . The + // project must not have any associated datasets. TestingData *types.TestingData - // Specifies an external manifest that the services uses to train the model. If - // you specify TrainingData you must also specify TestingData . The project must - // not have any associated datasets. + // Specifies an external manifest that the services uses to train the project + // version. If you specify TrainingData you must also specify TestingData . The + // project must not have any associated datasets. TrainingData *types.TrainingData + // A description applied to the project version being created. + VersionDescription *string + noSmithyDocumentSerde } type CreateProjectVersionOutput struct { - // The ARN of the model version that was created. Use DescribeProjectVersion to - // get the current status of the training operation. + // The ARN of the model or the project version that was created. Use + // DescribeProjectVersion to get the current status of the training operation. ProjectVersionArn *string // Metadata pertaining to the operation's result. diff --git a/service/rekognition/api_op_DeleteDataset.go b/service/rekognition/api_op_DeleteDataset.go index 66aeaefcf46..fa77ac36d8c 100644 --- a/service/rekognition/api_op_DeleteDataset.go +++ b/service/rekognition/api_op_DeleteDataset.go @@ -15,14 +15,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an existing Amazon Rekognition Custom Labels dataset. Deleting a -// dataset might take while. Use DescribeDataset to check the current status. The -// dataset is still deleting if the value of Status is DELETE_IN_PROGRESS . If you -// try to access the dataset after it is deleted, you get a -// ResourceNotFoundException exception. You can't delete a dataset while it is -// creating ( Status = CREATE_IN_PROGRESS ) or if the dataset is updating ( Status -// = UPDATE_IN_PROGRESS ). This operation requires permissions to perform the -// rekognition:DeleteDataset action. +// This operation applies only to Amazon Rekognition Custom Labels. Deletes an +// existing Amazon Rekognition Custom Labels dataset. Deleting a dataset might take +// while. Use DescribeDataset to check the current status. The dataset is still +// deleting if the value of Status is DELETE_IN_PROGRESS . If you try to access the +// dataset after it is deleted, you get a ResourceNotFoundException exception. You +// can't delete a dataset while it is creating ( Status = CREATE_IN_PROGRESS ) or +// if the dataset is updating ( Status = UPDATE_IN_PROGRESS ). This operation +// requires permissions to perform the rekognition:DeleteDataset action. func (c *Client) DeleteDataset(ctx context.Context, params *DeleteDatasetInput, optFns ...func(*Options)) (*DeleteDatasetOutput, error) { if params == nil { params = &DeleteDatasetInput{} diff --git a/service/rekognition/api_op_DeleteProject.go b/service/rekognition/api_op_DeleteProject.go index 5f8c20edfb4..e72ccbd0ee6 100644 --- a/service/rekognition/api_op_DeleteProject.go +++ b/service/rekognition/api_op_DeleteProject.go @@ -16,13 +16,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an Amazon Rekognition Custom Labels project. To delete a project you -// must first delete all models associated with the project. To delete a model, see -// DeleteProjectVersion . DeleteProject is an asynchronous operation. To check if -// the project is deleted, call DescribeProjects . The project is deleted when the -// project no longer appears in the response. Be aware that deleting a given -// project will also delete any ProjectPolicies associated with that project. This -// operation requires permissions to perform the rekognition:DeleteProject action. +// Deletes a Amazon Rekognition project. To delete a project you must first delete +// all models or adapters associated with the project. To delete a model or +// adapter, see DeleteProjectVersion . DeleteProject is an asynchronous operation. +// To check if the project is deleted, call DescribeProjects . The project is +// deleted when the project no longer appears in the response. Be aware that +// deleting a given project will also delete any ProjectPolicies associated with +// that project. This operation requires permissions to perform the +// rekognition:DeleteProject action. func (c *Client) DeleteProject(ctx context.Context, params *DeleteProjectInput, optFns ...func(*Options)) (*DeleteProjectOutput, error) { if params == nil { params = &DeleteProjectInput{} diff --git a/service/rekognition/api_op_DeleteProjectPolicy.go b/service/rekognition/api_op_DeleteProjectPolicy.go index b8e0054d152..8163dbb9219 100644 --- a/service/rekognition/api_op_DeleteProjectPolicy.go +++ b/service/rekognition/api_op_DeleteProjectPolicy.go @@ -15,10 +15,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an existing project policy. To get a list of project policies attached -// to a project, call ListProjectPolicies . To attach a project policy to a -// project, call PutProjectPolicy . This operation requires permissions to perform -// the rekognition:DeleteProjectPolicy action. +// This operation applies only to Amazon Rekognition Custom Labels. Deletes an +// existing project policy. To get a list of project policies attached to a +// project, call ListProjectPolicies . To attach a project policy to a project, +// call PutProjectPolicy . This operation requires permissions to perform the +// rekognition:DeleteProjectPolicy action. func (c *Client) DeleteProjectPolicy(ctx context.Context, params *DeleteProjectPolicyInput, optFns ...func(*Options)) (*DeleteProjectPolicyOutput, error) { if params == nil { params = &DeleteProjectPolicyInput{} diff --git a/service/rekognition/api_op_DeleteProjectVersion.go b/service/rekognition/api_op_DeleteProjectVersion.go index ea04aecdd3f..b1780b060db 100644 --- a/service/rekognition/api_op_DeleteProjectVersion.go +++ b/service/rekognition/api_op_DeleteProjectVersion.go @@ -16,12 +16,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an Amazon Rekognition Custom Labels model. You can't delete a model if -// it is running or if it is training. To check the status of a model, use the -// Status field returned from DescribeProjectVersions . To stop a running model -// call StopProjectVersion . If the model is training, wait until it finishes. This -// operation requires permissions to perform the rekognition:DeleteProjectVersion -// action. +// Deletes a Rekognition project model or project version, like a Amazon +// Rekognition Custom Labels model or a custom adapter. You can't delete a project +// version if it is running or if it is training. To check the status of a project +// version, use the Status field returned from DescribeProjectVersions . To stop a +// project version call StopProjectVersion . If the project version is training, +// wait until it finishes. This operation requires permissions to perform the +// rekognition:DeleteProjectVersion action. func (c *Client) DeleteProjectVersion(ctx context.Context, params *DeleteProjectVersionInput, optFns ...func(*Options)) (*DeleteProjectVersionOutput, error) { if params == nil { params = &DeleteProjectVersionInput{} @@ -39,7 +40,7 @@ func (c *Client) DeleteProjectVersion(ctx context.Context, params *DeleteProject type DeleteProjectVersionInput struct { - // The Amazon Resource Name (ARN) of the model version that you want to delete. + // The Amazon Resource Name (ARN) of the project version that you want to delete. // // This member is required. ProjectVersionArn *string diff --git a/service/rekognition/api_op_DescribeDataset.go b/service/rekognition/api_op_DescribeDataset.go index e3385ce9fbc..bad45ed67f7 100644 --- a/service/rekognition/api_op_DescribeDataset.go +++ b/service/rekognition/api_op_DescribeDataset.go @@ -16,9 +16,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes an Amazon Rekognition Custom Labels dataset. You can get information -// such as the current status of a dataset and statistics about the images and -// labels in a dataset. This operation requires permissions to perform the +// This operation applies only to Amazon Rekognition Custom Labels. Describes an +// Amazon Rekognition Custom Labels dataset. You can get information such as the +// current status of a dataset and statistics about the images and labels in a +// dataset. This operation requires permissions to perform the // rekognition:DescribeDataset action. func (c *Client) DescribeDataset(ctx context.Context, params *DescribeDatasetInput, optFns ...func(*Options)) (*DescribeDatasetOutput, error) { if params == nil { diff --git a/service/rekognition/api_op_DescribeProjectVersions.go b/service/rekognition/api_op_DescribeProjectVersions.go index b8acfdda462..c753530b51a 100644 --- a/service/rekognition/api_op_DescribeProjectVersions.go +++ b/service/rekognition/api_op_DescribeProjectVersions.go @@ -20,10 +20,10 @@ import ( "time" ) -// Lists and describes the versions of a model in an Amazon Rekognition Custom -// Labels project. You can specify up to 10 model versions in ProjectVersionArns . -// If you don't specify a value, descriptions for all model versions in the project -// are returned. This operation requires permissions to perform the +// Lists and describes the versions of an Amazon Rekognition project. You can +// specify up to 10 model or adapter versions in ProjectVersionArns . If you don't +// specify a value, descriptions for all model/adapter versions in the project are +// returned. This operation requires permissions to perform the // rekognition:DescribeProjectVersions action. func (c *Client) DescribeProjectVersions(ctx context.Context, params *DescribeProjectVersionsInput, optFns ...func(*Options)) (*DescribeProjectVersionsOutput, error) { if params == nil { @@ -42,8 +42,8 @@ func (c *Client) DescribeProjectVersions(ctx context.Context, params *DescribePr type DescribeProjectVersionsInput struct { - // The Amazon Resource Name (ARN) of the project that contains the models you want - // to describe. + // The Amazon Resource Name (ARN) of the project that contains the model/adapter + // you want to describe. // // This member is required. ProjectArn *string @@ -54,15 +54,15 @@ type DescribeProjectVersionsInput struct { MaxResults *int32 // If the previous response was incomplete (because there is more results to - // retrieve), Amazon Rekognition Custom Labels returns a pagination token in the - // response. You can use this pagination token to retrieve the next set of results. + // retrieve), Amazon Rekognition returns a pagination token in the response. You + // can use this pagination token to retrieve the next set of results. NextToken *string - // A list of model version names that you want to describe. You can add up to 10 - // model version names to the list. If you don't specify a value, all model - // descriptions are returned. A version name is part of a model (ProjectVersion) - // ARN. For example, my-model.2020-01-21T09.10.15 is the version name in the - // following ARN. + // A list of model or project version names that you want to describe. You can add + // up to 10 model or project version names to the list. If you don't specify a + // value, all project version descriptions are returned. A version name is part of + // a project version ARN. For example, my-model.2020-01-21T09.10.15 is the version + // name in the following ARN. // arn:aws:rekognition:us-east-1:123456789012:project/getting-started/version/my-model.2020-01-21T09.10.15/1234567890123 // . VersionNames []string @@ -73,12 +73,12 @@ type DescribeProjectVersionsInput struct { type DescribeProjectVersionsOutput struct { // If the previous response was incomplete (because there is more results to - // retrieve), Amazon Rekognition Custom Labels returns a pagination token in the - // response. You can use this pagination token to retrieve the next set of results. + // retrieve), Amazon Rekognition returns a pagination token in the response. You + // can use this pagination token to retrieve the next set of results. NextToken *string - // A list of model descriptions. The list is sorted by the creation date and time - // of the model versions, latest to earliest. + // A list of project version descriptions. The list is sorted by the creation date + // and time of the project versions, latest to earliest. ProjectVersionDescriptions []types.ProjectVersionDescription // Metadata pertaining to the operation's result. diff --git a/service/rekognition/api_op_DescribeProjects.go b/service/rekognition/api_op_DescribeProjects.go index ec848ccff44..f8a98e4a223 100644 --- a/service/rekognition/api_op_DescribeProjects.go +++ b/service/rekognition/api_op_DescribeProjects.go @@ -16,9 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets information about your Amazon Rekognition Custom Labels projects. This -// operation requires permissions to perform the rekognition:DescribeProjects -// action. +// Gets information about your Rekognition projects. This operation requires +// permissions to perform the rekognition:DescribeProjects action. func (c *Client) DescribeProjects(ctx context.Context, params *DescribeProjectsInput, optFns ...func(*Options)) (*DescribeProjectsOutput, error) { if params == nil { params = &DescribeProjectsInput{} @@ -36,19 +35,23 @@ func (c *Client) DescribeProjects(ctx context.Context, params *DescribeProjectsI type DescribeProjectsInput struct { + // Specifies the type of customization to filter projects by. If no value is + // specified, CUSTOM_LABELS is used as a default. + Features []types.CustomizationFeature + // The maximum number of results to return per paginated call. The largest value // you can specify is 100. If you specify a value greater than 100, a // ValidationException error occurs. The default value is 100. MaxResults *int32 // If the previous response was incomplete (because there is more results to - // retrieve), Amazon Rekognition Custom Labels returns a pagination token in the - // response. You can use this pagination token to retrieve the next set of results. + // retrieve), Rekognition returns a pagination token in the response. You can use + // this pagination token to retrieve the next set of results. NextToken *string - // A list of the projects that you want Amazon Rekognition Custom Labels to - // describe. If you don't specify a value, the response includes descriptions for - // all the projects in your AWS account. + // A list of the projects that you want Rekognition to describe. If you don't + // specify a value, the response includes descriptions for all the projects in your + // AWS account. ProjectNames []string noSmithyDocumentSerde @@ -57,8 +60,8 @@ type DescribeProjectsInput struct { type DescribeProjectsOutput struct { // If the previous response was incomplete (because there is more results to - // retrieve), Amazon Rekognition Custom Labels returns a pagination token in the - // response. You can use this pagination token to retrieve the next set of results. + // retrieve), Amazon Rekognition returns a pagination token in the response. You + // can use this pagination token to retrieve the next set of results. NextToken *string // A list of project descriptions. The list is sorted by the date and time the diff --git a/service/rekognition/api_op_DetectCustomLabels.go b/service/rekognition/api_op_DetectCustomLabels.go index 39daa6c7e7d..f16be6f7ef5 100644 --- a/service/rekognition/api_op_DetectCustomLabels.go +++ b/service/rekognition/api_op_DetectCustomLabels.go @@ -16,8 +16,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Detects custom labels in a supplied image by using an Amazon Rekognition Custom -// Labels model. You specify which version of a model version to use by using the +// This operation applies only to Amazon Rekognition Custom Labels. Detects custom +// labels in a supplied image by using an Amazon Rekognition Custom Labels model. +// You specify which version of a model version to use by using the // ProjectVersionArn input parameter. You pass the input image as base64-encoded // image bytes or as a reference to an image in an Amazon S3 bucket. If you use the // AWS CLI to call Amazon Rekognition operations, passing image bytes is not @@ -81,7 +82,10 @@ type DetectCustomLabelsInput struct { // This member is required. Image *types.Image - // The ARN of the model version that you want to use. + // The ARN of the model version that you want to use. Only models associated with + // Custom Labels projects accepted by the operation. If a provided ARN refers to a + // model version associated with a project for a different feature type, then an + // InvalidParameterException is returned. // // This member is required. ProjectVersionArn *string diff --git a/service/rekognition/api_op_DetectModerationLabels.go b/service/rekognition/api_op_DetectModerationLabels.go index b5d49b333b1..d4bf22d3c7a 100644 --- a/service/rekognition/api_op_DetectModerationLabels.go +++ b/service/rekognition/api_op_DetectModerationLabels.go @@ -25,7 +25,9 @@ import ( // Rekognition Developer Guide. You pass the input image either as base64-encoded // image bytes or as a reference to an image in an Amazon S3 bucket. If you use the // AWS CLI to call Amazon Rekognition operations, passing image bytes is not -// supported. The image must be either a PNG or JPEG formatted file. +// supported. The image must be either a PNG or JPEG formatted file. You can +// specify an adapter to use when retrieving label predictions by providing a +// ProjectVersionArn to the ProjectVersion argument. func (c *Client) DetectModerationLabels(ctx context.Context, params *DetectModerationLabelsInput, optFns ...func(*Options)) (*DetectModerationLabelsOutput, error) { if params == nil { params = &DetectModerationLabelsInput{} @@ -62,6 +64,10 @@ type DetectModerationLabelsInput struct { // labels with confidence values greater than or equal to 50 percent. MinConfidence *float32 + // Identifier for the custom adapter. Expects the ProjectVersionArn as a value. + // Use the CreateProject or CreateProjectVersion APIs to create a custom adapter. + ProjectVersion *string + noSmithyDocumentSerde } @@ -74,10 +80,15 @@ type DetectModerationLabelsOutput struct { // start of the video, they were detected. ModerationLabels []types.ModerationLabel - // Version number of the moderation detection model that was used to detect unsafe - // content. + // Version number of the base moderation detection model that was used to detect + // unsafe content. ModerationModelVersion *string + // Identifier of the custom adapter that was used during inference. If during + // inference the adapter was EXPIRED, then the parameter will not be returned, + // indicating that a base moderation detection project version was used. + ProjectVersion *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/rekognition/api_op_DistributeDatasetEntries.go b/service/rekognition/api_op_DistributeDatasetEntries.go index eb41fb7a817..925ad34f662 100644 --- a/service/rekognition/api_op_DistributeDatasetEntries.go +++ b/service/rekognition/api_op_DistributeDatasetEntries.go @@ -16,13 +16,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Distributes the entries (images) in a training dataset across the training -// dataset and the test dataset for a project. DistributeDatasetEntries moves 20% -// of the training dataset images to the test dataset. An entry is a JSON Line that -// describes an image. You supply the Amazon Resource Names (ARN) of a project's -// training dataset and test dataset. The training dataset must contain the images -// that you want to split. The test dataset must be empty. The datasets must belong -// to the same project. To create training and test datasets for a project, call +// This operation applies only to Amazon Rekognition Custom Labels. Distributes +// the entries (images) in a training dataset across the training dataset and the +// test dataset for a project. DistributeDatasetEntries moves 20% of the training +// dataset images to the test dataset. An entry is a JSON Line that describes an +// image. You supply the Amazon Resource Names (ARN) of a project's training +// dataset and test dataset. The training dataset must contain the images that you +// want to split. The test dataset must be empty. The datasets must belong to the +// same project. To create training and test datasets for a project, call // CreateDataset . Distributing a dataset takes a while to complete. To check the // status call DescribeDataset . The operation is complete when the Status field // for the training dataset and the test dataset is UPDATE_COMPLETE . If the diff --git a/service/rekognition/api_op_ListDatasetEntries.go b/service/rekognition/api_op_ListDatasetEntries.go index 0742a8dfb00..ea0ee8cbc3c 100644 --- a/service/rekognition/api_op_ListDatasetEntries.go +++ b/service/rekognition/api_op_ListDatasetEntries.go @@ -15,10 +15,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the entries (images) within a dataset. An entry is a JSON Line that -// contains the information for a single image, including the image location, -// assigned labels, and object location bounding boxes. For more information, see -// Creating a manifest file (https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-manifest-files.html) +// This operation applies only to Amazon Rekognition Custom Labels. Lists the +// entries (images) within a dataset. An entry is a JSON Line that contains the +// information for a single image, including the image location, assigned labels, +// and object location bounding boxes. For more information, see Creating a +// manifest file (https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-manifest-files.html) // . JSON Lines in the response include information about non-terminal errors found // in the dataset. Non terminal errors are reported in errors lists within each // JSON Line. The same information is reported in the training and testing diff --git a/service/rekognition/api_op_ListDatasetLabels.go b/service/rekognition/api_op_ListDatasetLabels.go index d30f8b9dd98..eca88f58af5 100644 --- a/service/rekognition/api_op_ListDatasetLabels.go +++ b/service/rekognition/api_op_ListDatasetLabels.go @@ -16,8 +16,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to -// describe images. For more information, see Labeling images (https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-labeling-images.html) +// This operation applies only to Amazon Rekognition Custom Labels. Lists the +// labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe +// images. For more information, see Labeling images (https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-labeling-images.html) // . Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to // describe images. For more information, see Labeling images in the Amazon // Rekognition Custom Labels Developer Guide. diff --git a/service/rekognition/api_op_ListProjectPolicies.go b/service/rekognition/api_op_ListProjectPolicies.go index 1f07717d9d6..ec853a68df1 100644 --- a/service/rekognition/api_op_ListProjectPolicies.go +++ b/service/rekognition/api_op_ListProjectPolicies.go @@ -16,10 +16,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets a list of the project policies attached to a project. To attach a project -// policy to a project, call PutProjectPolicy . To remove a project policy from a -// project, call DeleteProjectPolicy . This operation requires permissions to -// perform the rekognition:ListProjectPolicies action. +// This operation applies only to Amazon Rekognition Custom Labels. Gets a list of +// the project policies attached to a project. To attach a project policy to a +// project, call PutProjectPolicy . To remove a project policy from a project, call +// DeleteProjectPolicy . This operation requires permissions to perform the +// rekognition:ListProjectPolicies action. func (c *Client) ListProjectPolicies(ctx context.Context, params *ListProjectPoliciesInput, optFns ...func(*Options)) (*ListProjectPoliciesOutput, error) { if params == nil { params = &ListProjectPoliciesInput{} diff --git a/service/rekognition/api_op_PutProjectPolicy.go b/service/rekognition/api_op_PutProjectPolicy.go index 63566b93ff9..d163afdc8bb 100644 --- a/service/rekognition/api_op_PutProjectPolicy.go +++ b/service/rekognition/api_op_PutProjectPolicy.go @@ -15,19 +15,21 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Attaches a project policy to a Amazon Rekognition Custom Labels project in a -// trusting AWS account. A project policy specifies that a trusted AWS account can -// copy a model version from a trusting AWS account to a project in the trusted AWS -// account. To copy a model version you use the CopyProjectVersion operation. For -// more information about the format of a project policy document, see Attaching a -// project policy (SDK) in the Amazon Rekognition Custom Labels Developer Guide. -// The response from PutProjectPolicy is a revision ID for the project policy. You -// can attach multiple project policies to a project. You can also update an -// existing project policy by specifying the policy revision ID of the existing -// policy. To remove a project policy from a project, call DeleteProjectPolicy . To -// get a list of project policies attached to a project, call ListProjectPolicies . -// You copy a model version by calling CopyProjectVersion . This operation requires -// permissions to perform the rekognition:PutProjectPolicy action. +// This operation applies only to Amazon Rekognition Custom Labels. Attaches a +// project policy to a Amazon Rekognition Custom Labels project in a trusting AWS +// account. A project policy specifies that a trusted AWS account can copy a model +// version from a trusting AWS account to a project in the trusted AWS account. To +// copy a model version you use the CopyProjectVersion operation. Only applies to +// Custom Labels projects. For more information about the format of a project +// policy document, see Attaching a project policy (SDK) in the Amazon Rekognition +// Custom Labels Developer Guide. The response from PutProjectPolicy is a revision +// ID for the project policy. You can attach multiple project policies to a +// project. You can also update an existing project policy by specifying the policy +// revision ID of the existing policy. To remove a project policy from a project, +// call DeleteProjectPolicy . To get a list of project policies attached to a +// project, call ListProjectPolicies . You copy a model version by calling +// CopyProjectVersion . This operation requires permissions to perform the +// rekognition:PutProjectPolicy action. func (c *Client) PutProjectPolicy(ctx context.Context, params *PutProjectPolicyInput, optFns ...func(*Options)) (*PutProjectPolicyOutput, error) { if params == nil { params = &PutProjectPolicyInput{} diff --git a/service/rekognition/api_op_StartProjectVersion.go b/service/rekognition/api_op_StartProjectVersion.go index f8fca632c8c..61c33713bec 100644 --- a/service/rekognition/api_op_StartProjectVersion.go +++ b/service/rekognition/api_op_StartProjectVersion.go @@ -16,14 +16,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Starts the running of the version of a model. Starting a model takes a while to -// complete. To check the current state of the model, use DescribeProjectVersions . -// Once the model is running, you can detect custom labels in new images by calling +// This operation applies only to Amazon Rekognition Custom Labels. Starts the +// running of the version of a model. Starting a model takes a while to complete. +// To check the current state of the model, use DescribeProjectVersions . Once the +// model is running, you can detect custom labels in new images by calling // DetectCustomLabels . You are charged for the amount of time that the model is -// running. To stop a running model, call StopProjectVersion . For more -// information, see Running a trained Amazon Rekognition Custom Labels model in the -// Amazon Rekognition Custom Labels Guide. This operation requires permissions to -// perform the rekognition:StartProjectVersion action. +// running. To stop a running model, call StopProjectVersion . This operation +// requires permissions to perform the rekognition:StartProjectVersion action. func (c *Client) StartProjectVersion(ctx context.Context, params *StartProjectVersionInput, optFns ...func(*Options)) (*StartProjectVersionOutput, error) { if params == nil { params = &StartProjectVersionInput{} @@ -42,11 +41,9 @@ func (c *Client) StartProjectVersion(ctx context.Context, params *StartProjectVe type StartProjectVersionInput struct { // The minimum number of inference units to use. A single inference unit - // represents 1 hour of processing. For information about the number of - // transactions per second (TPS) that an inference unit can support, see Running a - // trained Amazon Rekognition Custom Labels model in the Amazon Rekognition Custom - // Labels Guide. Use a higher number to increase the TPS throughput of your model. - // You are charged for the number of inference units that you use. + // represents 1 hour of processing. Use a higher number to increase the TPS + // throughput of your model. You are charged for the number of inference units that + // you use. // // This member is required. MinInferenceUnits *int32 diff --git a/service/rekognition/api_op_StopProjectVersion.go b/service/rekognition/api_op_StopProjectVersion.go index f4b05be36c7..633e58a3fcf 100644 --- a/service/rekognition/api_op_StopProjectVersion.go +++ b/service/rekognition/api_op_StopProjectVersion.go @@ -16,9 +16,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Stops a running model. The operation might take a while to complete. To check -// the current status, call DescribeProjectVersions . This operation requires -// permissions to perform the rekognition:StopProjectVersion action. +// This operation applies only to Amazon Rekognition Custom Labels. Stops a +// running model. The operation might take a while to complete. To check the +// current status, call DescribeProjectVersions . Only applies to Custom Labels +// projects. This operation requires permissions to perform the +// rekognition:StopProjectVersion action. func (c *Client) StopProjectVersion(ctx context.Context, params *StopProjectVersionInput, optFns ...func(*Options)) (*StopProjectVersionOutput, error) { if params == nil { params = &StopProjectVersionInput{} @@ -36,9 +38,9 @@ func (c *Client) StopProjectVersion(ctx context.Context, params *StopProjectVers type StopProjectVersionInput struct { - // The Amazon Resource Name (ARN) of the model version that you want to delete. - // This operation requires permissions to perform the - // rekognition:StopProjectVersion action. + // The Amazon Resource Name (ARN) of the model version that you want to stop. This + // operation requires permissions to perform the rekognition:StopProjectVersion + // action. // // This member is required. ProjectVersionArn *string diff --git a/service/rekognition/api_op_UpdateDatasetEntries.go b/service/rekognition/api_op_UpdateDatasetEntries.go index 212e565184d..4de1af9484e 100644 --- a/service/rekognition/api_op_UpdateDatasetEntries.go +++ b/service/rekognition/api_op_UpdateDatasetEntries.go @@ -16,25 +16,26 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds or updates one or more entries (images) in a dataset. An entry is a JSON -// Line which contains the information for a single image, including the image -// location, assigned labels, and object location bounding boxes. For more -// information, see Image-Level labels in manifest files and Object localization in -// manifest files in the Amazon Rekognition Custom Labels Developer Guide. If the -// source-ref field in the JSON line references an existing image, the existing -// image in the dataset is updated. If source-ref field doesn't reference an -// existing image, the image is added as a new image to the dataset. You specify -// the changes that you want to make in the Changes input parameter. There isn't a -// limit to the number JSON Lines that you can change, but the size of Changes -// must be less than 5MB. UpdateDatasetEntries returns immediatly, but the dataset -// update might take a while to complete. Use DescribeDataset to check the current -// status. The dataset updated successfully if the value of Status is -// UPDATE_COMPLETE . To check if any non-terminal errors occured, call -// ListDatasetEntries and check for the presence of errors lists in the JSON -// Lines. Dataset update fails if a terminal error occurs ( Status = UPDATE_FAILED -// ). Currently, you can't access the terminal error information from the Amazon -// Rekognition Custom Labels SDK. This operation requires permissions to perform -// the rekognition:UpdateDatasetEntries action. +// This operation applies only to Amazon Rekognition Custom Labels. Adds or +// updates one or more entries (images) in a dataset. An entry is a JSON Line which +// contains the information for a single image, including the image location, +// assigned labels, and object location bounding boxes. For more information, see +// Image-Level labels in manifest files and Object localization in manifest files +// in the Amazon Rekognition Custom Labels Developer Guide. If the source-ref +// field in the JSON line references an existing image, the existing image in the +// dataset is updated. If source-ref field doesn't reference an existing image, +// the image is added as a new image to the dataset. You specify the changes that +// you want to make in the Changes input parameter. There isn't a limit to the +// number JSON Lines that you can change, but the size of Changes must be less +// than 5MB. UpdateDatasetEntries returns immediatly, but the dataset update might +// take a while to complete. Use DescribeDataset to check the current status. The +// dataset updated successfully if the value of Status is UPDATE_COMPLETE . To +// check if any non-terminal errors occured, call ListDatasetEntries and check for +// the presence of errors lists in the JSON Lines. Dataset update fails if a +// terminal error occurs ( Status = UPDATE_FAILED ). Currently, you can't access +// the terminal error information from the Amazon Rekognition Custom Labels SDK. +// This operation requires permissions to perform the +// rekognition:UpdateDatasetEntries action. func (c *Client) UpdateDatasetEntries(ctx context.Context, params *UpdateDatasetEntriesInput, optFns ...func(*Options)) (*UpdateDatasetEntriesOutput, error) { if params == nil { params = &UpdateDatasetEntriesInput{} diff --git a/service/rekognition/deserializers.go b/service/rekognition/deserializers.go index 40a612cac62..534639caa82 100644 --- a/service/rekognition/deserializers.go +++ b/service/rekognition/deserializers.go @@ -3533,6 +3533,12 @@ func awsAwsjson11_deserializeOpErrorDetectModerationLabels(response *smithyhttp. case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceNotReadyException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotReadyException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) @@ -12000,6 +12006,107 @@ func awsAwsjson11_deserializeDocumentCoversBodyPart(v **types.CoversBodyPart, va return nil } +func awsAwsjson11_deserializeDocumentCustomizationFeatureConfig(v **types.CustomizationFeatureConfig, 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.CustomizationFeatureConfig + if *v == nil { + sv = &types.CustomizationFeatureConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContentModeration": + if err := awsAwsjson11_deserializeDocumentCustomizationFeatureContentModerationConfig(&sv.ContentModeration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentCustomizationFeatureContentModerationConfig(v **types.CustomizationFeatureContentModerationConfig, 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.CustomizationFeatureContentModerationConfig + if *v == nil { + sv = &types.CustomizationFeatureContentModerationConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConfidenceThreshold": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ConfidenceThreshold = 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.ConfidenceThreshold = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentCustomLabel(v **types.CustomLabel, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -17303,6 +17410,15 @@ func awsAwsjson11_deserializeDocumentProjectDescription(v **types.ProjectDescrip for key, value := range shape { switch key { + case "AutoUpdate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProjectAutoUpdate to be of type string, got %T instead", value) + } + sv.AutoUpdate = types.ProjectAutoUpdate(jtv) + } + case "CreationTimestamp": if value != nil { switch jtv := value.(type) { @@ -17324,6 +17440,15 @@ func awsAwsjson11_deserializeDocumentProjectDescription(v **types.ProjectDescrip return err } + case "Feature": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomizationFeature to be of type string, got %T instead", value) + } + sv.Feature = types.CustomizationFeature(jtv) + } + case "ProjectArn": if value != nil { jtv, ok := value.(string) @@ -17540,6 +17665,15 @@ func awsAwsjson11_deserializeDocumentProjectVersionDescription(v **types.Project for key, value := range shape { switch key { + case "BaseModelVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BaseModelVersion = ptr.String(jtv) + } + case "BillableTrainingTimeInSeconds": if value != nil { jtv, ok := value.(json.Number) @@ -17574,6 +17708,20 @@ func awsAwsjson11_deserializeDocumentProjectVersionDescription(v **types.Project return err } + case "Feature": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomizationFeature to be of type string, got %T instead", value) + } + sv.Feature = types.CustomizationFeature(jtv) + } + + case "FeatureConfig": + if err := awsAwsjson11_deserializeDocumentCustomizationFeatureConfig(&sv.FeatureConfig, value); err != nil { + return err + } + case "KmsKeyId": if value != nil { jtv, ok := value.(string) @@ -17681,6 +17829,15 @@ func awsAwsjson11_deserializeDocumentProjectVersionDescription(v **types.Project } } + case "VersionDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value) + } + sv.VersionDescription = ptr.String(jtv) + } + default: _, _ = key, value @@ -22529,6 +22686,15 @@ func awsAwsjson11_deserializeOpDocumentDetectModerationLabelsOutput(v **DetectMo sv.ModerationModelVersion = ptr.String(jtv) } + case "ProjectVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProjectVersionId to be of type string, got %T instead", value) + } + sv.ProjectVersion = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/rekognition/serializers.go b/service/rekognition/serializers.go index 7d12bf79411..0ab6f631e60 100644 --- a/service/rekognition/serializers.go +++ b/service/rekognition/serializers.go @@ -4240,6 +4240,56 @@ func awsAwsjson11_serializeDocumentCreateFaceLivenessSessionRequestSettings(v *t return nil } +func awsAwsjson11_serializeDocumentCustomizationFeatureConfig(v *types.CustomizationFeatureConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContentModeration != nil { + ok := object.Key("ContentModeration") + if err := awsAwsjson11_serializeDocumentCustomizationFeatureContentModerationConfig(v.ContentModeration, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentCustomizationFeatureContentModerationConfig(v *types.CustomizationFeatureContentModerationConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConfidenceThreshold != nil { + ok := object.Key("ConfidenceThreshold") + switch { + case math.IsNaN(float64(*v.ConfidenceThreshold)): + ok.String("NaN") + + case math.IsInf(float64(*v.ConfidenceThreshold), 1): + ok.String("Infinity") + + case math.IsInf(float64(*v.ConfidenceThreshold), -1): + ok.String("-Infinity") + + default: + ok.Float(*v.ConfidenceThreshold) + + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentCustomizationFeatures(v []types.CustomizationFeature, 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 awsAwsjson11_serializeDocumentDatasetChanges(v *types.DatasetChanges, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5431,6 +5481,16 @@ func awsAwsjson11_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, v object := value.Object() defer object.Close() + if len(v.AutoUpdate) > 0 { + ok := object.Key("AutoUpdate") + ok.String(string(v.AutoUpdate)) + } + + if len(v.Feature) > 0 { + ok := object.Key("Feature") + ok.String(string(v.Feature)) + } + if v.ProjectName != nil { ok := object.Key("ProjectName") ok.String(*v.ProjectName) @@ -5443,6 +5503,13 @@ func awsAwsjson11_serializeOpDocumentCreateProjectVersionInput(v *CreateProjectV object := value.Object() defer object.Close() + if v.FeatureConfig != nil { + ok := object.Key("FeatureConfig") + if err := awsAwsjson11_serializeDocumentCustomizationFeatureConfig(v.FeatureConfig, ok); err != nil { + return err + } + } + if v.KmsKeyId != nil { ok := object.Key("KmsKeyId") ok.String(*v.KmsKeyId) @@ -5481,6 +5548,11 @@ func awsAwsjson11_serializeOpDocumentCreateProjectVersionInput(v *CreateProjectV } } + if v.VersionDescription != nil { + ok := object.Key("VersionDescription") + ok.String(*v.VersionDescription) + } + if v.VersionName != nil { ok := object.Key("VersionName") ok.String(*v.VersionName) @@ -5733,6 +5805,13 @@ func awsAwsjson11_serializeOpDocumentDescribeProjectsInput(v *DescribeProjectsIn object := value.Object() defer object.Close() + if v.Features != nil { + ok := object.Key("Features") + if err := awsAwsjson11_serializeDocumentCustomizationFeatures(v.Features, ok); err != nil { + return err + } + } + if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) @@ -5944,6 +6023,11 @@ func awsAwsjson11_serializeOpDocumentDetectModerationLabelsInput(v *DetectModera } } + if v.ProjectVersion != nil { + ok := object.Key("ProjectVersion") + ok.String(*v.ProjectVersion) + } + return nil } diff --git a/service/rekognition/types/enums.go b/service/rekognition/types/enums.go index 06644515942..5d79ee84b67 100644 --- a/service/rekognition/types/enums.go +++ b/service/rekognition/types/enums.go @@ -139,6 +139,24 @@ func (ContentModerationSortBy) Values() []ContentModerationSortBy { } } +type CustomizationFeature string + +// Enum values for CustomizationFeature +const ( + CustomizationFeatureContentModeration CustomizationFeature = "CONTENT_MODERATION" + CustomizationFeatureCustomLabels CustomizationFeature = "CUSTOM_LABELS" +) + +// Values returns all known values for CustomizationFeature. 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 (CustomizationFeature) Values() []CustomizationFeature { + return []CustomizationFeature{ + "CONTENT_MODERATION", + "CUSTOM_LABELS", + } +} + type DatasetStatus string // Enum values for DatasetStatus @@ -521,6 +539,24 @@ func (PersonTrackingSortBy) Values() []PersonTrackingSortBy { } } +type ProjectAutoUpdate string + +// Enum values for ProjectAutoUpdate +const ( + ProjectAutoUpdateEnabled ProjectAutoUpdate = "ENABLED" + ProjectAutoUpdateDisabled ProjectAutoUpdate = "DISABLED" +) + +// Values returns all known values for ProjectAutoUpdate. 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 (ProjectAutoUpdate) Values() []ProjectAutoUpdate { + return []ProjectAutoUpdate{ + "ENABLED", + "DISABLED", + } +} + type ProjectStatus string // Enum values for ProjectStatus @@ -557,6 +593,8 @@ const ( ProjectVersionStatusCopyingInProgress ProjectVersionStatus = "COPYING_IN_PROGRESS" ProjectVersionStatusCopyingCompleted ProjectVersionStatus = "COPYING_COMPLETED" ProjectVersionStatusCopyingFailed ProjectVersionStatus = "COPYING_FAILED" + ProjectVersionStatusDeprecated ProjectVersionStatus = "DEPRECATED" + ProjectVersionStatusExpired ProjectVersionStatus = "EXPIRED" ) // Values returns all known values for ProjectVersionStatus. Note that this can be @@ -576,6 +614,8 @@ func (ProjectVersionStatus) Values() []ProjectVersionStatus { "COPYING_IN_PROGRESS", "COPYING_COMPLETED", "COPYING_FAILED", + "DEPRECATED", + "EXPIRED", } } diff --git a/service/rekognition/types/errors.go b/service/rekognition/types/errors.go index 3b5b07070d8..6604461cfc0 100644 --- a/service/rekognition/types/errors.go +++ b/service/rekognition/types/errors.go @@ -340,10 +340,10 @@ func (e *InvalidS3ObjectException) ErrorCode() string { func (e *InvalidS3ObjectException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An Amazon Rekognition service limit was exceeded. For example, if you start too -// many Amazon Rekognition Video jobs concurrently, calls to start operations ( -// StartLabelDetection , for example) will raise a LimitExceededException -// exception (HTTP status code: 400) until the number of concurrently running jobs -// is below the Amazon Rekognition service limit. +// many jobs concurrently, subsequent calls to start operations (ex: +// StartLabelDetection ) will raise a LimitExceededException exception (HTTP +// status code: 400) until the number of concurrently running jobs is below the +// Amazon Rekognition service limit. type LimitExceededException struct { Message *string diff --git a/service/rekognition/types/types.go b/service/rekognition/types/types.go index bebaabe621f..be44a649206 100644 --- a/service/rekognition/types/types.go +++ b/service/rekognition/types/types.go @@ -411,6 +411,28 @@ type CreateFaceLivenessSessionRequestSettings struct { noSmithyDocumentSerde } +// Feature specific configuration for the training job. Configuration provided for +// the job must match the feature type parameter associated with project. If +// configuration and feature type do not match an InvalidParameterException is +// returned. +type CustomizationFeatureConfig struct { + + // Configuration options for Custom Moderation training. + ContentModeration *CustomizationFeatureContentModerationConfig + + noSmithyDocumentSerde +} + +// Configuration options for Content Moderation training. +type CustomizationFeatureContentModerationConfig struct { + + // The confidence level you plan to use to identify if unsafe content is present + // during inference. + ConfidenceThreshold *float32 + + noSmithyDocumentSerde +} + // A custom label detected in an image by a call to DetectCustomLabels . type CustomLabel struct { @@ -1636,12 +1658,19 @@ type Pose struct { // information, see DescribeProjects . type ProjectDescription struct { + // Indicates whether automatic retraining will be attempted for the versions of + // the project. Applies only to adapters. + AutoUpdate ProjectAutoUpdate + // The Unix timestamp for the date and time that the project was created. CreationTimestamp *time.Time // Information about the training and test datasets in the project. Datasets []DatasetMetadata + // Specifies the project that is being customized. + Feature CustomizationFeature + // The Amazon Resource Name (ARN) of the project. ProjectArn *string @@ -1676,9 +1705,12 @@ type ProjectPolicy struct { noSmithyDocumentSerde } -// A description of a version of an Amazon Rekognition Custom Labels model. +// A description of a version of a Amazon Rekognition project version. type ProjectVersionDescription struct { + // The base detection model version used to create the project version. + BaseModelVersion *string + // The duration, in seconds, that you were billed for a successful training of the // model version. This value is only returned if the model version has been // successfully trained. @@ -1691,6 +1723,12 @@ type ProjectVersionDescription struct { // successful. EvaluationResult *EvaluationResult + // The feature that was customized. + Feature CustomizationFeature + + // Feature specific configuration that was applied during training. + FeatureConfig *CustomizationFeatureConfig + // The identifer for the AWS Key Management Service key (AWS KMS key) that was // used to encrypt the model during training. KmsKeyId *string @@ -1699,18 +1737,19 @@ type ProjectVersionDescription struct { // data validation results for the training and test datasets. ManifestSummary *GroundTruthManifest - // The maximum number of inference units Amazon Rekognition Custom Labels uses to - // auto-scale the model. For more information, see StartProjectVersion . + // The maximum number of inference units Amazon Rekognition uses to auto-scale the + // model. Applies only to Custom Labels projects. For more information, see + // StartProjectVersion . MaxInferenceUnits *int32 - // The minimum number of inference units used by the model. For more information, - // see StartProjectVersion . + // The minimum number of inference units used by the model. Applies only to Custom + // Labels projects. For more information, see StartProjectVersion . MinInferenceUnits *int32 // The location where training results are saved. OutputConfig *OutputConfig - // The Amazon Resource Name (ARN) of the model version. + // The Amazon Resource Name (ARN) of the project version. ProjectVersionArn *string // If the model version was copied from a different project, @@ -1732,6 +1771,9 @@ type ProjectVersionDescription struct { // The Unix date and time that training of the model ended. TrainingEndTimestamp *time.Time + // A user-provided description of the project version. + VersionDescription *string + noSmithyDocumentSerde } @@ -2279,17 +2321,15 @@ type TechnicalCueSegment struct { } // The dataset used for testing. Optionally, if AutoCreate is set, Amazon -// Rekognition Custom Labels uses the training dataset to create a test dataset -// with a temporary split of the training dataset. +// Rekognition uses the training dataset to create a test dataset with a temporary +// split of the training dataset. type TestingData struct { // The assets used for testing. Assets []Asset - // If specified, Amazon Rekognition Custom Labels temporarily splits the training - // dataset (80%) to create a test dataset (20%) for the training job. After - // training completes, the test dataset is not stored and the training dataset - // reverts to its previous size. + // If specified, Rekognition splits training dataset to create a test dataset for + // the training job. AutoCreate bool noSmithyDocumentSerde @@ -2367,26 +2407,26 @@ type TextDetectionResult struct { // The dataset used for training. type TrainingData struct { - // A Sagemaker GroundTruth manifest file that contains the training images - // (assets). + // A manifest file that contains references to the training images and + // ground-truth annotations. Assets []Asset noSmithyDocumentSerde } -// Sagemaker Groundtruth format manifest files for the input, output and -// validation datasets that are used and created during testing. +// The data validation manifest created for the training dataset during model +// training. type TrainingDataResult struct { - // The training assets that you supplied for training. + // The training data that you supplied. Input *TrainingData - // The images (assets) that were actually trained by Amazon Rekognition Custom - // Labels. + // Reference to images (assets) that were actually used during training with + // trained model predictions. Output *TrainingData - // The location of the data validation manifest. The data validation manifest is - // created for the training dataset during model training. + // A manifest that you supplied for training, with validation results for each + // line. Validation *ValidationData noSmithyDocumentSerde diff --git a/service/sagemaker/api_op_CreateFeatureGroup.go b/service/sagemaker/api_op_CreateFeatureGroup.go index 0813813f4a5..45ccd020364 100644 --- a/service/sagemaker/api_op_CreateFeatureGroup.go +++ b/service/sagemaker/api_op_CreateFeatureGroup.go @@ -18,13 +18,14 @@ import ( // Create a new FeatureGroup . A FeatureGroup is a group of Features defined in // the FeatureStore to describe a Record . The FeatureGroup defines the schema and -// features contained in the FeatureGroup. A FeatureGroup definition is composed +// features contained in the FeatureGroup . A FeatureGroup definition is composed // of a list of Features , a RecordIdentifierFeatureName , an EventTimeFeatureName // and configurations for its OnlineStore and OfflineStore . Check Amazon Web // Services service quotas (https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) -// to see the FeatureGroup s quota for your Amazon Web Services account. You must -// include at least one of OnlineStoreConfig and OfflineStoreConfig to create a -// FeatureGroup . +// to see the FeatureGroup s quota for your Amazon Web Services account. Note that +// it can take approximately 10-15 minutes to provision an OnlineStore FeatureGroup +// with the InMemory StorageType . You must include at least one of +// OnlineStoreConfig and OfflineStoreConfig to create a FeatureGroup . func (c *Client) CreateFeatureGroup(ctx context.Context, params *CreateFeatureGroupInput, optFns ...func(*Options)) (*CreateFeatureGroupOutput, error) { if params == nil { params = &CreateFeatureGroupInput{} diff --git a/service/sagemaker/api_op_DeleteFeatureGroup.go b/service/sagemaker/api_op_DeleteFeatureGroup.go index b6deb6be7a4..74c78ec779a 100644 --- a/service/sagemaker/api_op_DeleteFeatureGroup.go +++ b/service/sagemaker/api_op_DeleteFeatureGroup.go @@ -19,7 +19,9 @@ import ( // FeatureGroup . Data cannot be accessed from the OnlineStore immediately after // DeleteFeatureGroup is called. Data written into the OfflineStore will not be // deleted. The Amazon Web Services Glue database and tables that are automatically -// created for your OfflineStore are not deleted. +// created for your OfflineStore are not deleted. Note that it can take +// approximately 10-15 minutes to delete an OnlineStore FeatureGroup with the +// InMemory StorageType . func (c *Client) DeleteFeatureGroup(ctx context.Context, params *DeleteFeatureGroupInput, optFns ...func(*Options)) (*DeleteFeatureGroupOutput, error) { if params == nil { params = &DeleteFeatureGroupInput{} diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index 6cfa5a0a74a..ecb4dadc1ed 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -37526,11 +37526,21 @@ func awsAwsjson11_deserializeDocumentCanvasAppSettings(v **types.CanvasAppSettin for key, value := range shape { switch key { + case "DirectDeploySettings": + if err := awsAwsjson11_deserializeDocumentDirectDeploySettings(&sv.DirectDeploySettings, value); err != nil { + return err + } + case "IdentityProviderOAuthSettings": if err := awsAwsjson11_deserializeDocumentIdentityProviderOAuthSettings(&sv.IdentityProviderOAuthSettings, value); err != nil { return err } + case "KendraSettings": + if err := awsAwsjson11_deserializeDocumentKendraSettings(&sv.KendraSettings, value); err != nil { + return err + } + case "ModelRegisterSettings": if err := awsAwsjson11_deserializeDocumentModelRegisterSettings(&sv.ModelRegisterSettings, value); err != nil { return err @@ -42289,6 +42299,46 @@ func awsAwsjson11_deserializeDocumentDeviceSummary(v **types.DeviceSummary, valu return nil } +func awsAwsjson11_deserializeDocumentDirectDeploySettings(v **types.DirectDeploySettings, 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.DirectDeploySettings + if *v == nil { + sv = &types.DirectDeploySettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value) + } + sv.Status = types.FeatureStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDomainDetails(v **types.DomainDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -51504,6 +51554,46 @@ func awsAwsjson11_deserializeDocumentJupyterServerAppSettings(v **types.JupyterS return nil } +func awsAwsjson11_deserializeDocumentKendraSettings(v **types.KendraSettings, 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.KendraSettings + if *v == nil { + sv = &types.KendraSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value) + } + sv.Status = types.FeatureStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentKernelGatewayAppSettings(v **types.KernelGatewayAppSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/sagemaker/serializers.go b/service/sagemaker/serializers.go index bc2b25028e3..19ccf92ebfe 100644 --- a/service/sagemaker/serializers.go +++ b/service/sagemaker/serializers.go @@ -17847,6 +17847,13 @@ func awsAwsjson11_serializeDocumentCanvasAppSettings(v *types.CanvasAppSettings, object := value.Object() defer object.Close() + if v.DirectDeploySettings != nil { + ok := object.Key("DirectDeploySettings") + if err := awsAwsjson11_serializeDocumentDirectDeploySettings(v.DirectDeploySettings, ok); err != nil { + return err + } + } + if v.IdentityProviderOAuthSettings != nil { ok := object.Key("IdentityProviderOAuthSettings") if err := awsAwsjson11_serializeDocumentIdentityProviderOAuthSettings(v.IdentityProviderOAuthSettings, ok); err != nil { @@ -17854,6 +17861,13 @@ func awsAwsjson11_serializeDocumentCanvasAppSettings(v *types.CanvasAppSettings, } } + if v.KendraSettings != nil { + ok := object.Key("KendraSettings") + if err := awsAwsjson11_serializeDocumentKendraSettings(v.KendraSettings, ok); err != nil { + return err + } + } + if v.ModelRegisterSettings != nil { ok := object.Key("ModelRegisterSettings") if err := awsAwsjson11_serializeDocumentModelRegisterSettings(v.ModelRegisterSettings, ok); err != nil { @@ -19329,6 +19343,18 @@ func awsAwsjson11_serializeDocumentDeviceSelectionConfig(v *types.DeviceSelectio return nil } +func awsAwsjson11_serializeDocumentDirectDeploySettings(v *types.DirectDeploySettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + return nil +} + func awsAwsjson11_serializeDocumentDomainSecurityGroupIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -21208,6 +21234,18 @@ func awsAwsjson11_serializeDocumentJupyterServerAppSettings(v *types.JupyterServ return nil } +func awsAwsjson11_serializeDocumentKendraSettings(v *types.KendraSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + return nil +} + func awsAwsjson11_serializeDocumentKernelGatewayAppSettings(v *types.KernelGatewayAppSettings, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index 1be64b6753d..4cc02527761 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -2044,13 +2044,19 @@ type CandidateProperties struct { // The SageMaker Canvas application settings. type CanvasAppSettings struct { + // The model deployment settings for the SageMaker Canvas application. + DirectDeploySettings *DirectDeploySettings + // The settings for connecting to an external data source with OAuth. IdentityProviderOAuthSettings []IdentityProviderOAuthSetting + // The settings for document querying. + KendraSettings *KendraSettings + // The model registry settings for the SageMaker Canvas application. ModelRegisterSettings *ModelRegisterSettings - // Time series forecast settings for the Canvas application. + // Time series forecast settings for the SageMaker Canvas application. TimeSeriesForecastingSettings *TimeSeriesForecastingSettings // The workspace settings for the SageMaker Canvas application. @@ -3567,6 +3573,21 @@ type DeviceSummary struct { noSmithyDocumentSerde } +// The model deployment settings for the SageMaker Canvas application. In order to +// enable model deployment for Canvas, the SageMaker Domain's or user profile's +// Amazon Web Services IAM execution role must have the +// AmazonSageMakerCanvasDirectDeployAccess policy attached. You can also turn on +// model deployment permissions through the SageMaker Domain's or user profile's +// settings in the SageMaker console. +type DirectDeploySettings struct { + + // Describes whether model deployment permissions are enabled or disabled in the + // Canvas application. + Status FeatureStatus + + noSmithyDocumentSerde +} + // The domain's details. type DomainDetails struct { @@ -6598,7 +6619,7 @@ type IamIdentity struct { noSmithyDocumentSerde } -// The Amazon SageMaker Canvas app setting where you configure OAuth for +// The Amazon SageMaker Canvas application setting where you configure OAuth for // connecting to an external data source, such as Snowflake. type IdentityProviderOAuthSetting struct { @@ -7235,6 +7256,17 @@ type JupyterServerAppSettings struct { noSmithyDocumentSerde } +// The Amazon SageMaker Canvas application setting where you configure document +// querying. +type KendraSettings struct { + + // Describes whether the document querying feature is enabled or disabled in the + // Canvas application. + Status FeatureStatus + + noSmithyDocumentSerde +} + // The KernelGateway app settings. type KernelGatewayAppSettings struct { @@ -12910,7 +12942,11 @@ type SelectiveExecutionConfig struct { // The ARN from a reference execution of the current pipeline. Used to copy input // collaterals needed for the selected steps to run. The execution status of the - // pipeline can be either Failed or Success . + // pipeline can be either Failed or Success . This field is required if the steps + // you specify for SelectedSteps depend on output collaterals from any + // non-specified pipeline steps. For more information, see Selective Execution for + // Pipeline Steps (https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-selective-ex.html) + // . SourcePipelineExecutionArn *string noSmithyDocumentSerde diff --git a/service/simspaceweaver/internal/endpoints/endpoints.go b/service/simspaceweaver/internal/endpoints/endpoints.go index a4ad1244300..d5c506bdc17 100644 --- a/service/simspaceweaver/internal/endpoints/endpoints.go +++ b/service/simspaceweaver/internal/endpoints/endpoints.go @@ -321,10 +321,20 @@ var defaultPartitions = endpoints.Partitions{ Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-east-1", - }: endpoints.Endpoint{}, + }: endpoints.Endpoint{ + Hostname: "simspaceweaver.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, endpoints.EndpointKey{ Region: "us-gov-west-1", - }: endpoints.Endpoint{}, + }: endpoints.Endpoint{ + Hostname: "simspaceweaver.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, }, }, } diff --git a/service/textract/api_client.go b/service/textract/api_client.go index 7f168505ed5..89551e7f16a 100644 --- a/service/textract/api_client.go +++ b/service/textract/api_client.go @@ -4,6 +4,7 @@ package textract import ( "context" + cryptorand "crypto/rand" "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" @@ -16,6 +17,7 @@ import ( smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" @@ -46,6 +48,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) + resolveIdempotencyTokenProvider(&options) + for _, fn := range optFns { fn(&options) } @@ -100,6 +104,10 @@ type Options struct { // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + // The logger writer interface to write logging messages to. Logger logging.Logger @@ -440,6 +448,13 @@ func newDefaultV4Signer(o Options) *v4.Signer { }) } +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, @@ -478,6 +493,11 @@ func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { return nil } +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } diff --git a/service/textract/api_op_AnalyzeDocument.go b/service/textract/api_op_AnalyzeDocument.go index c2d8161d087..a628e4a5852 100644 --- a/service/textract/api_op_AnalyzeDocument.go +++ b/service/textract/api_op_AnalyzeDocument.go @@ -76,15 +76,15 @@ type AnalyzeDocumentInput struct { // information about the tables that are detected in the input document. Add FORMS // to return detected form data. Add SIGNATURES to return the locations of detected // signatures. Add LAYOUT to the list to return information about the layout of the - // document. To perform both forms and table analysis, add TABLES and FORMS to - // FeatureTypes . To detect signatures within the document and within form data and - // table data, add SIGNATURES to either TABLES or FORMS. All lines and words - // detected in the document are included in the response (including text that isn't - // related to the value of FeatureTypes ). + // document. All lines and words detected in the document are included in the + // response (including text that isn't related to the value of FeatureTypes ). // // This member is required. FeatureTypes []types.FeatureType + // Specifies the adapter to be used when analyzing a document. + AdaptersConfig *types.AdaptersConfig + // Sets the configuration for the human in the loop workflow for analyzing // documents. HumanLoopConfig *types.HumanLoopConfig diff --git a/service/textract/api_op_CreateAdapter.go b/service/textract/api_op_CreateAdapter.go new file mode 100644 index 00000000000..f9d5e2664b0 --- /dev/null +++ b/service/textract/api_op_CreateAdapter.go @@ -0,0 +1,322 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/textract/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an adapter, which can be fine-tuned for enhanced performance on user +// provided documents. Takes an AdapterName and FeatureType. Currently the only +// supported feature type is QUERIES . You can also provide a Description, Tags, +// and a ClientRequestToken. You can choose whether or not the adapter should be +// AutoUpdated with the AutoUpdate argument. By default, AutoUpdate is set to +// DISABLED. +func (c *Client) CreateAdapter(ctx context.Context, params *CreateAdapterInput, optFns ...func(*Options)) (*CreateAdapterOutput, error) { + if params == nil { + params = &CreateAdapterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAdapter", params, optFns, c.addOperationCreateAdapterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAdapterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAdapterInput struct { + + // The name to be assigned to the adapter being created. + // + // This member is required. + AdapterName *string + + // The type of feature that the adapter is being trained on. Currrenly, supported + // feature types are: QUERIES + // + // This member is required. + FeatureTypes []types.FeatureType + + // Controls whether or not the adapter should automatically update. + AutoUpdate types.AutoUpdate + + // Idempotent token is used to recognize the request. If the same token is used + // with multiple CreateAdapter requests, the same session is returned. This token + // is employed to avoid unintentionally creating the same session multiple times. + ClientRequestToken *string + + // The description to be assigned to the adapter being created. + Description *string + + // A list of tags to be added to the adapter. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAdapterOutput struct { + + // A string containing the unique ID for the adapter that has been created. + AdapterId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAdapterMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAdapter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAdapter{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCreateAdapterResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateAdapterMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAdapterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAdapter(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAdapter struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAdapter) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAdapter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateAdapterInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAdapterInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateAdapterMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAdapter{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAdapter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "CreateAdapter", + } +} + +type opCreateAdapterResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateAdapterResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateAdapterResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateAdapterResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateAdapterResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_CreateAdapterVersion.go b/service/textract/api_op_CreateAdapterVersion.go new file mode 100644 index 00000000000..fdeac9dc7a5 --- /dev/null +++ b/service/textract/api_op_CreateAdapterVersion.go @@ -0,0 +1,344 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/textract/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new version of an adapter. Operates on a provided AdapterId and a +// specified dataset provided via the DatasetConfig argument. Requires that you +// specify an Amazon S3 bucket with the OutputConfig argument. You can provide an +// optional KMSKeyId, an optional ClientRequestToken, and optional tags. +func (c *Client) CreateAdapterVersion(ctx context.Context, params *CreateAdapterVersionInput, optFns ...func(*Options)) (*CreateAdapterVersionOutput, error) { + if params == nil { + params = &CreateAdapterVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateAdapterVersion", params, optFns, c.addOperationCreateAdapterVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateAdapterVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateAdapterVersionInput struct { + + // A string containing a unique ID for the adapter that will receive a new version. + // + // This member is required. + AdapterId *string + + // Specifies a dataset used to train a new adapter version. Takes a + // ManifestS3Object as the value. + // + // This member is required. + DatasetConfig *types.AdapterVersionDatasetConfig + + // Sets whether or not your output will go to a user created bucket. Used to set + // the name of the bucket, and the prefix on the output file. OutputConfig is an + // optional parameter which lets you adjust where your output will be placed. By + // default, Amazon Textract will store the results internally and can only be + // accessed by the Get API operations. With OutputConfig enabled, you can set the + // name of the bucket the output will be sent to the file prefix of the results + // where you can download your results. Additionally, you can set the KMSKeyID + // parameter to a customer master key (CMK) to encrypt your output. Without this + // parameter set Amazon Textract will encrypt server-side using the AWS managed CMK + // for Amazon S3. Decryption of Customer Content is necessary for processing of the + // documents by Amazon Textract. If your account is opted out under an AI services + // opt out policy then all unencrypted Customer Content is immediately and + // permanently deleted after the Customer Content has been processed by the + // service. No copy of of the output is retained by Amazon Textract. For + // information about how to opt out, see Managing AI services opt-out policy. (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) + // For more information on data privacy, see the Data Privacy FAQ (https://aws.amazon.com/compliance/data-privacy-faq/) + // . + // + // This member is required. + OutputConfig *types.OutputConfig + + // Idempotent token is used to recognize the request. If the same token is used + // with multiple CreateAdapterVersion requests, the same session is returned. This + // token is employed to avoid unintentionally creating the same session multiple + // times. + ClientRequestToken *string + + // The identifier for your AWS Key Management Service key (AWS KMS key). Used to + // encrypt your documents. + KMSKeyId *string + + // A set of tags (key-value pairs) that you want to attach to the adapter version. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateAdapterVersionOutput struct { + + // A string containing the unique ID for the adapter that has received a new + // version. + AdapterId *string + + // A string describing the new version of the adapter. + AdapterVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateAdapterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAdapterVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAdapterVersion{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCreateAdapterVersionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateAdapterVersionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateAdapterVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAdapterVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateAdapterVersion struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateAdapterVersion) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateAdapterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateAdapterVersionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAdapterVersionInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateAdapterVersionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAdapterVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateAdapterVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "CreateAdapterVersion", + } +} + +type opCreateAdapterVersionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateAdapterVersionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateAdapterVersionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateAdapterVersionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateAdapterVersionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_DeleteAdapter.go b/service/textract/api_op_DeleteAdapter.go new file mode 100644 index 00000000000..782438ac833 --- /dev/null +++ b/service/textract/api_op_DeleteAdapter.go @@ -0,0 +1,257 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the adapter +// specified by the ID. +func (c *Client) DeleteAdapter(ctx context.Context, params *DeleteAdapterInput, optFns ...func(*Options)) (*DeleteAdapterOutput, error) { + if params == nil { + params = &DeleteAdapterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAdapter", params, optFns, c.addOperationDeleteAdapterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAdapterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAdapterInput struct { + + // A string containing a unique ID for the adapter to be deleted. + // + // This member is required. + AdapterId *string + + noSmithyDocumentSerde +} + +type DeleteAdapterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAdapterMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAdapter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAdapter{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addDeleteAdapterResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteAdapterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAdapter(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAdapter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "DeleteAdapter", + } +} + +type opDeleteAdapterResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteAdapterResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteAdapterResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteAdapterResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteAdapterResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_DeleteAdapterVersion.go b/service/textract/api_op_DeleteAdapterVersion.go new file mode 100644 index 00000000000..810f337debf --- /dev/null +++ b/service/textract/api_op_DeleteAdapterVersion.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Amazon Textract adapter version. Requires that you specify both an +// AdapterId and a AdapterVersion. Deletes the adapter version specified by the +// AdapterId and the AdapterVersion. +func (c *Client) DeleteAdapterVersion(ctx context.Context, params *DeleteAdapterVersionInput, optFns ...func(*Options)) (*DeleteAdapterVersionOutput, error) { + if params == nil { + params = &DeleteAdapterVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAdapterVersion", params, optFns, c.addOperationDeleteAdapterVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAdapterVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAdapterVersionInput struct { + + // A string containing a unique ID for the adapter version that will be deleted. + // + // This member is required. + AdapterId *string + + // Specifies the adapter version to be deleted. + // + // This member is required. + AdapterVersion *string + + noSmithyDocumentSerde +} + +type DeleteAdapterVersionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAdapterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAdapterVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAdapterVersion{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addDeleteAdapterVersionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteAdapterVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAdapterVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAdapterVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "DeleteAdapterVersion", + } +} + +type opDeleteAdapterVersionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteAdapterVersionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteAdapterVersionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteAdapterVersionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteAdapterVersionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_GetAdapter.go b/service/textract/api_op_GetAdapter.go new file mode 100644 index 00000000000..085bc750e53 --- /dev/null +++ b/service/textract/api_op_GetAdapter.go @@ -0,0 +1,283 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/textract/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets configuration information for an adapter specified by an AdapterId, +// returning information on AdapterName, Description, CreationTime, AutoUpdate +// status, and FeatureTypes. +func (c *Client) GetAdapter(ctx context.Context, params *GetAdapterInput, optFns ...func(*Options)) (*GetAdapterOutput, error) { + if params == nil { + params = &GetAdapterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAdapter", params, optFns, c.addOperationGetAdapterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAdapterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAdapterInput struct { + + // A string containing a unique ID for the adapter. + // + // This member is required. + AdapterId *string + + noSmithyDocumentSerde +} + +type GetAdapterOutput struct { + + // A string identifying the adapter that information has been retrieved for. + AdapterId *string + + // The name of the requested adapter. + AdapterName *string + + // Binary value indicating if the adapter is being automatically updated or not. + AutoUpdate types.AutoUpdate + + // The date and time the requested adapter was created at. + CreationTime *time.Time + + // The description for the requested adapter. + Description *string + + // List of the targeted feature types for the requested adapter. + FeatureTypes []types.FeatureType + + // A set of tags (key-value pairs) associated with the adapter that has been + // retrieved. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAdapterMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAdapter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAdapter{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addGetAdapterResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetAdapterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAdapter(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAdapter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "GetAdapter", + } +} + +type opGetAdapterResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetAdapterResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetAdapterResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetAdapterResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetAdapterResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_GetAdapterVersion.go b/service/textract/api_op_GetAdapterVersion.go new file mode 100644 index 00000000000..4386f497041 --- /dev/null +++ b/service/textract/api_op_GetAdapterVersion.go @@ -0,0 +1,319 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/textract/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets configuration information for the specified adapter version, including: +// AdapterId, AdapterVersion, FeatureTypes, Status, StatusMessage, DatasetConfig, +// KMSKeyId, OutputConfig, Tags and EvaluationMetrics. +func (c *Client) GetAdapterVersion(ctx context.Context, params *GetAdapterVersionInput, optFns ...func(*Options)) (*GetAdapterVersionOutput, error) { + if params == nil { + params = &GetAdapterVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAdapterVersion", params, optFns, c.addOperationGetAdapterVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAdapterVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAdapterVersionInput struct { + + // A string specifying a unique ID for the adapter version you want to retrieve + // information for. + // + // This member is required. + AdapterId *string + + // A string specifying the adapter version you want to retrieve information for. + // + // This member is required. + AdapterVersion *string + + noSmithyDocumentSerde +} + +type GetAdapterVersionOutput struct { + + // A string containing a unique ID for the adapter version being retrieved. + AdapterId *string + + // A string containing the adapter version that has been retrieved. + AdapterVersion *string + + // The time that the adapter version was created. + CreationTime *time.Time + + // Specifies a dataset used to train a new adapter version. Takes a + // ManifestS3Objec as the value. + DatasetConfig *types.AdapterVersionDatasetConfig + + // The evaluation metrics (F1 score, Precision, and Recall) for the requested + // version, grouped by baseline metrics and adapter version. + EvaluationMetrics []types.AdapterVersionEvaluationMetric + + // List of the targeted feature types for the requested adapter version. + FeatureTypes []types.FeatureType + + // The identifier for your AWS Key Management Service key (AWS KMS key). Used to + // encrypt your documents. + KMSKeyId *string + + // Sets whether or not your output will go to a user created bucket. Used to set + // the name of the bucket, and the prefix on the output file. OutputConfig is an + // optional parameter which lets you adjust where your output will be placed. By + // default, Amazon Textract will store the results internally and can only be + // accessed by the Get API operations. With OutputConfig enabled, you can set the + // name of the bucket the output will be sent to the file prefix of the results + // where you can download your results. Additionally, you can set the KMSKeyID + // parameter to a customer master key (CMK) to encrypt your output. Without this + // parameter set Amazon Textract will encrypt server-side using the AWS managed CMK + // for Amazon S3. Decryption of Customer Content is necessary for processing of the + // documents by Amazon Textract. If your account is opted out under an AI services + // opt out policy then all unencrypted Customer Content is immediately and + // permanently deleted after the Customer Content has been processed by the + // service. No copy of of the output is retained by Amazon Textract. For + // information about how to opt out, see Managing AI services opt-out policy. (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) + // For more information on data privacy, see the Data Privacy FAQ (https://aws.amazon.com/compliance/data-privacy-faq/) + // . + OutputConfig *types.OutputConfig + + // The status of the adapter version that has been requested. + Status types.AdapterVersionStatus + + // A message that describes the status of the requested adapter version. + StatusMessage *string + + // A set of tags (key-value pairs) that are associated with the adapter version. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAdapterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAdapterVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAdapterVersion{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addGetAdapterVersionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetAdapterVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAdapterVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAdapterVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "GetAdapterVersion", + } +} + +type opGetAdapterVersionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetAdapterVersionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetAdapterVersionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetAdapterVersionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetAdapterVersionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_ListAdapterVersions.go b/service/textract/api_op_ListAdapterVersions.go new file mode 100644 index 00000000000..284da8234ee --- /dev/null +++ b/service/textract/api_op_ListAdapterVersions.go @@ -0,0 +1,369 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/textract/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// List all version of an adapter that meet the specified filtration criteria. +func (c *Client) ListAdapterVersions(ctx context.Context, params *ListAdapterVersionsInput, optFns ...func(*Options)) (*ListAdapterVersionsOutput, error) { + if params == nil { + params = &ListAdapterVersionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAdapterVersions", params, optFns, c.addOperationListAdapterVersionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAdapterVersionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAdapterVersionsInput struct { + + // A string containing a unique ID for the adapter to match for when listing + // adapter versions. + AdapterId *string + + // Specifies the lower bound for the ListAdapterVersions operation. Ensures + // ListAdapterVersions returns only adapter versions created after the specified + // creation time. + AfterCreationTime *time.Time + + // Specifies the upper bound for the ListAdapterVersions operation. Ensures + // ListAdapterVersions returns only adapter versions created after the specified + // creation time. + BeforeCreationTime *time.Time + + // The maximum number of results to return when listing adapter versions. + MaxResults *int32 + + // Identifies the next page of results to return when listing adapter versions. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAdapterVersionsOutput struct { + + // Adapter versions that match the filtering criteria specified when calling + // ListAdapters. + AdapterVersions []types.AdapterVersionOverview + + // Identifies the next page of results to return when listing adapter versions. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAdapterVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAdapterVersions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAdapterVersions{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListAdapterVersionsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAdapterVersions(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListAdapterVersionsAPIClient is a client that implements the +// ListAdapterVersions operation. +type ListAdapterVersionsAPIClient interface { + ListAdapterVersions(context.Context, *ListAdapterVersionsInput, ...func(*Options)) (*ListAdapterVersionsOutput, error) +} + +var _ ListAdapterVersionsAPIClient = (*Client)(nil) + +// ListAdapterVersionsPaginatorOptions is the paginator options for +// ListAdapterVersions +type ListAdapterVersionsPaginatorOptions struct { + // The maximum number of results to return when listing adapter versions. + 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 +} + +// ListAdapterVersionsPaginator is a paginator for ListAdapterVersions +type ListAdapterVersionsPaginator struct { + options ListAdapterVersionsPaginatorOptions + client ListAdapterVersionsAPIClient + params *ListAdapterVersionsInput + nextToken *string + firstPage bool +} + +// NewListAdapterVersionsPaginator returns a new ListAdapterVersionsPaginator +func NewListAdapterVersionsPaginator(client ListAdapterVersionsAPIClient, params *ListAdapterVersionsInput, optFns ...func(*ListAdapterVersionsPaginatorOptions)) *ListAdapterVersionsPaginator { + if params == nil { + params = &ListAdapterVersionsInput{} + } + + options := ListAdapterVersionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAdapterVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAdapterVersionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAdapterVersions page. +func (p *ListAdapterVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAdapterVersionsOutput, 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.ListAdapterVersions(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_opListAdapterVersions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "ListAdapterVersions", + } +} + +type opListAdapterVersionsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListAdapterVersionsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListAdapterVersionsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListAdapterVersionsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListAdapterVersionsResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_ListAdapters.go b/service/textract/api_op_ListAdapters.go new file mode 100644 index 00000000000..f370035f3d0 --- /dev/null +++ b/service/textract/api_op_ListAdapters.go @@ -0,0 +1,361 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/textract/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Lists all adapters that match the specified filtration criteria. +func (c *Client) ListAdapters(ctx context.Context, params *ListAdaptersInput, optFns ...func(*Options)) (*ListAdaptersOutput, error) { + if params == nil { + params = &ListAdaptersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAdapters", params, optFns, c.addOperationListAdaptersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAdaptersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAdaptersInput struct { + + // Specifies the lower bound for the ListAdapters operation. Ensures ListAdapters + // returns only adapters created after the specified creation time. + AfterCreationTime *time.Time + + // Specifies the upper bound for the ListAdapters operation. Ensures ListAdapters + // returns only adapters created before the specified creation time. + BeforeCreationTime *time.Time + + // The maximum number of results to return when listing adapters. + MaxResults *int32 + + // Identifies the next page of results to return when listing adapters. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAdaptersOutput struct { + + // A list of adapters that matches the filtering criteria specified when calling + // ListAdapters. + Adapters []types.AdapterOverview + + // Identifies the next page of results to return when listing adapters. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAdaptersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAdapters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAdapters{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListAdaptersResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAdapters(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListAdaptersAPIClient is a client that implements the ListAdapters operation. +type ListAdaptersAPIClient interface { + ListAdapters(context.Context, *ListAdaptersInput, ...func(*Options)) (*ListAdaptersOutput, error) +} + +var _ ListAdaptersAPIClient = (*Client)(nil) + +// ListAdaptersPaginatorOptions is the paginator options for ListAdapters +type ListAdaptersPaginatorOptions struct { + // The maximum number of results to return when listing adapters. + 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 +} + +// ListAdaptersPaginator is a paginator for ListAdapters +type ListAdaptersPaginator struct { + options ListAdaptersPaginatorOptions + client ListAdaptersAPIClient + params *ListAdaptersInput + nextToken *string + firstPage bool +} + +// NewListAdaptersPaginator returns a new ListAdaptersPaginator +func NewListAdaptersPaginator(client ListAdaptersAPIClient, params *ListAdaptersInput, optFns ...func(*ListAdaptersPaginatorOptions)) *ListAdaptersPaginator { + if params == nil { + params = &ListAdaptersInput{} + } + + options := ListAdaptersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAdaptersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAdaptersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAdapters page. +func (p *ListAdaptersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAdaptersOutput, 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.ListAdapters(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_opListAdapters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "ListAdapters", + } +} + +type opListAdaptersResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListAdaptersResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListAdaptersResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListAdaptersResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListAdaptersResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_ListTagsForResource.go b/service/textract/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..0dd0aef2c10 --- /dev/null +++ b/service/textract/api_op_ListTagsForResource.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all tags for an Amazon Textract resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) that specifies the resource to list tags for. + // + // This member is required. + ResourceARN *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A set of tags (key-value pairs) that are part of the requested resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addListTagsForResourceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "ListTagsForResource", + } +} + +type opListTagsForResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListTagsForResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListTagsForResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListTagsForResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_StartDocumentAnalysis.go b/service/textract/api_op_StartDocumentAnalysis.go index eee8202ec9c..ce92548f986 100644 --- a/service/textract/api_op_StartDocumentAnalysis.go +++ b/service/textract/api_op_StartDocumentAnalysis.go @@ -62,6 +62,9 @@ type StartDocumentAnalysisInput struct { // This member is required. FeatureTypes []types.FeatureType + // Specifies the adapter to be used when analyzing a document. + AdaptersConfig *types.AdaptersConfig + // The idempotent token that you use to identify the start request. If you use the // same token with multiple StartDocumentAnalysis requests, the same JobId is // returned. Use ClientRequestToken to prevent the same job from being diff --git a/service/textract/api_op_TagResource.go b/service/textract/api_op_TagResource.go new file mode 100644 index 00000000000..6220636b41c --- /dev/null +++ b/service/textract/api_op_TagResource.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds one or more tags to the specified resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) that specifies the resource to be tagged. + // + // This member is required. + ResourceARN *string + + // A set of tags (key-value pairs) that you want to assign to the resource. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addTagResourceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "TagResource", + } +} + +type opTagResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opTagResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addTagResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opTagResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_UntagResource.go b/service/textract/api_op_UntagResource.go new file mode 100644 index 00000000000..7901b23014d --- /dev/null +++ b/service/textract/api_op_UntagResource.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes any tags with the specified keys from the specified resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) that specifies the resource to be untagged. + // + // This member is required. + ResourceARN *string + + // Specifies the tags to be removed from the resource specified by the ResourceARN. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addUntagResourceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "UntagResource", + } +} + +type opUntagResourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUntagResourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUntagResourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUntagResourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/api_op_UpdateAdapter.go b/service/textract/api_op_UpdateAdapter.go new file mode 100644 index 00000000000..140bc3ff808 --- /dev/null +++ b/service/textract/api_op_UpdateAdapter.go @@ -0,0 +1,287 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/textract/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Update the configuration for an adapter. FeatureTypes configurations cannot be +// updated. At least one new parameter must be specified as an argument. +func (c *Client) UpdateAdapter(ctx context.Context, params *UpdateAdapterInput, optFns ...func(*Options)) (*UpdateAdapterOutput, error) { + if params == nil { + params = &UpdateAdapterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAdapter", params, optFns, c.addOperationUpdateAdapterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAdapterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateAdapterInput struct { + + // A string containing a unique ID for the adapter that will be updated. + // + // This member is required. + AdapterId *string + + // The new name to be applied to the adapter. + AdapterName *string + + // The new auto-update status to be applied to the adapter. + AutoUpdate types.AutoUpdate + + // The new description to be applied to the adapter. + Description *string + + noSmithyDocumentSerde +} + +type UpdateAdapterOutput struct { + + // A string containing a unique ID for the adapter that has been updated. + AdapterId *string + + // A string containing the name of the adapter that has been updated. + AdapterName *string + + // The auto-update status of the adapter that has been updated. + AutoUpdate types.AutoUpdate + + // An object specifying the creation time of the the adapter that has been updated. + CreationTime *time.Time + + // A string containing the description of the adapter that has been updated. + Description *string + + // List of the targeted feature types for the updated adapter. + FeatureTypes []types.FeatureType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateAdapterMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAdapter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAdapter{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addUpdateAdapterResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateAdapterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAdapter(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateAdapter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "textract", + OperationName: "UpdateAdapter", + } +} + +type opUpdateAdapterResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateAdapterResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateAdapterResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "textract" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "textract" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("textract") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateAdapterResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateAdapterResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/textract/deserializers.go b/service/textract/deserializers.go index 7fcbfe1e7fe..a89ada2bdae 100644 --- a/service/textract/deserializers.go +++ b/service/textract/deserializers.go @@ -13,6 +13,7 @@ import ( smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "math" @@ -427,14 +428,14 @@ func awsAwsjson11_deserializeOpErrorAnalyzeID(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpDetectDocumentText struct { +type awsAwsjson11_deserializeOpCreateAdapter struct { } -func (*awsAwsjson11_deserializeOpDetectDocumentText) ID() string { +func (*awsAwsjson11_deserializeOpCreateAdapter) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDetectDocumentText) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCreateAdapter) 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) @@ -448,9 +449,9 @@ func (m *awsAwsjson11_deserializeOpDetectDocumentText) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDetectDocumentText(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCreateAdapter(response, &metadata) } - output := &DetectDocumentTextOutput{} + output := &CreateAdapterOutput{} out.Result = output var buff [1024]byte @@ -470,7 +471,7 @@ func (m *awsAwsjson11_deserializeOpDetectDocumentText) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDetectDocumentTextOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCreateAdapterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -484,7 +485,7 @@ func (m *awsAwsjson11_deserializeOpDetectDocumentText) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDetectDocumentText(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateAdapter(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)} @@ -528,11 +529,11 @@ func awsAwsjson11_deserializeOpErrorDetectDocumentText(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadDocumentException", errorCode): - return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("DocumentTooLargeException", errorCode): - return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) @@ -540,17 +541,20 @@ func awsAwsjson11_deserializeOpErrorDetectDocumentText(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidS3ObjectException", errorCode): - return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedDocumentException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -562,14 +566,14 @@ func awsAwsjson11_deserializeOpErrorDetectDocumentText(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpGetDocumentAnalysis struct { +type awsAwsjson11_deserializeOpCreateAdapterVersion struct { } -func (*awsAwsjson11_deserializeOpGetDocumentAnalysis) ID() string { +func (*awsAwsjson11_deserializeOpCreateAdapterVersion) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetDocumentAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCreateAdapterVersion) 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) @@ -583,9 +587,9 @@ func (m *awsAwsjson11_deserializeOpGetDocumentAnalysis) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDocumentAnalysis(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCreateAdapterVersion(response, &metadata) } - output := &GetDocumentAnalysisOutput{} + output := &CreateAdapterVersionOutput{} out.Result = output var buff [1024]byte @@ -605,7 +609,7 @@ func (m *awsAwsjson11_deserializeOpGetDocumentAnalysis) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetDocumentAnalysisOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCreateAdapterVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -619,7 +623,7 @@ func (m *awsAwsjson11_deserializeOpGetDocumentAnalysis) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetDocumentAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateAdapterVersion(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)} @@ -663,12 +667,15 @@ func awsAwsjson11_deserializeOpErrorGetDocumentAnalysis(response *smithyhttp.Res case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidJobIdException", errorCode): - return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) - case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) @@ -678,12 +685,24 @@ func awsAwsjson11_deserializeOpErrorGetDocumentAnalysis(response *smithyhttp.Res case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -694,14 +713,14 @@ func awsAwsjson11_deserializeOpErrorGetDocumentAnalysis(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpGetDocumentTextDetection struct { +type awsAwsjson11_deserializeOpDeleteAdapter struct { } -func (*awsAwsjson11_deserializeOpGetDocumentTextDetection) ID() string { +func (*awsAwsjson11_deserializeOpDeleteAdapter) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetDocumentTextDetection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteAdapter) 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) @@ -715,9 +734,9 @@ func (m *awsAwsjson11_deserializeOpGetDocumentTextDetection) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDocumentTextDetection(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAdapter(response, &metadata) } - output := &GetDocumentTextDetectionOutput{} + output := &DeleteAdapterOutput{} out.Result = output var buff [1024]byte @@ -737,7 +756,7 @@ func (m *awsAwsjson11_deserializeOpGetDocumentTextDetection) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetDocumentTextDetectionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteAdapterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -751,7 +770,7 @@ func (m *awsAwsjson11_deserializeOpGetDocumentTextDetection) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetDocumentTextDetection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteAdapter(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)} @@ -795,27 +814,27 @@ func awsAwsjson11_deserializeOpErrorGetDocumentTextDetection(response *smithyhtt case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidJobIdException", errorCode): - return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) - - case strings.EqualFold("InvalidKMSKeyException", errorCode): - return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidS3ObjectException", errorCode): - return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -826,14 +845,14 @@ func awsAwsjson11_deserializeOpErrorGetDocumentTextDetection(response *smithyhtt } } -type awsAwsjson11_deserializeOpGetExpenseAnalysis struct { +type awsAwsjson11_deserializeOpDeleteAdapterVersion struct { } -func (*awsAwsjson11_deserializeOpGetExpenseAnalysis) ID() string { +func (*awsAwsjson11_deserializeOpDeleteAdapterVersion) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetExpenseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteAdapterVersion) 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) @@ -847,9 +866,9 @@ func (m *awsAwsjson11_deserializeOpGetExpenseAnalysis) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetExpenseAnalysis(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAdapterVersion(response, &metadata) } - output := &GetExpenseAnalysisOutput{} + output := &DeleteAdapterVersionOutput{} out.Result = output var buff [1024]byte @@ -869,7 +888,7 @@ func (m *awsAwsjson11_deserializeOpGetExpenseAnalysis) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetExpenseAnalysisOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteAdapterVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -883,7 +902,7 @@ func (m *awsAwsjson11_deserializeOpGetExpenseAnalysis) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetExpenseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteAdapterVersion(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)} @@ -927,27 +946,27 @@ func awsAwsjson11_deserializeOpErrorGetExpenseAnalysis(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidJobIdException", errorCode): - return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) - - case strings.EqualFold("InvalidKMSKeyException", errorCode): - return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidS3ObjectException", errorCode): - return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -958,14 +977,14 @@ func awsAwsjson11_deserializeOpErrorGetExpenseAnalysis(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpGetLendingAnalysis struct { +type awsAwsjson11_deserializeOpDetectDocumentText struct { } -func (*awsAwsjson11_deserializeOpGetLendingAnalysis) ID() string { +func (*awsAwsjson11_deserializeOpDetectDocumentText) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLendingAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDetectDocumentText) 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) @@ -979,9 +998,9 @@ func (m *awsAwsjson11_deserializeOpGetLendingAnalysis) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLendingAnalysis(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDetectDocumentText(response, &metadata) } - output := &GetLendingAnalysisOutput{} + output := &DetectDocumentTextOutput{} out.Result = output var buff [1024]byte @@ -1001,7 +1020,7 @@ func (m *awsAwsjson11_deserializeOpGetLendingAnalysis) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLendingAnalysisOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDetectDocumentTextOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1015,7 +1034,7 @@ func (m *awsAwsjson11_deserializeOpGetLendingAnalysis) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLendingAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDetectDocumentText(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)} @@ -1059,14 +1078,14 @@ func awsAwsjson11_deserializeOpErrorGetLendingAnalysis(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): - return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("BadDocumentException", errorCode): + return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) - case strings.EqualFold("InvalidJobIdException", errorCode): - return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) + case strings.EqualFold("DocumentTooLargeException", errorCode): + return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) - case strings.EqualFold("InvalidKMSKeyException", errorCode): - return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1080,6 +1099,9 @@ func awsAwsjson11_deserializeOpErrorGetLendingAnalysis(response *smithyhttp.Resp case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnsupportedDocumentException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1090,14 +1112,14 @@ func awsAwsjson11_deserializeOpErrorGetLendingAnalysis(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpGetLendingAnalysisSummary struct { +type awsAwsjson11_deserializeOpGetAdapter struct { } -func (*awsAwsjson11_deserializeOpGetLendingAnalysisSummary) ID() string { +func (*awsAwsjson11_deserializeOpGetAdapter) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLendingAnalysisSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetAdapter) 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) @@ -1111,9 +1133,9 @@ func (m *awsAwsjson11_deserializeOpGetLendingAnalysisSummary) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLendingAnalysisSummary(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetAdapter(response, &metadata) } - output := &GetLendingAnalysisSummaryOutput{} + output := &GetAdapterOutput{} out.Result = output var buff [1024]byte @@ -1133,7 +1155,7 @@ func (m *awsAwsjson11_deserializeOpGetLendingAnalysisSummary) HandleDeserialize( return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLendingAnalysisSummaryOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetAdapterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1147,7 +1169,7 @@ func (m *awsAwsjson11_deserializeOpGetLendingAnalysisSummary) HandleDeserialize( return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLendingAnalysisSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetAdapter(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)} @@ -1194,24 +1216,21 @@ func awsAwsjson11_deserializeOpErrorGetLendingAnalysisSummary(response *smithyht case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidJobIdException", errorCode): - return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) - - case strings.EqualFold("InvalidKMSKeyException", errorCode): - return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidS3ObjectException", errorCode): - return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1222,14 +1241,14 @@ func awsAwsjson11_deserializeOpErrorGetLendingAnalysisSummary(response *smithyht } } -type awsAwsjson11_deserializeOpStartDocumentAnalysis struct { +type awsAwsjson11_deserializeOpGetAdapterVersion struct { } -func (*awsAwsjson11_deserializeOpStartDocumentAnalysis) ID() string { +func (*awsAwsjson11_deserializeOpGetAdapterVersion) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartDocumentAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetAdapterVersion) 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) @@ -1243,9 +1262,9 @@ func (m *awsAwsjson11_deserializeOpStartDocumentAnalysis) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartDocumentAnalysis(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetAdapterVersion(response, &metadata) } - output := &StartDocumentAnalysisOutput{} + output := &GetAdapterVersionOutput{} out.Result = output var buff [1024]byte @@ -1265,7 +1284,7 @@ func (m *awsAwsjson11_deserializeOpStartDocumentAnalysis) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartDocumentAnalysisOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetAdapterVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1279,7 +1298,7 @@ func (m *awsAwsjson11_deserializeOpStartDocumentAnalysis) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartDocumentAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetAdapterVersion(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)} @@ -1323,38 +1342,23 @@ func awsAwsjson11_deserializeOpErrorStartDocumentAnalysis(response *smithyhttp.R case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadDocumentException", errorCode): - return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) - - case strings.EqualFold("DocumentTooLargeException", errorCode): - return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) - - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidKMSKeyException", errorCode): - return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidS3ObjectException", errorCode): - return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedDocumentException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1366,14 +1370,14 @@ func awsAwsjson11_deserializeOpErrorStartDocumentAnalysis(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpStartDocumentTextDetection struct { +type awsAwsjson11_deserializeOpGetDocumentAnalysis struct { } -func (*awsAwsjson11_deserializeOpStartDocumentTextDetection) ID() string { +func (*awsAwsjson11_deserializeOpGetDocumentAnalysis) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartDocumentTextDetection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDocumentAnalysis) 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) @@ -1387,9 +1391,9 @@ func (m *awsAwsjson11_deserializeOpStartDocumentTextDetection) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartDocumentTextDetection(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDocumentAnalysis(response, &metadata) } - output := &StartDocumentTextDetectionOutput{} + output := &GetDocumentAnalysisOutput{} out.Result = output var buff [1024]byte @@ -1409,7 +1413,7 @@ func (m *awsAwsjson11_deserializeOpStartDocumentTextDetection) HandleDeserialize return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartDocumentTextDetectionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDocumentAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1423,7 +1427,7 @@ func (m *awsAwsjson11_deserializeOpStartDocumentTextDetection) HandleDeserialize return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartDocumentTextDetection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDocumentAnalysis(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)} @@ -1467,18 +1471,12 @@ func awsAwsjson11_deserializeOpErrorStartDocumentTextDetection(response *smithyh case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadDocumentException", errorCode): - return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) - - case strings.EqualFold("DocumentTooLargeException", errorCode): - return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) - - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidJobIdException", errorCode): + return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) + case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) @@ -1488,18 +1486,12 @@ func awsAwsjson11_deserializeOpErrorStartDocumentTextDetection(response *smithyh case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedDocumentException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1510,14 +1502,14 @@ func awsAwsjson11_deserializeOpErrorStartDocumentTextDetection(response *smithyh } } -type awsAwsjson11_deserializeOpStartExpenseAnalysis struct { +type awsAwsjson11_deserializeOpGetDocumentTextDetection struct { } -func (*awsAwsjson11_deserializeOpStartExpenseAnalysis) ID() string { +func (*awsAwsjson11_deserializeOpGetDocumentTextDetection) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartExpenseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDocumentTextDetection) 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) @@ -1531,9 +1523,9 @@ func (m *awsAwsjson11_deserializeOpStartExpenseAnalysis) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartExpenseAnalysis(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDocumentTextDetection(response, &metadata) } - output := &StartExpenseAnalysisOutput{} + output := &GetDocumentTextDetectionOutput{} out.Result = output var buff [1024]byte @@ -1553,7 +1545,7 @@ func (m *awsAwsjson11_deserializeOpStartExpenseAnalysis) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartExpenseAnalysisOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDocumentTextDetectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1567,7 +1559,7 @@ func (m *awsAwsjson11_deserializeOpStartExpenseAnalysis) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartExpenseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDocumentTextDetection(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)} @@ -1611,18 +1603,12 @@ func awsAwsjson11_deserializeOpErrorStartExpenseAnalysis(response *smithyhttp.Re case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadDocumentException", errorCode): - return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) - - case strings.EqualFold("DocumentTooLargeException", errorCode): - return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) - - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidJobIdException", errorCode): + return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) + case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) @@ -1632,18 +1618,12 @@ func awsAwsjson11_deserializeOpErrorStartExpenseAnalysis(response *smithyhttp.Re case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedDocumentException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1654,14 +1634,14 @@ func awsAwsjson11_deserializeOpErrorStartExpenseAnalysis(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpStartLendingAnalysis struct { +type awsAwsjson11_deserializeOpGetExpenseAnalysis struct { } -func (*awsAwsjson11_deserializeOpStartLendingAnalysis) ID() string { +func (*awsAwsjson11_deserializeOpGetExpenseAnalysis) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartLendingAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetExpenseAnalysis) 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) @@ -1675,9 +1655,9 @@ func (m *awsAwsjson11_deserializeOpStartLendingAnalysis) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartLendingAnalysis(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetExpenseAnalysis(response, &metadata) } - output := &StartLendingAnalysisOutput{} + output := &GetExpenseAnalysisOutput{} out.Result = output var buff [1024]byte @@ -1697,7 +1677,7 @@ func (m *awsAwsjson11_deserializeOpStartLendingAnalysis) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartLendingAnalysisOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetExpenseAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1711,7 +1691,7 @@ func (m *awsAwsjson11_deserializeOpStartLendingAnalysis) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartLendingAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetExpenseAnalysis(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)} @@ -1755,18 +1735,12 @@ func awsAwsjson11_deserializeOpErrorStartLendingAnalysis(response *smithyhttp.Re case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadDocumentException", errorCode): - return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) - - case strings.EqualFold("DocumentTooLargeException", errorCode): - return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) - - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidJobIdException", errorCode): + return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) + case strings.EqualFold("InvalidKMSKeyException", errorCode): return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) @@ -1776,18 +1750,12 @@ func awsAwsjson11_deserializeOpErrorStartLendingAnalysis(response *smithyhttp.Re case strings.EqualFold("InvalidS3ObjectException", errorCode): return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedDocumentException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1798,12 +1766,37 @@ func awsAwsjson11_deserializeOpErrorStartLendingAnalysis(response *smithyhttp.Re } } -func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +type awsAwsjson11_deserializeOpGetLendingAnalysis struct { +} - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) +func (*awsAwsjson11_deserializeOpGetLendingAnalysis) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetLendingAnalysis) 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_deserializeOpErrorGetLendingAnalysis(response, &metadata) + } + output := &GetLendingAnalysisOutput{} + 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 { @@ -1813,12 +1806,10 @@ func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.AccessDeniedException{} - err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentGetLendingAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1826,22 +1817,35 @@ func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorBadDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorGetLendingAnalysis(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1851,28 +1855,79 @@ func awsAwsjson11_deserializeErrorBadDocumentException(response *smithyhttp.Resp return err } - output := &types.BadDocumentException{} - err := awsAwsjson11_deserializeDocumentBadDocumentException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - 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 { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidJobIdException", errorCode): + return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) + + case strings.EqualFold("InvalidKMSKeyException", errorCode): + return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidS3ObjectException", errorCode): + return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpGetLendingAnalysisSummary struct { } -func awsAwsjson11_deserializeErrorDocumentTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpGetLendingAnalysisSummary) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetLendingAnalysisSummary) 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_deserializeOpErrorGetLendingAnalysisSummary(response, &metadata) + } + output := &GetLendingAnalysisSummaryOutput{} + out.Result = output + 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() var shape interface{} @@ -1883,12 +1938,10 @@ func awsAwsjson11_deserializeErrorDocumentTooLargeException(response *smithyhttp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.DocumentTooLargeException{} - err := awsAwsjson11_deserializeDocumentDocumentTooLargeException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentGetLendingAnalysisSummaryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1896,22 +1949,35 @@ func awsAwsjson11_deserializeErrorDocumentTooLargeException(response *smithyhttp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorHumanLoopQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorGetLendingAnalysisSummary(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1921,28 +1987,79 @@ func awsAwsjson11_deserializeErrorHumanLoopQuotaExceededException(response *smit return err } - output := &types.HumanLoopQuotaExceededException{} - err := awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - 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 { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidJobIdException", errorCode): + return awsAwsjson11_deserializeErrorInvalidJobIdException(response, errorBody) + + case strings.EqualFold("InvalidKMSKeyException", errorCode): + return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidS3ObjectException", errorCode): + return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpListAdapters struct { } -func awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpListAdapters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListAdapters) 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_deserializeOpErrorListAdapters(response, &metadata) + } + output := &ListAdaptersOutput{} + out.Result = output + 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() var shape interface{} @@ -1953,12 +2070,10 @@ func awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.IdempotentParameterMismatchException{} - err := awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListAdaptersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1966,69 +2081,34 @@ func awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorInternalServerError(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 +func awsAwsjson11_deserializeOpErrorListAdapters(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()) - output := &types.InternalServerError{} - err := awsAwsjson11_deserializeDocumentInternalServerError(&output, shape) + errorCode := "UnknownError" + errorMessage := errorCode - 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 + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInvalidJobIdException(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.InvalidJobIdException{} - err := awsAwsjson11_deserializeDocumentInvalidJobIdException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2040,49 +2120,72 @@ func awsAwsjson11_deserializeErrorInvalidJobIdException(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - return output -} + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } -func awsAwsjson11_deserializeErrorInvalidKMSKeyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - 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(), + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - output := &types.InvalidKMSKeyException{} - err := awsAwsjson11_deserializeDocumentInvalidKMSKeyException(&output, shape) +type awsAwsjson11_deserializeOpListAdapterVersions struct { +} +func (*awsAwsjson11_deserializeOpListAdapterVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListAdapterVersions) 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 { - 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 + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output -} + 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_deserializeOpErrorListAdapterVersions(response, &metadata) + } + output := &ListAdapterVersionsOutput{} + out.Result = output -func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 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() var shape interface{} @@ -2093,12 +2196,10 @@ func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.InvalidParameterException{} - err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListAdapterVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2106,22 +2207,35 @@ func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorInvalidS3ObjectException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorListAdapterVersions(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -2131,28 +2245,76 @@ func awsAwsjson11_deserializeErrorInvalidS3ObjectException(response *smithyhttp. return err } - output := &types.InvalidS3ObjectException{} - err := awsAwsjson11_deserializeDocumentInvalidS3ObjectException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - 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 { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -2163,12 +2325,10 @@ func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Re Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.LimitExceededException{} - err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2176,22 +2336,35 @@ func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Re Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + 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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -2201,9 +2374,125 @@ func awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(respons return err } - output := &types.ProvisionedThroughputExceededException{} - err := awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartDocumentAnalysis struct { +} + +func (*awsAwsjson11_deserializeOpStartDocumentAnalysis) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartDocumentAnalysis) 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_deserializeOpErrorStartDocumentAnalysis(response, &metadata) + } + output := &StartDocumentAnalysisOutput{} + 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_deserializeOpDocumentStartDocumentAnalysisOutput(&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_deserializeOpErrorStartDocumentAnalysis(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) @@ -2215,14 +2504,90 @@ func awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(respons } errorBody.Seek(0, io.SeekStart) - return output + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadDocumentException", errorCode): + return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) + + case strings.EqualFold("DocumentTooLargeException", errorCode): + return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidKMSKeyException", errorCode): + return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidS3ObjectException", errorCode): + return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnsupportedDocumentException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +type awsAwsjson11_deserializeOpStartDocumentTextDetection struct { +} + +func (*awsAwsjson11_deserializeOpStartDocumentTextDetection) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartDocumentTextDetection) 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_deserializeOpErrorStartDocumentTextDetection(response, &metadata) + } + output := &StartDocumentTextDetectionOutput{} + out.Result = output + 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() var shape interface{} @@ -2233,12 +2598,10 @@ func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Respo Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.ThrottlingException{} - err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentStartDocumentTextDetectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2246,22 +2609,35 @@ func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Respo Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorUnsupportedDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorStartDocumentTextDetection(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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -2271,24 +2647,2552 @@ func awsAwsjson11_deserializeErrorUnsupportedDocumentException(response *smithyh return err } - output := &types.UnsupportedDocumentException{} - err := awsAwsjson11_deserializeDocumentUnsupportedDocumentException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadDocumentException", errorCode): + return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) + + case strings.EqualFold("DocumentTooLargeException", errorCode): + return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidKMSKeyException", errorCode): + return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidS3ObjectException", errorCode): + return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnsupportedDocumentException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartExpenseAnalysis struct { +} + +func (*awsAwsjson11_deserializeOpStartExpenseAnalysis) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartExpenseAnalysis) 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_deserializeOpErrorStartExpenseAnalysis(response, &metadata) + } + output := &StartExpenseAnalysisOutput{} + 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_deserializeOpDocumentStartExpenseAnalysisOutput(&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_deserializeOpErrorStartExpenseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadDocumentException", errorCode): + return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) + + case strings.EqualFold("DocumentTooLargeException", errorCode): + return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidKMSKeyException", errorCode): + return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidS3ObjectException", errorCode): + return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnsupportedDocumentException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartLendingAnalysis struct { +} + +func (*awsAwsjson11_deserializeOpStartLendingAnalysis) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartLendingAnalysis) 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_deserializeOpErrorStartLendingAnalysis(response, &metadata) + } + output := &StartLendingAnalysisOutput{} + 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_deserializeOpDocumentStartLendingAnalysisOutput(&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_deserializeOpErrorStartLendingAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadDocumentException", errorCode): + return awsAwsjson11_deserializeErrorBadDocumentException(response, errorBody) + + case strings.EqualFold("DocumentTooLargeException", errorCode): + return awsAwsjson11_deserializeErrorDocumentTooLargeException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidKMSKeyException", errorCode): + return awsAwsjson11_deserializeErrorInvalidKMSKeyException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidS3ObjectException", errorCode): + return awsAwsjson11_deserializeErrorInvalidS3ObjectException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnsupportedDocumentException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedDocumentException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTagResource struct { +} + +func (*awsAwsjson11_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + 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_deserializeOpDocumentTagResourceOutput(&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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + 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_deserializeOpDocumentUntagResourceOutput(&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_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateAdapter struct { +} + +func (*awsAwsjson11_deserializeOpUpdateAdapter) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateAdapter) 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_deserializeOpErrorUpdateAdapter(response, &metadata) + } + output := &UpdateAdapterOutput{} + 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_deserializeOpDocumentUpdateAdapterOutput(&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_deserializeOpErrorUpdateAdapter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ProvisionedThroughputExceededException", errorCode): + return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorAccessDeniedException(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.AccessDeniedException{} + err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorBadDocumentException(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.BadDocumentException{} + err := awsAwsjson11_deserializeDocumentBadDocumentException(&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_deserializeErrorConflictException(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.ConflictException{} + err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorDocumentTooLargeException(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.DocumentTooLargeException{} + err := awsAwsjson11_deserializeDocumentDocumentTooLargeException(&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_deserializeErrorHumanLoopQuotaExceededException(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.HumanLoopQuotaExceededException{} + err := awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(&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_deserializeErrorIdempotentParameterMismatchException(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.IdempotentParameterMismatchException{} + err := awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(&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_deserializeErrorInternalServerError(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.InternalServerError{} + err := awsAwsjson11_deserializeDocumentInternalServerError(&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_deserializeErrorInvalidJobIdException(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.InvalidJobIdException{} + err := awsAwsjson11_deserializeDocumentInvalidJobIdException(&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_deserializeErrorInvalidKMSKeyException(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.InvalidKMSKeyException{} + err := awsAwsjson11_deserializeDocumentInvalidKMSKeyException(&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_deserializeErrorInvalidParameterException(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.InvalidParameterException{} + err := awsAwsjson11_deserializeDocumentInvalidParameterException(&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_deserializeErrorInvalidS3ObjectException(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.InvalidS3ObjectException{} + err := awsAwsjson11_deserializeDocumentInvalidS3ObjectException(&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_deserializeErrorLimitExceededException(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.LimitExceededException{} + err := awsAwsjson11_deserializeDocumentLimitExceededException(&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_deserializeErrorProvisionedThroughputExceededException(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.ProvisionedThroughputExceededException{} + err := awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(&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_deserializeErrorResourceNotFoundException(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.ResourceNotFoundException{} + err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorServiceQuotaExceededException(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.ServiceQuotaExceededException{} + err := awsAwsjson11_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorThrottlingException(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.ThrottlingException{} + err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUnsupportedDocumentException(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.UnsupportedDocumentException{} + err := awsAwsjson11_deserializeDocumentUnsupportedDocumentException(&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_deserializeErrorValidationException(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.ValidationException{} + err := awsAwsjson11_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAdapterList(v *[]types.AdapterOverview, 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.AdapterOverview + if *v == nil { + cv = []types.AdapterOverview{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AdapterOverview + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAdapterOverview(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAdapterOverview(v **types.AdapterOverview, 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.AdapterOverview + if *v == nil { + sv = &types.AdapterOverview{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdapterId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterId to be of type string, got %T instead", value) + } + sv.AdapterId = ptr.String(jtv) + } + + case "AdapterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterName to be of type string, got %T instead", value) + } + sv.AdapterName = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "FeatureTypes": + if err := awsAwsjson11_deserializeDocumentFeatureTypes(&sv.FeatureTypes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAdapterVersionDatasetConfig(v **types.AdapterVersionDatasetConfig, 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.AdapterVersionDatasetConfig + if *v == nil { + sv = &types.AdapterVersionDatasetConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ManifestS3Object": + if err := awsAwsjson11_deserializeDocumentS3Object(&sv.ManifestS3Object, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAdapterVersionEvaluationMetric(v **types.AdapterVersionEvaluationMetric, 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.AdapterVersionEvaluationMetric + if *v == nil { + sv = &types.AdapterVersionEvaluationMetric{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdapterVersion": + if err := awsAwsjson11_deserializeDocumentEvaluationMetric(&sv.AdapterVersion, value); err != nil { + return err + } + + case "Baseline": + if err := awsAwsjson11_deserializeDocumentEvaluationMetric(&sv.Baseline, value); err != nil { + return err + } + + case "FeatureType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeatureType to be of type string, got %T instead", value) + } + sv.FeatureType = types.FeatureType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAdapterVersionEvaluationMetrics(v *[]types.AdapterVersionEvaluationMetric, 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.AdapterVersionEvaluationMetric + if *v == nil { + cv = []types.AdapterVersionEvaluationMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AdapterVersionEvaluationMetric + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAdapterVersionEvaluationMetric(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAdapterVersionList(v *[]types.AdapterVersionOverview, 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.AdapterVersionOverview + if *v == nil { + cv = []types.AdapterVersionOverview{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AdapterVersionOverview + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAdapterVersionOverview(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAdapterVersionOverview(v **types.AdapterVersionOverview, 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.AdapterVersionOverview + if *v == nil { + sv = &types.AdapterVersionOverview{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdapterId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterId to be of type string, got %T instead", value) + } + sv.AdapterId = ptr.String(jtv) + } + + case "AdapterVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterVersion to be of type string, got %T instead", value) + } + sv.AdapterVersion = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "FeatureTypes": + if err := awsAwsjson11_deserializeDocumentFeatureTypes(&sv.FeatureTypes, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterVersionStatus to be of type string, got %T instead", value) + } + sv.Status = types.AdapterVersionStatus(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterVersionStatusMessage to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAnalyzeIDDetections(v **types.AnalyzeIDDetections, 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.AnalyzeIDDetections + if *v == nil { + sv = &types.AnalyzeIDDetections{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } + } + + case "NormalizedValue": + if err := awsAwsjson11_deserializeDocumentNormalizedValue(&sv.NormalizedValue, value); err != nil { + return err + } + + case "Text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBadDocumentException(v **types.BadDocumentException, 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.BadDocumentException + if *v == nil { + sv = &types.BadDocumentException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBlock(v **types.Block, 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.Block + if *v == nil { + sv = &types.Block{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BlockType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BlockType to be of type string, got %T instead", value) + } + sv.BlockType = types.BlockType(jtv) + } + + case "ColumnIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ColumnIndex = ptr.Int32(int32(i64)) + } + + case "ColumnSpan": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ColumnSpan = ptr.Int32(int32(i64)) + } + + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } + } + + case "EntityTypes": + if err := awsAwsjson11_deserializeDocumentEntityTypes(&sv.EntityTypes, value); err != nil { + return err + } + + case "Geometry": + if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + + case "Query": + if err := awsAwsjson11_deserializeDocumentQuery(&sv.Query, value); err != nil { + return err + } + + case "Relationships": + if err := awsAwsjson11_deserializeDocumentRelationshipList(&sv.Relationships, value); err != nil { + return err + } + + case "RowIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RowIndex = ptr.Int32(int32(i64)) + } + + case "RowSpan": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RowSpan = ptr.Int32(int32(i64)) + } + + case "SelectionStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SelectionStatus to be of type string, got %T instead", value) + } + sv.SelectionStatus = types.SelectionStatus(jtv) + } + + case "Text": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Text = ptr.String(jtv) + } + + case "TextType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextType to be of type string, got %T instead", value) + } + sv.TextType = types.TextType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentBlockList(v *[]types.Block, 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.Block + if *v == nil { + cv = []types.Block{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Block + destAddr := &col + if err := awsAwsjson11_deserializeDocumentBlock(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, 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.BoundingBox + if *v == nil { + sv = &types.BoundingBox{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Height": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Height = 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.Height = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Left": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Left = 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.Left = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Top": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Top = 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.Top = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + case "Width": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Width = 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.Width = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDetectedSignature(v **types.DetectedSignature, 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.DetectedSignature + if *v == nil { + sv = &types.DetectedSignature{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDetectedSignatureList(v *[]types.DetectedSignature, 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.DetectedSignature + if *v == nil { + cv = []types.DetectedSignature{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DetectedSignature + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDetectedSignature(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDocumentGroup(v **types.DocumentGroup, 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.DocumentGroup + if *v == nil { + sv = &types.DocumentGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DetectedSignatures": + if err := awsAwsjson11_deserializeDocumentDetectedSignatureList(&sv.DetectedSignatures, value); err != nil { + return err + } + + case "SplitDocuments": + if err := awsAwsjson11_deserializeDocumentSplitDocumentList(&sv.SplitDocuments, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "UndetectedSignatures": + if err := awsAwsjson11_deserializeDocumentUndetectedSignatureList(&sv.UndetectedSignatures, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDocumentGroupList(v *[]types.DocumentGroup, 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.DocumentGroup + if *v == nil { + cv = []types.DocumentGroup{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DocumentGroup + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDocumentGroup(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDocumentMetadata(v **types.DocumentMetadata, 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.DocumentMetadata + if *v == nil { + sv = &types.DocumentMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Pages": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Pages = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, 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 } - - errorBody.Seek(0, io.SeekStart) - return output + *v = sv + return nil } -func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { +func awsAwsjson11_deserializeDocumentDocumentTooLargeException(v **types.DocumentTooLargeException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2301,9 +5205,9 @@ func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDenie return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccessDeniedException + var sv *types.DocumentTooLargeException if *v == nil { - sv = &types.AccessDeniedException{} + sv = &types.DocumentTooLargeException{} } else { sv = *v } @@ -2337,7 +5241,43 @@ func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } -func awsAwsjson11_deserializeDocumentAnalyzeIDDetections(v **types.AnalyzeIDDetections, value interface{}) error { +func awsAwsjson11_deserializeDocumentEntityTypes(v *[]types.EntityType, 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.EntityType + if *v == nil { + cv = []types.EntityType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EntityType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) + } + col = types.EntityType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentEvaluationMetric(v **types.EvaluationMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2350,16 +5290,16 @@ func awsAwsjson11_deserializeDocumentAnalyzeIDDetections(v **types.AnalyzeIDDete return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AnalyzeIDDetections + var sv *types.EvaluationMetric if *v == nil { - sv = &types.AnalyzeIDDetections{} + sv = &types.EvaluationMetric{} } else { sv = *v } for key, value := range shape { switch key { - case "Confidence": + case "F1Score": if value != nil { switch jtv := value.(type) { case json.Number: @@ -2367,7 +5307,7 @@ func awsAwsjson11_deserializeDocumentAnalyzeIDDetections(v **types.AnalyzeIDDete if err != nil { return err } - sv.Confidence = ptr.Float32(float32(f64)) + sv.F1Score = float32(f64) case string: var f64 float64 @@ -2385,26 +5325,154 @@ func awsAwsjson11_deserializeDocumentAnalyzeIDDetections(v **types.AnalyzeIDDete return fmt.Errorf("unknown JSON number value: %s", jtv) } - sv.Confidence = ptr.Float32(float32(f64)) + sv.F1Score = float32(f64) default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) } } - case "NormalizedValue": - if err := awsAwsjson11_deserializeDocumentNormalizedValue(&sv.NormalizedValue, value); err != nil { - return err + case "Precision": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Precision = 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.Precision = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } } - case "Text": + case "Recall": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Recall = 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.Recall = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentExpenseCurrency(v **types.ExpenseCurrency, 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.ExpenseCurrency + if *v == nil { + sv = &types.ExpenseCurrency{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.Code = ptr.String(jtv) + } + + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } } default: @@ -2416,7 +5484,7 @@ func awsAwsjson11_deserializeDocumentAnalyzeIDDetections(v **types.AnalyzeIDDete return nil } -func awsAwsjson11_deserializeDocumentBadDocumentException(v **types.BadDocumentException, value interface{}) error { +func awsAwsjson11_deserializeDocumentExpenseDetection(v **types.ExpenseDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2429,31 +5497,61 @@ func awsAwsjson11_deserializeDocumentBadDocumentException(v **types.BadDocumentE return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BadDocumentException + var sv *types.ExpenseDetection if *v == nil { - sv = &types.BadDocumentException{} + sv = &types.ExpenseDetection{} } else { sv = *v } - for key, value := range shape { - switch key { - case "Code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + } - sv.Code = ptr.String(jtv) } - case "Message": + case "Geometry": + if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { + return err + } + + case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Text = ptr.String(jtv) } default: @@ -2465,7 +5563,7 @@ func awsAwsjson11_deserializeDocumentBadDocumentException(v **types.BadDocumentE return nil } -func awsAwsjson11_deserializeDocumentBlock(v **types.Block, value interface{}) error { +func awsAwsjson11_deserializeDocumentExpenseDocument(v **types.ExpenseDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2478,25 +5576,21 @@ func awsAwsjson11_deserializeDocumentBlock(v **types.Block, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Block + var sv *types.ExpenseDocument if *v == nil { - sv = &types.Block{} + sv = &types.ExpenseDocument{} } else { sv = *v } for key, value := range shape { switch key { - case "BlockType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BlockType to be of type string, got %T instead", value) - } - sv.BlockType = types.BlockType(jtv) + case "Blocks": + if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { + return err } - case "ColumnIndex": + case "ExpenseIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { @@ -2506,76 +5600,100 @@ func awsAwsjson11_deserializeDocumentBlock(v **types.Block, value interface{}) e if err != nil { return err } - sv.ColumnIndex = ptr.Int32(int32(i64)) + sv.ExpenseIndex = ptr.Int32(int32(i64)) } - case "ColumnSpan": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ColumnSpan = ptr.Int32(int32(i64)) + case "LineItemGroups": + if err := awsAwsjson11_deserializeDocumentLineItemGroupList(&sv.LineItemGroups, value); err != nil { + return err } - case "Confidence": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Confidence = ptr.Float32(float32(f64)) + case "SummaryFields": + if err := awsAwsjson11_deserializeDocumentExpenseFieldList(&sv.SummaryFields, value); err != nil { + return err + } - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() + default: + _, _ = key, value - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) + } + } + *v = sv + return nil +} - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) +func awsAwsjson11_deserializeDocumentExpenseDocumentList(v *[]types.ExpenseDocument, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - } - sv.Confidence = ptr.Float32(float32(f64)) + var cv []types.ExpenseDocument + if *v == nil { + cv = []types.ExpenseDocument{} + } else { + cv = *v + } - default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + for _, value := range shape { + var col types.ExpenseDocument + destAddr := &col + if err := awsAwsjson11_deserializeDocumentExpenseDocument(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) - } - } + } + *v = cv + return nil +} - case "EntityTypes": - if err := awsAwsjson11_deserializeDocumentEntityTypes(&sv.EntityTypes, value); err != nil { +func awsAwsjson11_deserializeDocumentExpenseField(v **types.ExpenseField, 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.ExpenseField + if *v == nil { + sv = &types.ExpenseField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Currency": + if err := awsAwsjson11_deserializeDocumentExpenseCurrency(&sv.Currency, value); err != nil { return err } - case "Geometry": - if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { + case "GroupProperties": + if err := awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(&sv.GroupProperties, value); err != nil { return err } - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) + case "LabelDetection": + if err := awsAwsjson11_deserializeDocumentExpenseDetection(&sv.LabelDetection, value); err != nil { + return err } - case "Page": + case "PageNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { @@ -2585,70 +5703,96 @@ func awsAwsjson11_deserializeDocumentBlock(v **types.Block, value interface{}) e if err != nil { return err } - sv.Page = ptr.Int32(int32(i64)) + sv.PageNumber = ptr.Int32(int32(i64)) } - case "Query": - if err := awsAwsjson11_deserializeDocumentQuery(&sv.Query, value); err != nil { + case "Type": + if err := awsAwsjson11_deserializeDocumentExpenseType(&sv.Type, value); err != nil { return err } - case "Relationships": - if err := awsAwsjson11_deserializeDocumentRelationshipList(&sv.Relationships, value); err != nil { + case "ValueDetection": + if err := awsAwsjson11_deserializeDocumentExpenseDetection(&sv.ValueDetection, value); err != nil { return err } - case "RowIndex": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.RowIndex = ptr.Int32(int32(i64)) - } + default: + _, _ = key, value - case "RowSpan": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.RowSpan = ptr.Int32(int32(i64)) - } + } + } + *v = sv + return nil +} - case "SelectionStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SelectionStatus to be of type string, got %T instead", value) - } - sv.SelectionStatus = types.SelectionStatus(jtv) - } +func awsAwsjson11_deserializeDocumentExpenseFieldList(v *[]types.ExpenseField, 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.ExpenseField + if *v == nil { + cv = []types.ExpenseField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ExpenseField + destAddr := &col + if err := awsAwsjson11_deserializeDocumentExpenseField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentExpenseGroupProperty(v **types.ExpenseGroupProperty, 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 "Text": + var sv *types.ExpenseGroupProperty + if *v == nil { + sv = &types.ExpenseGroupProperty{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.Id = ptr.String(jtv) } - case "TextType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TextType to be of type string, got %T instead", value) - } - sv.TextType = types.TextType(jtv) + case "Types": + if err := awsAwsjson11_deserializeDocumentStringList(&sv.Types, value); err != nil { + return err } default: @@ -2660,7 +5804,7 @@ func awsAwsjson11_deserializeDocumentBlock(v **types.Block, value interface{}) e return nil } -func awsAwsjson11_deserializeDocumentBlockList(v *[]types.Block, value interface{}) error { +func awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(v *[]types.ExpenseGroupProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2673,17 +5817,17 @@ func awsAwsjson11_deserializeDocumentBlockList(v *[]types.Block, value interface return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Block + var cv []types.ExpenseGroupProperty if *v == nil { - cv = []types.Block{} + cv = []types.ExpenseGroupProperty{} } else { cv = *v } for _, value := range shape { - var col types.Block + var col types.ExpenseGroupProperty destAddr := &col - if err := awsAwsjson11_deserializeDocumentBlock(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentExpenseGroupProperty(&destAddr, value); err != nil { return err } col = *destAddr @@ -2694,7 +5838,7 @@ func awsAwsjson11_deserializeDocumentBlockList(v *[]types.Block, value interface return nil } -func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, value interface{}) error { +func awsAwsjson11_deserializeDocumentExpenseType(v **types.ExpenseType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2707,84 +5851,16 @@ func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BoundingBox + var sv *types.ExpenseType if *v == nil { - sv = &types.BoundingBox{} + sv = &types.ExpenseType{} } else { sv = *v } for key, value := range shape { switch key { - case "Height": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Height = 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.Height = float32(f64) - - default: - return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) - - } - } - - case "Left": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Left = 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.Left = float32(f64) - - default: - return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) - - } - } - - case "Top": + case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: @@ -2792,7 +5868,7 @@ func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, value in if err != nil { return err } - sv.Top = float32(f64) + sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 @@ -2810,46 +5886,21 @@ func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, value in return fmt.Errorf("unknown JSON number value: %s", jtv) } - sv.Top = float32(f64) + sv.Confidence = ptr.Float32(float32(f64)) default: - return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } - case "Width": + case "Text": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Width = 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.Width = float32(f64) - - default: - return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } + sv.Text = ptr.String(jtv) } default: @@ -2861,7 +5912,7 @@ func awsAwsjson11_deserializeDocumentBoundingBox(v **types.BoundingBox, value in return nil } -func awsAwsjson11_deserializeDocumentDetectedSignature(v **types.DetectedSignature, value interface{}) error { +func awsAwsjson11_deserializeDocumentExtraction(v **types.Extraction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2874,26 +5925,28 @@ func awsAwsjson11_deserializeDocumentDetectedSignature(v **types.DetectedSignatu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DetectedSignature + var sv *types.Extraction if *v == nil { - sv = &types.DetectedSignature{} + sv = &types.Extraction{} } else { sv = *v } for key, value := range shape { switch key { - case "Page": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Page = ptr.Int32(int32(i64)) + case "ExpenseDocument": + if err := awsAwsjson11_deserializeDocumentExpenseDocument(&sv.ExpenseDocument, value); err != nil { + return err + } + + case "IdentityDocument": + if err := awsAwsjson11_deserializeDocumentIdentityDocument(&sv.IdentityDocument, value); err != nil { + return err + } + + case "LendingDocument": + if err := awsAwsjson11_deserializeDocumentLendingDocument(&sv.LendingDocument, value); err != nil { + return err } default: @@ -2905,7 +5958,7 @@ func awsAwsjson11_deserializeDocumentDetectedSignature(v **types.DetectedSignatu return nil } -func awsAwsjson11_deserializeDocumentDetectedSignatureList(v *[]types.DetectedSignature, value interface{}) error { +func awsAwsjson11_deserializeDocumentExtractionList(v *[]types.Extraction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2918,17 +5971,17 @@ func awsAwsjson11_deserializeDocumentDetectedSignatureList(v *[]types.DetectedSi return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.DetectedSignature + var cv []types.Extraction if *v == nil { - cv = []types.DetectedSignature{} + cv = []types.Extraction{} } else { cv = *v } for _, value := range shape { - var col types.DetectedSignature + var col types.Extraction destAddr := &col - if err := awsAwsjson11_deserializeDocumentDetectedSignature(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentExtraction(&destAddr, value); err != nil { return err } col = *destAddr @@ -2939,62 +5992,7 @@ func awsAwsjson11_deserializeDocumentDetectedSignatureList(v *[]types.DetectedSi return nil } -func awsAwsjson11_deserializeDocumentDocumentGroup(v **types.DocumentGroup, 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.DocumentGroup - if *v == nil { - sv = &types.DocumentGroup{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DetectedSignatures": - if err := awsAwsjson11_deserializeDocumentDetectedSignatureList(&sv.DetectedSignatures, value); err != nil { - return err - } - - case "SplitDocuments": - if err := awsAwsjson11_deserializeDocumentSplitDocumentList(&sv.SplitDocuments, value); err != nil { - return err - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - case "UndetectedSignatures": - if err := awsAwsjson11_deserializeDocumentUndetectedSignatureList(&sv.UndetectedSignatures, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDocumentGroupList(v *[]types.DocumentGroup, value interface{}) error { +func awsAwsjson11_deserializeDocumentFeatureTypes(v *[]types.FeatureType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3007,20 +6005,22 @@ func awsAwsjson11_deserializeDocumentDocumentGroupList(v *[]types.DocumentGroup, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.DocumentGroup + var cv []types.FeatureType if *v == nil { - cv = []types.DocumentGroup{} + cv = []types.FeatureType{} } else { cv = *v } for _, value := range shape { - var col types.DocumentGroup - destAddr := &col - if err := awsAwsjson11_deserializeDocumentDocumentGroup(&destAddr, value); err != nil { - return err + var col types.FeatureType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FeatureType to be of type string, got %T instead", value) + } + col = types.FeatureType(jtv) } - col = *destAddr cv = append(cv, col) } @@ -3028,7 +6028,7 @@ func awsAwsjson11_deserializeDocumentDocumentGroupList(v *[]types.DocumentGroup, return nil } -func awsAwsjson11_deserializeDocumentDocumentMetadata(v **types.DocumentMetadata, value interface{}) error { +func awsAwsjson11_deserializeDocumentGeometry(v **types.Geometry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3041,26 +6041,23 @@ func awsAwsjson11_deserializeDocumentDocumentMetadata(v **types.DocumentMetadata return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DocumentMetadata + var sv *types.Geometry if *v == nil { - sv = &types.DocumentMetadata{} + sv = &types.Geometry{} } else { sv = *v } for key, value := range shape { switch key { - case "Pages": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Pages = ptr.Int32(int32(i64)) + case "BoundingBox": + if err := awsAwsjson11_deserializeDocumentBoundingBox(&sv.BoundingBox, value); err != nil { + return err + } + + case "Polygon": + if err := awsAwsjson11_deserializeDocumentPolygon(&sv.Polygon, value); err != nil { + return err } default: @@ -3072,7 +6069,7 @@ func awsAwsjson11_deserializeDocumentDocumentMetadata(v **types.DocumentMetadata return nil } -func awsAwsjson11_deserializeDocumentDocumentTooLargeException(v **types.DocumentTooLargeException, value interface{}) error { +func awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(v **types.HumanLoopActivationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3085,31 +6082,36 @@ func awsAwsjson11_deserializeDocumentDocumentTooLargeException(v **types.Documen return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DocumentTooLargeException + var sv *types.HumanLoopActivationOutput if *v == nil { - sv = &types.DocumentTooLargeException{} + sv = &types.HumanLoopActivationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "HumanLoopActivationConditionsEvaluationResults": 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 SynthesizedJsonHumanLoopActivationConditionsEvaluationResults to be of type string, got %T instead", value) } - sv.Code = ptr.String(jtv) + sv.HumanLoopActivationConditionsEvaluationResults = ptr.String(jtv) } - case "Message": + case "HumanLoopActivationReasons": + if err := awsAwsjson11_deserializeDocumentHumanLoopActivationReasons(&sv.HumanLoopActivationReasons, value); err != nil { + return err + } + + case "HumanLoopArn": 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 HumanLoopArn to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.HumanLoopArn = ptr.String(jtv) } default: @@ -3121,7 +6123,7 @@ func awsAwsjson11_deserializeDocumentDocumentTooLargeException(v **types.Documen return nil } -func awsAwsjson11_deserializeDocumentEntityTypes(v *[]types.EntityType, value interface{}) error { +func awsAwsjson11_deserializeDocumentHumanLoopActivationReasons(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3134,21 +6136,21 @@ func awsAwsjson11_deserializeDocumentEntityTypes(v *[]types.EntityType, value in return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.EntityType + var cv []string if *v == nil { - cv = []types.EntityType{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.EntityType + var col string if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) + return fmt.Errorf("expected HumanLoopActivationReason to be of type string, got %T instead", value) } - col = types.EntityType(jtv) + col = jtv } cv = append(cv, col) @@ -3157,7 +6159,7 @@ func awsAwsjson11_deserializeDocumentEntityTypes(v *[]types.EntityType, value in return nil } -func awsAwsjson11_deserializeDocumentExpenseCurrency(v **types.ExpenseCurrency, value interface{}) error { +func awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(v **types.HumanLoopQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3170,9 +6172,9 @@ func awsAwsjson11_deserializeDocumentExpenseCurrency(v **types.ExpenseCurrency, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ExpenseCurrency + var sv *types.HumanLoopQuotaExceededException if *v == nil { - sv = &types.ExpenseCurrency{} + sv = &types.HumanLoopQuotaExceededException{} } else { sv = *v } @@ -3188,117 +6190,40 @@ func awsAwsjson11_deserializeDocumentExpenseCurrency(v **types.ExpenseCurrency, sv.Code = ptr.String(jtv) } - case "Confidence": + case "Message": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } + sv.Message = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentExpenseDetection(v **types.ExpenseDetection, 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.ExpenseDetection - if *v == nil { - sv = &types.ExpenseDetection{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Confidence": + case "QuotaCode": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } + sv.QuotaCode = ptr.String(jtv) } - case "Geometry": - if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { - return err + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) } - case "Text": + case "ServiceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.ServiceCode = ptr.String(jtv) } default: @@ -3310,7 +6235,7 @@ func awsAwsjson11_deserializeDocumentExpenseDetection(v **types.ExpenseDetection return nil } -func awsAwsjson11_deserializeDocumentExpenseDocument(v **types.ExpenseDocument, value interface{}) error { +func awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3323,87 +6248,43 @@ func awsAwsjson11_deserializeDocumentExpenseDocument(v **types.ExpenseDocument, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ExpenseDocument + var sv *types.IdempotentParameterMismatchException if *v == nil { - sv = &types.ExpenseDocument{} + sv = &types.IdempotentParameterMismatchException{} } else { sv = *v } for key, value := range shape { switch key { - case "Blocks": - if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { - return err - } - - case "ExpenseIndex": + case "Code": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ExpenseIndex = ptr.Int32(int32(i64)) - } - - case "LineItemGroups": - if err := awsAwsjson11_deserializeDocumentLineItemGroupList(&sv.LineItemGroups, value); err != nil { - return err + sv.Code = ptr.String(jtv) } - case "SummaryFields": - if err := awsAwsjson11_deserializeDocumentExpenseFieldList(&sv.SummaryFields, value); err != nil { - return err + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: _, _ = key, value - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentExpenseDocumentList(v *[]types.ExpenseDocument, 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.ExpenseDocument - if *v == nil { - cv = []types.ExpenseDocument{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ExpenseDocument - destAddr := &col - if err := awsAwsjson11_deserializeDocumentExpenseDocument(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentExpenseField(v **types.ExpenseField, value interface{}) error { +func awsAwsjson11_deserializeDocumentIdentityDocument(v **types.IdentityDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3416,31 +6297,21 @@ func awsAwsjson11_deserializeDocumentExpenseField(v **types.ExpenseField, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ExpenseField + var sv *types.IdentityDocument if *v == nil { - sv = &types.ExpenseField{} + sv = &types.IdentityDocument{} } else { sv = *v } for key, value := range shape { switch key { - case "Currency": - if err := awsAwsjson11_deserializeDocumentExpenseCurrency(&sv.Currency, value); err != nil { - return err - } - - case "GroupProperties": - if err := awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(&sv.GroupProperties, value); err != nil { - return err - } - - case "LabelDetection": - if err := awsAwsjson11_deserializeDocumentExpenseDetection(&sv.LabelDetection, value); err != nil { + case "Blocks": + if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } - case "PageNumber": + case "DocumentIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { @@ -3450,16 +6321,11 @@ func awsAwsjson11_deserializeDocumentExpenseField(v **types.ExpenseField, value if err != nil { return err } - sv.PageNumber = ptr.Int32(int32(i64)) - } - - case "Type": - if err := awsAwsjson11_deserializeDocumentExpenseType(&sv.Type, value); err != nil { - return err + sv.DocumentIndex = ptr.Int32(int32(i64)) } - case "ValueDetection": - if err := awsAwsjson11_deserializeDocumentExpenseDetection(&sv.ValueDetection, value); err != nil { + case "IdentityDocumentFields": + if err := awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(&sv.IdentityDocumentFields, value); err != nil { return err } @@ -3472,41 +6338,7 @@ func awsAwsjson11_deserializeDocumentExpenseField(v **types.ExpenseField, value return nil } -func awsAwsjson11_deserializeDocumentExpenseFieldList(v *[]types.ExpenseField, 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.ExpenseField - if *v == nil { - cv = []types.ExpenseField{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ExpenseField - destAddr := &col - if err := awsAwsjson11_deserializeDocumentExpenseField(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentExpenseGroupProperty(v **types.ExpenseGroupProperty, value interface{}) error { +func awsAwsjson11_deserializeDocumentIdentityDocumentField(v **types.IdentityDocumentField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3519,26 +6351,22 @@ func awsAwsjson11_deserializeDocumentExpenseGroupProperty(v **types.ExpenseGroup return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ExpenseGroupProperty + var sv *types.IdentityDocumentField if *v == nil { - sv = &types.ExpenseGroupProperty{} + sv = &types.IdentityDocumentField{} } else { sv = *v } for key, value := range shape { switch key { - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) + case "Type": + if err := awsAwsjson11_deserializeDocumentAnalyzeIDDetections(&sv.Type, value); err != nil { + return err } - case "Types": - if err := awsAwsjson11_deserializeDocumentStringList(&sv.Types, value); err != nil { + case "ValueDetection": + if err := awsAwsjson11_deserializeDocumentAnalyzeIDDetections(&sv.ValueDetection, value); err != nil { return err } @@ -3551,7 +6379,7 @@ func awsAwsjson11_deserializeDocumentExpenseGroupProperty(v **types.ExpenseGroup return nil } -func awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(v *[]types.ExpenseGroupProperty, value interface{}) error { +func awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(v *[]types.IdentityDocumentField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3564,17 +6392,17 @@ func awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(v *[]types.Expense return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ExpenseGroupProperty + var cv []types.IdentityDocumentField if *v == nil { - cv = []types.ExpenseGroupProperty{} + cv = []types.IdentityDocumentField{} } else { cv = *v } for _, value := range shape { - var col types.ExpenseGroupProperty + var col types.IdentityDocumentField destAddr := &col - if err := awsAwsjson11_deserializeDocumentExpenseGroupProperty(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentIdentityDocumentField(&destAddr, value); err != nil { return err } col = *destAddr @@ -3585,7 +6413,7 @@ func awsAwsjson11_deserializeDocumentExpenseGroupPropertyList(v *[]types.Expense return nil } -func awsAwsjson11_deserializeDocumentExpenseType(v **types.ExpenseType, value interface{}) error { +func awsAwsjson11_deserializeDocumentIdentityDocumentList(v *[]types.IdentityDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3593,119 +6421,33 @@ func awsAwsjson11_deserializeDocumentExpenseType(v **types.ExpenseType, value in 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.ExpenseType + var cv []types.IdentityDocument if *v == nil { - sv = &types.ExpenseType{} + cv = []types.IdentityDocument{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Confidence": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) - - } - } - - case "Text": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Text = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.IdentityDocument + destAddr := &col + if err := awsAwsjson11_deserializeDocumentIdentityDocument(&destAddr, value); err != nil { + return err } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentExtraction(v **types.Extraction, 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.Extraction - if *v == nil { - sv = &types.Extraction{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ExpenseDocument": - if err := awsAwsjson11_deserializeDocumentExpenseDocument(&sv.ExpenseDocument, value); err != nil { - return err - } - - case "IdentityDocument": - if err := awsAwsjson11_deserializeDocumentIdentityDocument(&sv.IdentityDocument, value); err != nil { - return err - } - - case "LendingDocument": - if err := awsAwsjson11_deserializeDocumentLendingDocument(&sv.LendingDocument, value); err != nil { - return err - } - - default: - _, _ = key, value + col = *destAddr + cv = append(cv, col) - } } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentExtractionList(v *[]types.Extraction, value interface{}) error { +func awsAwsjson11_deserializeDocumentIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3718,20 +6460,22 @@ func awsAwsjson11_deserializeDocumentExtractionList(v *[]types.Extraction, value return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Extraction + var cv []string if *v == nil { - cv = []types.Extraction{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.Extraction - destAddr := &col - if err := awsAwsjson11_deserializeDocumentExtraction(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -3739,7 +6483,7 @@ func awsAwsjson11_deserializeDocumentExtractionList(v *[]types.Extraction, value return nil } -func awsAwsjson11_deserializeDocumentGeometry(v **types.Geometry, value interface{}) error { +func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3752,23 +6496,31 @@ func awsAwsjson11_deserializeDocumentGeometry(v **types.Geometry, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Geometry + var sv *types.InternalServerError if *v == nil { - sv = &types.Geometry{} + sv = &types.InternalServerError{} } else { sv = *v } for key, value := range shape { switch key { - case "BoundingBox": - if err := awsAwsjson11_deserializeDocumentBoundingBox(&sv.BoundingBox, value); err != nil { - return err + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) } - case "Polygon": - if err := awsAwsjson11_deserializeDocumentPolygon(&sv.Polygon, value); err != nil { - return err + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: @@ -3780,7 +6532,7 @@ func awsAwsjson11_deserializeDocumentGeometry(v **types.Geometry, value interfac return nil } -func awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(v **types.HumanLoopActivationOutput, value interface{}) error { +func awsAwsjson11_deserializeDocumentInvalidJobIdException(v **types.InvalidJobIdException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3793,36 +6545,31 @@ func awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(v **types.HumanLo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.HumanLoopActivationOutput + var sv *types.InvalidJobIdException if *v == nil { - sv = &types.HumanLoopActivationOutput{} + sv = &types.InvalidJobIdException{} } else { sv = *v } for key, value := range shape { switch key { - case "HumanLoopActivationConditionsEvaluationResults": + case "Code": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SynthesizedJsonHumanLoopActivationConditionsEvaluationResults to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.HumanLoopActivationConditionsEvaluationResults = ptr.String(jtv) - } - - case "HumanLoopActivationReasons": - if err := awsAwsjson11_deserializeDocumentHumanLoopActivationReasons(&sv.HumanLoopActivationReasons, value); err != nil { - return err + sv.Code = ptr.String(jtv) } - case "HumanLoopArn": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected HumanLoopArn to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.HumanLoopArn = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -3834,7 +6581,7 @@ func awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(v **types.HumanLo return nil } -func awsAwsjson11_deserializeDocumentHumanLoopActivationReasons(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentInvalidKMSKeyException(v **types.InvalidKMSKeyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3842,35 +6589,48 @@ func awsAwsjson11_deserializeDocumentHumanLoopActivationReasons(v *[]string, val return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.InvalidKMSKeyException if *v == nil { - cv = []string{} + sv = &types.InvalidKMSKeyException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HumanLoopActivationReason to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(v **types.HumanLoopQuotaExceededException, value interface{}) error { +func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3883,9 +6643,9 @@ func awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(v **types.H return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.HumanLoopQuotaExceededException + var sv *types.InvalidParameterException if *v == nil { - sv = &types.HumanLoopQuotaExceededException{} + sv = &types.InvalidParameterException{} } else { sv = *v } @@ -3910,31 +6670,53 @@ func awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(v **types.H sv.Message = ptr.String(jtv) } - case "QuotaCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.QuotaCode = ptr.String(jtv) - } + default: + _, _ = key, value - case "ResourceType": + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInvalidS3ObjectException(v **types.InvalidS3ObjectException, 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.InvalidS3ObjectException + if *v == nil { + sv = &types.InvalidS3ObjectException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ResourceType = ptr.String(jtv) + sv.Code = ptr.String(jtv) } - case "ServiceCode": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ServiceCode = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -3946,7 +6728,7 @@ func awsAwsjson11_deserializeDocumentHumanLoopQuotaExceededException(v **types.H return nil } -func awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { +func awsAwsjson11_deserializeDocumentLendingDetection(v **types.LendingDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3959,31 +6741,70 @@ func awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(v **ty return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IdempotentParameterMismatchException + var sv *types.LendingDetection if *v == nil { - sv = &types.IdempotentParameterMismatchException{} + sv = &types.LendingDetection{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } + } + + case "Geometry": + if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { + return err + } + + case "SelectionStatus": 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 SelectionStatus to be of type string, got %T instead", value) } - sv.Code = ptr.String(jtv) + sv.SelectionStatus = types.SelectionStatus(jtv) } - case "Message": + case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Text = ptr.String(jtv) } default: @@ -3995,7 +6816,41 @@ func awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(v **ty return nil } -func awsAwsjson11_deserializeDocumentIdentityDocument(v **types.IdentityDocument, value interface{}) error { +func awsAwsjson11_deserializeDocumentLendingDetectionList(v *[]types.LendingDetection, 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.LendingDetection + if *v == nil { + cv = []types.LendingDetection{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LendingDetection + destAddr := &col + if err := awsAwsjson11_deserializeDocumentLendingDetection(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentLendingDocument(v **types.LendingDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4008,35 +6863,22 @@ func awsAwsjson11_deserializeDocumentIdentityDocument(v **types.IdentityDocument return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IdentityDocument + var sv *types.LendingDocument if *v == nil { - sv = &types.IdentityDocument{} + sv = &types.LendingDocument{} } else { sv = *v } for key, value := range shape { switch key { - case "Blocks": - if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { + case "LendingFields": + if err := awsAwsjson11_deserializeDocumentLendingFieldList(&sv.LendingFields, value); err != nil { return err } - case "DocumentIndex": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.DocumentIndex = ptr.Int32(int32(i64)) - } - - case "IdentityDocumentFields": - if err := awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(&sv.IdentityDocumentFields, value); err != nil { + case "SignatureDetections": + if err := awsAwsjson11_deserializeDocumentSignatureDetectionList(&sv.SignatureDetections, value); err != nil { return err } @@ -4049,7 +6891,7 @@ func awsAwsjson11_deserializeDocumentIdentityDocument(v **types.IdentityDocument return nil } -func awsAwsjson11_deserializeDocumentIdentityDocumentField(v **types.IdentityDocumentField, value interface{}) error { +func awsAwsjson11_deserializeDocumentLendingField(v **types.LendingField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4062,22 +6904,31 @@ func awsAwsjson11_deserializeDocumentIdentityDocumentField(v **types.IdentityDoc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.IdentityDocumentField + var sv *types.LendingField if *v == nil { - sv = &types.IdentityDocumentField{} + sv = &types.LendingField{} } else { sv = *v } for key, value := range shape { switch key { - case "Type": - if err := awsAwsjson11_deserializeDocumentAnalyzeIDDetections(&sv.Type, value); err != nil { + case "KeyDetection": + if err := awsAwsjson11_deserializeDocumentLendingDetection(&sv.KeyDetection, value); err != nil { return err } - case "ValueDetection": - if err := awsAwsjson11_deserializeDocumentAnalyzeIDDetections(&sv.ValueDetection, value); err != nil { + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "ValueDetections": + if err := awsAwsjson11_deserializeDocumentLendingDetectionList(&sv.ValueDetections, value); err != nil { return err } @@ -4090,7 +6941,7 @@ func awsAwsjson11_deserializeDocumentIdentityDocumentField(v **types.IdentityDoc return nil } -func awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(v *[]types.IdentityDocumentField, value interface{}) error { +func awsAwsjson11_deserializeDocumentLendingFieldList(v *[]types.LendingField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4103,17 +6954,17 @@ func awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(v *[]types.Identi return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.IdentityDocumentField + var cv []types.LendingField if *v == nil { - cv = []types.IdentityDocumentField{} + cv = []types.LendingField{} } else { cv = *v } for _, value := range shape { - var col types.IdentityDocumentField + var col types.LendingField destAddr := &col - if err := awsAwsjson11_deserializeDocumentIdentityDocumentField(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentLendingField(&destAddr, value); err != nil { return err } col = *destAddr @@ -4124,7 +6975,61 @@ func awsAwsjson11_deserializeDocumentIdentityDocumentFieldList(v *[]types.Identi return nil } -func awsAwsjson11_deserializeDocumentIdentityDocumentList(v *[]types.IdentityDocument, value interface{}) error { +func awsAwsjson11_deserializeDocumentLendingResult(v **types.LendingResult, 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.LendingResult + if *v == nil { + sv = &types.LendingResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Extractions": + if err := awsAwsjson11_deserializeDocumentExtractionList(&sv.Extractions, value); err != nil { + return err + } + + case "Page": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) + } + + case "PageClassification": + if err := awsAwsjson11_deserializeDocumentPageClassification(&sv.PageClassification, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLendingResultList(v *[]types.LendingResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4137,17 +7042,17 @@ func awsAwsjson11_deserializeDocumentIdentityDocumentList(v *[]types.IdentityDoc return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.IdentityDocument + var cv []types.LendingResult if *v == nil { - cv = []types.IdentityDocument{} + cv = []types.LendingResult{} } else { cv = *v } for _, value := range shape { - var col types.IdentityDocument + var col types.LendingResult destAddr := &col - if err := awsAwsjson11_deserializeDocumentIdentityDocument(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentLendingResult(&destAddr, value); err != nil { return err } col = *destAddr @@ -4158,7 +7063,7 @@ func awsAwsjson11_deserializeDocumentIdentityDocumentList(v *[]types.IdentityDoc return nil } -func awsAwsjson11_deserializeDocumentIdList(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentLendingSummary(v **types.LendingSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4166,35 +7071,40 @@ func awsAwsjson11_deserializeDocumentIdList(v *[]string, value interface{}) erro return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.LendingSummary if *v == nil { - cv = []string{} + sv = &types.LendingSummary{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "DocumentGroups": + if err := awsAwsjson11_deserializeDocumentDocumentGroupList(&sv.DocumentGroups, value); err != nil { + return err + } + + case "UndetectedDocumentTypes": + if err := awsAwsjson11_deserializeDocumentUndetectedDocumentTypeList(&sv.UndetectedDocumentTypes, value); err != nil { + return err } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error { +func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4207,9 +7117,9 @@ func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InternalServerError + var sv *types.LimitExceededException if *v == nil { - sv = &types.InternalServerError{} + sv = &types.LimitExceededException{} } else { sv = *v } @@ -4243,7 +7153,7 @@ func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServe return nil } -func awsAwsjson11_deserializeDocumentInvalidJobIdException(v **types.InvalidJobIdException, value interface{}) error { +func awsAwsjson11_deserializeDocumentLineItemFields(v **types.LineItemFields, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4256,31 +7166,18 @@ func awsAwsjson11_deserializeDocumentInvalidJobIdException(v **types.InvalidJobI return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidJobIdException + var sv *types.LineItemFields if *v == nil { - sv = &types.InvalidJobIdException{} + sv = &types.LineItemFields{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "LineItemExpenseFields": + if err := awsAwsjson11_deserializeDocumentExpenseFieldList(&sv.LineItemExpenseFields, value); err != nil { + return err } default: @@ -4292,7 +7189,7 @@ func awsAwsjson11_deserializeDocumentInvalidJobIdException(v **types.InvalidJobI return nil } -func awsAwsjson11_deserializeDocumentInvalidKMSKeyException(v **types.InvalidKMSKeyException, value interface{}) error { +func awsAwsjson11_deserializeDocumentLineItemGroup(v **types.LineItemGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4305,31 +7202,31 @@ func awsAwsjson11_deserializeDocumentInvalidKMSKeyException(v **types.InvalidKMS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidKMSKeyException + var sv *types.LineItemGroup if *v == nil { - sv = &types.InvalidKMSKeyException{} + sv = &types.LineItemGroup{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "LineItemGroupIndex": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } - sv.Code = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LineItemGroupIndex = ptr.Int32(int32(i64)) } - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "LineItems": + if err := awsAwsjson11_deserializeDocumentLineItemList(&sv.LineItems, value); err != nil { + return err } default: @@ -4341,7 +7238,75 @@ func awsAwsjson11_deserializeDocumentInvalidKMSKeyException(v **types.InvalidKMS return nil } -func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { +func awsAwsjson11_deserializeDocumentLineItemGroupList(v *[]types.LineItemGroup, 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.LineItemGroup + if *v == nil { + cv = []types.LineItemGroup{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LineItemGroup + destAddr := &col + if err := awsAwsjson11_deserializeDocumentLineItemGroup(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentLineItemList(v *[]types.LineItemFields, 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.LineItemFields + if *v == nil { + cv = []types.LineItemFields{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LineItemFields + destAddr := &col + if err := awsAwsjson11_deserializeDocumentLineItemFields(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentNormalizedValue(v **types.NormalizedValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4354,31 +7319,31 @@ func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.Invalid return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidParameterException + var sv *types.NormalizedValue if *v == nil { - sv = &types.InvalidParameterException{} + sv = &types.NormalizedValue{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Code = ptr.String(jtv) + sv.Value = ptr.String(jtv) } - case "Message": + case "ValueType": 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 ValueType to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.ValueType = types.ValueType(jtv) } default: @@ -4390,7 +7355,7 @@ func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.Invalid return nil } -func awsAwsjson11_deserializeDocumentInvalidS3ObjectException(v **types.InvalidS3ObjectException, value interface{}) error { +func awsAwsjson11_deserializeDocumentOutputConfig(v **types.OutputConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4403,31 +7368,31 @@ func awsAwsjson11_deserializeDocumentInvalidS3ObjectException(v **types.InvalidS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidS3ObjectException + var sv *types.OutputConfig if *v == nil { - sv = &types.InvalidS3ObjectException{} + sv = &types.OutputConfig{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "S3Bucket": 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 S3Bucket to be of type string, got %T instead", value) } - sv.Code = ptr.String(jtv) + sv.S3Bucket = ptr.String(jtv) } - case "Message": + case "S3Prefix": 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 S3ObjectName to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.S3Prefix = ptr.String(jtv) } default: @@ -4439,7 +7404,7 @@ func awsAwsjson11_deserializeDocumentInvalidS3ObjectException(v **types.InvalidS return nil } -func awsAwsjson11_deserializeDocumentLendingDetection(v **types.LendingDetection, value interface{}) error { +func awsAwsjson11_deserializeDocumentPageClassification(v **types.PageClassification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4452,70 +7417,23 @@ func awsAwsjson11_deserializeDocumentLendingDetection(v **types.LendingDetection return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LendingDetection + var sv *types.PageClassification if *v == nil { - sv = &types.LendingDetection{} + sv = &types.PageClassification{} } else { sv = *v } for key, value := range shape { switch key { - case "Confidence": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) - - } - } - - case "Geometry": - if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { + case "PageNumber": + if err := awsAwsjson11_deserializeDocumentPredictionList(&sv.PageNumber, value); err != nil { return err } - case "SelectionStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SelectionStatus to be of type string, got %T instead", value) - } - sv.SelectionStatus = types.SelectionStatus(jtv) - } - - case "Text": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Text = ptr.String(jtv) + case "PageType": + if err := awsAwsjson11_deserializeDocumentPredictionList(&sv.PageType, value); err != nil { + return err } default: @@ -4527,7 +7445,7 @@ func awsAwsjson11_deserializeDocumentLendingDetection(v **types.LendingDetection return nil } -func awsAwsjson11_deserializeDocumentLendingDetectionList(v *[]types.LendingDetection, value interface{}) error { +func awsAwsjson11_deserializeDocumentPageList(v *[]int32, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4540,20 +7458,26 @@ func awsAwsjson11_deserializeDocumentLendingDetectionList(v *[]types.LendingDete return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LendingDetection + var cv []int32 if *v == nil { - cv = []types.LendingDetection{} + cv = []int32{} } else { cv = *v } for _, value := range shape { - var col types.LendingDetection - destAddr := &col - if err := awsAwsjson11_deserializeDocumentLendingDetection(&destAddr, value); err != nil { - return err + var col int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + col = int32(i64) } - col = *destAddr cv = append(cv, col) } @@ -4561,7 +7485,7 @@ func awsAwsjson11_deserializeDocumentLendingDetectionList(v *[]types.LendingDete return nil } -func awsAwsjson11_deserializeDocumentLendingDocument(v **types.LendingDocument, value interface{}) error { +func awsAwsjson11_deserializeDocumentPages(v *[]int32, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4569,40 +7493,39 @@ func awsAwsjson11_deserializeDocumentLendingDocument(v **types.LendingDocument, 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.LendingDocument + var cv []int32 if *v == nil { - sv = &types.LendingDocument{} + cv = []int32{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "LendingFields": - if err := awsAwsjson11_deserializeDocumentLendingFieldList(&sv.LendingFields, value); err != nil { - return err + for _, value := range shape { + var col int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } - - case "SignatureDetections": - if err := awsAwsjson11_deserializeDocumentSignatureDetectionList(&sv.SignatureDetections, value); err != nil { + i64, err := jtv.Int64() + if err != nil { return err } - - default: - _, _ = key, value - + col = int32(i64) } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentLendingField(v **types.LendingField, value interface{}) error { +func awsAwsjson11_deserializeDocumentPoint(v **types.Point, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4615,32 +7538,81 @@ func awsAwsjson11_deserializeDocumentLendingField(v **types.LendingField, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LendingField + var sv *types.Point if *v == nil { - sv = &types.LendingField{} + sv = &types.Point{} } else { sv = *v } for key, value := range shape { switch key { - case "KeyDetection": - if err := awsAwsjson11_deserializeDocumentLendingDetection(&sv.KeyDetection, value); err != nil { - return err - } - - case "Type": + case "X": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.X = 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.X = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + } - sv.Type = ptr.String(jtv) } - case "ValueDetections": - if err := awsAwsjson11_deserializeDocumentLendingDetectionList(&sv.ValueDetections, value); err != nil { - return err + case "Y": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Y = 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.Y = float32(f64) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } } default: @@ -4652,7 +7624,7 @@ func awsAwsjson11_deserializeDocumentLendingField(v **types.LendingField, value return nil } -func awsAwsjson11_deserializeDocumentLendingFieldList(v *[]types.LendingField, value interface{}) error { +func awsAwsjson11_deserializeDocumentPolygon(v *[]types.Point, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4665,17 +7637,17 @@ func awsAwsjson11_deserializeDocumentLendingFieldList(v *[]types.LendingField, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LendingField + var cv []types.Point if *v == nil { - cv = []types.LendingField{} + cv = []types.Point{} } else { cv = *v } for _, value := range shape { - var col types.LendingField + var col types.Point destAddr := &col - if err := awsAwsjson11_deserializeDocumentLendingField(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentPoint(&destAddr, value); err != nil { return err } col = *destAddr @@ -4686,7 +7658,7 @@ func awsAwsjson11_deserializeDocumentLendingFieldList(v *[]types.LendingField, v return nil } -func awsAwsjson11_deserializeDocumentLendingResult(v **types.LendingResult, value interface{}) error { +func awsAwsjson11_deserializeDocumentPrediction(v **types.Prediction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4699,36 +7671,56 @@ func awsAwsjson11_deserializeDocumentLendingResult(v **types.LendingResult, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LendingResult + var sv *types.Prediction if *v == nil { - sv = &types.LendingResult{} + sv = &types.Prediction{} } else { sv = *v } for key, value := range shape { switch key { - case "Extractions": - if err := awsAwsjson11_deserializeDocumentExtractionList(&sv.Extractions, value); err != nil { - return err + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } } - case "Page": + case "Value": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Page = ptr.Int32(int32(i64)) - } - - case "PageClassification": - if err := awsAwsjson11_deserializeDocumentPageClassification(&sv.PageClassification, value); err != nil { - return err + sv.Value = ptr.String(jtv) } default: @@ -4740,7 +7732,7 @@ func awsAwsjson11_deserializeDocumentLendingResult(v **types.LendingResult, valu return nil } -func awsAwsjson11_deserializeDocumentLendingResultList(v *[]types.LendingResult, value interface{}) error { +func awsAwsjson11_deserializeDocumentPredictionList(v *[]types.Prediction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4753,17 +7745,17 @@ func awsAwsjson11_deserializeDocumentLendingResultList(v *[]types.LendingResult, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LendingResult + var cv []types.Prediction if *v == nil { - cv = []types.LendingResult{} + cv = []types.Prediction{} } else { cv = *v } for _, value := range shape { - var col types.LendingResult + var col types.Prediction destAddr := &col - if err := awsAwsjson11_deserializeDocumentLendingResult(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentPrediction(&destAddr, value); err != nil { return err } col = *destAddr @@ -4774,7 +7766,7 @@ func awsAwsjson11_deserializeDocumentLendingResultList(v *[]types.LendingResult, return nil } -func awsAwsjson11_deserializeDocumentLendingSummary(v **types.LendingSummary, value interface{}) error { +func awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(v **types.ProvisionedThroughputExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4787,23 +7779,31 @@ func awsAwsjson11_deserializeDocumentLendingSummary(v **types.LendingSummary, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LendingSummary + var sv *types.ProvisionedThroughputExceededException if *v == nil { - sv = &types.LendingSummary{} + sv = &types.ProvisionedThroughputExceededException{} } else { sv = *v } for key, value := range shape { switch key { - case "DocumentGroups": - if err := awsAwsjson11_deserializeDocumentDocumentGroupList(&sv.DocumentGroups, value); err != nil { - return err + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) } - case "UndetectedDocumentTypes": - if err := awsAwsjson11_deserializeDocumentUndetectedDocumentTypeList(&sv.UndetectedDocumentTypes, value); err != nil { - return err + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: @@ -4815,7 +7815,7 @@ func awsAwsjson11_deserializeDocumentLendingSummary(v **types.LendingSummary, va return nil } -func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { +func awsAwsjson11_deserializeDocumentQuery(v **types.Query, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4828,31 +7828,36 @@ func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExcee return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LimitExceededException + var sv *types.Query if *v == nil { - sv = &types.LimitExceededException{} + sv = &types.Query{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "Alias": 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 QueryInput to be of type string, got %T instead", value) } - sv.Code = ptr.String(jtv) + sv.Alias = ptr.String(jtv) } - case "Message": + case "Pages": + if err := awsAwsjson11_deserializeDocumentQueryPages(&sv.Pages, value); err != nil { + return err + } + + case "Text": 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 QueryInput to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Text = ptr.String(jtv) } default: @@ -4864,7 +7869,7 @@ func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExcee return nil } -func awsAwsjson11_deserializeDocumentLineItemFields(v **types.LineItemFields, value interface{}) error { +func awsAwsjson11_deserializeDocumentQueryPages(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4872,35 +7877,35 @@ func awsAwsjson11_deserializeDocumentLineItemFields(v **types.LineItemFields, va 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.LineItemFields + var cv []string if *v == nil { - sv = &types.LineItemFields{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "LineItemExpenseFields": - if err := awsAwsjson11_deserializeDocumentExpenseFieldList(&sv.LineItemExpenseFields, value); err != nil { - return err + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryPage to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentLineItemGroup(v **types.LineItemGroup, value interface{}) error { +func awsAwsjson11_deserializeDocumentRelationship(v **types.Relationship, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4913,31 +7918,27 @@ func awsAwsjson11_deserializeDocumentLineItemGroup(v **types.LineItemGroup, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LineItemGroup + var sv *types.Relationship if *v == nil { - sv = &types.LineItemGroup{} + sv = &types.Relationship{} } else { sv = *v } for key, value := range shape { switch key { - case "LineItemGroupIndex": + case "Ids": + if err := awsAwsjson11_deserializeDocumentIdList(&sv.Ids, value); err != nil { + return err + } + + case "Type": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected RelationshipType to be of type string, got %T instead", value) } - sv.LineItemGroupIndex = ptr.Int32(int32(i64)) - } - - case "LineItems": - if err := awsAwsjson11_deserializeDocumentLineItemList(&sv.LineItems, value); err != nil { - return err + sv.Type = types.RelationshipType(jtv) } default: @@ -4949,41 +7950,7 @@ func awsAwsjson11_deserializeDocumentLineItemGroup(v **types.LineItemGroup, valu return nil } -func awsAwsjson11_deserializeDocumentLineItemGroupList(v *[]types.LineItemGroup, 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.LineItemGroup - if *v == nil { - cv = []types.LineItemGroup{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.LineItemGroup - destAddr := &col - if err := awsAwsjson11_deserializeDocumentLineItemGroup(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentLineItemList(v *[]types.LineItemFields, value interface{}) error { +func awsAwsjson11_deserializeDocumentRelationshipList(v *[]types.Relationship, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4996,17 +7963,17 @@ func awsAwsjson11_deserializeDocumentLineItemList(v *[]types.LineItemFields, val return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.LineItemFields + var cv []types.Relationship if *v == nil { - cv = []types.LineItemFields{} + cv = []types.Relationship{} } else { cv = *v } for _, value := range shape { - var col types.LineItemFields + var col types.Relationship destAddr := &col - if err := awsAwsjson11_deserializeDocumentLineItemFields(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentRelationship(&destAddr, value); err != nil { return err } col = *destAddr @@ -5017,7 +7984,7 @@ func awsAwsjson11_deserializeDocumentLineItemList(v *[]types.LineItemFields, val return nil } -func awsAwsjson11_deserializeDocumentNormalizedValue(v **types.NormalizedValue, value interface{}) error { +func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5030,31 +7997,31 @@ func awsAwsjson11_deserializeDocumentNormalizedValue(v **types.NormalizedValue, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.NormalizedValue + var sv *types.ResourceNotFoundException if *v == nil { - sv = &types.NormalizedValue{} + sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { - case "Value": + case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Value = ptr.String(jtv) + sv.Code = ptr.String(jtv) } - case "ValueType": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ValueType to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ValueType = types.ValueType(jtv) + sv.Message = ptr.String(jtv) } default: @@ -5066,7 +8033,7 @@ func awsAwsjson11_deserializeDocumentNormalizedValue(v **types.NormalizedValue, return nil } -func awsAwsjson11_deserializeDocumentPageClassification(v **types.PageClassification, value interface{}) error { +func awsAwsjson11_deserializeDocumentS3Object(v **types.S3Object, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5079,23 +8046,40 @@ func awsAwsjson11_deserializeDocumentPageClassification(v **types.PageClassifica return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PageClassification + var sv *types.S3Object if *v == nil { - sv = &types.PageClassification{} + sv = &types.S3Object{} } else { sv = *v } for key, value := range shape { switch key { - case "PageNumber": - if err := awsAwsjson11_deserializeDocumentPredictionList(&sv.PageNumber, value); err != nil { - return err + case "Bucket": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) + } + sv.Bucket = ptr.String(jtv) } - case "PageType": - if err := awsAwsjson11_deserializeDocumentPredictionList(&sv.PageType, value); err != nil { - return err + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3ObjectName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3ObjectVersion to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) } default: @@ -5107,47 +8091,7 @@ func awsAwsjson11_deserializeDocumentPageClassification(v **types.PageClassifica return nil } -func awsAwsjson11_deserializeDocumentPageList(v *[]int32, 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 []int32 - if *v == nil { - cv = []int32{} - } else { - cv = *v - } - - for _, value := range shape { - var col int32 - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - col = int32(i64) - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentPages(v *[]int32, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5155,39 +8099,48 @@ func awsAwsjson11_deserializeDocumentPages(v *[]int32, value interface{}) error return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []int32 + var sv *types.ServiceQuotaExceededException if *v == nil { - cv = []int32{} + sv = &types.ServiceQuotaExceededException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col int32 - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) } - i64, err := jtv.Int64() - if err != nil { - return err + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } - col = int32(i64) - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentPoint(v **types.Point, value interface{}) error { +func awsAwsjson11_deserializeDocumentSignatureDetection(v **types.SignatureDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5200,16 +8153,16 @@ func awsAwsjson11_deserializeDocumentPoint(v **types.Point, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Point + var sv *types.SignatureDetection if *v == nil { - sv = &types.Point{} + sv = &types.SignatureDetection{} } else { sv = *v } for key, value := range shape { switch key { - case "X": + case "Confidence": if value != nil { switch jtv := value.(type) { case json.Number: @@ -5217,7 +8170,7 @@ func awsAwsjson11_deserializeDocumentPoint(v **types.Point, value interface{}) e if err != nil { return err } - sv.X = float32(f64) + sv.Confidence = ptr.Float32(float32(f64)) case string: var f64 float64 @@ -5235,46 +8188,17 @@ func awsAwsjson11_deserializeDocumentPoint(v **types.Point, value interface{}) e return fmt.Errorf("unknown JSON number value: %s", jtv) } - sv.X = float32(f64) + sv.Confidence = ptr.Float32(float32(f64)) default: - return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) } } - case "Y": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Y = 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.Y = float32(f64) - - default: - return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) - - } + case "Geometry": + if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { + return err } default: @@ -5286,7 +8210,7 @@ func awsAwsjson11_deserializeDocumentPoint(v **types.Point, value interface{}) e return nil } -func awsAwsjson11_deserializeDocumentPolygon(v *[]types.Point, value interface{}) error { +func awsAwsjson11_deserializeDocumentSignatureDetectionList(v *[]types.SignatureDetection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5299,17 +8223,17 @@ func awsAwsjson11_deserializeDocumentPolygon(v *[]types.Point, value interface{} return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Point + var cv []types.SignatureDetection if *v == nil { - cv = []types.Point{} + cv = []types.SignatureDetection{} } else { cv = *v } for _, value := range shape { - var col types.Point + var col types.SignatureDetection destAddr := &col - if err := awsAwsjson11_deserializeDocumentPoint(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentSignatureDetection(&destAddr, value); err != nil { return err } col = *destAddr @@ -5320,7 +8244,7 @@ func awsAwsjson11_deserializeDocumentPolygon(v *[]types.Point, value interface{} return nil } -func awsAwsjson11_deserializeDocumentPrediction(v **types.Prediction, value interface{}) error { +func awsAwsjson11_deserializeDocumentSplitDocument(v **types.SplitDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5333,56 +8257,31 @@ func awsAwsjson11_deserializeDocumentPrediction(v **types.Prediction, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Prediction + var sv *types.SplitDocument if *v == nil { - sv = &types.Prediction{} + sv = &types.SplitDocument{} } else { sv = *v } for key, value := range shape { switch key { - case "Confidence": + case "Index": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) - + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err } + sv.Index = ptr.Int32(int32(i64)) } - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) + case "Pages": + if err := awsAwsjson11_deserializeDocumentPageList(&sv.Pages, value); err != nil { + return err } default: @@ -5394,7 +8293,7 @@ func awsAwsjson11_deserializeDocumentPrediction(v **types.Prediction, value inte return nil } -func awsAwsjson11_deserializeDocumentPredictionList(v *[]types.Prediction, value interface{}) error { +func awsAwsjson11_deserializeDocumentSplitDocumentList(v *[]types.SplitDocument, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5407,17 +8306,17 @@ func awsAwsjson11_deserializeDocumentPredictionList(v *[]types.Prediction, value return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Prediction + var cv []types.SplitDocument if *v == nil { - cv = []types.Prediction{} + cv = []types.SplitDocument{} } else { cv = *v } for _, value := range shape { - var col types.Prediction + var col types.SplitDocument destAddr := &col - if err := awsAwsjson11_deserializeDocumentPrediction(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentSplitDocument(&destAddr, value); err != nil { return err } col = *destAddr @@ -5428,7 +8327,7 @@ func awsAwsjson11_deserializeDocumentPredictionList(v *[]types.Prediction, value return nil } -func awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(v **types.ProvisionedThroughputExceededException, value interface{}) error { +func awsAwsjson11_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5436,48 +8335,71 @@ func awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(v ** 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.ProvisionedThroughputExceededException + var cv []string if *v == nil { - sv = &types.ProvisionedThroughputExceededException{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } + col = jtv + } + cv = append(cv, col) - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } + } + *v = cv + return nil +} - default: - _, _ = key, value +func awsAwsjson11_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv } + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsAwsjson11_deserializeDocumentQuery(v **types.Query, value interface{}) error { +func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5490,36 +8412,31 @@ func awsAwsjson11_deserializeDocumentQuery(v **types.Query, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Query + var sv *types.ThrottlingException if *v == nil { - sv = &types.Query{} + sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { - case "Alias": + case "Code": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryInput to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Alias = ptr.String(jtv) - } - - case "Pages": - if err := awsAwsjson11_deserializeDocumentQueryPages(&sv.Pages, value); err != nil { - return err + sv.Code = ptr.String(jtv) } - case "Text": + case "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryInput to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Text = ptr.String(jtv) + sv.Message = ptr.String(jtv) } default: @@ -5531,7 +8448,7 @@ func awsAwsjson11_deserializeDocumentQuery(v **types.Query, value interface{}) e return nil } -func awsAwsjson11_deserializeDocumentQueryPages(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentUndetectedDocumentTypeList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5556,7 +8473,7 @@ func awsAwsjson11_deserializeDocumentQueryPages(v *[]string, value interface{}) if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryPage to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } col = jtv } @@ -5567,7 +8484,7 @@ func awsAwsjson11_deserializeDocumentQueryPages(v *[]string, value interface{}) return nil } -func awsAwsjson11_deserializeDocumentRelationship(v **types.Relationship, value interface{}) error { +func awsAwsjson11_deserializeDocumentUndetectedSignature(v **types.UndetectedSignature, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5580,27 +8497,26 @@ func awsAwsjson11_deserializeDocumentRelationship(v **types.Relationship, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Relationship + var sv *types.UndetectedSignature if *v == nil { - sv = &types.Relationship{} + sv = &types.UndetectedSignature{} } else { sv = *v } for key, value := range shape { switch key { - case "Ids": - if err := awsAwsjson11_deserializeDocumentIdList(&sv.Ids, value); err != nil { - return err - } - - case "Type": + case "Page": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected RelationshipType to be of type string, got %T instead", value) + return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) } - sv.Type = types.RelationshipType(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Page = ptr.Int32(int32(i64)) } default: @@ -5612,7 +8528,7 @@ func awsAwsjson11_deserializeDocumentRelationship(v **types.Relationship, value return nil } -func awsAwsjson11_deserializeDocumentRelationshipList(v *[]types.Relationship, value interface{}) error { +func awsAwsjson11_deserializeDocumentUndetectedSignatureList(v *[]types.UndetectedSignature, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5625,17 +8541,17 @@ func awsAwsjson11_deserializeDocumentRelationshipList(v *[]types.Relationship, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Relationship + var cv []types.UndetectedSignature if *v == nil { - cv = []types.Relationship{} + cv = []types.UndetectedSignature{} } else { cv = *v } for _, value := range shape { - var col types.Relationship + var col types.UndetectedSignature destAddr := &col - if err := awsAwsjson11_deserializeDocumentRelationship(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentUndetectedSignature(&destAddr, value); err != nil { return err } col = *destAddr @@ -5646,7 +8562,7 @@ func awsAwsjson11_deserializeDocumentRelationshipList(v *[]types.Relationship, v return nil } -func awsAwsjson11_deserializeDocumentSignatureDetection(v **types.SignatureDetection, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnsupportedDocumentException(v **types.UnsupportedDocumentException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5659,52 +8575,31 @@ func awsAwsjson11_deserializeDocumentSignatureDetection(v **types.SignatureDetec return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SignatureDetection + var sv *types.UnsupportedDocumentException if *v == nil { - sv = &types.SignatureDetection{} + sv = &types.UnsupportedDocumentException{} } else { sv = *v } for key, value := range shape { switch key { - case "Confidence": + case "Code": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Confidence = 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.Confidence = ptr.Float32(float32(f64)) - - default: - return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } + sv.Code = ptr.String(jtv) } - case "Geometry": - if err := awsAwsjson11_deserializeDocumentGeometry(&sv.Geometry, value); err != nil { - return err + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: @@ -5716,7 +8611,7 @@ func awsAwsjson11_deserializeDocumentSignatureDetection(v **types.SignatureDetec return nil } -func awsAwsjson11_deserializeDocumentSignatureDetectionList(v *[]types.SignatureDetection, value interface{}) error { +func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5724,33 +8619,48 @@ func awsAwsjson11_deserializeDocumentSignatureDetectionList(v *[]types.Signature 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.SignatureDetection + var sv *types.ValidationException if *v == nil { - cv = []types.SignatureDetection{} + sv = &types.ValidationException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.SignatureDetection - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSignatureDetection(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentSplitDocument(v **types.SplitDocument, value interface{}) error { +func awsAwsjson11_deserializeDocumentWarning(v **types.Warning, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5763,30 +8673,26 @@ func awsAwsjson11_deserializeDocumentSplitDocument(v **types.SplitDocument, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SplitDocument + var sv *types.Warning if *v == nil { - sv = &types.SplitDocument{} + sv = &types.Warning{} } else { sv = *v } for key, value := range shape { switch key { - case "Index": + case "ErrorCode": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } - sv.Index = ptr.Int32(int32(i64)) + sv.ErrorCode = ptr.String(jtv) } case "Pages": - if err := awsAwsjson11_deserializeDocumentPageList(&sv.Pages, value); err != nil { + if err := awsAwsjson11_deserializeDocumentPages(&sv.Pages, value); err != nil { return err } @@ -5799,7 +8705,7 @@ func awsAwsjson11_deserializeDocumentSplitDocument(v **types.SplitDocument, valu return nil } -func awsAwsjson11_deserializeDocumentSplitDocumentList(v *[]types.SplitDocument, value interface{}) error { +func awsAwsjson11_deserializeDocumentWarnings(v *[]types.Warning, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5812,17 +8718,17 @@ func awsAwsjson11_deserializeDocumentSplitDocumentList(v *[]types.SplitDocument, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SplitDocument + var cv []types.Warning if *v == nil { - cv = []types.SplitDocument{} + cv = []types.Warning{} } else { cv = *v } for _, value := range shape { - var col types.SplitDocument + var col types.Warning destAddr := &col - if err := awsAwsjson11_deserializeDocumentSplitDocument(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentWarning(&destAddr, value); err != nil { return err } col = *destAddr @@ -5833,43 +8739,7 @@ func awsAwsjson11_deserializeDocumentSplitDocumentList(v *[]types.SplitDocument, return nil } -func awsAwsjson11_deserializeDocumentStringList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentAnalyzeDocumentOutput(v **AnalyzeDocumentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5882,79 +8752,49 @@ func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingExc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ThrottlingException + var sv *AnalyzeDocumentOutput if *v == nil { - sv = &types.ThrottlingException{} + sv = &AnalyzeDocumentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "AnalyzeDocumentModelVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Code = ptr.String(jtv) + sv.AnalyzeDocumentModelVersion = ptr.String(jtv) } - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "Blocks": + if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { + return err } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUndetectedDocumentTypeList(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 - } + case "DocumentMetadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + return err + } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + case "HumanLoopActivationOutput": + if err := awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(&sv.HumanLoopActivationOutput, value); err != nil { + return err } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentUndetectedSignature(v **types.UndetectedSignature, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentAnalyzeExpenseOutput(v **AnalyzeExpenseOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5967,26 +8807,23 @@ func awsAwsjson11_deserializeDocumentUndetectedSignature(v **types.UndetectedSig return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UndetectedSignature + var sv *AnalyzeExpenseOutput if *v == nil { - sv = &types.UndetectedSignature{} + sv = &AnalyzeExpenseOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Page": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected UInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Page = ptr.Int32(int32(i64)) + case "DocumentMetadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + return err + } + + case "ExpenseDocuments": + if err := awsAwsjson11_deserializeDocumentExpenseDocumentList(&sv.ExpenseDocuments, value); err != nil { + return err } default: @@ -5998,7 +8835,7 @@ func awsAwsjson11_deserializeDocumentUndetectedSignature(v **types.UndetectedSig return nil } -func awsAwsjson11_deserializeDocumentUndetectedSignatureList(v *[]types.UndetectedSignature, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentAnalyzeIDOutput(v **AnalyzeIDOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6006,33 +8843,49 @@ func awsAwsjson11_deserializeDocumentUndetectedSignatureList(v *[]types.Undetect 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.UndetectedSignature + var sv *AnalyzeIDOutput if *v == nil { - cv = []types.UndetectedSignature{} + sv = &AnalyzeIDOutput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.UndetectedSignature - destAddr := &col - if err := awsAwsjson11_deserializeDocumentUndetectedSignature(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "AnalyzeIDModelVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AnalyzeIDModelVersion = ptr.String(jtv) + } + + case "DocumentMetadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + return err + } + + case "IdentityDocuments": + if err := awsAwsjson11_deserializeDocumentIdentityDocumentList(&sv.IdentityDocuments, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentUnsupportedDocumentException(v **types.UnsupportedDocumentException, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentCreateAdapterOutput(v **CreateAdapterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6045,31 +8898,22 @@ func awsAwsjson11_deserializeDocumentUnsupportedDocumentException(v **types.Unsu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnsupportedDocumentException + var sv *CreateAdapterOutput if *v == nil { - sv = &types.UnsupportedDocumentException{} + sv = &CreateAdapterOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "Message": + case "AdapterId": 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 AdapterId to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.AdapterId = ptr.String(jtv) } default: @@ -6081,7 +8925,7 @@ func awsAwsjson11_deserializeDocumentUnsupportedDocumentException(v **types.Unsu return nil } -func awsAwsjson11_deserializeDocumentWarning(v **types.Warning, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentCreateAdapterVersionOutput(v **CreateAdapterVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6094,27 +8938,31 @@ func awsAwsjson11_deserializeDocumentWarning(v **types.Warning, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Warning + var sv *CreateAdapterVersionOutput if *v == nil { - sv = &types.Warning{} + sv = &CreateAdapterVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ErrorCode": + case "AdapterId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + return fmt.Errorf("expected AdapterId to be of type string, got %T instead", value) } - sv.ErrorCode = ptr.String(jtv) + sv.AdapterId = ptr.String(jtv) } - case "Pages": - if err := awsAwsjson11_deserializeDocumentPages(&sv.Pages, value); err != nil { - return err + case "AdapterVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterVersion to be of type string, got %T instead", value) + } + sv.AdapterVersion = ptr.String(jtv) } default: @@ -6126,7 +8974,7 @@ func awsAwsjson11_deserializeDocumentWarning(v **types.Warning, value interface{ return nil } -func awsAwsjson11_deserializeDocumentWarnings(v *[]types.Warning, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteAdapterOutput(v **DeleteAdapterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6134,33 +8982,30 @@ func awsAwsjson11_deserializeDocumentWarnings(v *[]types.Warning, value interfac 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.Warning + var sv *DeleteAdapterOutput if *v == nil { - cv = []types.Warning{} + sv = &DeleteAdapterOutput{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Warning - destAddr := &col - if err := awsAwsjson11_deserializeDocumentWarning(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeOpDocumentAnalyzeDocumentOutput(v **AnalyzeDocumentOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteAdapterVersionOutput(v **DeleteAdapterVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6173,39 +9018,15 @@ func awsAwsjson11_deserializeOpDocumentAnalyzeDocumentOutput(v **AnalyzeDocument return fmt.Errorf("unexpected JSON type %v", value) } - var sv *AnalyzeDocumentOutput + var sv *DeleteAdapterVersionOutput if *v == nil { - sv = &AnalyzeDocumentOutput{} + sv = &DeleteAdapterVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AnalyzeDocumentModelVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AnalyzeDocumentModelVersion = ptr.String(jtv) - } - - case "Blocks": - if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { - return err - } - - case "DocumentMetadata": - if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { - return err - } - - case "HumanLoopActivationOutput": - if err := awsAwsjson11_deserializeDocumentHumanLoopActivationOutput(&sv.HumanLoopActivationOutput, value); err != nil { - return err - } - default: _, _ = key, value @@ -6215,7 +9036,7 @@ func awsAwsjson11_deserializeOpDocumentAnalyzeDocumentOutput(v **AnalyzeDocument return nil } -func awsAwsjson11_deserializeOpDocumentAnalyzeExpenseOutput(v **AnalyzeExpenseOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDetectDocumentTextOutput(v **DetectDocumentTextOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6228,22 +9049,31 @@ func awsAwsjson11_deserializeOpDocumentAnalyzeExpenseOutput(v **AnalyzeExpenseOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *AnalyzeExpenseOutput + var sv *DetectDocumentTextOutput if *v == nil { - sv = &AnalyzeExpenseOutput{} + sv = &DetectDocumentTextOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DocumentMetadata": - if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + case "Blocks": + if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { return err } - case "ExpenseDocuments": - if err := awsAwsjson11_deserializeDocumentExpenseDocumentList(&sv.ExpenseDocuments, value); err != nil { + case "DetectDocumentTextModelVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DetectDocumentTextModelVersion = ptr.String(jtv) + } + + case "DocumentMetadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { return err } @@ -6256,7 +9086,7 @@ func awsAwsjson11_deserializeOpDocumentAnalyzeExpenseOutput(v **AnalyzeExpenseOu return nil } -func awsAwsjson11_deserializeOpDocumentAnalyzeIDOutput(v **AnalyzeIDOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentGetAdapterOutput(v **GetAdapterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6269,31 +9099,74 @@ func awsAwsjson11_deserializeOpDocumentAnalyzeIDOutput(v **AnalyzeIDOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *AnalyzeIDOutput + var sv *GetAdapterOutput if *v == nil { - sv = &AnalyzeIDOutput{} + sv = &GetAdapterOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "AnalyzeIDModelVersion": + case "AdapterId": 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 AdapterId to be of type string, got %T instead", value) } - sv.AnalyzeIDModelVersion = ptr.String(jtv) + sv.AdapterId = ptr.String(jtv) } - case "DocumentMetadata": - if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + case "AdapterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterName to be of type string, got %T instead", value) + } + sv.AdapterName = ptr.String(jtv) + } + + case "AutoUpdate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutoUpdate to be of type string, got %T instead", value) + } + sv.AutoUpdate = types.AutoUpdate(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "FeatureTypes": + if err := awsAwsjson11_deserializeDocumentFeatureTypes(&sv.FeatureTypes, value); err != nil { return err } - case "IdentityDocuments": - if err := awsAwsjson11_deserializeDocumentIdentityDocumentList(&sv.IdentityDocuments, value); err != nil { + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -6306,7 +9179,7 @@ func awsAwsjson11_deserializeOpDocumentAnalyzeIDOutput(v **AnalyzeIDOutput, valu return nil } -func awsAwsjson11_deserializeOpDocumentDetectDocumentTextOutput(v **DetectDocumentTextOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentGetAdapterVersionOutput(v **GetAdapterVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6319,31 +9192,98 @@ func awsAwsjson11_deserializeOpDocumentDetectDocumentTextOutput(v **DetectDocume return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DetectDocumentTextOutput + var sv *GetAdapterVersionOutput if *v == nil { - sv = &DetectDocumentTextOutput{} + sv = &GetAdapterVersionOutput{} } else { sv = *v } - for key, value := range shape { - switch key { - case "Blocks": - if err := awsAwsjson11_deserializeDocumentBlockList(&sv.Blocks, value); err != nil { + for key, value := range shape { + switch key { + case "AdapterId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterId to be of type string, got %T instead", value) + } + sv.AdapterId = ptr.String(jtv) + } + + case "AdapterVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterVersion to be of type string, got %T instead", value) + } + sv.AdapterVersion = ptr.String(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "DatasetConfig": + if err := awsAwsjson11_deserializeDocumentAdapterVersionDatasetConfig(&sv.DatasetConfig, value); err != nil { + return err + } + + case "EvaluationMetrics": + if err := awsAwsjson11_deserializeDocumentAdapterVersionEvaluationMetrics(&sv.EvaluationMetrics, value); err != nil { + return err + } + + case "FeatureTypes": + if err := awsAwsjson11_deserializeDocumentFeatureTypes(&sv.FeatureTypes, value); err != nil { + return err + } + + 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 "OutputConfig": + if err := awsAwsjson11_deserializeDocumentOutputConfig(&sv.OutputConfig, value); err != nil { return err } - case "DetectDocumentTextModelVersion": + case "Status": 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 AdapterVersionStatus to be of type string, got %T instead", value) } - sv.DetectDocumentTextModelVersion = ptr.String(jtv) + sv.Status = types.AdapterVersionStatus(jtv) } - case "DocumentMetadata": - if err := awsAwsjson11_deserializeDocumentDocumentMetadata(&sv.DocumentMetadata, value); err != nil { + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterVersionStatusMessage to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } @@ -6757,6 +9697,132 @@ func awsAwsjson11_deserializeOpDocumentGetLendingAnalysisSummaryOutput(v **GetLe return nil } +func awsAwsjson11_deserializeOpDocumentListAdaptersOutput(v **ListAdaptersOutput, 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 *ListAdaptersOutput + if *v == nil { + sv = &ListAdaptersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Adapters": + if err := awsAwsjson11_deserializeDocumentAdapterList(&sv.Adapters, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListAdapterVersionsOutput(v **ListAdapterVersionsOutput, 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 *ListAdapterVersionsOutput + if *v == nil { + sv = &ListAdapterVersionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdapterVersions": + if err := awsAwsjson11_deserializeDocumentAdapterVersionList(&sv.AdapterVersions, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_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 := awsAwsjson11_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentStartDocumentAnalysisOutput(v **StartDocumentAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6916,3 +9982,153 @@ func awsAwsjson11_deserializeOpDocumentStartLendingAnalysisOutput(v **StartLendi *v = sv return nil } + +func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, 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 *TagResourceOutput + if *v == nil { + sv = &TagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, 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 *UntagResourceOutput + if *v == nil { + sv = &UntagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateAdapterOutput(v **UpdateAdapterOutput, 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 *UpdateAdapterOutput + if *v == nil { + sv = &UpdateAdapterOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdapterId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterId to be of type string, got %T instead", value) + } + sv.AdapterId = ptr.String(jtv) + } + + case "AdapterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterName to be of type string, got %T instead", value) + } + sv.AdapterName = ptr.String(jtv) + } + + case "AutoUpdate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutoUpdate to be of type string, got %T instead", value) + } + sv.AutoUpdate = types.AutoUpdate(jtv) + } + + case "CreationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AdapterDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "FeatureTypes": + if err := awsAwsjson11_deserializeDocumentFeatureTypes(&sv.FeatureTypes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/textract/generated.json b/service/textract/generated.json index c95b5bc4d8b..97d5bbfb50f 100644 --- a/service/textract/generated.json +++ b/service/textract/generated.json @@ -12,16 +12,28 @@ "api_op_AnalyzeDocument.go", "api_op_AnalyzeExpense.go", "api_op_AnalyzeID.go", + "api_op_CreateAdapter.go", + "api_op_CreateAdapterVersion.go", + "api_op_DeleteAdapter.go", + "api_op_DeleteAdapterVersion.go", "api_op_DetectDocumentText.go", + "api_op_GetAdapter.go", + "api_op_GetAdapterVersion.go", "api_op_GetDocumentAnalysis.go", "api_op_GetDocumentTextDetection.go", "api_op_GetExpenseAnalysis.go", "api_op_GetLendingAnalysis.go", "api_op_GetLendingAnalysisSummary.go", + "api_op_ListAdapterVersions.go", + "api_op_ListAdapters.go", + "api_op_ListTagsForResource.go", "api_op_StartDocumentAnalysis.go", "api_op_StartDocumentTextDetection.go", "api_op_StartExpenseAnalysis.go", "api_op_StartLendingAnalysis.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateAdapter.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/textract/serializers.go b/service/textract/serializers.go index 8d746effaec..2fd5782a656 100644 --- a/service/textract/serializers.go +++ b/service/textract/serializers.go @@ -11,6 +11,7 @@ import ( "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) @@ -180,14 +181,619 @@ func (m *awsAwsjson11_serializeOpAnalyzeID) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateAdapter struct { +} + +func (*awsAwsjson11_serializeOpCreateAdapter) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateAdapter) 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.(*CreateAdapterInput) + _ = 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("Textract.CreateAdapter") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateAdapterInput(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_serializeOpCreateAdapterVersion struct { +} + +func (*awsAwsjson11_serializeOpCreateAdapterVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateAdapterVersion) 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.(*CreateAdapterVersionInput) + _ = 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("Textract.CreateAdapterVersion") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateAdapterVersionInput(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_serializeOpDeleteAdapter struct { +} + +func (*awsAwsjson11_serializeOpDeleteAdapter) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteAdapter) 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.(*DeleteAdapterInput) + _ = 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("Textract.DeleteAdapter") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteAdapterInput(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_serializeOpDeleteAdapterVersion struct { +} + +func (*awsAwsjson11_serializeOpDeleteAdapterVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteAdapterVersion) 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.(*DeleteAdapterVersionInput) + _ = 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("Textract.DeleteAdapterVersion") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteAdapterVersionInput(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_serializeOpDetectDocumentText struct { } -func (*awsAwsjson11_serializeOpDetectDocumentText) ID() string { +func (*awsAwsjson11_serializeOpDetectDocumentText) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDetectDocumentText) 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.(*DetectDocumentTextInput) + _ = 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("Textract.DetectDocumentText") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDetectDocumentTextInput(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_serializeOpGetAdapter struct { +} + +func (*awsAwsjson11_serializeOpGetAdapter) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetAdapter) 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.(*GetAdapterInput) + _ = 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("Textract.GetAdapter") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetAdapterInput(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_serializeOpGetAdapterVersion struct { +} + +func (*awsAwsjson11_serializeOpGetAdapterVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetAdapterVersion) 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.(*GetAdapterVersionInput) + _ = 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("Textract.GetAdapterVersion") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetAdapterVersionInput(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_serializeOpGetDocumentAnalysis struct { +} + +func (*awsAwsjson11_serializeOpGetDocumentAnalysis) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDocumentAnalysis) 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.(*GetDocumentAnalysisInput) + _ = 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("Textract.GetDocumentAnalysis") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetDocumentAnalysisInput(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_serializeOpGetDocumentTextDetection struct { +} + +func (*awsAwsjson11_serializeOpGetDocumentTextDetection) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDocumentTextDetection) 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.(*GetDocumentTextDetectionInput) + _ = 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("Textract.GetDocumentTextDetection") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetDocumentTextDetectionInput(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_serializeOpGetExpenseAnalysis struct { +} + +func (*awsAwsjson11_serializeOpGetExpenseAnalysis) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetExpenseAnalysis) 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.(*GetExpenseAnalysisInput) + _ = 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("Textract.GetExpenseAnalysis") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetExpenseAnalysisInput(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_serializeOpGetLendingAnalysis struct { +} + +func (*awsAwsjson11_serializeOpGetLendingAnalysis) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetLendingAnalysis) 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.(*GetLendingAnalysisInput) + _ = 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("Textract.GetLendingAnalysis") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetLendingAnalysisInput(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_serializeOpGetLendingAnalysisSummary struct { +} + +func (*awsAwsjson11_serializeOpGetLendingAnalysisSummary) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDetectDocumentText) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpGetLendingAnalysisSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -195,7 +801,7 @@ func (m *awsAwsjson11_serializeOpDetectDocumentText) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DetectDocumentTextInput) + input, ok := in.Parameters.(*GetLendingAnalysisSummaryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -216,10 +822,10 @@ func (m *awsAwsjson11_serializeOpDetectDocumentText) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.DetectDocumentText") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.GetLendingAnalysisSummary") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDetectDocumentTextInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentGetLendingAnalysisSummaryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -235,14 +841,14 @@ func (m *awsAwsjson11_serializeOpDetectDocumentText) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetDocumentAnalysis struct { +type awsAwsjson11_serializeOpListAdapters struct { } -func (*awsAwsjson11_serializeOpGetDocumentAnalysis) ID() string { +func (*awsAwsjson11_serializeOpListAdapters) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetDocumentAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListAdapters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -250,7 +856,7 @@ func (m *awsAwsjson11_serializeOpGetDocumentAnalysis) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetDocumentAnalysisInput) + input, ok := in.Parameters.(*ListAdaptersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -271,10 +877,10 @@ func (m *awsAwsjson11_serializeOpGetDocumentAnalysis) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.GetDocumentAnalysis") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.ListAdapters") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetDocumentAnalysisInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListAdaptersInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -290,14 +896,14 @@ func (m *awsAwsjson11_serializeOpGetDocumentAnalysis) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetDocumentTextDetection struct { +type awsAwsjson11_serializeOpListAdapterVersions struct { } -func (*awsAwsjson11_serializeOpGetDocumentTextDetection) ID() string { +func (*awsAwsjson11_serializeOpListAdapterVersions) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetDocumentTextDetection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListAdapterVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -305,7 +911,7 @@ func (m *awsAwsjson11_serializeOpGetDocumentTextDetection) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetDocumentTextDetectionInput) + input, ok := in.Parameters.(*ListAdapterVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -326,10 +932,10 @@ func (m *awsAwsjson11_serializeOpGetDocumentTextDetection) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.GetDocumentTextDetection") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.ListAdapterVersions") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetDocumentTextDetectionInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListAdapterVersionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -345,14 +951,14 @@ func (m *awsAwsjson11_serializeOpGetDocumentTextDetection) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetExpenseAnalysis struct { +type awsAwsjson11_serializeOpListTagsForResource struct { } -func (*awsAwsjson11_serializeOpGetExpenseAnalysis) ID() string { +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetExpenseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -360,7 +966,7 @@ func (m *awsAwsjson11_serializeOpGetExpenseAnalysis) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetExpenseAnalysisInput) + input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -381,10 +987,10 @@ func (m *awsAwsjson11_serializeOpGetExpenseAnalysis) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.GetExpenseAnalysis") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.ListTagsForResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetExpenseAnalysisInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -400,14 +1006,14 @@ func (m *awsAwsjson11_serializeOpGetExpenseAnalysis) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetLendingAnalysis struct { +type awsAwsjson11_serializeOpStartDocumentAnalysis struct { } -func (*awsAwsjson11_serializeOpGetLendingAnalysis) ID() string { +func (*awsAwsjson11_serializeOpStartDocumentAnalysis) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetLendingAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartDocumentAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -415,7 +1021,7 @@ func (m *awsAwsjson11_serializeOpGetLendingAnalysis) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetLendingAnalysisInput) + input, ok := in.Parameters.(*StartDocumentAnalysisInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -436,10 +1042,10 @@ func (m *awsAwsjson11_serializeOpGetLendingAnalysis) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.GetLendingAnalysis") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.StartDocumentAnalysis") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetLendingAnalysisInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartDocumentAnalysisInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -455,14 +1061,14 @@ func (m *awsAwsjson11_serializeOpGetLendingAnalysis) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetLendingAnalysisSummary struct { +type awsAwsjson11_serializeOpStartDocumentTextDetection struct { } -func (*awsAwsjson11_serializeOpGetLendingAnalysisSummary) ID() string { +func (*awsAwsjson11_serializeOpStartDocumentTextDetection) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetLendingAnalysisSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartDocumentTextDetection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -470,7 +1076,7 @@ func (m *awsAwsjson11_serializeOpGetLendingAnalysisSummary) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetLendingAnalysisSummaryInput) + input, ok := in.Parameters.(*StartDocumentTextDetectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -491,10 +1097,10 @@ func (m *awsAwsjson11_serializeOpGetLendingAnalysisSummary) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.GetLendingAnalysisSummary") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.StartDocumentTextDetection") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetLendingAnalysisSummaryInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartDocumentTextDetectionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -510,14 +1116,14 @@ func (m *awsAwsjson11_serializeOpGetLendingAnalysisSummary) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartDocumentAnalysis struct { +type awsAwsjson11_serializeOpStartExpenseAnalysis struct { } -func (*awsAwsjson11_serializeOpStartDocumentAnalysis) ID() string { +func (*awsAwsjson11_serializeOpStartExpenseAnalysis) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartDocumentAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartExpenseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -525,7 +1131,7 @@ func (m *awsAwsjson11_serializeOpStartDocumentAnalysis) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartDocumentAnalysisInput) + input, ok := in.Parameters.(*StartExpenseAnalysisInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -546,10 +1152,10 @@ func (m *awsAwsjson11_serializeOpStartDocumentAnalysis) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.StartDocumentAnalysis") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.StartExpenseAnalysis") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartDocumentAnalysisInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartExpenseAnalysisInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -565,14 +1171,14 @@ func (m *awsAwsjson11_serializeOpStartDocumentAnalysis) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartDocumentTextDetection struct { +type awsAwsjson11_serializeOpStartLendingAnalysis struct { } -func (*awsAwsjson11_serializeOpStartDocumentTextDetection) ID() string { +func (*awsAwsjson11_serializeOpStartLendingAnalysis) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartDocumentTextDetection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartLendingAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -580,7 +1186,7 @@ func (m *awsAwsjson11_serializeOpStartDocumentTextDetection) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartDocumentTextDetectionInput) + input, ok := in.Parameters.(*StartLendingAnalysisInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -601,10 +1207,10 @@ func (m *awsAwsjson11_serializeOpStartDocumentTextDetection) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.StartDocumentTextDetection") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.StartLendingAnalysis") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartDocumentTextDetectionInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartLendingAnalysisInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -620,14 +1226,14 @@ func (m *awsAwsjson11_serializeOpStartDocumentTextDetection) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartExpenseAnalysis struct { +type awsAwsjson11_serializeOpTagResource struct { } -func (*awsAwsjson11_serializeOpStartExpenseAnalysis) ID() string { +func (*awsAwsjson11_serializeOpTagResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartExpenseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -635,7 +1241,7 @@ func (m *awsAwsjson11_serializeOpStartExpenseAnalysis) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartExpenseAnalysisInput) + input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -656,10 +1262,10 @@ func (m *awsAwsjson11_serializeOpStartExpenseAnalysis) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.StartExpenseAnalysis") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Textract.TagResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartExpenseAnalysisInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -675,14 +1281,69 @@ func (m *awsAwsjson11_serializeOpStartExpenseAnalysis) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartLendingAnalysis struct { +type awsAwsjson11_serializeOpUntagResource struct { } -func (*awsAwsjson11_serializeOpStartLendingAnalysis) ID() string { +func (*awsAwsjson11_serializeOpUntagResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartLendingAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + 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("Textract.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(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_serializeOpUpdateAdapter struct { +} + +func (*awsAwsjson11_serializeOpUpdateAdapter) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateAdapter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -690,45 +1351,121 @@ func (m *awsAwsjson11_serializeOpStartLendingAnalysis) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartLendingAnalysisInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } + input, ok := in.Parameters.(*UpdateAdapterInput) + _ = 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("Textract.UpdateAdapter") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateAdapterInput(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) +} +func awsAwsjson11_serializeDocumentAdapter(v *types.Adapter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + if v.Pages != nil { + ok := object.Key("Pages") + if err := awsAwsjson11_serializeDocumentAdapterPages(v.Pages, ok); err != nil { + return err + } + } + + if v.Version != nil { + ok := object.Key("Version") + ok.String(*v.Version) + } + + return nil +} + +func awsAwsjson11_serializeDocumentAdapterPages(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentAdapters(v []types.Adapter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentAdapter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentAdaptersConfig(v *types.AdaptersConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - 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 += "/" + if v.Adapters != nil { + ok := object.Key("Adapters") + if err := awsAwsjson11_serializeDocumentAdapters(v.Adapters, ok); err != nil { + return err } } - 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("Textract.StartLendingAnalysis") - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartLendingAnalysisInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + return nil +} - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } +func awsAwsjson11_serializeDocumentAdapterVersionDatasetConfig(v *types.AdapterVersionDatasetConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} + if v.ManifestS3Object != nil { + ok := object.Key("ManifestS3Object") + if err := awsAwsjson11_serializeDocumentS3Object(v.ManifestS3Object, ok); err != nil { + return err + } } - in.Request = request - return next.HandleSerialize(ctx, in) + return nil } + func awsAwsjson11_serializeDocumentContentClassifiers(v []types.ContentClassifier, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -953,10 +1690,39 @@ func awsAwsjson11_serializeDocumentS3Object(v *types.S3Object, value smithyjson. return nil } +func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + func awsAwsjson11_serializeOpDocumentAnalyzeDocumentInput(v *AnalyzeDocumentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AdaptersConfig != nil { + ok := object.Key("AdaptersConfig") + if err := awsAwsjson11_serializeDocumentAdaptersConfig(v.AdaptersConfig, ok); err != nil { + return err + } + } + if v.Document != nil { ok := object.Key("Document") if err := awsAwsjson11_serializeDocumentDocument(v.Document, ok); err != nil { @@ -1016,6 +1782,119 @@ func awsAwsjson11_serializeOpDocumentAnalyzeIDInput(v *AnalyzeIDInput, value smi return nil } +func awsAwsjson11_serializeOpDocumentCreateAdapterInput(v *CreateAdapterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterName != nil { + ok := object.Key("AdapterName") + ok.String(*v.AdapterName) + } + + if len(v.AutoUpdate) > 0 { + ok := object.Key("AutoUpdate") + ok.String(string(v.AutoUpdate)) + } + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.FeatureTypes != nil { + ok := object.Key("FeatureTypes") + if err := awsAwsjson11_serializeDocumentFeatureTypes(v.FeatureTypes, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateAdapterVersionInput(v *CreateAdapterVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.DatasetConfig != nil { + ok := object.Key("DatasetConfig") + if err := awsAwsjson11_serializeDocumentAdapterVersionDatasetConfig(v.DatasetConfig, ok); err != nil { + return err + } + } + + if v.KMSKeyId != nil { + ok := object.Key("KMSKeyId") + ok.String(*v.KMSKeyId) + } + + if v.OutputConfig != nil { + ok := object.Key("OutputConfig") + if err := awsAwsjson11_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteAdapterInput(v *DeleteAdapterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteAdapterVersionInput(v *DeleteAdapterVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + if v.AdapterVersion != nil { + ok := object.Key("AdapterVersion") + ok.String(*v.AdapterVersion) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDetectDocumentTextInput(v *DetectDocumentTextInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1030,6 +1909,35 @@ func awsAwsjson11_serializeOpDocumentDetectDocumentTextInput(v *DetectDocumentTe return nil } +func awsAwsjson11_serializeOpDocumentGetAdapterInput(v *GetAdapterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetAdapterVersionInput(v *GetAdapterVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + if v.AdapterVersion != nil { + ok := object.Key("AdapterVersion") + ok.String(*v.AdapterVersion) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetDocumentAnalysisInput(v *GetDocumentAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1130,10 +2038,88 @@ func awsAwsjson11_serializeOpDocumentGetLendingAnalysisSummaryInput(v *GetLendin return nil } +func awsAwsjson11_serializeOpDocumentListAdaptersInput(v *ListAdaptersInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AfterCreationTime != nil { + ok := object.Key("AfterCreationTime") + ok.Double(smithytime.FormatEpochSeconds(*v.AfterCreationTime)) + } + + if v.BeforeCreationTime != nil { + ok := object.Key("BeforeCreationTime") + ok.Double(smithytime.FormatEpochSeconds(*v.BeforeCreationTime)) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListAdapterVersionsInput(v *ListAdapterVersionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + if v.AfterCreationTime != nil { + ok := object.Key("AfterCreationTime") + ok.Double(smithytime.FormatEpochSeconds(*v.AfterCreationTime)) + } + + if v.BeforeCreationTime != nil { + ok := object.Key("BeforeCreationTime") + ok.Double(smithytime.FormatEpochSeconds(*v.BeforeCreationTime)) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartDocumentAnalysisInput(v *StartDocumentAnalysisInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AdaptersConfig != nil { + ok := object.Key("AdaptersConfig") + if err := awsAwsjson11_serializeDocumentAdaptersConfig(v.AdaptersConfig, ok); err != nil { + return err + } + } + if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) @@ -1315,3 +2301,68 @@ func awsAwsjson11_serializeOpDocumentStartLendingAnalysisInput(v *StartLendingAn return nil } + +func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateAdapterInput(v *UpdateAdapterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdapterId != nil { + ok := object.Key("AdapterId") + ok.String(*v.AdapterId) + } + + if v.AdapterName != nil { + ok := object.Key("AdapterName") + ok.String(*v.AdapterName) + } + + if len(v.AutoUpdate) > 0 { + ok := object.Key("AutoUpdate") + ok.String(string(v.AutoUpdate)) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + return nil +} diff --git a/service/textract/types/enums.go b/service/textract/types/enums.go index 27a332d702b..513ba340f9d 100644 --- a/service/textract/types/enums.go +++ b/service/textract/types/enums.go @@ -2,6 +2,48 @@ package types +type AdapterVersionStatus string + +// Enum values for AdapterVersionStatus +const ( + AdapterVersionStatusActive AdapterVersionStatus = "ACTIVE" + AdapterVersionStatusAtRisk AdapterVersionStatus = "AT_RISK" + AdapterVersionStatusDeprecated AdapterVersionStatus = "DEPRECATED" + AdapterVersionStatusCreationError AdapterVersionStatus = "CREATION_ERROR" + AdapterVersionStatusCreationInProgress AdapterVersionStatus = "CREATION_IN_PROGRESS" +) + +// Values returns all known values for AdapterVersionStatus. 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 (AdapterVersionStatus) Values() []AdapterVersionStatus { + return []AdapterVersionStatus{ + "ACTIVE", + "AT_RISK", + "DEPRECATED", + "CREATION_ERROR", + "CREATION_IN_PROGRESS", + } +} + +type AutoUpdate string + +// Enum values for AutoUpdate +const ( + AutoUpdateEnabled AutoUpdate = "ENABLED" + AutoUpdateDisabled AutoUpdate = "DISABLED" +) + +// Values returns all known values for AutoUpdate. 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 (AutoUpdate) Values() []AutoUpdate { + return []AutoUpdate{ + "ENABLED", + "DISABLED", + } +} + type BlockType string // Enum values for BlockType diff --git a/service/textract/types/errors.go b/service/textract/types/errors.go index b0a5ad99381..6f500a2dba6 100644 --- a/service/textract/types/errors.go +++ b/service/textract/types/errors.go @@ -65,6 +65,34 @@ func (e *BadDocumentException) ErrorCode() string { } func (e *BadDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Updating or deleting a resource can cause an inconsistent state. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + Code *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The document can't be processed because it's too large. The maximum document // size for synchronous operations 10 MB. The maximum document size for // asynchronous operations is 500 MB for PDF files. @@ -368,6 +396,63 @@ func (e *ProvisionedThroughputExceededException) ErrorFault() smithy.ErrorFault return smithy.FaultClient } +// Returned when an operation tried to access a nonexistent resource. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + Code *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Returned when a request cannot be completed as it would exceed a maximum +// service quota. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + Code *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Amazon Textract is temporarily unable to process the request. Try your call // again. type ThrottlingException struct { @@ -425,3 +510,31 @@ func (e *UnsupportedDocumentException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnsupportedDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a request was not valid. Check request for proper formatting. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Code *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/textract/types/types.go b/service/textract/types/types.go index f5633b2b979..768424dc934 100644 --- a/service/textract/types/types.go +++ b/service/textract/types/types.go @@ -4,8 +4,126 @@ package types import ( smithydocument "github.com/aws/smithy-go/document" + "time" ) +// An adapter selected for use when analyzing documents. Contains an adapter ID +// and a version number. Contains information on pages selected for analysis when +// analyzing documents asychronously. +type Adapter struct { + + // A unique identifier for the adapter resource. + // + // This member is required. + AdapterId *string + + // A string that identifies the version of the adapter. + // + // This member is required. + Version *string + + // Pages is a parameter that the user inputs to specify which pages to apply an + // adapter to. The following is a list of rules for using this parameter. + // - If a page is not specified, it is set to ["1"] by default. + // - The following characters are allowed in the parameter's string: 0 1 2 3 4 5 + // 6 7 8 9 - * . No whitespace is allowed. + // - When using * to indicate all pages, it must be the only element in the + // list. + // - You can use page intervals, such as ["1-3", "1-1", "4-*"] . Where * + // indicates last page of document. + // - Specified pages must be greater than 0 and less than or equal to the number + // of pages in the document. + Pages []string + + noSmithyDocumentSerde +} + +// Contains information on the adapter, including the adapter ID, Name, Creation +// time, and feature types. +type AdapterOverview struct { + + // A unique identifier for the adapter resource. + AdapterId *string + + // A string naming the adapter resource. + AdapterName *string + + // The date and time that the adapter was created. + CreationTime *time.Time + + // The feature types that the adapter is operating on. + FeatureTypes []FeatureType + + noSmithyDocumentSerde +} + +// Contains information about adapters used when analyzing a document, with each +// adapter specified using an AdapterId and version +type AdaptersConfig struct { + + // A list of adapters to be used when analyzing the specified document. + // + // This member is required. + Adapters []Adapter + + noSmithyDocumentSerde +} + +// The dataset configuration options for a given version of an adapter. Can +// include an Amazon S3 bucket if specified. +type AdapterVersionDatasetConfig struct { + + // The S3 bucket name and file name that identifies the document. The AWS Region + // for the S3 bucket that contains the document must match the Region that you use + // for Amazon Textract operations. For Amazon Textract to process a file in an S3 + // bucket, the user must have permission to access the S3 bucket and file. + ManifestS3Object *S3Object + + noSmithyDocumentSerde +} + +// Contains information on the metrics used to evalute the peformance of a given +// adapter version. Includes data for baseline model performance and individual +// adapter version perfromance. +type AdapterVersionEvaluationMetric struct { + + // The F1 score, precision, and recall metrics for the baseline model. + AdapterVersion *EvaluationMetric + + // The F1 score, precision, and recall metrics for the baseline model. + Baseline *EvaluationMetric + + // Indicates the feature type being analyzed by a given adapter version. + FeatureType FeatureType + + noSmithyDocumentSerde +} + +// Summary info for an adapter version. Contains information on the AdapterId, +// AdapterVersion, CreationTime, FeatureTypes, and Status. +type AdapterVersionOverview struct { + + // A unique identifier for the adapter associated with a given adapter version. + AdapterId *string + + // An identified for a given adapter version. + AdapterVersion *string + + // The date and time that a given adapter version was created. + CreationTime *time.Time + + // The feature types that the adapter version is operating on. + FeatureTypes []FeatureType + + // Contains information on the status of a given adapter version. + Status AdapterVersionStatus + + // A message explaining the status of a given adapter vesion. + StatusMessage *string + + noSmithyDocumentSerde +} + // Used to contain the information detected by an AnalyzeID operation. type AnalyzeIDDetections struct { @@ -78,6 +196,18 @@ type Block struct { // - QUERY_RESULT - A response to a question asked during the call of analyze // document. Comes with an alias and ID for ease of locating in a response. Also // contains location and confidence score. + // The following BlockTypes are only returned for Amazon Textract Layout. + // - LAYOUT_TITLE - The main title of the document. + // - LAYOUT_HEADER - Text located in the top margin of the document. + // - LAYOUT_FOOTER - Text located in the bottom margin of the document. + // - LAYOUT_SECTION_HEADER - The titles of sections within a document. + // - LAYOUT_PAGE_NUMBER - The page number of the documents. + // - LAYOUT_LIST - Any information grouped together in list form. + // - LAYOUT_FIGURE - Indicates the location of an image in a document. + // - LAYOUT_TABLE - Indicates the location of a table in the document. + // - LAYOUT_KEY_VALUE - Indicates the location of form key-values in a document. + // - LAYOUT_TEXT - Text that is present typically as a part of paragraphs in + // documents. BlockType BlockType // The column in which a table cell appears. The first column position is 1. @@ -270,6 +400,21 @@ type DocumentMetadata struct { noSmithyDocumentSerde } +// The evaluation metrics (F1 score, Precision, and Recall) for an adapter version. +type EvaluationMetric struct { + + // The F1 score for an adapter version. + F1Score float32 + + // The Precision score for an adapter version. + Precision float32 + + // The Recall score for an adapter version. + Recall float32 + + noSmithyDocumentSerde +} + // Returns the kind of currency detected. type ExpenseCurrency struct { diff --git a/service/textract/validators.go b/service/textract/validators.go index 20515c41d77..0e67ffcb9e6 100644 --- a/service/textract/validators.go +++ b/service/textract/validators.go @@ -70,6 +70,86 @@ func (m *validateOpAnalyzeID) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpCreateAdapter struct { +} + +func (*validateOpCreateAdapter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAdapter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAdapterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAdapterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateAdapterVersion struct { +} + +func (*validateOpCreateAdapterVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateAdapterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateAdapterVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateAdapterVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAdapter struct { +} + +func (*validateOpDeleteAdapter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAdapter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAdapterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAdapterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteAdapterVersion struct { +} + +func (*validateOpDeleteAdapterVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAdapterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAdapterVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAdapterVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDetectDocumentText struct { } @@ -90,6 +170,46 @@ func (m *validateOpDetectDocumentText) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetAdapter struct { +} + +func (*validateOpGetAdapter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAdapter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAdapterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAdapterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAdapterVersion struct { +} + +func (*validateOpGetAdapterVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAdapterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAdapterVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAdapterVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetDocumentAnalysis struct { } @@ -190,6 +310,26 @@ func (m *validateOpGetLendingAnalysisSummary) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartDocumentAnalysis struct { } @@ -270,6 +410,66 @@ func (m *validateOpStartLendingAnalysis) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateAdapter struct { +} + +func (*validateOpUpdateAdapter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAdapter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAdapterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAdapterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpAnalyzeDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAnalyzeDocument{}, middleware.After) } @@ -282,10 +482,34 @@ func addOpAnalyzeIDValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAnalyzeID{}, middleware.After) } +func addOpCreateAdapterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAdapter{}, middleware.After) +} + +func addOpCreateAdapterVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateAdapterVersion{}, middleware.After) +} + +func addOpDeleteAdapterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAdapter{}, middleware.After) +} + +func addOpDeleteAdapterVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAdapterVersion{}, middleware.After) +} + func addOpDetectDocumentTextValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDetectDocumentText{}, middleware.After) } +func addOpGetAdapterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAdapter{}, middleware.After) +} + +func addOpGetAdapterVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAdapterVersion{}, middleware.After) +} + func addOpGetDocumentAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDocumentAnalysis{}, middleware.After) } @@ -306,6 +530,10 @@ func addOpGetLendingAnalysisSummaryValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpGetLendingAnalysisSummary{}, middleware.After) } +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + func addOpStartDocumentAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartDocumentAnalysis{}, middleware.After) } @@ -322,6 +550,72 @@ func addOpStartLendingAnalysisValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpStartLendingAnalysis{}, middleware.After) } +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateAdapterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAdapter{}, middleware.After) +} + +func validateAdapter(v *types.Adapter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Adapter"} + if v.AdapterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterId")) + } + if v.Version == nil { + invalidParams.Add(smithy.NewErrParamRequired("Version")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAdapters(v []types.Adapter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Adapters"} + for i := range v { + if err := validateAdapter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAdaptersConfig(v *types.AdaptersConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AdaptersConfig"} + if v.Adapters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Adapters")) + } else if v.Adapters != nil { + if err := validateAdapters(v.Adapters); err != nil { + invalidParams.AddNested("Adapters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateHumanLoopConfig(v *types.HumanLoopConfig) error { if v == nil { return nil @@ -445,6 +739,11 @@ func validateOpAnalyzeDocumentInput(v *AnalyzeDocumentInput) error { invalidParams.AddNested("QueriesConfig", err.(smithy.InvalidParamsError)) } } + if v.AdaptersConfig != nil { + if err := validateAdaptersConfig(v.AdaptersConfig); err != nil { + invalidParams.AddNested("AdaptersConfig", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -482,6 +781,82 @@ func validateOpAnalyzeIDInput(v *AnalyzeIDInput) error { } } +func validateOpCreateAdapterInput(v *CreateAdapterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAdapterInput"} + if v.AdapterName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterName")) + } + if v.FeatureTypes == nil { + invalidParams.Add(smithy.NewErrParamRequired("FeatureTypes")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateAdapterVersionInput(v *CreateAdapterVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateAdapterVersionInput"} + if v.AdapterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterId")) + } + if v.DatasetConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("DatasetConfig")) + } + if v.OutputConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("OutputConfig")) + } else if v.OutputConfig != nil { + if err := validateOutputConfig(v.OutputConfig); err != nil { + invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAdapterInput(v *DeleteAdapterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAdapterInput"} + if v.AdapterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAdapterVersionInput(v *DeleteAdapterVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAdapterVersionInput"} + if v.AdapterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterId")) + } + if v.AdapterVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDetectDocumentTextInput(v *DetectDocumentTextInput) error { if v == nil { return nil @@ -497,6 +872,39 @@ func validateOpDetectDocumentTextInput(v *DetectDocumentTextInput) error { } } +func validateOpGetAdapterInput(v *GetAdapterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAdapterInput"} + if v.AdapterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAdapterVersionInput(v *GetAdapterVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAdapterVersionInput"} + if v.AdapterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterId")) + } + if v.AdapterVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetDocumentAnalysisInput(v *GetDocumentAnalysisInput) error { if v == nil { return nil @@ -572,6 +980,21 @@ func validateOpGetLendingAnalysisSummaryInput(v *GetLendingAnalysisSummaryInput) } } +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartDocumentAnalysisInput(v *StartDocumentAnalysisInput) error { if v == nil { return nil @@ -598,6 +1021,11 @@ func validateOpStartDocumentAnalysisInput(v *StartDocumentAnalysisInput) error { invalidParams.AddNested("QueriesConfig", err.(smithy.InvalidParamsError)) } } + if v.AdaptersConfig != nil { + if err := validateAdaptersConfig(v.AdaptersConfig); err != nil { + invalidParams.AddNested("AdaptersConfig", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -679,3 +1107,54 @@ func validateOpStartLendingAnalysisInput(v *StartLendingAnalysisInput) error { return nil } } + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceARN == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARN")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateAdapterInput(v *UpdateAdapterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAdapterInput"} + if v.AdapterId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AdapterId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/transcribe/types/enums.go b/service/transcribe/types/enums.go index c6d4733e933..06926492397 100644 --- a/service/transcribe/types/enums.go +++ b/service/transcribe/types/enums.go @@ -191,6 +191,7 @@ const ( MediaFormatOgg MediaFormat = "ogg" MediaFormatAmr MediaFormat = "amr" MediaFormatWebm MediaFormat = "webm" + MediaFormatM4a MediaFormat = "m4a" ) // Values returns all known values for MediaFormat. Note that this can be expanded @@ -205,6 +206,7 @@ func (MediaFormat) Values() []MediaFormat { "ogg", "amr", "webm", + "m4a", } } diff --git a/service/workspaces/api_op_CreateWorkspaces.go b/service/workspaces/api_op_CreateWorkspaces.go index 2626f380673..e911c617de7 100644 --- a/service/workspaces/api_op_CreateWorkspaces.go +++ b/service/workspaces/api_op_CreateWorkspaces.go @@ -17,10 +17,12 @@ import ( ) // Creates one or more WorkSpaces. This operation is asynchronous and returns -// before the WorkSpaces are created. The MANUAL running mode value is only -// supported by Amazon WorkSpaces Core. Contact your account team to be -// allow-listed to use this value. For more information, see Amazon WorkSpaces Core (http://aws.amazon.com/workspaces/core/) -// . +// before the WorkSpaces are created. +// - The MANUAL running mode value is only supported by Amazon WorkSpaces Core. +// Contact your account team to be allow-listed to use this value. For more +// information, see Amazon WorkSpaces Core (http://aws.amazon.com/workspaces/core/) +// . +// - PCoIP is only available for Windows bundles. func (c *Client) CreateWorkspaces(ctx context.Context, params *CreateWorkspacesInput, optFns ...func(*Options)) (*CreateWorkspacesOutput, error) { if params == nil { params = &CreateWorkspacesInput{}