diff --git a/.changelog/07276b2f174548288189b6e70ea1da72.json b/.changelog/07276b2f174548288189b6e70ea1da72.json new file mode 100644 index 00000000000..9ea8386559b --- /dev/null +++ b/.changelog/07276b2f174548288189b6e70ea1da72.json @@ -0,0 +1,8 @@ +{ + "id": "07276b2f-1745-4828-8189-b6e70ea1da72", + "type": "feature", + "description": "Neo Integration via IAM Identity Center (IdC)", + "modules": [ + "service/opensearchserverless" + ] +} \ No newline at end of file diff --git a/.changelog/0ca78f87247d48e1809b75d2c574349a.json b/.changelog/0ca78f87247d48e1809b75d2c574349a.json new file mode 100644 index 00000000000..f328b3f470f --- /dev/null +++ b/.changelog/0ca78f87247d48e1809b75d2c574349a.json @@ -0,0 +1,8 @@ +{ + "id": "0ca78f87-247d-48e1-809b-75d2c574349a", + "type": "feature", + "description": "Release of Amazon Location Maps API. Maps enables you to build digital maps that showcase your locations, visualize your data, and unlock insights to drive your business", + "modules": [ + "service/geomaps" + ] +} \ No newline at end of file diff --git a/.changelog/24a9ea866b694eaebcfee3f4a6a55d8b.json b/.changelog/24a9ea866b694eaebcfee3f4a6a55d8b.json new file mode 100644 index 00000000000..a2258dc2658 --- /dev/null +++ b/.changelog/24a9ea866b694eaebcfee3f4a6a55d8b.json @@ -0,0 +1,8 @@ +{ + "id": "24a9ea86-6b69-4eae-bcfe-e3f4a6a55d8b", + "type": "feature", + "description": "This release adds support for TLSA, SSHFP, SVCB, and HTTPS record types.", + "modules": [ + "service/route53" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..30f577bdcb1 --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,10 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/geomaps", + "service/geoplaces", + "service/georoutes" + ] +} \ No newline at end of file diff --git a/.changelog/49c02c9c096549e987e4a093dc950820.json b/.changelog/49c02c9c096549e987e4a093dc950820.json new file mode 100644 index 00000000000..6ee79ccd638 --- /dev/null +++ b/.changelog/49c02c9c096549e987e4a093dc950820.json @@ -0,0 +1,8 @@ +{ + "id": "49c02c9c-0965-49e9-87e4-a093dc950820", + "type": "feature", + "description": "Adds and updates API members for the Redshift Serverless AI-driven scaling and optimization feature using the price-performance target setting.", + "modules": [ + "service/redshiftserverless" + ] +} \ No newline at end of file diff --git a/.changelog/60382073c4c947cd9700acdcdec81fad.json b/.changelog/60382073c4c947cd9700acdcdec81fad.json new file mode 100644 index 00000000000..4de8a228f1f --- /dev/null +++ b/.changelog/60382073c4c947cd9700acdcdec81fad.json @@ -0,0 +1,8 @@ +{ + "id": "60382073-c4c9-47cd-9700-acdcdec81fad", + "type": "feature", + "description": "This release adds two new capabilities to VPC Security Groups: Security Group VPC Associations and Shared Security Groups.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/69e55b9752c645a4adc0bacc5ef30913.json b/.changelog/69e55b9752c645a4adc0bacc5ef30913.json new file mode 100644 index 00000000000..5b5c45c4301 --- /dev/null +++ b/.changelog/69e55b9752c645a4adc0bacc5ef30913.json @@ -0,0 +1,8 @@ +{ + "id": "69e55b97-52c6-45a4-adc0-bacc5ef30913", + "type": "feature", + "description": "Release of Amazon Location Places API. Places enables you to quickly search, display, and filter places, businesses, and locations based on proximity, category, and name", + "modules": [ + "service/geoplaces" + ] +} \ No newline at end of file diff --git a/.changelog/9a64f03491324848a391306721e3ce4a.json b/.changelog/9a64f03491324848a391306721e3ce4a.json new file mode 100644 index 00000000000..6e017a60543 --- /dev/null +++ b/.changelog/9a64f03491324848a391306721e3ce4a.json @@ -0,0 +1,8 @@ +{ + "id": "9a64f034-9132-4848-a391-306721e3ce4a", + "type": "feature", + "description": "Release of Amazon Location Routes API. Routes enables you to plan efficient routes and streamline deliveries by leveraging real-time traffic, vehicle restrictions, and turn-by-turn directions.", + "modules": [ + "service/georoutes" + ] +} \ No newline at end of file diff --git a/.changelog/a078a7b84fb04122b666ee0d2d0a383f.json b/.changelog/a078a7b84fb04122b666ee0d2d0a383f.json new file mode 100644 index 00000000000..a1ad31e4072 --- /dev/null +++ b/.changelog/a078a7b84fb04122b666ee0d2d0a383f.json @@ -0,0 +1,8 @@ +{ + "id": "a078a7b8-4fb0-4122-b666-ee0d2d0a383f", + "type": "feature", + "description": "Adds support for interacting with user-defined types (UDTs) through the following new operations: Create-Type, Delete-Type, List-Types, Get-Type.", + "modules": [ + "service/keyspaces" + ] +} \ No newline at end of file diff --git a/.changelog/accfb1ecff6549ceb46d1adba3e85595.json b/.changelog/accfb1ecff6549ceb46d1adba3e85595.json new file mode 100644 index 00000000000..988c0ab17de --- /dev/null +++ b/.changelog/accfb1ecff6549ceb46d1adba3e85595.json @@ -0,0 +1,8 @@ +{ + "id": "accfb1ec-ff65-49ce-b46d-1adba3e85595", + "type": "feature", + "description": "AWS DataSync now supports Enhanced mode tasks. This task mode supports transfer of virtually unlimited numbers of objects with enhanced metrics, more detailed logs, and higher performance than Basic mode. This mode currently supports transfers between Amazon S3 locations.", + "modules": [ + "service/datasync" + ] +} \ No newline at end of file diff --git a/.changelog/b19af23f9bfb44028e0c1a16cf400e8a.json b/.changelog/b19af23f9bfb44028e0c1a16cf400e8a.json new file mode 100644 index 00000000000..9c29a79c8d8 --- /dev/null +++ b/.changelog/b19af23f9bfb44028e0c1a16cf400e8a.json @@ -0,0 +1,8 @@ +{ + "id": "b19af23f-9bfb-4402-8e0c-1a16cf400e8a", + "type": "feature", + "description": "This release supports service deployments and service revisions which provide a comprehensive view of your Amazon ECS service history.", + "modules": [ + "service/ecs" + ] +} \ No newline at end of file diff --git a/.changelog/b3fdaf9818da4d229146b744ec30a8a0.json b/.changelog/b3fdaf9818da4d229146b744ec30a8a0.json new file mode 100644 index 00000000000..8b651a0e5cf --- /dev/null +++ b/.changelog/b3fdaf9818da4d229146b744ec30a8a0.json @@ -0,0 +1,8 @@ +{ + "id": "b3fdaf98-18da-4d22-9146-b744ec30a8a0", + "type": "feature", + "description": "Updated the public documentation for the UserIdentityInfo object to accurately reflect the character limits for the FirstName and LastName fields, which were previously listed as 1-100 characters.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/bbcdb2cb47da4a23bd0adaed6937b057.json b/.changelog/bbcdb2cb47da4a23bd0adaed6937b057.json new file mode 100644 index 00000000000..6d038cf5203 --- /dev/null +++ b/.changelog/bbcdb2cb47da4a23bd0adaed6937b057.json @@ -0,0 +1,8 @@ +{ + "id": "bbcdb2cb-47da-4a23-bd0a-daed6937b057", + "type": "feature", + "description": "AWS Network Firewall now supports configuring TCP idle timeout", + "modules": [ + "service/networkfirewall" + ] +} \ No newline at end of file diff --git a/.changelog/be705c9d73c64c88af65d015dcc71285.json b/.changelog/be705c9d73c64c88af65d015dcc71285.json new file mode 100644 index 00000000000..352f8e3826f --- /dev/null +++ b/.changelog/be705c9d73c64c88af65d015dcc71285.json @@ -0,0 +1,8 @@ +{ + "id": "be705c9d-73c6-4c88-af65-d015dcc71285", + "type": "feature", + "description": "This release adds support for Multi-Factor Authentication (MFA) and Personal Access Tokens through integration with AWS IAM Identity Center.", + "modules": [ + "service/workmail" + ] +} \ No newline at end of file diff --git a/.changelog/cf2a79e28f904882a8c59a5d7c29aa6f.json b/.changelog/cf2a79e28f904882a8c59a5d7c29aa6f.json new file mode 100644 index 00000000000..d50ff90fd00 --- /dev/null +++ b/.changelog/cf2a79e28f904882a8c59a5d7c29aa6f.json @@ -0,0 +1,8 @@ +{ + "id": "cf2a79e2-8f90-4882-a8c5-9a5d7c29aa6f", + "type": "feature", + "description": "Added support for Model Registry Staging construct. Users can define series of stages that models can progress through for model workflows and lifecycle. This simplifies tracking and managing models as they transition through development, testing, and production stages.", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/d5bb2186ba7f49698f4073622ae7a019.json b/.changelog/d5bb2186ba7f49698f4073622ae7a019.json new file mode 100644 index 00000000000..641d410e777 --- /dev/null +++ b/.changelog/d5bb2186ba7f49698f4073622ae7a019.json @@ -0,0 +1,8 @@ +{ + "id": "d5bb2186-ba7f-4969-8f40-73622ae7a019", + "type": "feature", + "description": "This release launches S3 event integrations to create and manage integrations from an Amazon S3 source into an Amazon Redshift database.", + "modules": [ + "service/redshift" + ] +} \ No newline at end of file diff --git a/.changelog/d5bd7876a09e4bafa8a7750e83dca271.json b/.changelog/d5bd7876a09e4bafa8a7750e83dca271.json new file mode 100644 index 00000000000..7bc6e7b0d39 --- /dev/null +++ b/.changelog/d5bd7876a09e4bafa8a7750e83dca271.json @@ -0,0 +1,8 @@ +{ + "id": "d5bd7876-a09e-4baf-a8a7-750e83dca271", + "type": "feature", + "description": "This release introduces the new OpenSearch user interface (Dashboards), a new web-based application that can be associated with multiple data sources across OpenSearch managed clusters, serverless collections, and Amazon S3, so that users can gain a comprehensive insights in an unified interface.", + "modules": [ + "service/opensearch" + ] +} \ No newline at end of file diff --git a/.changelog/ea67cb4153e541b9b977dcdf5d077ab2.json b/.changelog/ea67cb4153e541b9b977dcdf5d077ab2.json new file mode 100644 index 00000000000..46ea328aa94 --- /dev/null +++ b/.changelog/ea67cb4153e541b9b977dcdf5d077ab2.json @@ -0,0 +1,8 @@ +{ + "id": "ea67cb41-53e5-41b9-b977-dcdf5d077ab2", + "type": "feature", + "description": "This release adds support for AppSync Event APIs.", + "modules": [ + "service/appsync" + ] +} \ No newline at end of file diff --git a/feature/dynamodbstreams/attributevalue/go_module_metadata.go b/feature/dynamodbstreams/attributevalue/go_module_metadata.go index d2c5ca8ee08..04358c081d7 100644 --- a/feature/dynamodbstreams/attributevalue/go_module_metadata.go +++ b/feature/dynamodbstreams/attributevalue/go_module_metadata.go @@ -3,4 +3,4 @@ package attributevalue // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.45" +const goModuleVersion = "1.15.13" diff --git a/service/appsync/api_op_CreateApi.go b/service/appsync/api_op_CreateApi.go new file mode 100644 index 00000000000..ce36f798b1a --- /dev/null +++ b/service/appsync/api_op_CreateApi.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Api object. Use this operation to create an AppSync API with your +// preferred configuration, such as an Event API that provides real-time message +// publishing and message subscriptions over WebSockets. +func (c *Client) CreateApi(ctx context.Context, params *CreateApiInput, optFns ...func(*Options)) (*CreateApiOutput, error) { + if params == nil { + params = &CreateApiInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateApi", params, optFns, c.addOperationCreateApiMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateApiOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateApiInput struct { + + // The name for the Api . + // + // This member is required. + Name *string + + // The Event API configuration. This includes the default authorization + // configuration for connecting, publishing, and subscribing to an Event API. + EventConfig *types.EventConfig + + // The owner contact information for the Api . + OwnerContact *string + + // A map with keys of TagKey objects and values of TagValue objects. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateApiOutput struct { + + // The Api object. + Api *types.Api + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateApiMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateApi{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateApi{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateApi"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateApiValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApi(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateApi(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateApi", + } +} diff --git a/service/appsync/api_op_CreateChannelNamespace.go b/service/appsync/api_op_CreateChannelNamespace.go new file mode 100644 index 00000000000..f2d574d4c76 --- /dev/null +++ b/service/appsync/api_op_CreateChannelNamespace.go @@ -0,0 +1,178 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a ChannelNamespace for an Api . +func (c *Client) CreateChannelNamespace(ctx context.Context, params *CreateChannelNamespaceInput, optFns ...func(*Options)) (*CreateChannelNamespaceOutput, error) { + if params == nil { + params = &CreateChannelNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateChannelNamespace", params, optFns, c.addOperationCreateChannelNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateChannelNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateChannelNamespaceInput struct { + + // The Api ID. + // + // This member is required. + ApiId *string + + // The name of the ChannelNamespace . This name must be unique within the Api + // + // This member is required. + Name *string + + // The event handler functions that run custom business logic to process published + // events and subscribe requests. + CodeHandlers *string + + // The authorization mode to use for publishing messages on the channel namespace. + // This configuration overrides the default Api authorization configuration. + PublishAuthModes []types.AuthMode + + // The authorization mode to use for subscribing to messages on the channel + // namespace. This configuration overrides the default Api authorization + // configuration. + SubscribeAuthModes []types.AuthMode + + // A map with keys of TagKey objects and values of TagValue objects. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateChannelNamespaceOutput struct { + + // The ChannelNamespace object. + ChannelNamespace *types.ChannelNamespace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateChannelNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateChannelNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateChannelNamespace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateChannelNamespace"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateChannelNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateChannelNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateChannelNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateChannelNamespace", + } +} diff --git a/service/appsync/api_op_DeleteApi.go b/service/appsync/api_op_DeleteApi.go new file mode 100644 index 00000000000..584b850fe31 --- /dev/null +++ b/service/appsync/api_op_DeleteApi.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Api object +func (c *Client) DeleteApi(ctx context.Context, params *DeleteApiInput, optFns ...func(*Options)) (*DeleteApiOutput, error) { + if params == nil { + params = &DeleteApiInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteApi", params, optFns, c.addOperationDeleteApiMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteApiOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteApiInput struct { + + // The Api ID. + // + // This member is required. + ApiId *string + + noSmithyDocumentSerde +} + +type DeleteApiOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteApiMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApi{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApi{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteApi"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteApiValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApi(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteApi(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteApi", + } +} diff --git a/service/appsync/api_op_DeleteChannelNamespace.go b/service/appsync/api_op_DeleteChannelNamespace.go new file mode 100644 index 00000000000..e4e714b393e --- /dev/null +++ b/service/appsync/api_op_DeleteChannelNamespace.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a ChannelNamespace . +func (c *Client) DeleteChannelNamespace(ctx context.Context, params *DeleteChannelNamespaceInput, optFns ...func(*Options)) (*DeleteChannelNamespaceOutput, error) { + if params == nil { + params = &DeleteChannelNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteChannelNamespace", params, optFns, c.addOperationDeleteChannelNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteChannelNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteChannelNamespaceInput struct { + + // The ID of the Api associated with the ChannelNamespace . + // + // This member is required. + ApiId *string + + // The name of the ChannelNamespace . + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DeleteChannelNamespaceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteChannelNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteChannelNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteChannelNamespace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteChannelNamespace"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteChannelNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteChannelNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteChannelNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteChannelNamespace", + } +} diff --git a/service/appsync/api_op_GetApi.go b/service/appsync/api_op_GetApi.go new file mode 100644 index 00000000000..e09e71af02c --- /dev/null +++ b/service/appsync/api_op_GetApi.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves an Api object. +func (c *Client) GetApi(ctx context.Context, params *GetApiInput, optFns ...func(*Options)) (*GetApiOutput, error) { + if params == nil { + params = &GetApiInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetApi", params, optFns, c.addOperationGetApiMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetApiOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetApiInput struct { + + // The Api ID. + // + // This member is required. + ApiId *string + + noSmithyDocumentSerde +} + +type GetApiOutput struct { + + // The Api object. + Api *types.Api + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetApiMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetApi{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetApi{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetApi"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetApiValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApi(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetApi(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetApi", + } +} diff --git a/service/appsync/api_op_GetChannelNamespace.go b/service/appsync/api_op_GetChannelNamespace.go new file mode 100644 index 00000000000..64840b224e7 --- /dev/null +++ b/service/appsync/api_op_GetChannelNamespace.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the channel namespace for a specified Api . +func (c *Client) GetChannelNamespace(ctx context.Context, params *GetChannelNamespaceInput, optFns ...func(*Options)) (*GetChannelNamespaceOutput, error) { + if params == nil { + params = &GetChannelNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetChannelNamespace", params, optFns, c.addOperationGetChannelNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetChannelNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetChannelNamespaceInput struct { + + // The Api ID. + // + // This member is required. + ApiId *string + + // The name of the ChannelNamespace . + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type GetChannelNamespaceOutput struct { + + // The ChannelNamespace object. + ChannelNamespace *types.ChannelNamespace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetChannelNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetChannelNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetChannelNamespace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetChannelNamespace"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetChannelNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetChannelNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetChannelNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetChannelNamespace", + } +} diff --git a/service/appsync/api_op_GetDataSourceIntrospection.go b/service/appsync/api_op_GetDataSourceIntrospection.go index feafb011528..28f3426d7a9 100644 --- a/service/appsync/api_op_GetDataSourceIntrospection.go +++ b/service/appsync/api_op_GetDataSourceIntrospection.go @@ -38,9 +38,9 @@ type GetDataSourceIntrospectionInput struct { IntrospectionId *string // A boolean flag that determines whether SDL should be generated for introspected - // types or not. If set to true , each model will contain an sdl property that - // contains the SDL for that type. The SDL only contains the type data and no - // additional metadata or directives. + // types. If set to true , each model will contain an sdl property that contains + // the SDL for that type. The SDL only contains the type data and no additional + // metadata or directives. IncludeModelsSDL bool // The maximum number of introspected types that will be returned in a single diff --git a/service/appsync/api_op_ListApis.go b/service/appsync/api_op_ListApis.go new file mode 100644 index 00000000000..2fc70710e33 --- /dev/null +++ b/service/appsync/api_op_ListApis.go @@ -0,0 +1,251 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the APIs in your AppSync account. +// +// ListApis returns only the high level API details. For more detailed information +// about an API, use GetApi . +func (c *Client) ListApis(ctx context.Context, params *ListApisInput, optFns ...func(*Options)) (*ListApisOutput, error) { + if params == nil { + params = &ListApisInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListApis", params, optFns, c.addOperationListApisMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListApisOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListApisInput struct { + + // The maximum number of results that you want the request to return. + MaxResults int32 + + // An identifier that was returned from the previous call to this operation, which + // you can use to return the next set of items in the list. + NextToken *string + + noSmithyDocumentSerde +} + +type ListApisOutput struct { + + // The Api objects. + Apis []types.Api + + // An identifier that was returned from the previous call to this operation, which + // you can use to return the next set of items in the list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListApisMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListApis{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApis{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListApis"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApis(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListApisPaginatorOptions is the paginator options for ListApis +type ListApisPaginatorOptions struct { + // The maximum number of results that you want the request to return. + 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 +} + +// ListApisPaginator is a paginator for ListApis +type ListApisPaginator struct { + options ListApisPaginatorOptions + client ListApisAPIClient + params *ListApisInput + nextToken *string + firstPage bool +} + +// NewListApisPaginator returns a new ListApisPaginator +func NewListApisPaginator(client ListApisAPIClient, params *ListApisInput, optFns ...func(*ListApisPaginatorOptions)) *ListApisPaginator { + if params == nil { + params = &ListApisInput{} + } + + options := ListApisPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListApisPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApisPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListApis page. +func (p *ListApisPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApisOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListApis(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 +} + +// ListApisAPIClient is a client that implements the ListApis operation. +type ListApisAPIClient interface { + ListApis(context.Context, *ListApisInput, ...func(*Options)) (*ListApisOutput, error) +} + +var _ ListApisAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListApis(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListApis", + } +} diff --git a/service/appsync/api_op_ListChannelNamespaces.go b/service/appsync/api_op_ListChannelNamespaces.go new file mode 100644 index 00000000000..972c9807b04 --- /dev/null +++ b/service/appsync/api_op_ListChannelNamespaces.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the channel namespaces for a specified Api . +// +// ListChannelNamespaces returns only high level details for the channel +// namespace. To retrieve code handlers, use GetChannelNamespace . +func (c *Client) ListChannelNamespaces(ctx context.Context, params *ListChannelNamespacesInput, optFns ...func(*Options)) (*ListChannelNamespacesOutput, error) { + if params == nil { + params = &ListChannelNamespacesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListChannelNamespaces", params, optFns, c.addOperationListChannelNamespacesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListChannelNamespacesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListChannelNamespacesInput struct { + + // The Api ID. + // + // This member is required. + ApiId *string + + // The maximum number of results that you want the request to return. + MaxResults int32 + + // An identifier that was returned from the previous call to this operation, which + // you can use to return the next set of items in the list. + NextToken *string + + noSmithyDocumentSerde +} + +type ListChannelNamespacesOutput struct { + + // The ChannelNamespace objects. + ChannelNamespaces []types.ChannelNamespace + + // An identifier that was returned from the previous call to this operation, which + // you can use to return the next set of items in the list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListChannelNamespacesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListChannelNamespaces{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListChannelNamespaces{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListChannelNamespaces"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListChannelNamespacesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListChannelNamespaces(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListChannelNamespacesPaginatorOptions is the paginator options for +// ListChannelNamespaces +type ListChannelNamespacesPaginatorOptions struct { + // The maximum number of results that you want the request to return. + 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 +} + +// ListChannelNamespacesPaginator is a paginator for ListChannelNamespaces +type ListChannelNamespacesPaginator struct { + options ListChannelNamespacesPaginatorOptions + client ListChannelNamespacesAPIClient + params *ListChannelNamespacesInput + nextToken *string + firstPage bool +} + +// NewListChannelNamespacesPaginator returns a new ListChannelNamespacesPaginator +func NewListChannelNamespacesPaginator(client ListChannelNamespacesAPIClient, params *ListChannelNamespacesInput, optFns ...func(*ListChannelNamespacesPaginatorOptions)) *ListChannelNamespacesPaginator { + if params == nil { + params = &ListChannelNamespacesInput{} + } + + options := ListChannelNamespacesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListChannelNamespacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelNamespacesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListChannelNamespaces page. +func (p *ListChannelNamespacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelNamespacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListChannelNamespaces(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 +} + +// ListChannelNamespacesAPIClient is a client that implements the +// ListChannelNamespaces operation. +type ListChannelNamespacesAPIClient interface { + ListChannelNamespaces(context.Context, *ListChannelNamespacesInput, ...func(*Options)) (*ListChannelNamespacesOutput, error) +} + +var _ ListChannelNamespacesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListChannelNamespaces(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListChannelNamespaces", + } +} diff --git a/service/appsync/api_op_UpdateApi.go b/service/appsync/api_op_UpdateApi.go new file mode 100644 index 00000000000..18314c413d4 --- /dev/null +++ b/service/appsync/api_op_UpdateApi.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an Api . +func (c *Client) UpdateApi(ctx context.Context, params *UpdateApiInput, optFns ...func(*Options)) (*UpdateApiOutput, error) { + if params == nil { + params = &UpdateApiInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateApi", params, optFns, c.addOperationUpdateApiMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateApiOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateApiInput struct { + + // The Api ID. + // + // This member is required. + ApiId *string + + // The name of the Api. + // + // This member is required. + Name *string + + // The new event configuration. This includes the default authorization + // configuration for connecting, publishing, and subscribing to an Event API. + EventConfig *types.EventConfig + + // The owner contact information for the Api . + OwnerContact *string + + noSmithyDocumentSerde +} + +type UpdateApiOutput struct { + + // The Api object. + Api *types.Api + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateApiMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApi{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApi{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateApi"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateApiValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApi(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateApi(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateApi", + } +} diff --git a/service/appsync/api_op_UpdateChannelNamespace.go b/service/appsync/api_op_UpdateChannelNamespace.go new file mode 100644 index 00000000000..d545ba6f3d6 --- /dev/null +++ b/service/appsync/api_op_UpdateChannelNamespace.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/appsync/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a ChannelNamespace associated with an Api . +func (c *Client) UpdateChannelNamespace(ctx context.Context, params *UpdateChannelNamespaceInput, optFns ...func(*Options)) (*UpdateChannelNamespaceOutput, error) { + if params == nil { + params = &UpdateChannelNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateChannelNamespace", params, optFns, c.addOperationUpdateChannelNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateChannelNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateChannelNamespaceInput struct { + + // The Api ID. + // + // This member is required. + ApiId *string + + // The name of the ChannelNamespace . + // + // This member is required. + Name *string + + // The event handler functions that run custom business logic to process published + // events and subscribe requests. + CodeHandlers *string + + // The authorization mode to use for publishing messages on the channel namespace. + // This configuration overrides the default Api authorization configuration. + PublishAuthModes []types.AuthMode + + // The authorization mode to use for subscribing to messages on the channel + // namespace. This configuration overrides the default Api authorization + // configuration. + SubscribeAuthModes []types.AuthMode + + noSmithyDocumentSerde +} + +type UpdateChannelNamespaceOutput struct { + + // The ChannelNamespace object. + ChannelNamespace *types.ChannelNamespace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateChannelNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateChannelNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateChannelNamespace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateChannelNamespace"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateChannelNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateChannelNamespace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateChannelNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateChannelNamespace", + } +} diff --git a/service/appsync/api_op_UpdateGraphqlApi.go b/service/appsync/api_op_UpdateGraphqlApi.go index f1ccf0b2986..8da10c0882a 100644 --- a/service/appsync/api_op_UpdateGraphqlApi.go +++ b/service/appsync/api_op_UpdateGraphqlApi.go @@ -34,11 +34,6 @@ type UpdateGraphqlApiInput struct { // This member is required. ApiId *string - // The new authentication type for the GraphqlApi object. - // - // This member is required. - AuthenticationType types.AuthenticationType - // The new name for the GraphqlApi object. // // This member is required. @@ -47,6 +42,9 @@ type UpdateGraphqlApiInput struct { // A list of additional authentication providers for the GraphqlApi API. AdditionalAuthenticationProviders []types.AdditionalAuthenticationProvider + // The new authentication type for the GraphqlApi object. + AuthenticationType types.AuthenticationType + // The enhancedMetricsConfig object. EnhancedMetricsConfig *types.EnhancedMetricsConfig diff --git a/service/appsync/deserializers.go b/service/appsync/deserializers.go index 6b35b764979..f82894cef2a 100644 --- a/service/appsync/deserializers.go +++ b/service/appsync/deserializers.go @@ -524,14 +524,14 @@ func awsRestjson1_deserializeOpDocumentAssociateSourceGraphqlApiOutput(v **Assoc return nil } -type awsRestjson1_deserializeOpCreateApiCache struct { +type awsRestjson1_deserializeOpCreateApi struct { } -func (*awsRestjson1_deserializeOpCreateApiCache) ID() string { +func (*awsRestjson1_deserializeOpCreateApi) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateApiCache) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateApi) 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) @@ -549,9 +549,9 @@ func (m *awsRestjson1_deserializeOpCreateApiCache) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateApiCache(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateApi(response, &metadata) } - output := &CreateApiCacheOutput{} + output := &CreateApiOutput{} out.Result = output var buff [1024]byte @@ -572,7 +572,7 @@ func (m *awsRestjson1_deserializeOpCreateApiCache) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateApiCacheOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateApiOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -586,7 +586,7 @@ func (m *awsRestjson1_deserializeOpCreateApiCache) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateApiCache(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateApi(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)} @@ -636,8 +636,8 @@ func awsRestjson1_deserializeOpErrorCreateApiCache(response *smithyhttp.Response case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -652,7 +652,7 @@ func awsRestjson1_deserializeOpErrorCreateApiCache(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentCreateApiCacheOutput(v **CreateApiCacheOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateApiOutput(v **CreateApiOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -665,17 +665,17 @@ func awsRestjson1_deserializeOpDocumentCreateApiCacheOutput(v **CreateApiCacheOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateApiCacheOutput + var sv *CreateApiOutput if *v == nil { - sv = &CreateApiCacheOutput{} + sv = &CreateApiOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "apiCache": - if err := awsRestjson1_deserializeDocumentApiCache(&sv.ApiCache, value); err != nil { + case "api": + if err := awsRestjson1_deserializeDocumentApi(&sv.Api, value); err != nil { return err } @@ -688,14 +688,14 @@ func awsRestjson1_deserializeOpDocumentCreateApiCacheOutput(v **CreateApiCacheOu return nil } -type awsRestjson1_deserializeOpCreateApiKey struct { +type awsRestjson1_deserializeOpCreateApiCache struct { } -func (*awsRestjson1_deserializeOpCreateApiKey) ID() string { +func (*awsRestjson1_deserializeOpCreateApiCache) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateApiKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateApiCache) 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) @@ -713,9 +713,9 @@ func (m *awsRestjson1_deserializeOpCreateApiKey) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateApiKey(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateApiCache(response, &metadata) } - output := &CreateApiKeyOutput{} + output := &CreateApiCacheOutput{} out.Result = output var buff [1024]byte @@ -736,7 +736,7 @@ func (m *awsRestjson1_deserializeOpCreateApiKey) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateApiKeyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateApiCacheOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -750,7 +750,7 @@ func (m *awsRestjson1_deserializeOpCreateApiKey) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateApiKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateApiCache(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)} @@ -791,21 +791,15 @@ func awsRestjson1_deserializeOpErrorCreateApiKey(response *smithyhttp.Response, } switch { - case strings.EqualFold("ApiKeyLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorApiKeyLimitExceededException(response, errorBody) - - case strings.EqualFold("ApiKeyValidityOutOfBoundsException", errorCode): - return awsRestjson1_deserializeErrorApiKeyValidityOutOfBoundsException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -822,7 +816,7 @@ func awsRestjson1_deserializeOpErrorCreateApiKey(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentCreateApiKeyOutput(v **CreateApiKeyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateApiCacheOutput(v **CreateApiCacheOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -835,17 +829,17 @@ func awsRestjson1_deserializeOpDocumentCreateApiKeyOutput(v **CreateApiKeyOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateApiKeyOutput + var sv *CreateApiCacheOutput if *v == nil { - sv = &CreateApiKeyOutput{} + sv = &CreateApiCacheOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "apiKey": - if err := awsRestjson1_deserializeDocumentApiKey(&sv.ApiKey, value); err != nil { + case "apiCache": + if err := awsRestjson1_deserializeDocumentApiCache(&sv.ApiCache, value); err != nil { return err } @@ -858,14 +852,14 @@ func awsRestjson1_deserializeOpDocumentCreateApiKeyOutput(v **CreateApiKeyOutput return nil } -type awsRestjson1_deserializeOpCreateDataSource struct { +type awsRestjson1_deserializeOpCreateApiKey struct { } -func (*awsRestjson1_deserializeOpCreateDataSource) ID() string { +func (*awsRestjson1_deserializeOpCreateApiKey) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateApiKey) 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) @@ -883,9 +877,9 @@ func (m *awsRestjson1_deserializeOpCreateDataSource) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateApiKey(response, &metadata) } - output := &CreateDataSourceOutput{} + output := &CreateApiKeyOutput{} out.Result = output var buff [1024]byte @@ -906,7 +900,7 @@ func (m *awsRestjson1_deserializeOpCreateDataSource) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateApiKeyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -920,7 +914,7 @@ func (m *awsRestjson1_deserializeOpCreateDataSource) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateApiKey(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)} @@ -961,15 +955,21 @@ func awsRestjson1_deserializeOpErrorCreateDataSource(response *smithyhttp.Respon } switch { + case strings.EqualFold("ApiKeyLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorApiKeyLimitExceededException(response, errorBody) + + case strings.EqualFold("ApiKeyValidityOutOfBoundsException", errorCode): + return awsRestjson1_deserializeErrorApiKeyValidityOutOfBoundsException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -986,7 +986,7 @@ func awsRestjson1_deserializeOpErrorCreateDataSource(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(v **CreateDataSourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateApiKeyOutput(v **CreateApiKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -999,17 +999,17 @@ func awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(v **CreateDataSour return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateDataSourceOutput + var sv *CreateApiKeyOutput if *v == nil { - sv = &CreateDataSourceOutput{} + sv = &CreateApiKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSource": - if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { + case "apiKey": + if err := awsRestjson1_deserializeDocumentApiKey(&sv.ApiKey, value); err != nil { return err } @@ -1022,14 +1022,14 @@ func awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(v **CreateDataSour return nil } -type awsRestjson1_deserializeOpCreateDomainName struct { +type awsRestjson1_deserializeOpCreateChannelNamespace struct { } -func (*awsRestjson1_deserializeOpCreateDomainName) ID() string { +func (*awsRestjson1_deserializeOpCreateChannelNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateDomainName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateChannelNamespace) 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) @@ -1047,9 +1047,9 @@ func (m *awsRestjson1_deserializeOpCreateDomainName) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateDomainName(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateChannelNamespace(response, &metadata) } - output := &CreateDomainNameOutput{} + output := &CreateChannelNamespaceOutput{} out.Result = output var buff [1024]byte @@ -1070,7 +1070,7 @@ func (m *awsRestjson1_deserializeOpCreateDomainName) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateChannelNamespaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1084,7 +1084,7 @@ func (m *awsRestjson1_deserializeOpCreateDomainName) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateDomainName(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateChannelNamespace(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)} @@ -1125,15 +1125,27 @@ func awsRestjson1_deserializeOpErrorCreateDomainName(response *smithyhttp.Respon } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1144,7 +1156,7 @@ func awsRestjson1_deserializeOpErrorCreateDomainName(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNameOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateChannelNamespaceOutput(v **CreateChannelNamespaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1157,17 +1169,17 @@ func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNa return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateDomainNameOutput + var sv *CreateChannelNamespaceOutput if *v == nil { - sv = &CreateDomainNameOutput{} + sv = &CreateChannelNamespaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "domainNameConfig": - if err := awsRestjson1_deserializeDocumentDomainNameConfig(&sv.DomainNameConfig, value); err != nil { + case "channelNamespace": + if err := awsRestjson1_deserializeDocumentChannelNamespace(&sv.ChannelNamespace, value); err != nil { return err } @@ -1180,14 +1192,14 @@ func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNa return nil } -type awsRestjson1_deserializeOpCreateFunction struct { +type awsRestjson1_deserializeOpCreateDataSource struct { } -func (*awsRestjson1_deserializeOpCreateFunction) ID() string { +func (*awsRestjson1_deserializeOpCreateDataSource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateDataSource) 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) @@ -1205,9 +1217,9 @@ func (m *awsRestjson1_deserializeOpCreateFunction) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateFunction(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateDataSource(response, &metadata) } - output := &CreateFunctionOutput{} + output := &CreateDataSourceOutput{} out.Result = output var buff [1024]byte @@ -1228,7 +1240,7 @@ func (m *awsRestjson1_deserializeOpCreateFunction) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateFunctionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1242,7 +1254,7 @@ func (m *awsRestjson1_deserializeOpCreateFunction) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateDataSource(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)} @@ -1308,7 +1320,7 @@ func awsRestjson1_deserializeOpErrorCreateFunction(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentCreateFunctionOutput(v **CreateFunctionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(v **CreateDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1321,17 +1333,17 @@ func awsRestjson1_deserializeOpDocumentCreateFunctionOutput(v **CreateFunctionOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateFunctionOutput + var sv *CreateDataSourceOutput if *v == nil { - sv = &CreateFunctionOutput{} + sv = &CreateDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "functionConfiguration": - if err := awsRestjson1_deserializeDocumentFunctionConfiguration(&sv.FunctionConfiguration, value); err != nil { + case "dataSource": + if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { return err } @@ -1344,14 +1356,14 @@ func awsRestjson1_deserializeOpDocumentCreateFunctionOutput(v **CreateFunctionOu return nil } -type awsRestjson1_deserializeOpCreateGraphqlApi struct { +type awsRestjson1_deserializeOpCreateDomainName struct { } -func (*awsRestjson1_deserializeOpCreateGraphqlApi) ID() string { +func (*awsRestjson1_deserializeOpCreateDomainName) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateGraphqlApi) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateDomainName) 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) @@ -1369,9 +1381,9 @@ func (m *awsRestjson1_deserializeOpCreateGraphqlApi) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateGraphqlApi(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateDomainName(response, &metadata) } - output := &CreateGraphqlApiOutput{} + output := &CreateDomainNameOutput{} out.Result = output var buff [1024]byte @@ -1392,7 +1404,7 @@ func (m *awsRestjson1_deserializeOpCreateGraphqlApi) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateGraphqlApiOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1406,7 +1418,7 @@ func (m *awsRestjson1_deserializeOpCreateGraphqlApi) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateGraphqlApi(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateDomainName(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)} @@ -1447,24 +1459,15 @@ func awsRestjson1_deserializeOpErrorCreateGraphqlApi(response *smithyhttp.Respon } switch { - case strings.EqualFold("ApiLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorApiLimitExceededException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1475,7 +1478,7 @@ func awsRestjson1_deserializeOpErrorCreateGraphqlApi(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentCreateGraphqlApiOutput(v **CreateGraphqlApiOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNameOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1488,17 +1491,17 @@ func awsRestjson1_deserializeOpDocumentCreateGraphqlApiOutput(v **CreateGraphqlA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateGraphqlApiOutput + var sv *CreateDomainNameOutput if *v == nil { - sv = &CreateGraphqlApiOutput{} + sv = &CreateDomainNameOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "graphqlApi": - if err := awsRestjson1_deserializeDocumentGraphqlApi(&sv.GraphqlApi, value); err != nil { + case "domainNameConfig": + if err := awsRestjson1_deserializeDocumentDomainNameConfig(&sv.DomainNameConfig, value); err != nil { return err } @@ -1511,14 +1514,14 @@ func awsRestjson1_deserializeOpDocumentCreateGraphqlApiOutput(v **CreateGraphqlA return nil } -type awsRestjson1_deserializeOpCreateResolver struct { +type awsRestjson1_deserializeOpCreateFunction struct { } -func (*awsRestjson1_deserializeOpCreateResolver) ID() string { +func (*awsRestjson1_deserializeOpCreateFunction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateResolver) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFunction) 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) @@ -1536,9 +1539,9 @@ func (m *awsRestjson1_deserializeOpCreateResolver) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateResolver(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFunction(response, &metadata) } - output := &CreateResolverOutput{} + output := &CreateFunctionOutput{} out.Result = output var buff [1024]byte @@ -1559,7 +1562,7 @@ func (m *awsRestjson1_deserializeOpCreateResolver) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateResolverOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateFunctionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1573,7 +1576,7 @@ func (m *awsRestjson1_deserializeOpCreateResolver) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateResolver(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFunction(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)} @@ -1639,7 +1642,7 @@ func awsRestjson1_deserializeOpErrorCreateResolver(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentCreateResolverOutput(v **CreateResolverOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateFunctionOutput(v **CreateFunctionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1652,17 +1655,17 @@ func awsRestjson1_deserializeOpDocumentCreateResolverOutput(v **CreateResolverOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateResolverOutput + var sv *CreateFunctionOutput if *v == nil { - sv = &CreateResolverOutput{} + sv = &CreateFunctionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "resolver": - if err := awsRestjson1_deserializeDocumentResolver(&sv.Resolver, value); err != nil { + case "functionConfiguration": + if err := awsRestjson1_deserializeDocumentFunctionConfiguration(&sv.FunctionConfiguration, value); err != nil { return err } @@ -1675,14 +1678,14 @@ func awsRestjson1_deserializeOpDocumentCreateResolverOutput(v **CreateResolverOu return nil } -type awsRestjson1_deserializeOpCreateType struct { +type awsRestjson1_deserializeOpCreateGraphqlApi struct { } -func (*awsRestjson1_deserializeOpCreateType) ID() string { +func (*awsRestjson1_deserializeOpCreateGraphqlApi) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateGraphqlApi) 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) @@ -1700,9 +1703,9 @@ func (m *awsRestjson1_deserializeOpCreateType) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateGraphqlApi(response, &metadata) } - output := &CreateTypeOutput{} + output := &CreateGraphqlApiOutput{} out.Result = output var buff [1024]byte @@ -1723,7 +1726,7 @@ func (m *awsRestjson1_deserializeOpCreateType) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateTypeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateGraphqlApiOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1737,7 +1740,7 @@ func (m *awsRestjson1_deserializeOpCreateType) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateGraphqlApi(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)} @@ -1778,6 +1781,9 @@ func awsRestjson1_deserializeOpErrorCreateType(response *smithyhttp.Response, me } switch { + case strings.EqualFold("ApiLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorApiLimitExceededException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) @@ -1787,8 +1793,8 @@ func awsRestjson1_deserializeOpErrorCreateType(response *smithyhttp.Response, me case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -1803,7 +1809,7 @@ func awsRestjson1_deserializeOpErrorCreateType(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentCreateTypeOutput(v **CreateTypeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateGraphqlApiOutput(v **CreateGraphqlApiOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1816,17 +1822,17 @@ func awsRestjson1_deserializeOpDocumentCreateTypeOutput(v **CreateTypeOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateTypeOutput + var sv *CreateGraphqlApiOutput if *v == nil { - sv = &CreateTypeOutput{} + sv = &CreateGraphqlApiOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "type": - if err := awsRestjson1_deserializeDocumentType(&sv.Type, value); err != nil { + case "graphqlApi": + if err := awsRestjson1_deserializeDocumentGraphqlApi(&sv.GraphqlApi, value); err != nil { return err } @@ -1839,14 +1845,14 @@ func awsRestjson1_deserializeOpDocumentCreateTypeOutput(v **CreateTypeOutput, va return nil } -type awsRestjson1_deserializeOpDeleteApiCache struct { +type awsRestjson1_deserializeOpCreateResolver struct { } -func (*awsRestjson1_deserializeOpDeleteApiCache) ID() string { +func (*awsRestjson1_deserializeOpCreateResolver) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteApiCache) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateResolver) 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) @@ -1864,28 +1870,56 @@ func (m *awsRestjson1_deserializeOpDeleteApiCache) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteApiCache(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateResolver(response, &metadata) } - output := &DeleteApiCacheOutput{} + output := &CreateResolverOutput{} out.Result = output - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteApiCache(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()) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) - errorCode := "UnknownError" - errorMessage := errorCode + body := io.TeeReader(response.Body, ringBuffer) - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) + 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_deserializeOpDocumentCreateResolverOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateResolver(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 @@ -1939,14 +1973,50 @@ func awsRestjson1_deserializeOpErrorDeleteApiCache(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpDeleteApiKey struct { +func awsRestjson1_deserializeOpDocumentCreateResolverOutput(v **CreateResolverOutput, 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 *CreateResolverOutput + if *v == nil { + sv = &CreateResolverOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "resolver": + if err := awsRestjson1_deserializeDocumentResolver(&sv.Resolver, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteApiKey) ID() string { +type awsRestjson1_deserializeOpCreateType struct { +} + +func (*awsRestjson1_deserializeOpCreateType) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteApiKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateType) 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) @@ -1964,16 +2034,44 @@ func (m *awsRestjson1_deserializeOpDeleteApiKey) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteApiKey(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateType(response, &metadata) } - output := &DeleteApiKeyOutput{} + output := &CreateTypeOutput{} 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_deserializeOpDocumentCreateTypeOutput(&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(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteApiKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateType(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)} @@ -2017,6 +2115,9 @@ func awsRestjson1_deserializeOpErrorDeleteApiKey(response *smithyhttp.Response, case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -2036,14 +2137,50 @@ func awsRestjson1_deserializeOpErrorDeleteApiKey(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeleteDataSource struct { +func awsRestjson1_deserializeOpDocumentCreateTypeOutput(v **CreateTypeOutput, 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 *CreateTypeOutput + if *v == nil { + sv = &CreateTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "type": + if err := awsRestjson1_deserializeDocumentType(&sv.Type, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string { +type awsRestjson1_deserializeOpDeleteApi struct { +} + +func (*awsRestjson1_deserializeOpDeleteApi) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteApi) 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) @@ -2061,16 +2198,16 @@ func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteApi(response, &metadata) } - output := &DeleteDataSourceOutput{} + output := &DeleteApiOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteApi(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)} @@ -2111,6 +2248,9 @@ func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Respon } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) @@ -2136,14 +2276,14 @@ func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Respon } } -type awsRestjson1_deserializeOpDeleteDomainName struct { +type awsRestjson1_deserializeOpDeleteApiCache struct { } -func (*awsRestjson1_deserializeOpDeleteDomainName) ID() string { +func (*awsRestjson1_deserializeOpDeleteApiCache) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDomainName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteApiCache) 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) @@ -2161,16 +2301,16 @@ func (m *awsRestjson1_deserializeOpDeleteDomainName) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDomainName(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteApiCache(response, &metadata) } - output := &DeleteDomainNameOutput{} + output := &DeleteApiCacheOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDomainName(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteApiCache(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)} @@ -2211,9 +2351,6 @@ func awsRestjson1_deserializeOpErrorDeleteDomainName(response *smithyhttp.Respon } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) @@ -2226,6 +2363,9 @@ func awsRestjson1_deserializeOpErrorDeleteDomainName(response *smithyhttp.Respon case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2236,14 +2376,14 @@ func awsRestjson1_deserializeOpErrorDeleteDomainName(response *smithyhttp.Respon } } -type awsRestjson1_deserializeOpDeleteFunction struct { +type awsRestjson1_deserializeOpDeleteApiKey struct { } -func (*awsRestjson1_deserializeOpDeleteFunction) ID() string { +func (*awsRestjson1_deserializeOpDeleteApiKey) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteApiKey) 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) @@ -2261,16 +2401,16 @@ func (m *awsRestjson1_deserializeOpDeleteFunction) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteFunction(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteApiKey(response, &metadata) } - output := &DeleteFunctionOutput{} + output := &DeleteApiKeyOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteApiKey(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)} @@ -2314,9 +2454,6 @@ func awsRestjson1_deserializeOpErrorDeleteFunction(response *smithyhttp.Response case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -2336,14 +2473,14 @@ func awsRestjson1_deserializeOpErrorDeleteFunction(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpDeleteGraphqlApi struct { +type awsRestjson1_deserializeOpDeleteChannelNamespace struct { } -func (*awsRestjson1_deserializeOpDeleteGraphqlApi) ID() string { +func (*awsRestjson1_deserializeOpDeleteChannelNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteGraphqlApi) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteChannelNamespace) 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) @@ -2361,16 +2498,16 @@ func (m *awsRestjson1_deserializeOpDeleteGraphqlApi) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteGraphqlApi(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteChannelNamespace(response, &metadata) } - output := &DeleteGraphqlApiOutput{} + output := &DeleteChannelNamespaceOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteGraphqlApi(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteChannelNamespace(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)} @@ -2439,14 +2576,14 @@ func awsRestjson1_deserializeOpErrorDeleteGraphqlApi(response *smithyhttp.Respon } } -type awsRestjson1_deserializeOpDeleteResolver struct { +type awsRestjson1_deserializeOpDeleteDataSource struct { } -func (*awsRestjson1_deserializeOpDeleteResolver) ID() string { +func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteResolver) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDataSource) 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) @@ -2464,16 +2601,16 @@ func (m *awsRestjson1_deserializeOpDeleteResolver) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteResolver(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataSource(response, &metadata) } - output := &DeleteResolverOutput{} + output := &DeleteDataSourceOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteResolver(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDataSource(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)} @@ -2539,14 +2676,14 @@ func awsRestjson1_deserializeOpErrorDeleteResolver(response *smithyhttp.Response } } -type awsRestjson1_deserializeOpDeleteType struct { +type awsRestjson1_deserializeOpDeleteDomainName struct { } -func (*awsRestjson1_deserializeOpDeleteType) ID() string { +func (*awsRestjson1_deserializeOpDeleteDomainName) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDomainName) 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) @@ -2564,16 +2701,16 @@ func (m *awsRestjson1_deserializeOpDeleteType) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDomainName(response, &metadata) } - output := &DeleteTypeOutput{} + output := &DeleteDomainNameOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDomainName(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)} @@ -2614,6 +2751,9 @@ func awsRestjson1_deserializeOpErrorDeleteType(response *smithyhttp.Response, me } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) @@ -2626,9 +2766,6 @@ func awsRestjson1_deserializeOpErrorDeleteType(response *smithyhttp.Response, me case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2639,14 +2776,14 @@ func awsRestjson1_deserializeOpErrorDeleteType(response *smithyhttp.Response, me } } -type awsRestjson1_deserializeOpDisassociateApi struct { +type awsRestjson1_deserializeOpDeleteFunction struct { } -func (*awsRestjson1_deserializeOpDisassociateApi) ID() string { +func (*awsRestjson1_deserializeOpDeleteFunction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateApi) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFunction) 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) @@ -2664,16 +2801,16 @@ func (m *awsRestjson1_deserializeOpDisassociateApi) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateApi(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFunction(response, &metadata) } - output := &DisassociateApiOutput{} + output := &DeleteFunctionOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateApi(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteFunction(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)} @@ -2714,9 +2851,6 @@ func awsRestjson1_deserializeOpErrorDisassociateApi(response *smithyhttp.Respons } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) @@ -2729,6 +2863,9 @@ func awsRestjson1_deserializeOpErrorDisassociateApi(response *smithyhttp.Respons case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2739,14 +2876,925 @@ func awsRestjson1_deserializeOpErrorDisassociateApi(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDisassociateMergedGraphqlApi struct { +type awsRestjson1_deserializeOpDeleteGraphqlApi struct { } -func (*awsRestjson1_deserializeOpDisassociateMergedGraphqlApi) ID() string { +func (*awsRestjson1_deserializeOpDeleteGraphqlApi) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateMergedGraphqlApi) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteGraphqlApi) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDeleteGraphqlApi(response, &metadata) + } + output := &DeleteGraphqlApiOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteGraphqlApi(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteResolver struct { +} + +func (*awsRestjson1_deserializeOpDeleteResolver) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteResolver) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDeleteResolver(response, &metadata) + } + output := &DeleteResolverOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteResolver(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteType struct { +} + +func (*awsRestjson1_deserializeOpDeleteType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteType) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDeleteType(response, &metadata) + } + output := &DeleteTypeOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteType(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociateApi struct { +} + +func (*awsRestjson1_deserializeOpDisassociateApi) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateApi) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDisassociateApi(response, &metadata) + } + output := &DisassociateApiOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateApi(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociateMergedGraphqlApi struct { +} + +func (*awsRestjson1_deserializeOpDisassociateMergedGraphqlApi) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateMergedGraphqlApi) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDisassociateMergedGraphqlApi(response, &metadata) + } + output := &DisassociateMergedGraphqlApiOutput{} + 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_deserializeOpDocumentDisassociateMergedGraphqlApiOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateMergedGraphqlApi(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDisassociateMergedGraphqlApiOutput(v **DisassociateMergedGraphqlApiOutput, 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 *DisassociateMergedGraphqlApiOutput + if *v == nil { + sv = &DisassociateMergedGraphqlApiOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sourceApiAssociationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceApiAssociationStatus to be of type string, got %T instead", value) + } + sv.SourceApiAssociationStatus = types.SourceApiAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDisassociateSourceGraphqlApi struct { +} + +func (*awsRestjson1_deserializeOpDisassociateSourceGraphqlApi) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateSourceGraphqlApi) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDisassociateSourceGraphqlApi(response, &metadata) + } + output := &DisassociateSourceGraphqlApiOutput{} + 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_deserializeOpDocumentDisassociateSourceGraphqlApiOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateSourceGraphqlApi(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDisassociateSourceGraphqlApiOutput(v **DisassociateSourceGraphqlApiOutput, 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 *DisassociateSourceGraphqlApiOutput + if *v == nil { + sv = &DisassociateSourceGraphqlApiOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sourceApiAssociationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceApiAssociationStatus to be of type string, got %T instead", value) + } + sv.SourceApiAssociationStatus = types.SourceApiAssociationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpEvaluateCode struct { +} + +func (*awsRestjson1_deserializeOpEvaluateCode) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpEvaluateCode) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorEvaluateCode(response, &metadata) + } + output := &EvaluateCodeOutput{} + 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_deserializeOpDocumentEvaluateCodeOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorEvaluateCode(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentEvaluateCodeOutput(v **EvaluateCodeOutput, 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 *EvaluateCodeOutput + if *v == nil { + sv = &EvaluateCodeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if err := awsRestjson1_deserializeDocumentEvaluateCodeErrorDetail(&sv.Error, value); err != nil { + return err + } + + case "evaluationResult": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EvaluationResult to be of type string, got %T instead", value) + } + sv.EvaluationResult = ptr.String(jtv) + } + + case "logs": + if err := awsRestjson1_deserializeDocumentLogs(&sv.Logs, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpEvaluateMappingTemplate struct { +} + +func (*awsRestjson1_deserializeOpEvaluateMappingTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpEvaluateMappingTemplate) 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) @@ -2764,9 +3812,9 @@ func (m *awsRestjson1_deserializeOpDisassociateMergedGraphqlApi) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateMergedGraphqlApi(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorEvaluateMappingTemplate(response, &metadata) } - output := &DisassociateMergedGraphqlApiOutput{} + output := &EvaluateMappingTemplateOutput{} out.Result = output var buff [1024]byte @@ -2787,7 +3835,7 @@ func (m *awsRestjson1_deserializeOpDisassociateMergedGraphqlApi) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDisassociateMergedGraphqlApiOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentEvaluateMappingTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2801,7 +3849,7 @@ func (m *awsRestjson1_deserializeOpDisassociateMergedGraphqlApi) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateMergedGraphqlApi(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorEvaluateMappingTemplate(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)} @@ -2842,21 +3890,15 @@ func awsRestjson1_deserializeOpErrorDisassociateMergedGraphqlApi(response *smith } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2867,7 +3909,7 @@ func awsRestjson1_deserializeOpErrorDisassociateMergedGraphqlApi(response *smith } } -func awsRestjson1_deserializeOpDocumentDisassociateMergedGraphqlApiOutput(v **DisassociateMergedGraphqlApiOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentEvaluateMappingTemplateOutput(v **EvaluateMappingTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2880,22 +3922,32 @@ func awsRestjson1_deserializeOpDocumentDisassociateMergedGraphqlApiOutput(v **Di return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DisassociateMergedGraphqlApiOutput + var sv *EvaluateMappingTemplateOutput if *v == nil { - sv = &DisassociateMergedGraphqlApiOutput{} + sv = &EvaluateMappingTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "sourceApiAssociationStatus": + case "error": + if err := awsRestjson1_deserializeDocumentErrorDetail(&sv.Error, value); err != nil { + return err + } + + case "evaluationResult": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SourceApiAssociationStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected EvaluationResult to be of type string, got %T instead", value) } - sv.SourceApiAssociationStatus = types.SourceApiAssociationStatus(jtv) + sv.EvaluationResult = ptr.String(jtv) + } + + case "logs": + if err := awsRestjson1_deserializeDocumentLogs(&sv.Logs, value); err != nil { + return err } default: @@ -2903,18 +3955,118 @@ func awsRestjson1_deserializeOpDocumentDisassociateMergedGraphqlApiOutput(v **Di } } - *v = sv - return nil + *v = sv + return nil +} + +type awsRestjson1_deserializeOpFlushApiCache struct { +} + +func (*awsRestjson1_deserializeOpFlushApiCache) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpFlushApiCache) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorFlushApiCache(response, &metadata) + } + output := &FlushApiCacheOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorFlushApiCache(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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -type awsRestjson1_deserializeOpDisassociateSourceGraphqlApi struct { +type awsRestjson1_deserializeOpGetApi struct { } -func (*awsRestjson1_deserializeOpDisassociateSourceGraphqlApi) ID() string { +func (*awsRestjson1_deserializeOpGetApi) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateSourceGraphqlApi) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetApi) 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) @@ -2932,9 +4084,9 @@ func (m *awsRestjson1_deserializeOpDisassociateSourceGraphqlApi) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateSourceGraphqlApi(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetApi(response, &metadata) } - output := &DisassociateSourceGraphqlApiOutput{} + output := &GetApiOutput{} out.Result = output var buff [1024]byte @@ -2955,7 +4107,7 @@ func (m *awsRestjson1_deserializeOpDisassociateSourceGraphqlApi) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDisassociateSourceGraphqlApiOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetApiOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2969,7 +4121,7 @@ func (m *awsRestjson1_deserializeOpDisassociateSourceGraphqlApi) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateSourceGraphqlApi(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetApi(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)} @@ -3010,12 +4162,12 @@ func awsRestjson1_deserializeOpErrorDisassociateSourceGraphqlApi(response *smith } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -3035,7 +4187,7 @@ func awsRestjson1_deserializeOpErrorDisassociateSourceGraphqlApi(response *smith } } -func awsRestjson1_deserializeOpDocumentDisassociateSourceGraphqlApiOutput(v **DisassociateSourceGraphqlApiOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetApiOutput(v **GetApiOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3048,22 +4200,18 @@ func awsRestjson1_deserializeOpDocumentDisassociateSourceGraphqlApiOutput(v **Di return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DisassociateSourceGraphqlApiOutput + var sv *GetApiOutput if *v == nil { - sv = &DisassociateSourceGraphqlApiOutput{} + sv = &GetApiOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "sourceApiAssociationStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SourceApiAssociationStatus to be of type string, got %T instead", value) - } - sv.SourceApiAssociationStatus = types.SourceApiAssociationStatus(jtv) + case "api": + if err := awsRestjson1_deserializeDocumentApi(&sv.Api, value); err != nil { + return err } default: @@ -3075,14 +4223,14 @@ func awsRestjson1_deserializeOpDocumentDisassociateSourceGraphqlApiOutput(v **Di return nil } -type awsRestjson1_deserializeOpEvaluateCode struct { +type awsRestjson1_deserializeOpGetApiAssociation struct { } -func (*awsRestjson1_deserializeOpEvaluateCode) ID() string { +func (*awsRestjson1_deserializeOpGetApiAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEvaluateCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetApiAssociation) 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) @@ -3100,9 +4248,9 @@ func (m *awsRestjson1_deserializeOpEvaluateCode) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEvaluateCode(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetApiAssociation(response, &metadata) } - output := &EvaluateCodeOutput{} + output := &GetApiAssociationOutput{} out.Result = output var buff [1024]byte @@ -3123,7 +4271,7 @@ func (m *awsRestjson1_deserializeOpEvaluateCode) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentEvaluateCodeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetApiAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3137,7 +4285,7 @@ func (m *awsRestjson1_deserializeOpEvaluateCode) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorEvaluateCode(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetApiAssociation(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)} @@ -3187,6 +4335,9 @@ func awsRestjson1_deserializeOpErrorEvaluateCode(response *smithyhttp.Response, case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3197,7 +4348,7 @@ func awsRestjson1_deserializeOpErrorEvaluateCode(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentEvaluateCodeOutput(v **EvaluateCodeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetApiAssociationOutput(v **GetApiAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3210,31 +4361,17 @@ func awsRestjson1_deserializeOpDocumentEvaluateCodeOutput(v **EvaluateCodeOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *EvaluateCodeOutput + var sv *GetApiAssociationOutput if *v == nil { - sv = &EvaluateCodeOutput{} + sv = &GetApiAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "error": - if err := awsRestjson1_deserializeDocumentEvaluateCodeErrorDetail(&sv.Error, value); err != nil { - return err - } - - case "evaluationResult": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EvaluationResult to be of type string, got %T instead", value) - } - sv.EvaluationResult = ptr.String(jtv) - } - - case "logs": - if err := awsRestjson1_deserializeDocumentLogs(&sv.Logs, value); err != nil { + case "apiAssociation": + if err := awsRestjson1_deserializeDocumentApiAssociation(&sv.ApiAssociation, value); err != nil { return err } @@ -3247,14 +4384,14 @@ func awsRestjson1_deserializeOpDocumentEvaluateCodeOutput(v **EvaluateCodeOutput return nil } -type awsRestjson1_deserializeOpEvaluateMappingTemplate struct { +type awsRestjson1_deserializeOpGetApiCache struct { } -func (*awsRestjson1_deserializeOpEvaluateMappingTemplate) ID() string { +func (*awsRestjson1_deserializeOpGetApiCache) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpEvaluateMappingTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetApiCache) 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) @@ -3272,9 +4409,9 @@ func (m *awsRestjson1_deserializeOpEvaluateMappingTemplate) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorEvaluateMappingTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetApiCache(response, &metadata) } - output := &EvaluateMappingTemplateOutput{} + output := &GetApiCacheOutput{} out.Result = output var buff [1024]byte @@ -3295,7 +4432,7 @@ func (m *awsRestjson1_deserializeOpEvaluateMappingTemplate) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentEvaluateMappingTemplateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetApiCacheOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3309,7 +4446,7 @@ func (m *awsRestjson1_deserializeOpEvaluateMappingTemplate) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorEvaluateMappingTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetApiCache(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)} @@ -3350,15 +4487,21 @@ func awsRestjson1_deserializeOpErrorEvaluateMappingTemplate(response *smithyhttp } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3369,7 +4512,7 @@ func awsRestjson1_deserializeOpErrorEvaluateMappingTemplate(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentEvaluateMappingTemplateOutput(v **EvaluateMappingTemplateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetApiCacheOutput(v **GetApiCacheOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3382,31 +4525,17 @@ func awsRestjson1_deserializeOpDocumentEvaluateMappingTemplateOutput(v **Evaluat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *EvaluateMappingTemplateOutput + var sv *GetApiCacheOutput if *v == nil { - sv = &EvaluateMappingTemplateOutput{} + sv = &GetApiCacheOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "error": - if err := awsRestjson1_deserializeDocumentErrorDetail(&sv.Error, value); err != nil { - return err - } - - case "evaluationResult": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EvaluationResult to be of type string, got %T instead", value) - } - sv.EvaluationResult = ptr.String(jtv) - } - - case "logs": - if err := awsRestjson1_deserializeDocumentLogs(&sv.Logs, value); err != nil { + case "apiCache": + if err := awsRestjson1_deserializeDocumentApiCache(&sv.ApiCache, value); err != nil { return err } @@ -3419,14 +4548,14 @@ func awsRestjson1_deserializeOpDocumentEvaluateMappingTemplateOutput(v **Evaluat return nil } -type awsRestjson1_deserializeOpFlushApiCache struct { +type awsRestjson1_deserializeOpGetChannelNamespace struct { } -func (*awsRestjson1_deserializeOpFlushApiCache) ID() string { +func (*awsRestjson1_deserializeOpGetChannelNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpFlushApiCache) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetChannelNamespace) 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) @@ -3444,16 +4573,44 @@ func (m *awsRestjson1_deserializeOpFlushApiCache) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorFlushApiCache(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetChannelNamespace(response, &metadata) } - output := &FlushApiCacheOutput{} + output := &GetChannelNamespaceOutput{} 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_deserializeOpDocumentGetChannelNamespaceOutput(&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(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorFlushApiCache(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetChannelNamespace(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)} @@ -3494,12 +4651,12 @@ func awsRestjson1_deserializeOpErrorFlushApiCache(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -3519,14 +4676,50 @@ func awsRestjson1_deserializeOpErrorFlushApiCache(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpGetApiAssociation struct { +func awsRestjson1_deserializeOpDocumentGetChannelNamespaceOutput(v **GetChannelNamespaceOutput, 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 *GetChannelNamespaceOutput + if *v == nil { + sv = &GetChannelNamespaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "channelNamespace": + if err := awsRestjson1_deserializeDocumentChannelNamespace(&sv.ChannelNamespace, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpGetApiAssociation) ID() string { +type awsRestjson1_deserializeOpGetDataSource struct { +} + +func (*awsRestjson1_deserializeOpGetDataSource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetApiAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDataSource) 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) @@ -3544,9 +4737,9 @@ func (m *awsRestjson1_deserializeOpGetApiAssociation) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetApiAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDataSource(response, &metadata) } - output := &GetApiAssociationOutput{} + output := &GetDataSourceOutput{} out.Result = output var buff [1024]byte @@ -3567,7 +4760,7 @@ func (m *awsRestjson1_deserializeOpGetApiAssociation) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetApiAssociationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDataSourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3581,7 +4774,7 @@ func (m *awsRestjson1_deserializeOpGetApiAssociation) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetApiAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDataSource(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)} @@ -3622,18 +4815,21 @@ func awsRestjson1_deserializeOpErrorGetApiAssociation(response *smithyhttp.Respo } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3644,7 +4840,7 @@ func awsRestjson1_deserializeOpErrorGetApiAssociation(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetApiAssociationOutput(v **GetApiAssociationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3657,17 +4853,17 @@ func awsRestjson1_deserializeOpDocumentGetApiAssociationOutput(v **GetApiAssocia return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetApiAssociationOutput + var sv *GetDataSourceOutput if *v == nil { - sv = &GetApiAssociationOutput{} + sv = &GetDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "apiAssociation": - if err := awsRestjson1_deserializeDocumentApiAssociation(&sv.ApiAssociation, value); err != nil { + case "dataSource": + if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { return err } @@ -3680,14 +4876,14 @@ func awsRestjson1_deserializeOpDocumentGetApiAssociationOutput(v **GetApiAssocia return nil } -type awsRestjson1_deserializeOpGetApiCache struct { +type awsRestjson1_deserializeOpGetDataSourceIntrospection struct { } -func (*awsRestjson1_deserializeOpGetApiCache) ID() string { +func (*awsRestjson1_deserializeOpGetDataSourceIntrospection) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetApiCache) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDataSourceIntrospection) 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) @@ -3705,9 +4901,9 @@ func (m *awsRestjson1_deserializeOpGetApiCache) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetApiCache(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDataSourceIntrospection(response, &metadata) } - output := &GetApiCacheOutput{} + output := &GetDataSourceIntrospectionOutput{} out.Result = output var buff [1024]byte @@ -3728,7 +4924,7 @@ func (m *awsRestjson1_deserializeOpGetApiCache) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetApiCacheOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDataSourceIntrospectionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3742,7 +4938,7 @@ func (m *awsRestjson1_deserializeOpGetApiCache) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetApiCache(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDataSourceIntrospection(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)} @@ -3786,18 +4982,12 @@ func awsRestjson1_deserializeOpErrorGetApiCache(response *smithyhttp.Response, m case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3808,7 +4998,7 @@ func awsRestjson1_deserializeOpErrorGetApiCache(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentGetApiCacheOutput(v **GetApiCacheOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDataSourceIntrospectionOutput(v **GetDataSourceIntrospectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3821,20 +5011,47 @@ func awsRestjson1_deserializeOpDocumentGetApiCacheOutput(v **GetApiCacheOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetApiCacheOutput + var sv *GetDataSourceIntrospectionOutput if *v == nil { - sv = &GetApiCacheOutput{} + sv = &GetDataSourceIntrospectionOutput{} } else { sv = *v } - for key, value := range shape { - switch key { - case "apiCache": - if err := awsRestjson1_deserializeDocumentApiCache(&sv.ApiCache, value); err != nil { + for key, value := range shape { + switch key { + case "introspectionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.IntrospectionId = ptr.String(jtv) + } + + case "introspectionResult": + if err := awsRestjson1_deserializeDocumentDataSourceIntrospectionResult(&sv.IntrospectionResult, value); err != nil { return err } + case "introspectionStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceIntrospectionStatus to be of type string, got %T instead", value) + } + sv.IntrospectionStatus = types.DataSourceIntrospectionStatus(jtv) + } + + case "introspectionStatusDetail": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.IntrospectionStatusDetail = ptr.String(jtv) + } + default: _, _ = key, value @@ -3844,14 +5061,14 @@ func awsRestjson1_deserializeOpDocumentGetApiCacheOutput(v **GetApiCacheOutput, return nil } -type awsRestjson1_deserializeOpGetDataSource struct { +type awsRestjson1_deserializeOpGetDomainName struct { } -func (*awsRestjson1_deserializeOpGetDataSource) ID() string { +func (*awsRestjson1_deserializeOpGetDomainName) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDomainName) 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) @@ -3869,9 +5086,9 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDomainName(response, &metadata) } - output := &GetDataSourceOutput{} + output := &GetDomainNameOutput{} out.Result = output var buff [1024]byte @@ -3892,7 +5109,7 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDataSourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDomainNameOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3906,7 +5123,7 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDomainName(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)} @@ -3947,21 +5164,18 @@ func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3972,7 +5186,7 @@ func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3985,17 +5199,17 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDataSourceOutput + var sv *GetDomainNameOutput if *v == nil { - sv = &GetDataSourceOutput{} + sv = &GetDomainNameOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dataSource": - if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { + case "domainNameConfig": + if err := awsRestjson1_deserializeDocumentDomainNameConfig(&sv.DomainNameConfig, value); err != nil { return err } @@ -4008,14 +5222,14 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutp return nil } -type awsRestjson1_deserializeOpGetDataSourceIntrospection struct { +type awsRestjson1_deserializeOpGetFunction struct { } -func (*awsRestjson1_deserializeOpGetDataSourceIntrospection) ID() string { +func (*awsRestjson1_deserializeOpGetFunction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDataSourceIntrospection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetFunction) 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) @@ -4033,9 +5247,9 @@ func (m *awsRestjson1_deserializeOpGetDataSourceIntrospection) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDataSourceIntrospection(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetFunction(response, &metadata) } - output := &GetDataSourceIntrospectionOutput{} + output := &GetFunctionOutput{} out.Result = output var buff [1024]byte @@ -4056,7 +5270,7 @@ func (m *awsRestjson1_deserializeOpGetDataSourceIntrospection) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDataSourceIntrospectionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetFunctionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4070,7 +5284,7 @@ func (m *awsRestjson1_deserializeOpGetDataSourceIntrospection) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDataSourceIntrospection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetFunction(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)} @@ -4111,15 +5325,15 @@ func awsRestjson1_deserializeOpErrorGetDataSourceIntrospection(response *smithyh } switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4130,7 +5344,7 @@ func awsRestjson1_deserializeOpErrorGetDataSourceIntrospection(response *smithyh } } -func awsRestjson1_deserializeOpDocumentGetDataSourceIntrospectionOutput(v **GetDataSourceIntrospectionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetFunctionOutput(v **GetFunctionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4143,47 +5357,20 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceIntrospectionOutput(v **GetD return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDataSourceIntrospectionOutput + var sv *GetFunctionOutput if *v == nil { - sv = &GetDataSourceIntrospectionOutput{} + sv = &GetFunctionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "introspectionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IntrospectionId = ptr.String(jtv) - } - - case "introspectionResult": - if err := awsRestjson1_deserializeDocumentDataSourceIntrospectionResult(&sv.IntrospectionResult, value); err != nil { + case "functionConfiguration": + if err := awsRestjson1_deserializeDocumentFunctionConfiguration(&sv.FunctionConfiguration, value); err != nil { return err } - case "introspectionStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DataSourceIntrospectionStatus to be of type string, got %T instead", value) - } - sv.IntrospectionStatus = types.DataSourceIntrospectionStatus(jtv) - } - - case "introspectionStatusDetail": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IntrospectionStatusDetail = ptr.String(jtv) - } - default: _, _ = key, value @@ -4193,14 +5380,14 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceIntrospectionOutput(v **GetD return nil } -type awsRestjson1_deserializeOpGetDomainName struct { +type awsRestjson1_deserializeOpGetGraphqlApi struct { } -func (*awsRestjson1_deserializeOpGetDomainName) ID() string { +func (*awsRestjson1_deserializeOpGetGraphqlApi) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDomainName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetGraphqlApi) 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) @@ -4218,9 +5405,9 @@ func (m *awsRestjson1_deserializeOpGetDomainName) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDomainName(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetGraphqlApi(response, &metadata) } - output := &GetDomainNameOutput{} + output := &GetGraphqlApiOutput{} out.Result = output var buff [1024]byte @@ -4241,7 +5428,7 @@ func (m *awsRestjson1_deserializeOpGetDomainName) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDomainNameOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetGraphqlApiOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4255,7 +5442,7 @@ func (m *awsRestjson1_deserializeOpGetDomainName) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDomainName(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetGraphqlApi(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)} @@ -4308,6 +5495,9 @@ func awsRestjson1_deserializeOpErrorGetDomainName(response *smithyhttp.Response, case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4318,7 +5508,7 @@ func awsRestjson1_deserializeOpErrorGetDomainName(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetGraphqlApiOutput(v **GetGraphqlApiOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4331,17 +5521,17 @@ func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDomainNameOutput + var sv *GetGraphqlApiOutput if *v == nil { - sv = &GetDomainNameOutput{} + sv = &GetGraphqlApiOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "domainNameConfig": - if err := awsRestjson1_deserializeDocumentDomainNameConfig(&sv.DomainNameConfig, value); err != nil { + case "graphqlApi": + if err := awsRestjson1_deserializeDocumentGraphqlApi(&sv.GraphqlApi, value); err != nil { return err } @@ -4354,14 +5544,14 @@ func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutp return nil } -type awsRestjson1_deserializeOpGetFunction struct { +type awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables struct { } -func (*awsRestjson1_deserializeOpGetFunction) ID() string { +func (*awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables) 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) @@ -4379,9 +5569,9 @@ func (m *awsRestjson1_deserializeOpGetFunction) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetFunction(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetGraphqlApiEnvironmentVariables(response, &metadata) } - output := &GetFunctionOutput{} + output := &GetGraphqlApiEnvironmentVariablesOutput{} out.Result = output var buff [1024]byte @@ -4402,7 +5592,7 @@ func (m *awsRestjson1_deserializeOpGetFunction) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetFunctionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetGraphqlApiEnvironmentVariablesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4416,7 +5606,7 @@ func (m *awsRestjson1_deserializeOpGetFunction) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetGraphqlApiEnvironmentVariables(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)} @@ -4457,8 +5647,14 @@ func awsRestjson1_deserializeOpErrorGetFunction(response *smithyhttp.Response, m } switch { - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -4476,7 +5672,7 @@ func awsRestjson1_deserializeOpErrorGetFunction(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentGetFunctionOutput(v **GetFunctionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetGraphqlApiEnvironmentVariablesOutput(v **GetGraphqlApiEnvironmentVariablesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4489,17 +5685,17 @@ func awsRestjson1_deserializeOpDocumentGetFunctionOutput(v **GetFunctionOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetFunctionOutput + var sv *GetGraphqlApiEnvironmentVariablesOutput if *v == nil { - sv = &GetFunctionOutput{} + sv = &GetGraphqlApiEnvironmentVariablesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "functionConfiguration": - if err := awsRestjson1_deserializeDocumentFunctionConfiguration(&sv.FunctionConfiguration, value); err != nil { + case "environmentVariables": + if err := awsRestjson1_deserializeDocumentEnvironmentVariableMap(&sv.EnvironmentVariables, value); err != nil { return err } @@ -4512,14 +5708,14 @@ func awsRestjson1_deserializeOpDocumentGetFunctionOutput(v **GetFunctionOutput, return nil } -type awsRestjson1_deserializeOpGetGraphqlApi struct { +type awsRestjson1_deserializeOpGetIntrospectionSchema struct { } -func (*awsRestjson1_deserializeOpGetGraphqlApi) ID() string { +func (*awsRestjson1_deserializeOpGetIntrospectionSchema) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetGraphqlApi) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetIntrospectionSchema) 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) @@ -4537,44 +5733,21 @@ func (m *awsRestjson1_deserializeOpGetGraphqlApi) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetGraphqlApi(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetIntrospectionSchema(response, &metadata) } - output := &GetGraphqlApiOutput{} + output := &GetIntrospectionSchemaOutput{} 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_deserializeOpDocumentGetGraphqlApiOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetIntrospectionSchemaOutput(output, response.Body, response.ContentLength) 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, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} } span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetGraphqlApi(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetIntrospectionSchema(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)} @@ -4615,11 +5788,8 @@ func awsRestjson1_deserializeOpErrorGetGraphqlApi(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("GraphQLSchemaException", errorCode): + return awsRestjson1_deserializeErrorGraphQLSchemaException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -4640,50 +5810,36 @@ func awsRestjson1_deserializeOpErrorGetGraphqlApi(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetGraphqlApiOutput(v **GetGraphqlApiOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetIntrospectionSchemaOutput(v *GetIntrospectionSchemaOutput, body io.ReadCloser, contentLength int64) 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) + return fmt.Errorf("unsupported deserialization of nil %T", v) } - var sv *GetGraphqlApiOutput - if *v == nil { - sv = &GetGraphqlApiOutput{} + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "graphqlApi": - if err := awsRestjson1_deserializeDocumentGraphqlApi(&sv.GraphqlApi, value); err != nil { - return err - } - - default: - _, _ = key, value + buf.Grow(512) + } - } + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Schema = buf.Bytes() } - *v = sv return nil } -type awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables struct { +type awsRestjson1_deserializeOpGetResolver struct { } -func (*awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables) ID() string { +func (*awsRestjson1_deserializeOpGetResolver) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetResolver) 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) @@ -4701,9 +5857,9 @@ func (m *awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetGraphqlApiEnvironmentVariables(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetResolver(response, &metadata) } - output := &GetGraphqlApiEnvironmentVariablesOutput{} + output := &GetResolverOutput{} out.Result = output var buff [1024]byte @@ -4724,7 +5880,7 @@ func (m *awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetGraphqlApiEnvironmentVariablesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetResolverOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4738,7 +5894,7 @@ func (m *awsRestjson1_deserializeOpGetGraphqlApiEnvironmentVariables) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetGraphqlApiEnvironmentVariables(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetResolver(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)} @@ -4779,14 +5935,8 @@ func awsRestjson1_deserializeOpErrorGetGraphqlApiEnvironmentVariables(response * } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -4804,7 +5954,7 @@ func awsRestjson1_deserializeOpErrorGetGraphqlApiEnvironmentVariables(response * } } -func awsRestjson1_deserializeOpDocumentGetGraphqlApiEnvironmentVariablesOutput(v **GetGraphqlApiEnvironmentVariablesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetResolverOutput(v **GetResolverOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4817,17 +5967,17 @@ func awsRestjson1_deserializeOpDocumentGetGraphqlApiEnvironmentVariablesOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetGraphqlApiEnvironmentVariablesOutput + var sv *GetResolverOutput if *v == nil { - sv = &GetGraphqlApiEnvironmentVariablesOutput{} + sv = &GetResolverOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "environmentVariables": - if err := awsRestjson1_deserializeDocumentEnvironmentVariableMap(&sv.EnvironmentVariables, value); err != nil { + case "resolver": + if err := awsRestjson1_deserializeDocumentResolver(&sv.Resolver, value); err != nil { return err } @@ -4840,14 +5990,14 @@ func awsRestjson1_deserializeOpDocumentGetGraphqlApiEnvironmentVariablesOutput(v return nil } -type awsRestjson1_deserializeOpGetIntrospectionSchema struct { +type awsRestjson1_deserializeOpGetSchemaCreationStatus struct { } -func (*awsRestjson1_deserializeOpGetIntrospectionSchema) ID() string { +func (*awsRestjson1_deserializeOpGetSchemaCreationStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetIntrospectionSchema) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetSchemaCreationStatus) 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) @@ -4865,21 +6015,44 @@ func (m *awsRestjson1_deserializeOpGetIntrospectionSchema) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetIntrospectionSchema(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetSchemaCreationStatus(response, &metadata) } - output := &GetIntrospectionSchemaOutput{} + output := &GetSchemaCreationStatusOutput{} out.Result = output - err = awsRestjson1_deserializeOpDocumentGetIntrospectionSchemaOutput(output, response.Body, response.ContentLength) + 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_deserializeOpDocumentGetSchemaCreationStatusOutput(&output, shape) if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + 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(), + } } span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetIntrospectionSchema(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetSchemaCreationStatus(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)} @@ -4920,8 +6093,8 @@ func awsRestjson1_deserializeOpErrorGetIntrospectionSchema(response *smithyhttp. } switch { - case strings.EqualFold("GraphQLSchemaException", errorCode): - return awsRestjson1_deserializeErrorGraphQLSchemaException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -4942,36 +6115,63 @@ func awsRestjson1_deserializeOpErrorGetIntrospectionSchema(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentGetIntrospectionSchemaOutput(v *GetIntrospectionSchemaOutput, body io.ReadCloser, contentLength int64) error { +func awsRestjson1_deserializeOpDocumentGetSchemaCreationStatusOutput(v **GetSchemaCreationStatusOutput, value interface{}) error { if v == nil { - return fmt.Errorf("unsupported deserialization of nil %T", v) + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - var buf bytes.Buffer - if contentLength > 0 { - buf.Grow(int(contentLength)) - } else { - buf.Grow(512) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - _, err := buf.ReadFrom(body) - if err != nil { - return err + var sv *GetSchemaCreationStatusOutput + if *v == nil { + sv = &GetSchemaCreationStatusOutput{} + } else { + sv = *v } - if buf.Len() > 0 { - v.Schema = buf.Bytes() + + for key, value := range shape { + switch key { + case "details": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Details = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SchemaStatus to be of type string, got %T instead", value) + } + sv.Status = types.SchemaStatus(jtv) + } + + default: + _, _ = key, value + + } } + *v = sv return nil } -type awsRestjson1_deserializeOpGetResolver struct { +type awsRestjson1_deserializeOpGetSourceApiAssociation struct { } -func (*awsRestjson1_deserializeOpGetResolver) ID() string { +func (*awsRestjson1_deserializeOpGetSourceApiAssociation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetResolver) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetSourceApiAssociation) 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) @@ -4989,9 +6189,9 @@ func (m *awsRestjson1_deserializeOpGetResolver) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetResolver(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetSourceApiAssociation(response, &metadata) } - output := &GetResolverOutput{} + output := &GetSourceApiAssociationOutput{} out.Result = output var buff [1024]byte @@ -5012,7 +6212,7 @@ func (m *awsRestjson1_deserializeOpGetResolver) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetResolverOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetSourceApiAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5026,7 +6226,7 @@ func (m *awsRestjson1_deserializeOpGetResolver) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetResolver(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetSourceApiAssociation(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)} @@ -5067,8 +6267,11 @@ func awsRestjson1_deserializeOpErrorGetResolver(response *smithyhttp.Response, m } switch { - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -5086,7 +6289,7 @@ func awsRestjson1_deserializeOpErrorGetResolver(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentGetResolverOutput(v **GetResolverOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetSourceApiAssociationOutput(v **GetSourceApiAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5099,17 +6302,17 @@ func awsRestjson1_deserializeOpDocumentGetResolverOutput(v **GetResolverOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetResolverOutput + var sv *GetSourceApiAssociationOutput if *v == nil { - sv = &GetResolverOutput{} + sv = &GetSourceApiAssociationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "resolver": - if err := awsRestjson1_deserializeDocumentResolver(&sv.Resolver, value); err != nil { + case "sourceApiAssociation": + if err := awsRestjson1_deserializeDocumentSourceApiAssociation(&sv.SourceApiAssociation, value); err != nil { return err } @@ -5122,14 +6325,14 @@ func awsRestjson1_deserializeOpDocumentGetResolverOutput(v **GetResolverOutput, return nil } -type awsRestjson1_deserializeOpGetSchemaCreationStatus struct { +type awsRestjson1_deserializeOpGetType struct { } -func (*awsRestjson1_deserializeOpGetSchemaCreationStatus) ID() string { +func (*awsRestjson1_deserializeOpGetType) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetSchemaCreationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetType) 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) @@ -5147,9 +6350,9 @@ func (m *awsRestjson1_deserializeOpGetSchemaCreationStatus) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetSchemaCreationStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetType(response, &metadata) } - output := &GetSchemaCreationStatusOutput{} + output := &GetTypeOutput{} out.Result = output var buff [1024]byte @@ -5170,7 +6373,7 @@ func (m *awsRestjson1_deserializeOpGetSchemaCreationStatus) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSchemaCreationStatusOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5184,7 +6387,7 @@ func (m *awsRestjson1_deserializeOpGetSchemaCreationStatus) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetSchemaCreationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetType(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)} @@ -5228,6 +6431,9 @@ func awsRestjson1_deserializeOpErrorGetSchemaCreationStatus(response *smithyhttp case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -5247,7 +6453,7 @@ func awsRestjson1_deserializeOpErrorGetSchemaCreationStatus(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetSchemaCreationStatusOutput(v **GetSchemaCreationStatusOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetTypeOutput(v **GetTypeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5260,31 +6466,18 @@ func awsRestjson1_deserializeOpDocumentGetSchemaCreationStatusOutput(v **GetSche return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSchemaCreationStatusOutput + var sv *GetTypeOutput if *v == nil { - sv = &GetSchemaCreationStatusOutput{} + sv = &GetTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "details": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Details = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SchemaStatus to be of type string, got %T instead", value) - } - sv.Status = types.SchemaStatus(jtv) + case "type": + if err := awsRestjson1_deserializeDocumentType(&sv.Type, value); err != nil { + return err } default: @@ -5296,14 +6489,14 @@ func awsRestjson1_deserializeOpDocumentGetSchemaCreationStatusOutput(v **GetSche return nil } -type awsRestjson1_deserializeOpGetSourceApiAssociation struct { +type awsRestjson1_deserializeOpListApiKeys struct { } -func (*awsRestjson1_deserializeOpGetSourceApiAssociation) ID() string { +func (*awsRestjson1_deserializeOpListApiKeys) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetSourceApiAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListApiKeys) 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) @@ -5321,9 +6514,9 @@ func (m *awsRestjson1_deserializeOpGetSourceApiAssociation) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetSourceApiAssociation(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListApiKeys(response, &metadata) } - output := &GetSourceApiAssociationOutput{} + output := &ListApiKeysOutput{} out.Result = output var buff [1024]byte @@ -5344,7 +6537,7 @@ func (m *awsRestjson1_deserializeOpGetSourceApiAssociation) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSourceApiAssociationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListApiKeysOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5358,7 +6551,7 @@ func (m *awsRestjson1_deserializeOpGetSourceApiAssociation) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetSourceApiAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListApiKeys(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)} @@ -5421,7 +6614,7 @@ func awsRestjson1_deserializeOpErrorGetSourceApiAssociation(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetSourceApiAssociationOutput(v **GetSourceApiAssociationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListApiKeysOutput(v **ListApiKeysOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5434,20 +6627,29 @@ func awsRestjson1_deserializeOpDocumentGetSourceApiAssociationOutput(v **GetSour return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSourceApiAssociationOutput + var sv *ListApiKeysOutput if *v == nil { - sv = &GetSourceApiAssociationOutput{} + sv = &ListApiKeysOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "sourceApiAssociation": - if err := awsRestjson1_deserializeDocumentSourceApiAssociation(&sv.SourceApiAssociation, value); err != nil { + case "apiKeys": + if err := awsRestjson1_deserializeDocumentApiKeys(&sv.ApiKeys, 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 @@ -5457,14 +6659,14 @@ func awsRestjson1_deserializeOpDocumentGetSourceApiAssociationOutput(v **GetSour return nil } -type awsRestjson1_deserializeOpGetType struct { +type awsRestjson1_deserializeOpListApis struct { } -func (*awsRestjson1_deserializeOpGetType) ID() string { +func (*awsRestjson1_deserializeOpListApis) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListApis) 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) @@ -5482,9 +6684,9 @@ func (m *awsRestjson1_deserializeOpGetType) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListApis(response, &metadata) } - output := &GetTypeOutput{} + output := &ListApisOutput{} out.Result = output var buff [1024]byte @@ -5505,7 +6707,7 @@ func (m *awsRestjson1_deserializeOpGetType) HandleDeserialize(ctx context.Contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetTypeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListApisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5519,7 +6721,7 @@ func (m *awsRestjson1_deserializeOpGetType) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListApis(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)} @@ -5560,18 +6762,12 @@ func awsRestjson1_deserializeOpErrorGetType(response *smithyhttp.Response, metad } switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -5585,7 +6781,7 @@ func awsRestjson1_deserializeOpErrorGetType(response *smithyhttp.Response, metad } } -func awsRestjson1_deserializeOpDocumentGetTypeOutput(v **GetTypeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListApisOutput(v **ListApisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5598,20 +6794,29 @@ func awsRestjson1_deserializeOpDocumentGetTypeOutput(v **GetTypeOutput, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetTypeOutput + var sv *ListApisOutput if *v == nil { - sv = &GetTypeOutput{} + sv = &ListApisOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "type": - if err := awsRestjson1_deserializeDocumentType(&sv.Type, value); err != nil { + case "apis": + if err := awsRestjson1_deserializeDocumentApis(&sv.Apis, 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 @@ -5621,14 +6826,14 @@ func awsRestjson1_deserializeOpDocumentGetTypeOutput(v **GetTypeOutput, value in return nil } -type awsRestjson1_deserializeOpListApiKeys struct { +type awsRestjson1_deserializeOpListChannelNamespaces struct { } -func (*awsRestjson1_deserializeOpListApiKeys) ID() string { +func (*awsRestjson1_deserializeOpListChannelNamespaces) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListApiKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListChannelNamespaces) 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) @@ -5646,9 +6851,9 @@ func (m *awsRestjson1_deserializeOpListApiKeys) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListApiKeys(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListChannelNamespaces(response, &metadata) } - output := &ListApiKeysOutput{} + output := &ListChannelNamespacesOutput{} out.Result = output var buff [1024]byte @@ -5669,7 +6874,7 @@ func (m *awsRestjson1_deserializeOpListApiKeys) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListApiKeysOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListChannelNamespacesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5683,7 +6888,7 @@ func (m *awsRestjson1_deserializeOpListApiKeys) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListApiKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListChannelNamespaces(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)} @@ -5746,7 +6951,7 @@ func awsRestjson1_deserializeOpErrorListApiKeys(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListApiKeysOutput(v **ListApiKeysOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListChannelNamespacesOutput(v **ListChannelNamespacesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5759,17 +6964,17 @@ func awsRestjson1_deserializeOpDocumentListApiKeysOutput(v **ListApiKeysOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListApiKeysOutput + var sv *ListChannelNamespacesOutput if *v == nil { - sv = &ListApiKeysOutput{} + sv = &ListChannelNamespacesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "apiKeys": - if err := awsRestjson1_deserializeDocumentApiKeys(&sv.ApiKeys, value); err != nil { + case "channelNamespaces": + if err := awsRestjson1_deserializeDocumentChannelNamespaces(&sv.ChannelNamespaces, value); err != nil { return err } @@ -8201,14 +9406,248 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } - output := &TagResourceOutput{} - out.Result = output + output := &TagResourceOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateApi struct { +} + +func (*awsRestjson1_deserializeOpUpdateApi) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateApi) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateApi(response, &metadata) + } + output := &UpdateApiOutput{} + 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_deserializeOpDocumentUpdateApiOutput(&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(), + } + } span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateApi(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)} @@ -8255,12 +9694,12 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -8277,14 +9716,50 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentUpdateApiOutput(v **UpdateApiOutput, 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 *UpdateApiOutput + if *v == nil { + sv = &UpdateApiOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "api": + if err := awsRestjson1_deserializeDocumentApi(&sv.Api, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpUpdateApiCache struct { +} + +func (*awsRestjson1_deserializeOpUpdateApiCache) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateApiCache) 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) @@ -8302,16 +9777,44 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateApiCache(response, &metadata) } - output := &UntagResourceOutput{} + output := &UpdateApiCacheOutput{} 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_deserializeOpDocumentUpdateApiCacheOutput(&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(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateApiCache(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)} @@ -8352,18 +9855,15 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -8380,14 +9880,50 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateApiCache struct { +func awsRestjson1_deserializeOpDocumentUpdateApiCacheOutput(v **UpdateApiCacheOutput, 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 *UpdateApiCacheOutput + if *v == nil { + sv = &UpdateApiCacheOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "apiCache": + if err := awsRestjson1_deserializeDocumentApiCache(&sv.ApiCache, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateApiCache) ID() string { +type awsRestjson1_deserializeOpUpdateApiKey struct { +} + +func (*awsRestjson1_deserializeOpUpdateApiKey) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateApiCache) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateApiKey) 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) @@ -8405,9 +9941,9 @@ func (m *awsRestjson1_deserializeOpUpdateApiCache) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateApiCache(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateApiKey(response, &metadata) } - output := &UpdateApiCacheOutput{} + output := &UpdateApiKeyOutput{} out.Result = output var buff [1024]byte @@ -8428,7 +9964,7 @@ func (m *awsRestjson1_deserializeOpUpdateApiCache) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateApiCacheOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateApiKeyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8442,7 +9978,7 @@ func (m *awsRestjson1_deserializeOpUpdateApiCache) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateApiCache(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateApiKey(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)} @@ -8483,15 +10019,18 @@ func awsRestjson1_deserializeOpErrorUpdateApiCache(response *smithyhttp.Response } switch { + case strings.EqualFold("ApiKeyValidityOutOfBoundsException", errorCode): + return awsRestjson1_deserializeErrorApiKeyValidityOutOfBoundsException(response, errorBody) + case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -8508,7 +10047,7 @@ func awsRestjson1_deserializeOpErrorUpdateApiCache(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentUpdateApiCacheOutput(v **UpdateApiCacheOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateApiKeyOutput(v **UpdateApiKeyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8521,17 +10060,17 @@ func awsRestjson1_deserializeOpDocumentUpdateApiCacheOutput(v **UpdateApiCacheOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateApiCacheOutput + var sv *UpdateApiKeyOutput if *v == nil { - sv = &UpdateApiCacheOutput{} + sv = &UpdateApiKeyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "apiCache": - if err := awsRestjson1_deserializeDocumentApiCache(&sv.ApiCache, value); err != nil { + case "apiKey": + if err := awsRestjson1_deserializeDocumentApiKey(&sv.ApiKey, value); err != nil { return err } @@ -8544,14 +10083,14 @@ func awsRestjson1_deserializeOpDocumentUpdateApiCacheOutput(v **UpdateApiCacheOu return nil } -type awsRestjson1_deserializeOpUpdateApiKey struct { +type awsRestjson1_deserializeOpUpdateChannelNamespace struct { } -func (*awsRestjson1_deserializeOpUpdateApiKey) ID() string { +func (*awsRestjson1_deserializeOpUpdateChannelNamespace) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateApiKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateChannelNamespace) 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) @@ -8569,9 +10108,9 @@ func (m *awsRestjson1_deserializeOpUpdateApiKey) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateApiKey(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateChannelNamespace(response, &metadata) } - output := &UpdateApiKeyOutput{} + output := &UpdateChannelNamespaceOutput{} out.Result = output var buff [1024]byte @@ -8592,7 +10131,7 @@ func (m *awsRestjson1_deserializeOpUpdateApiKey) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateApiKeyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateChannelNamespaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8606,7 +10145,7 @@ func (m *awsRestjson1_deserializeOpUpdateApiKey) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateApiKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateChannelNamespace(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)} @@ -8647,18 +10186,18 @@ func awsRestjson1_deserializeOpErrorUpdateApiKey(response *smithyhttp.Response, } switch { - case strings.EqualFold("ApiKeyValidityOutOfBoundsException", errorCode): - return awsRestjson1_deserializeErrorApiKeyValidityOutOfBoundsException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) @@ -8675,7 +10214,7 @@ func awsRestjson1_deserializeOpErrorUpdateApiKey(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateApiKeyOutput(v **UpdateApiKeyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateChannelNamespaceOutput(v **UpdateChannelNamespaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8688,17 +10227,17 @@ func awsRestjson1_deserializeOpDocumentUpdateApiKeyOutput(v **UpdateApiKeyOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateApiKeyOutput + var sv *UpdateChannelNamespaceOutput if *v == nil { - sv = &UpdateApiKeyOutput{} + sv = &UpdateChannelNamespaceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "apiKey": - if err := awsRestjson1_deserializeDocumentApiKey(&sv.ApiKey, value); err != nil { + case "channelNamespace": + if err := awsRestjson1_deserializeDocumentChannelNamespace(&sv.ChannelNamespace, value); err != nil { return err } @@ -9953,7 +11492,79 @@ func awsRestjson1_deserializeErrorApiKeyValidityOutOfBoundsException(response *s return err } - err := awsRestjson1_deserializeDocumentApiKeyValidityOutOfBoundsException(&output, shape) + err := awsRestjson1_deserializeDocumentApiKeyValidityOutOfBoundsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorApiLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ApiLimitExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentApiLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BadRequestException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -9970,8 +11581,8 @@ func awsRestjson1_deserializeErrorApiKeyValidityOutOfBoundsException(response *s return output } -func awsRestjson1_deserializeErrorApiLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ApiLimitExceededException{} +func awsRestjson1_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConcurrentModificationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -9989,7 +11600,7 @@ func awsRestjson1_deserializeErrorApiLimitExceededException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentApiLimitExceededException(&output, shape) + err := awsRestjson1_deserializeDocumentConcurrentModificationException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -10006,8 +11617,8 @@ func awsRestjson1_deserializeErrorApiLimitExceededException(response *smithyhttp return output } -func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.BadRequestException{} +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -10025,7 +11636,7 @@ func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Respo return err } - err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -10042,8 +11653,8 @@ func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Respo return output } -func awsRestjson1_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConcurrentModificationException{} +func awsRestjson1_deserializeErrorGraphQLSchemaException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.GraphQLSchemaException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -10061,7 +11672,7 @@ func awsRestjson1_deserializeErrorConcurrentModificationException(response *smit return err } - err := awsRestjson1_deserializeDocumentConcurrentModificationException(&output, shape) + err := awsRestjson1_deserializeDocumentGraphQLSchemaException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -10078,8 +11689,8 @@ func awsRestjson1_deserializeErrorConcurrentModificationException(response *smit return output } -func awsRestjson1_deserializeErrorGraphQLSchemaException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.GraphQLSchemaException{} +func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalFailureException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -10097,7 +11708,7 @@ func awsRestjson1_deserializeErrorGraphQLSchemaException(response *smithyhttp.Re return err } - err := awsRestjson1_deserializeDocumentGraphQLSchemaException(&output, shape) + err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -10114,8 +11725,8 @@ func awsRestjson1_deserializeErrorGraphQLSchemaException(response *smithyhttp.Re return output } -func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalFailureException{} +func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LimitExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -10133,7 +11744,7 @@ func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp. return err } - err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) + err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -10150,8 +11761,8 @@ func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp. return output } -func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.LimitExceededException{} +func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -10169,7 +11780,7 @@ func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Re return err } - err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) + err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -10186,8 +11797,8 @@ func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Re return output } -func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NotFoundException{} +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -10205,7 +11816,7 @@ func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Respons return err } - err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -10387,6 +11998,122 @@ func awsRestjson1_deserializeDocumentAdditionalAuthenticationProviders(v *[]type return nil } +func awsRestjson1_deserializeDocumentApi(v **types.Api, 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.Api + if *v == nil { + sv = &types.Api{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "apiArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ApiArn = ptr.String(jtv) + } + + case "apiId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ApiId = ptr.String(jtv) + } + + case "created": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Created = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dns": + if err := awsRestjson1_deserializeDocumentMapOfStringToString(&sv.Dns, value); err != nil { + return err + } + + case "eventConfig": + if err := awsRestjson1_deserializeDocumentEventConfig(&sv.EventConfig, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApiName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ownerContact": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OwnerContact to be of type string, got %T instead", value) + } + sv.OwnerContact = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "wafWebAclArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.WafWebAclArn = ptr.String(jtv) + } + + case "xrayEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.XrayEnabled = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentApiAssociation(v **types.ApiAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10640,9 +12367,123 @@ func awsRestjson1_deserializeDocumentApiKeyLimitExceededException(v **types.ApiK return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ApiKeyLimitExceededException + var sv *types.ApiKeyLimitExceededException + if *v == nil { + sv = &types.ApiKeyLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentApiKeys(v *[]types.ApiKey, 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.ApiKey + if *v == nil { + cv = []types.ApiKey{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ApiKey + destAddr := &col + if err := awsRestjson1_deserializeDocumentApiKey(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApiKeyValidityOutOfBoundsException(v **types.ApiKeyValidityOutOfBoundsException, 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.ApiKeyValidityOutOfBoundsException + if *v == nil { + sv = &types.ApiKeyValidityOutOfBoundsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentApiLimitExceededException(v **types.ApiLimitExceededException, 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.ApiLimitExceededException if *v == nil { - sv = &types.ApiKeyLimitExceededException{} + sv = &types.ApiLimitExceededException{} } else { sv = *v } @@ -10667,7 +12508,7 @@ func awsRestjson1_deserializeDocumentApiKeyLimitExceededException(v **types.ApiK return nil } -func awsRestjson1_deserializeDocumentApiKeys(v *[]types.ApiKey, value interface{}) error { +func awsRestjson1_deserializeDocumentApis(v *[]types.Api, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10680,17 +12521,17 @@ func awsRestjson1_deserializeDocumentApiKeys(v *[]types.ApiKey, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ApiKey + var cv []types.Api if *v == nil { - cv = []types.ApiKey{} + cv = []types.Api{} } else { cv = *v } for _, value := range shape { - var col types.ApiKey + var col types.Api destAddr := &col - if err := awsRestjson1_deserializeDocumentApiKey(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentApi(&destAddr, value); err != nil { return err } col = *destAddr @@ -10701,7 +12542,7 @@ func awsRestjson1_deserializeDocumentApiKeys(v *[]types.ApiKey, value interface{ return nil } -func awsRestjson1_deserializeDocumentApiKeyValidityOutOfBoundsException(v **types.ApiKeyValidityOutOfBoundsException, value interface{}) error { +func awsRestjson1_deserializeDocumentAppSyncRuntime(v **types.AppSyncRuntime, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10714,22 +12555,31 @@ func awsRestjson1_deserializeDocumentApiKeyValidityOutOfBoundsException(v **type return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ApiKeyValidityOutOfBoundsException + var sv *types.AppSyncRuntime if *v == nil { - sv = &types.ApiKeyValidityOutOfBoundsException{} + sv = &types.AppSyncRuntime{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RuntimeName to be of type string, got %T instead", value) + } + sv.Name = types.RuntimeName(jtv) + } + + case "runtimeVersion": 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.RuntimeVersion = ptr.String(jtv) } default: @@ -10741,7 +12591,7 @@ func awsRestjson1_deserializeDocumentApiKeyValidityOutOfBoundsException(v **type return nil } -func awsRestjson1_deserializeDocumentApiLimitExceededException(v **types.ApiLimitExceededException, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthMode(v **types.AuthMode, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10754,22 +12604,22 @@ func awsRestjson1_deserializeDocumentApiLimitExceededException(v **types.ApiLimi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ApiLimitExceededException + var sv *types.AuthMode if *v == nil { - sv = &types.ApiLimitExceededException{} + sv = &types.AuthMode{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "authType": 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 AuthenticationType to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.AuthType = types.AuthenticationType(jtv) } default: @@ -10781,7 +12631,41 @@ func awsRestjson1_deserializeDocumentApiLimitExceededException(v **types.ApiLimi return nil } -func awsRestjson1_deserializeDocumentAppSyncRuntime(v **types.AppSyncRuntime, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthModes(v *[]types.AuthMode, 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.AuthMode + if *v == nil { + cv = []types.AuthMode{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuthMode + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuthMode(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizationConfig(v **types.AuthorizationConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10794,31 +12678,27 @@ func awsRestjson1_deserializeDocumentAppSyncRuntime(v **types.AppSyncRuntime, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AppSyncRuntime + var sv *types.AuthorizationConfig if *v == nil { - sv = &types.AppSyncRuntime{} + sv = &types.AuthorizationConfig{} } else { sv = *v } for key, value := range shape { switch key { - case "name": + case "authorizationType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuntimeName to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizationType to be of type string, got %T instead", value) } - sv.Name = types.RuntimeName(jtv) + sv.AuthorizationType = types.AuthorizationType(jtv) } - case "runtimeVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.RuntimeVersion = ptr.String(jtv) + case "awsIamConfig": + if err := awsRestjson1_deserializeDocumentAwsIamConfig(&sv.AwsIamConfig, value); err != nil { + return err } default: @@ -10830,7 +12710,7 @@ func awsRestjson1_deserializeDocumentAppSyncRuntime(v **types.AppSyncRuntime, va return nil } -func awsRestjson1_deserializeDocumentAuthorizationConfig(v **types.AuthorizationConfig, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthProvider(v **types.AuthProvider, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10843,26 +12723,36 @@ func awsRestjson1_deserializeDocumentAuthorizationConfig(v **types.Authorization return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuthorizationConfig + var sv *types.AuthProvider if *v == nil { - sv = &types.AuthorizationConfig{} + sv = &types.AuthProvider{} } else { sv = *v } for key, value := range shape { switch key { - case "authorizationType": + case "authType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuthorizationType to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthenticationType to be of type string, got %T instead", value) } - sv.AuthorizationType = types.AuthorizationType(jtv) + sv.AuthType = types.AuthenticationType(jtv) } - case "awsIamConfig": - if err := awsRestjson1_deserializeDocumentAwsIamConfig(&sv.AwsIamConfig, value); err != nil { + case "cognitoConfig": + if err := awsRestjson1_deserializeDocumentCognitoConfig(&sv.CognitoConfig, value); err != nil { + return err + } + + case "lambdaAuthorizerConfig": + if err := awsRestjson1_deserializeDocumentLambdaAuthorizerConfig(&sv.LambdaAuthorizerConfig, value); err != nil { + return err + } + + case "openIDConnectConfig": + if err := awsRestjson1_deserializeDocumentOpenIDConnectConfig(&sv.OpenIDConnectConfig, value); err != nil { return err } @@ -10875,6 +12765,40 @@ func awsRestjson1_deserializeDocumentAuthorizationConfig(v **types.Authorization return nil } +func awsRestjson1_deserializeDocumentAuthProviders(v *[]types.AuthProvider, 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.AuthProvider + if *v == nil { + cv = []types.AuthProvider{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuthProvider + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuthProvider(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAwsIamConfig(v **types.AwsIamConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11041,17 +12965,167 @@ func awsRestjson1_deserializeDocumentCachingConfig(v **types.CachingConfig, valu return err } - case "ttl": + case "ttl": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Ttl = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCachingKeys(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentChannelNamespace(v **types.ChannelNamespace, 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.ChannelNamespace + if *v == nil { + sv = &types.ChannelNamespace{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "apiId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ApiId = ptr.String(jtv) + } + + case "channelNamespaceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ChannelNamespaceArn = ptr.String(jtv) + } + + case "codeHandlers": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Code to be of type string, got %T instead", value) + } + sv.CodeHandlers = ptr.String(jtv) + } + + case "created": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Created = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "lastModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Long to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } - sv.Ttl = i64 + sv.Name = ptr.String(jtv) + } + + case "publishAuthModes": + if err := awsRestjson1_deserializeDocumentAuthModes(&sv.PublishAuthModes, value); err != nil { + return err + } + + case "subscribeAuthModes": + if err := awsRestjson1_deserializeDocumentAuthModes(&sv.SubscribeAuthModes, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -11063,7 +13137,7 @@ func awsRestjson1_deserializeDocumentCachingConfig(v **types.CachingConfig, valu return nil } -func awsRestjson1_deserializeDocumentCachingKeys(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentChannelNamespaces(v *[]types.ChannelNamespace, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11076,22 +13150,20 @@ func awsRestjson1_deserializeDocumentCachingKeys(v *[]string, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.ChannelNamespace if *v == nil { - cv = []string{} + cv = []types.ChannelNamespace{} } 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 + var col types.ChannelNamespace + destAddr := &col + if err := awsRestjson1_deserializeDocumentChannelNamespace(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -11257,6 +13329,64 @@ func awsRestjson1_deserializeDocumentCodeErrors(v *[]types.CodeError, value inte return nil } +func awsRestjson1_deserializeDocumentCognitoConfig(v **types.CognitoConfig, 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.CognitoConfig + if *v == nil { + sv = &types.CognitoConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appIdClientRegex": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AppIdClientRegex = ptr.String(jtv) + } + + case "awsRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AwsRegion = ptr.String(jtv) + } + + case "userPoolId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UserPoolId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentCognitoUserPoolConfig(v **types.CognitoUserPoolConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11355,6 +13485,46 @@ func awsRestjson1_deserializeDocumentConcurrentModificationException(v **types.C return nil } +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12470,6 +14640,111 @@ func awsRestjson1_deserializeDocumentEventBridgeDataSourceConfig(v **types.Event return nil } +func awsRestjson1_deserializeDocumentEventConfig(v **types.EventConfig, 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.EventConfig + if *v == nil { + sv = &types.EventConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "authProviders": + if err := awsRestjson1_deserializeDocumentAuthProviders(&sv.AuthProviders, value); err != nil { + return err + } + + case "connectionAuthModes": + if err := awsRestjson1_deserializeDocumentAuthModes(&sv.ConnectionAuthModes, value); err != nil { + return err + } + + case "defaultPublishAuthModes": + if err := awsRestjson1_deserializeDocumentAuthModes(&sv.DefaultPublishAuthModes, value); err != nil { + return err + } + + case "defaultSubscribeAuthModes": + if err := awsRestjson1_deserializeDocumentAuthModes(&sv.DefaultSubscribeAuthModes, value); err != nil { + return err + } + + case "logConfig": + if err := awsRestjson1_deserializeDocumentEventLogConfig(&sv.LogConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventLogConfig(v **types.EventLogConfig, 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.EventLogConfig + if *v == nil { + sv = &types.EventLogConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cloudWatchLogsRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CloudWatchLogsRoleArn = ptr.String(jtv) + } + + case "logLevel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventLogLevel to be of type string, got %T instead", value) + } + sv.LogLevel = types.EventLogLevel(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFunctionConfiguration(v **types.FunctionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13856,6 +16131,46 @@ func awsRestjson1_deserializeDocumentResolvers(v *[]types.Resolver, value interf return nil } +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSourceApiAssociation(v **types.SourceApiAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/appsync/generated.json b/service/appsync/generated.json index c5768be707d..3083450251a 100644 --- a/service/appsync/generated.json +++ b/service/appsync/generated.json @@ -11,16 +11,20 @@ "api_op_AssociateApi.go", "api_op_AssociateMergedGraphqlApi.go", "api_op_AssociateSourceGraphqlApi.go", + "api_op_CreateApi.go", "api_op_CreateApiCache.go", "api_op_CreateApiKey.go", + "api_op_CreateChannelNamespace.go", "api_op_CreateDataSource.go", "api_op_CreateDomainName.go", "api_op_CreateFunction.go", "api_op_CreateGraphqlApi.go", "api_op_CreateResolver.go", "api_op_CreateType.go", + "api_op_DeleteApi.go", "api_op_DeleteApiCache.go", "api_op_DeleteApiKey.go", + "api_op_DeleteChannelNamespace.go", "api_op_DeleteDataSource.go", "api_op_DeleteDomainName.go", "api_op_DeleteFunction.go", @@ -33,8 +37,10 @@ "api_op_EvaluateCode.go", "api_op_EvaluateMappingTemplate.go", "api_op_FlushApiCache.go", + "api_op_GetApi.go", "api_op_GetApiAssociation.go", "api_op_GetApiCache.go", + "api_op_GetChannelNamespace.go", "api_op_GetDataSource.go", "api_op_GetDataSourceIntrospection.go", "api_op_GetDomainName.go", @@ -47,6 +53,8 @@ "api_op_GetSourceApiAssociation.go", "api_op_GetType.go", "api_op_ListApiKeys.go", + "api_op_ListApis.go", + "api_op_ListChannelNamespaces.go", "api_op_ListDataSources.go", "api_op_ListDomainNames.go", "api_op_ListFunctions.go", @@ -63,8 +71,10 @@ "api_op_StartSchemaMerge.go", "api_op_TagResource.go", "api_op_UntagResource.go", + "api_op_UpdateApi.go", "api_op_UpdateApiCache.go", "api_op_UpdateApiKey.go", + "api_op_UpdateChannelNamespace.go", "api_op_UpdateDataSource.go", "api_op_UpdateDomainName.go", "api_op_UpdateFunction.go", diff --git a/service/appsync/serializers.go b/service/appsync/serializers.go index a1e22532cb8..e62da00aff8 100644 --- a/service/appsync/serializers.go +++ b/service/appsync/serializers.go @@ -321,6 +321,106 @@ func awsRestjson1_serializeOpDocumentAssociateSourceGraphqlApiInput(v *Associate return nil } +type awsRestjson1_serializeOpCreateApi struct { +} + +func (*awsRestjson1_serializeOpCreateApi) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateApi) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateApiInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis") + 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_serializeOpDocumentCreateApiInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateApiInput(v *CreateApiInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateApiInput(v *CreateApiInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EventConfig != nil { + ok := object.Key("eventConfig") + if err := awsRestjson1_serializeDocumentEventConfig(v.EventConfig, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.OwnerContact != nil { + ok := object.Key("ownerContact") + ok.String(*v.OwnerContact) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateApiCache struct { } @@ -539,6 +639,126 @@ func awsRestjson1_serializeOpDocumentCreateApiKeyInput(v *CreateApiKeyInput, val return nil } +type awsRestjson1_serializeOpCreateChannelNamespace struct { +} + +func (*awsRestjson1_serializeOpCreateChannelNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateChannelNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateChannelNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}/channelNamespaces") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateChannelNamespaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateChannelNamespaceInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateChannelNamespaceInput(v *CreateChannelNamespaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + } + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateChannelNamespaceInput(v *CreateChannelNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CodeHandlers != nil { + ok := object.Key("codeHandlers") + ok.String(*v.CodeHandlers) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.PublishAuthModes != nil { + ok := object.Key("publishAuthModes") + if err := awsRestjson1_serializeDocumentAuthModes(v.PublishAuthModes, ok); err != nil { + return err + } + } + + if v.SubscribeAuthModes != nil { + ok := object.Key("subscribeAuthModes") + if err := awsRestjson1_serializeDocumentAuthModes(v.SubscribeAuthModes, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateDataSource struct { } @@ -1376,6 +1596,77 @@ func awsRestjson1_serializeOpDocumentCreateTypeInput(v *CreateTypeInput, value s return nil } +type awsRestjson1_serializeOpDeleteApi struct { +} + +func (*awsRestjson1_serializeOpDeleteApi) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteApi) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteApiInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteApiInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteApiInput(v *DeleteApiInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + } + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteApiCache struct { } @@ -1527,6 +1818,86 @@ func awsRestjson1_serializeOpHttpBindingsDeleteApiKeyInput(v *DeleteApiKeyInput, return nil } +type awsRestjson1_serializeOpDeleteChannelNamespace struct { +} + +func (*awsRestjson1_serializeOpDeleteChannelNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteChannelNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteChannelNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}/channelNamespaces/{name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteChannelNamespaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteChannelNamespaceInput(v *DeleteChannelNamespaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + } + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + return err + } + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteDataSource struct { } @@ -2472,11 +2843,153 @@ func awsRestjson1_serializeOpHttpBindingsFlushApiCacheInput(v *FlushApiCacheInpu return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ApiId == nil || len(*v.ApiId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + } + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetApi struct { +} + +func (*awsRestjson1_serializeOpGetApi) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetApi) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetApiInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetApiInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetApiInput(v *GetApiInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + } + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetApiAssociation struct { +} + +func (*awsRestjson1_serializeOpGetApiAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetApiAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetApiAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/domainnames/{domainName}/apiassociation") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetApiAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetApiAssociationInput(v *GetApiAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainName must not be empty")} } - if v.ApiId != nil { - if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + if v.DomainName != nil { + if err := encoder.SetURI("domainName").String(*v.DomainName); err != nil { return err } } @@ -2484,14 +2997,14 @@ func awsRestjson1_serializeOpHttpBindingsFlushApiCacheInput(v *FlushApiCacheInpu return nil } -type awsRestjson1_serializeOpGetApiAssociation struct { +type awsRestjson1_serializeOpGetApiCache struct { } -func (*awsRestjson1_serializeOpGetApiAssociation) ID() string { +func (*awsRestjson1_serializeOpGetApiCache) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetApiAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetApiCache) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2503,13 +3016,13 @@ func (m *awsRestjson1_serializeOpGetApiAssociation) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetApiAssociationInput) + input, ok := in.Parameters.(*GetApiCacheInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v1/domainnames/{domainName}/apiassociation") + opPath, opQuery := httpbinding.SplitURI("/v1/apis/{apiId}/ApiCaches") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2525,7 +3038,7 @@ func (m *awsRestjson1_serializeOpGetApiAssociation) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetApiAssociationInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetApiCacheInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2538,16 +3051,16 @@ func (m *awsRestjson1_serializeOpGetApiAssociation) HandleSerialize(ctx context. span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetApiAssociationInput(v *GetApiAssociationInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetApiCacheInput(v *GetApiCacheInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.DomainName == nil || len(*v.DomainName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member domainName must not be empty")} + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} } - if v.DomainName != nil { - if err := encoder.SetURI("domainName").String(*v.DomainName); err != nil { + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { return err } } @@ -2555,14 +3068,14 @@ func awsRestjson1_serializeOpHttpBindingsGetApiAssociationInput(v *GetApiAssocia return nil } -type awsRestjson1_serializeOpGetApiCache struct { +type awsRestjson1_serializeOpGetChannelNamespace struct { } -func (*awsRestjson1_serializeOpGetApiCache) ID() string { +func (*awsRestjson1_serializeOpGetChannelNamespace) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetApiCache) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetChannelNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2574,13 +3087,13 @@ func (m *awsRestjson1_serializeOpGetApiCache) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetApiCacheInput) + input, ok := in.Parameters.(*GetChannelNamespaceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/v1/apis/{apiId}/ApiCaches") + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}/channelNamespaces/{name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -2596,7 +3109,7 @@ func (m *awsRestjson1_serializeOpGetApiCache) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsGetApiCacheInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsGetChannelNamespaceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2609,7 +3122,7 @@ func (m *awsRestjson1_serializeOpGetApiCache) HandleSerialize(ctx context.Contex span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetApiCacheInput(v *GetApiCacheInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetChannelNamespaceInput(v *GetChannelNamespaceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -2623,6 +3136,15 @@ func awsRestjson1_serializeOpHttpBindingsGetApiCacheInput(v *GetApiCacheInput, e } } + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + return nil } @@ -3564,6 +4086,155 @@ func awsRestjson1_serializeOpHttpBindingsListApiKeysInput(v *ListApiKeysInput, e return nil } +type awsRestjson1_serializeOpListApis struct { +} + +func (*awsRestjson1_serializeOpListApis) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListApis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListApisInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListApisInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListApisInput(v *ListApisInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListChannelNamespaces struct { +} + +func (*awsRestjson1_serializeOpListChannelNamespaces) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListChannelNamespaces) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListChannelNamespacesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}/channelNamespaces") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListChannelNamespacesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListChannelNamespacesInput(v *ListChannelNamespacesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + } + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListDataSources struct { } @@ -4857,11 +5528,99 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } - if err != nil { + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateApi struct { +} + +func (*awsRestjson1_serializeOpUpdateApi) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateApi) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateApiInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateApiInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateApiInput(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} } @@ -4874,26 +5633,44 @@ func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsUpdateApiInput(v *UpdateApiInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { return err } } - if v.TagKeys != nil { - for i := range v.TagKeys { - encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateApiInput(v *UpdateApiInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EventConfig != nil { + ok := object.Key("eventConfig") + if err := awsRestjson1_serializeDocumentEventConfig(v.EventConfig, ok); err != nil { + return err } } + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.OwnerContact != nil { + ok := object.Key("ownerContact") + ok.String(*v.OwnerContact) + } + return nil } @@ -5114,6 +5891,123 @@ func awsRestjson1_serializeOpDocumentUpdateApiKeyInput(v *UpdateApiKeyInput, val return nil } +type awsRestjson1_serializeOpUpdateChannelNamespace struct { +} + +func (*awsRestjson1_serializeOpUpdateChannelNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateChannelNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateChannelNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v2/apis/{apiId}/channelNamespaces/{name}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateChannelNamespaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateChannelNamespaceInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateChannelNamespaceInput(v *UpdateChannelNamespaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApiId == nil || len(*v.ApiId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member apiId must not be empty")} + } + if v.ApiId != nil { + if err := encoder.SetURI("apiId").String(*v.ApiId); err != nil { + return err + } + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateChannelNamespaceInput(v *UpdateChannelNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CodeHandlers != nil { + ok := object.Key("codeHandlers") + ok.String(*v.CodeHandlers) + } + + if v.PublishAuthModes != nil { + ok := object.Key("publishAuthModes") + if err := awsRestjson1_serializeDocumentAuthModes(v.PublishAuthModes, ok); err != nil { + return err + } + } + + if v.SubscribeAuthModes != nil { + ok := object.Key("subscribeAuthModes") + if err := awsRestjson1_serializeDocumentAuthModes(v.SubscribeAuthModes, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateDataSource struct { } @@ -6149,6 +7043,31 @@ func awsRestjson1_serializeDocumentAppSyncRuntime(v *types.AppSyncRuntime, value return nil } +func awsRestjson1_serializeDocumentAuthMode(v *types.AuthMode, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentAuthModes(v []types.AuthMode, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAuthMode(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAuthorizationConfig(v *types.AuthorizationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6168,6 +7087,52 @@ func awsRestjson1_serializeDocumentAuthorizationConfig(v *types.AuthorizationCon return nil } +func awsRestjson1_serializeDocumentAuthProvider(v *types.AuthProvider, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthType) > 0 { + ok := object.Key("authType") + ok.String(string(v.AuthType)) + } + + if v.CognitoConfig != nil { + ok := object.Key("cognitoConfig") + if err := awsRestjson1_serializeDocumentCognitoConfig(v.CognitoConfig, ok); err != nil { + return err + } + } + + if v.LambdaAuthorizerConfig != nil { + ok := object.Key("lambdaAuthorizerConfig") + if err := awsRestjson1_serializeDocumentLambdaAuthorizerConfig(v.LambdaAuthorizerConfig, ok); err != nil { + return err + } + } + + if v.OpenIDConnectConfig != nil { + ok := object.Key("openIDConnectConfig") + if err := awsRestjson1_serializeDocumentOpenIDConnectConfig(v.OpenIDConnectConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAuthProviders(v []types.AuthProvider, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAuthProvider(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAwsIamConfig(v *types.AwsIamConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6215,6 +7180,28 @@ func awsRestjson1_serializeDocumentCachingKeys(v []string, value smithyjson.Valu return nil } +func awsRestjson1_serializeDocumentCognitoConfig(v *types.CognitoConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppIdClientRegex != nil { + ok := object.Key("appIdClientRegex") + ok.String(*v.AppIdClientRegex) + } + + if v.AwsRegion != nil { + ok := object.Key("awsRegion") + ok.String(*v.AwsRegion) + } + + if v.UserPoolId != nil { + ok := object.Key("userPoolId") + ok.String(*v.UserPoolId) + } + + return nil +} + func awsRestjson1_serializeDocumentCognitoUserPoolConfig(v *types.CognitoUserPoolConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6355,6 +7342,65 @@ func awsRestjson1_serializeDocumentEventBridgeDataSourceConfig(v *types.EventBri return nil } +func awsRestjson1_serializeDocumentEventConfig(v *types.EventConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AuthProviders != nil { + ok := object.Key("authProviders") + if err := awsRestjson1_serializeDocumentAuthProviders(v.AuthProviders, ok); err != nil { + return err + } + } + + if v.ConnectionAuthModes != nil { + ok := object.Key("connectionAuthModes") + if err := awsRestjson1_serializeDocumentAuthModes(v.ConnectionAuthModes, ok); err != nil { + return err + } + } + + if v.DefaultPublishAuthModes != nil { + ok := object.Key("defaultPublishAuthModes") + if err := awsRestjson1_serializeDocumentAuthModes(v.DefaultPublishAuthModes, ok); err != nil { + return err + } + } + + if v.DefaultSubscribeAuthModes != nil { + ok := object.Key("defaultSubscribeAuthModes") + if err := awsRestjson1_serializeDocumentAuthModes(v.DefaultSubscribeAuthModes, ok); err != nil { + return err + } + } + + if v.LogConfig != nil { + ok := object.Key("logConfig") + if err := awsRestjson1_serializeDocumentEventLogConfig(v.LogConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEventLogConfig(v *types.EventLogConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CloudWatchLogsRoleArn != nil { + ok := object.Key("cloudWatchLogsRoleArn") + ok.String(*v.CloudWatchLogsRoleArn) + } + + if len(v.LogLevel) > 0 { + ok := object.Key("logLevel") + ok.String(string(v.LogLevel)) + } + + return nil +} + func awsRestjson1_serializeDocumentFunctionsIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/appsync/snapshot/api_op_CreateApi.go.snap b/service/appsync/snapshot/api_op_CreateApi.go.snap new file mode 100644 index 00000000000..b16efe069ee --- /dev/null +++ b/service/appsync/snapshot/api_op_CreateApi.go.snap @@ -0,0 +1,41 @@ +CreateApi + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_CreateChannelNamespace.go.snap b/service/appsync/snapshot/api_op_CreateChannelNamespace.go.snap new file mode 100644 index 00000000000..be1755a8dfc --- /dev/null +++ b/service/appsync/snapshot/api_op_CreateChannelNamespace.go.snap @@ -0,0 +1,41 @@ +CreateChannelNamespace + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_DeleteApi.go.snap b/service/appsync/snapshot/api_op_DeleteApi.go.snap new file mode 100644 index 00000000000..c2e01a8ebdb --- /dev/null +++ b/service/appsync/snapshot/api_op_DeleteApi.go.snap @@ -0,0 +1,41 @@ +DeleteApi + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_DeleteChannelNamespace.go.snap b/service/appsync/snapshot/api_op_DeleteChannelNamespace.go.snap new file mode 100644 index 00000000000..320cae74518 --- /dev/null +++ b/service/appsync/snapshot/api_op_DeleteChannelNamespace.go.snap @@ -0,0 +1,41 @@ +DeleteChannelNamespace + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_GetApi.go.snap b/service/appsync/snapshot/api_op_GetApi.go.snap new file mode 100644 index 00000000000..2453998780d --- /dev/null +++ b/service/appsync/snapshot/api_op_GetApi.go.snap @@ -0,0 +1,41 @@ +GetApi + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_GetChannelNamespace.go.snap b/service/appsync/snapshot/api_op_GetChannelNamespace.go.snap new file mode 100644 index 00000000000..0ba7daa02da --- /dev/null +++ b/service/appsync/snapshot/api_op_GetChannelNamespace.go.snap @@ -0,0 +1,41 @@ +GetChannelNamespace + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_ListApis.go.snap b/service/appsync/snapshot/api_op_ListApis.go.snap new file mode 100644 index 00000000000..008079cf385 --- /dev/null +++ b/service/appsync/snapshot/api_op_ListApis.go.snap @@ -0,0 +1,40 @@ +ListApis + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_ListChannelNamespaces.go.snap b/service/appsync/snapshot/api_op_ListChannelNamespaces.go.snap new file mode 100644 index 00000000000..731990da3bd --- /dev/null +++ b/service/appsync/snapshot/api_op_ListChannelNamespaces.go.snap @@ -0,0 +1,41 @@ +ListChannelNamespaces + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_UpdateApi.go.snap b/service/appsync/snapshot/api_op_UpdateApi.go.snap new file mode 100644 index 00000000000..ba48351990f --- /dev/null +++ b/service/appsync/snapshot/api_op_UpdateApi.go.snap @@ -0,0 +1,41 @@ +UpdateApi + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot/api_op_UpdateChannelNamespace.go.snap b/service/appsync/snapshot/api_op_UpdateChannelNamespace.go.snap new file mode 100644 index 00000000000..6491a52b0fa --- /dev/null +++ b/service/appsync/snapshot/api_op_UpdateChannelNamespace.go.snap @@ -0,0 +1,41 @@ +UpdateChannelNamespace + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/appsync/snapshot_test.go b/service/appsync/snapshot_test.go index 2297ad2bb52..2b33031dea9 100644 --- a/service/appsync/snapshot_test.go +++ b/service/appsync/snapshot_test.go @@ -98,6 +98,18 @@ func TestCheckSnapshot_AssociateSourceGraphqlApi(t *testing.T) { } } +func TestCheckSnapshot_CreateApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateApiCache(t *testing.T) { svc := New(Options{}) _, err := svc.CreateApiCache(context.Background(), nil, func(o *Options) { @@ -122,6 +134,18 @@ func TestCheckSnapshot_CreateApiKey(t *testing.T) { } } +func TestCheckSnapshot_CreateChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.CreateDataSource(context.Background(), nil, func(o *Options) { @@ -194,6 +218,18 @@ func TestCheckSnapshot_CreateType(t *testing.T) { } } +func TestCheckSnapshot_DeleteApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteApiCache(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteApiCache(context.Background(), nil, func(o *Options) { @@ -218,6 +254,18 @@ func TestCheckSnapshot_DeleteApiKey(t *testing.T) { } } +func TestCheckSnapshot_DeleteChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteDataSource(context.Background(), nil, func(o *Options) { @@ -362,6 +410,18 @@ func TestCheckSnapshot_FlushApiCache(t *testing.T) { } } +func TestCheckSnapshot_GetApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetApiAssociation(t *testing.T) { svc := New(Options{}) _, err := svc.GetApiAssociation(context.Background(), nil, func(o *Options) { @@ -386,6 +446,18 @@ func TestCheckSnapshot_GetApiCache(t *testing.T) { } } +func TestCheckSnapshot_GetChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.GetDataSource(context.Background(), nil, func(o *Options) { @@ -530,6 +602,30 @@ func TestCheckSnapshot_ListApiKeys(t *testing.T) { } } +func TestCheckSnapshot_ListApis(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListApis(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListApis") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListChannelNamespaces(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListChannelNamespaces(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListChannelNamespaces") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListDataSources(t *testing.T) { svc := New(Options{}) _, err := svc.ListDataSources(context.Background(), nil, func(o *Options) { @@ -722,6 +818,18 @@ func TestCheckSnapshot_UntagResource(t *testing.T) { } } +func TestCheckSnapshot_UpdateApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateApiCache(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateApiCache(context.Background(), nil, func(o *Options) { @@ -746,6 +854,18 @@ func TestCheckSnapshot_UpdateApiKey(t *testing.T) { } } +func TestCheckSnapshot_UpdateChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateDataSource(context.Background(), nil, func(o *Options) { @@ -865,6 +985,18 @@ func TestUpdateSnapshot_AssociateSourceGraphqlApi(t *testing.T) { } } +func TestUpdateSnapshot_CreateApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateApiCache(t *testing.T) { svc := New(Options{}) _, err := svc.CreateApiCache(context.Background(), nil, func(o *Options) { @@ -889,6 +1021,18 @@ func TestUpdateSnapshot_CreateApiKey(t *testing.T) { } } +func TestUpdateSnapshot_CreateChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.CreateDataSource(context.Background(), nil, func(o *Options) { @@ -961,6 +1105,18 @@ func TestUpdateSnapshot_CreateType(t *testing.T) { } } +func TestUpdateSnapshot_DeleteApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteApiCache(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteApiCache(context.Background(), nil, func(o *Options) { @@ -985,6 +1141,18 @@ func TestUpdateSnapshot_DeleteApiKey(t *testing.T) { } } +func TestUpdateSnapshot_DeleteChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteDataSource(context.Background(), nil, func(o *Options) { @@ -1129,6 +1297,18 @@ func TestUpdateSnapshot_FlushApiCache(t *testing.T) { } } +func TestUpdateSnapshot_GetApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetApiAssociation(t *testing.T) { svc := New(Options{}) _, err := svc.GetApiAssociation(context.Background(), nil, func(o *Options) { @@ -1153,6 +1333,18 @@ func TestUpdateSnapshot_GetApiCache(t *testing.T) { } } +func TestUpdateSnapshot_GetChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.GetDataSource(context.Background(), nil, func(o *Options) { @@ -1297,6 +1489,30 @@ func TestUpdateSnapshot_ListApiKeys(t *testing.T) { } } +func TestUpdateSnapshot_ListApis(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListApis(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListApis") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListChannelNamespaces(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListChannelNamespaces(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListChannelNamespaces") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListDataSources(t *testing.T) { svc := New(Options{}) _, err := svc.ListDataSources(context.Background(), nil, func(o *Options) { @@ -1489,6 +1705,18 @@ func TestUpdateSnapshot_UntagResource(t *testing.T) { } } +func TestUpdateSnapshot_UpdateApi(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateApi(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateApi") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateApiCache(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateApiCache(context.Background(), nil, func(o *Options) { @@ -1513,6 +1741,18 @@ func TestUpdateSnapshot_UpdateApiKey(t *testing.T) { } } +func TestUpdateSnapshot_UpdateChannelNamespace(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateChannelNamespace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateChannelNamespace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateDataSource(context.Background(), nil, func(o *Options) { diff --git a/service/appsync/types/enums.go b/service/appsync/types/enums.go index b8db3c685c7..815c58162c1 100644 --- a/service/appsync/types/enums.go +++ b/service/appsync/types/enums.go @@ -344,6 +344,31 @@ func (DefaultAction) Values() []DefaultAction { } } +type EventLogLevel string + +// Enum values for EventLogLevel +const ( + EventLogLevelNone EventLogLevel = "NONE" + EventLogLevelError EventLogLevel = "ERROR" + EventLogLevelAll EventLogLevel = "ALL" + EventLogLevelInfo EventLogLevel = "INFO" + EventLogLevelDebug EventLogLevel = "DEBUG" +) + +// Values returns all known values for EventLogLevel. 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 (EventLogLevel) Values() []EventLogLevel { + return []EventLogLevel{ + "NONE", + "ERROR", + "ALL", + "INFO", + "DEBUG", + } +} + type FieldLogLevel string // Enum values for FieldLogLevel diff --git a/service/appsync/types/errors.go b/service/appsync/types/errors.go index e7323bc7da1..410dd91a678 100644 --- a/service/appsync/types/errors.go +++ b/service/appsync/types/errors.go @@ -171,6 +171,35 @@ func (e *ConcurrentModificationException) ErrorCode() string { } func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// A conflict with a previous successful update is detected. This typically occurs +// when the previous update did not have time to propagate before the next update +// was made. A retry (with appropriate backoff logic) is the recommended response +// to this exception. +type ConflictException struct { + Message *string + + ErrorCodeOverride *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 GraphQL schema is not valid. type GraphQLSchemaException struct { Message *string @@ -276,6 +305,32 @@ func (e *NotFoundException) ErrorCode() string { } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The operation exceeded the service quota for this resource. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *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 } + // You aren't authorized to perform this operation. type UnauthorizedException struct { Message *string diff --git a/service/appsync/types/types.go b/service/appsync/types/types.go index 6c47d1e0e34..e9708ceb319 100644 --- a/service/appsync/types/types.go +++ b/service/appsync/types/types.go @@ -26,6 +26,46 @@ type AdditionalAuthenticationProvider struct { noSmithyDocumentSerde } +// Describes an AppSync API. You can use Api for an AppSync API with your +// preferred configuration, such as an Event API that provides real-time message +// publishing and message subscriptions over WebSockets. +type Api struct { + + // The Amazon Resource Name (ARN) for the Api . + ApiArn *string + + // The Api ID. + ApiId *string + + // The date and time that the Api was created. + Created *time.Time + + // The DNS records for the API. This will include an HTTP and a real-time endpoint. + Dns map[string]string + + // The Event API configuration. This includes the default authorization + // configuration for connecting, publishing, and subscribing to an Event API. + EventConfig *EventConfig + + // The name of the Api . + Name *string + + // The owner contact information for the Api + OwnerContact *string + + // A map with keys of TagKey objects and values of TagValue objects. + Tags map[string]string + + // The Amazon Resource Name (ARN) of the WAF web access control list (web ACL) + // associated with this Api , if one exists. + WafWebAclArn *string + + // A flag indicating whether to use X-Ray tracing for this Api . + XrayEnabled bool + + noSmithyDocumentSerde +} + // Describes an ApiAssociation object. type ApiAssociation struct { @@ -226,6 +266,18 @@ type AppSyncRuntime struct { noSmithyDocumentSerde } +// Describes an authorization configuration. Use AuthMode to specify the +// publishing and subscription authorization configuration for an Event API. +type AuthMode struct { + + // The authorization type. + // + // This member is required. + AuthType AuthenticationType + + noSmithyDocumentSerde +} + // The authorization configuration in case the HTTP endpoint requires // authorization. type AuthorizationConfig struct { @@ -243,6 +295,28 @@ type AuthorizationConfig struct { noSmithyDocumentSerde } +// Describes an authorization provider. +type AuthProvider struct { + + // The authorization type. + // + // This member is required. + AuthType AuthenticationType + + // Describes an Amazon Cognito user pool configuration. + CognitoConfig *CognitoConfig + + // A LambdaAuthorizerConfig specifies how to authorize AppSync API access when + // using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have + // only one Lambda authorizer configured at a time. + LambdaAuthorizerConfig *LambdaAuthorizerConfig + + // Describes an OpenID Connect (OIDC) configuration. + OpenIDConnectConfig *OpenIDConnectConfig + + noSmithyDocumentSerde +} + // The Identity and Access Management (IAM) configuration. type AwsIamConfig struct { @@ -284,6 +358,44 @@ type CachingConfig struct { noSmithyDocumentSerde } +// Describes a channel namespace associated with an Api . The ChannelNamespace +// contains the definitions for code handlers for the Api . +type ChannelNamespace struct { + + // The Api ID. + ApiId *string + + // The Amazon Resource Name (ARN) for the ChannelNamespace . + ChannelNamespaceArn *string + + // The event handler functions that run custom business logic to process published + // events and subscribe requests. + CodeHandlers *string + + // The date and time that the ChannelNamespace was created. + Created *time.Time + + // The date and time that the ChannelNamespace was last changed. + LastModified *time.Time + + // The name of the channel namespace. This name must be unique within the Api . + Name *string + + // The authorization mode to use for publishing messages on the channel namespace. + // This configuration overrides the default Api authorization configuration. + PublishAuthModes []AuthMode + + // The authorization mode to use for subscribing to messages on the channel + // namespace. This configuration overrides the default Api authorization + // configuration. + SubscribeAuthModes []AuthMode + + // A map with keys of TagKey objects and values of TagValue objects. + Tags map[string]string + + noSmithyDocumentSerde +} + // Describes an AppSync error. type CodeError struct { @@ -319,6 +431,26 @@ type CodeErrorLocation struct { noSmithyDocumentSerde } +// Describes an Amazon Cognito configuration. +type CognitoConfig struct { + + // The Amazon Web Services Region in which the user pool was created. + // + // This member is required. + AwsRegion *string + + // The user pool ID. + // + // This member is required. + UserPoolId *string + + // A regular expression for validating the incoming Amazon Cognito user pool app + // client ID. If this value isn't set, no filtering is applied. + AppIdClientRegex *string + + noSmithyDocumentSerde +} + // Describes an Amazon Cognito user pool configuration. type CognitoUserPoolConfig struct { @@ -764,6 +896,53 @@ type EventBridgeDataSourceConfig struct { noSmithyDocumentSerde } +// Describes the authorization configuration for connections, message publishing, +// message subscriptions, and logging for an Event API. +type EventConfig struct { + + // A list of authorization providers. + // + // This member is required. + AuthProviders []AuthProvider + + // A list of valid authorization modes for the Event API connections. + // + // This member is required. + ConnectionAuthModes []AuthMode + + // A list of valid authorization modes for the Event API publishing. + // + // This member is required. + DefaultPublishAuthModes []AuthMode + + // A list of valid authorization modes for the Event API subscriptions. + // + // This member is required. + DefaultSubscribeAuthModes []AuthMode + + // The CloudWatch Logs configuration for the Event API. + LogConfig *EventLogConfig + + noSmithyDocumentSerde +} + +// Describes the CloudWatch Logs configuration for the Event API. +type EventLogConfig struct { + + // The IAM service role that AppSync assumes to publish CloudWatch Logs in your + // account. + // + // This member is required. + CloudWatchLogsRoleArn *string + + // The type of information to log for the Event API. + // + // This member is required. + LogLevel EventLogLevel + + noSmithyDocumentSerde +} + // A function is a reusable entity. You can use multiple functions to compose the // resolver logic. type FunctionConfiguration struct { @@ -999,12 +1178,11 @@ type LogConfig struct { // This member is required. CloudWatchLogsRoleArn *string - // The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL. + // The field logging level. Values can be NONE, ERROR, or ALL. // // - NONE: No field-level logs are captured. // - // - ERROR: Logs the following information only for the fields that are in the - // error category: + // - ERROR: Logs the following information only for the fields that are in error: // // - The error section in the server response. // @@ -1012,30 +1190,11 @@ type LogConfig struct { // // - The generated request/response functions that got resolved for error fields. // - // - INFO: Logs the following information only for the fields that are in the - // info and error categories: - // - // - Info-level messages. - // - // - The user messages sent through $util.log.info and console.log . - // - // - Field-level tracing and mapping logs are not shown. - // - // - DEBUG: Logs the following information only for the fields that are in the - // debug, info, and error categories: - // - // - Debug-level messages. - // - // - The user messages sent through $util.log.info , $util.log.debug , - // console.log , and console.debug . - // - // - Field-level tracing and mapping logs are not shown. - // // - ALL: The following information is logged for all fields in the query: // // - Field-level tracing information. // - // - The generated request/response functions that were resolved for each field. + // - The generated request/response functions that got resolved for each field. // // This member is required. FieldLogLevel FieldLogLevel diff --git a/service/appsync/validators.go b/service/appsync/validators.go index 977f8a62e37..9b3430238c9 100644 --- a/service/appsync/validators.go +++ b/service/appsync/validators.go @@ -90,6 +90,26 @@ func (m *validateOpCreateApiCache) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpCreateApi struct { +} + +func (*validateOpCreateApi) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateApi) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateApiInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateApiInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateApiKey struct { } @@ -110,6 +130,26 @@ func (m *validateOpCreateApiKey) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpCreateChannelNamespace struct { +} + +func (*validateOpCreateChannelNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateChannelNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateChannelNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateChannelNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateDataSource struct { } @@ -250,6 +290,26 @@ func (m *validateOpDeleteApiCache) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpDeleteApi struct { +} + +func (*validateOpDeleteApi) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteApi) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteApiInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteApiInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteApiKey struct { } @@ -270,6 +330,26 @@ func (m *validateOpDeleteApiKey) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpDeleteChannelNamespace struct { +} + +func (*validateOpDeleteChannelNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteChannelNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteChannelNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteChannelNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDataSource struct { } @@ -550,6 +630,46 @@ func (m *validateOpGetApiCache) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpGetApi struct { +} + +func (*validateOpGetApi) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetApi) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetApiInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetApiInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetChannelNamespace struct { +} + +func (*validateOpGetChannelNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetChannelNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetChannelNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetChannelNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetDataSource struct { } @@ -790,6 +910,26 @@ func (m *validateOpListApiKeys) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpListChannelNamespaces struct { +} + +func (*validateOpListChannelNamespaces) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListChannelNamespaces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListChannelNamespacesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListChannelNamespacesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListDataSources struct { } @@ -1090,6 +1230,26 @@ func (m *validateOpUpdateApiCache) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpUpdateApi struct { +} + +func (*validateOpUpdateApi) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateApi) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateApiInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateApiInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateApiKey struct { } @@ -1110,6 +1270,26 @@ func (m *validateOpUpdateApiKey) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpUpdateChannelNamespace struct { +} + +func (*validateOpUpdateChannelNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateChannelNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateChannelNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateChannelNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateDataSource struct { } @@ -1266,10 +1446,18 @@ func addOpCreateApiCacheValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateApiCache{}, middleware.After) } +func addOpCreateApiValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateApi{}, middleware.After) +} + func addOpCreateApiKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateApiKey{}, middleware.After) } +func addOpCreateChannelNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateChannelNamespace{}, middleware.After) +} + func addOpCreateDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataSource{}, middleware.After) } @@ -1298,10 +1486,18 @@ func addOpDeleteApiCacheValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteApiCache{}, middleware.After) } +func addOpDeleteApiValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteApi{}, middleware.After) +} + func addOpDeleteApiKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteApiKey{}, middleware.After) } +func addOpDeleteChannelNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteChannelNamespace{}, middleware.After) +} + func addOpDeleteDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataSource{}, middleware.After) } @@ -1358,6 +1554,14 @@ func addOpGetApiCacheValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetApiCache{}, middleware.After) } +func addOpGetApiValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetApi{}, middleware.After) +} + +func addOpGetChannelNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetChannelNamespace{}, middleware.After) +} + func addOpGetDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataSource{}, middleware.After) } @@ -1406,6 +1610,10 @@ func addOpListApiKeysValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListApiKeys{}, middleware.After) } +func addOpListChannelNamespacesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListChannelNamespaces{}, middleware.After) +} + func addOpListDataSourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDataSources{}, middleware.After) } @@ -1466,10 +1674,18 @@ func addOpUpdateApiCacheValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateApiCache{}, middleware.After) } +func addOpUpdateApiValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateApi{}, middleware.After) +} + func addOpUpdateApiKeyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateApiKey{}, middleware.After) } +func addOpUpdateChannelNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateChannelNamespace{}, middleware.After) +} + func addOpUpdateDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDataSource{}, middleware.After) } @@ -1560,6 +1776,38 @@ func validateAppSyncRuntime(v *types.AppSyncRuntime) error { } } +func validateAuthMode(v *types.AuthMode) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthMode"} + if len(v.AuthType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AuthType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAuthModes(v []types.AuthMode) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthModes"} + for i := range v { + if err := validateAuthMode(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAuthorizationConfig(v *types.AuthorizationConfig) error { if v == nil { return nil @@ -1575,6 +1823,53 @@ func validateAuthorizationConfig(v *types.AuthorizationConfig) error { } } +func validateAuthProvider(v *types.AuthProvider) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthProvider"} + if len(v.AuthType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AuthType")) + } + if v.CognitoConfig != nil { + if err := validateCognitoConfig(v.CognitoConfig); err != nil { + invalidParams.AddNested("CognitoConfig", err.(smithy.InvalidParamsError)) + } + } + if v.OpenIDConnectConfig != nil { + if err := validateOpenIDConnectConfig(v.OpenIDConnectConfig); err != nil { + invalidParams.AddNested("OpenIDConnectConfig", err.(smithy.InvalidParamsError)) + } + } + if v.LambdaAuthorizerConfig != nil { + if err := validateLambdaAuthorizerConfig(v.LambdaAuthorizerConfig); err != nil { + invalidParams.AddNested("LambdaAuthorizerConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAuthProviders(v []types.AuthProvider) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthProviders"} + for i := range v { + if err := validateAuthProvider(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCachingConfig(v *types.CachingConfig) error { if v == nil { return nil @@ -1587,6 +1882,24 @@ func validateCachingConfig(v *types.CachingConfig) error { } } +func validateCognitoConfig(v *types.CognitoConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CognitoConfig"} + if v.UserPoolId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserPoolId")) + } + if v.AwsRegion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsRegion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCognitoUserPoolConfig(v *types.CognitoUserPoolConfig) error { if v == nil { return nil @@ -1677,6 +1990,69 @@ func validateEventBridgeDataSourceConfig(v *types.EventBridgeDataSourceConfig) e } } +func validateEventConfig(v *types.EventConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventConfig"} + if v.AuthProviders == nil { + invalidParams.Add(smithy.NewErrParamRequired("AuthProviders")) + } else if v.AuthProviders != nil { + if err := validateAuthProviders(v.AuthProviders); err != nil { + invalidParams.AddNested("AuthProviders", err.(smithy.InvalidParamsError)) + } + } + if v.ConnectionAuthModes == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionAuthModes")) + } else if v.ConnectionAuthModes != nil { + if err := validateAuthModes(v.ConnectionAuthModes); err != nil { + invalidParams.AddNested("ConnectionAuthModes", err.(smithy.InvalidParamsError)) + } + } + if v.DefaultPublishAuthModes == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultPublishAuthModes")) + } else if v.DefaultPublishAuthModes != nil { + if err := validateAuthModes(v.DefaultPublishAuthModes); err != nil { + invalidParams.AddNested("DefaultPublishAuthModes", err.(smithy.InvalidParamsError)) + } + } + if v.DefaultSubscribeAuthModes == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultSubscribeAuthModes")) + } else if v.DefaultSubscribeAuthModes != nil { + if err := validateAuthModes(v.DefaultSubscribeAuthModes); err != nil { + invalidParams.AddNested("DefaultSubscribeAuthModes", err.(smithy.InvalidParamsError)) + } + } + if v.LogConfig != nil { + if err := validateEventLogConfig(v.LogConfig); err != nil { + invalidParams.AddNested("LogConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEventLogConfig(v *types.EventLogConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventLogConfig"} + if len(v.LogLevel) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("LogLevel")) + } + if v.CloudWatchLogsRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CloudWatchLogsRoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateHttpDataSourceConfig(v *types.HttpDataSourceConfig) error { if v == nil { return nil @@ -1892,6 +2268,26 @@ func validateOpCreateApiCacheInput(v *CreateApiCacheInput) error { } } +func validateOpCreateApiInput(v *CreateApiInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateApiInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.EventConfig != nil { + if err := validateEventConfig(v.EventConfig); err != nil { + invalidParams.AddNested("EventConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateApiKeyInput(v *CreateApiKeyInput) error { if v == nil { return nil @@ -1907,6 +2303,34 @@ func validateOpCreateApiKeyInput(v *CreateApiKeyInput) error { } } +func validateOpCreateChannelNamespaceInput(v *CreateChannelNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateChannelNamespaceInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.SubscribeAuthModes != nil { + if err := validateAuthModes(v.SubscribeAuthModes); err != nil { + invalidParams.AddNested("SubscribeAuthModes", err.(smithy.InvalidParamsError)) + } + } + if v.PublishAuthModes != nil { + if err := validateAuthModes(v.PublishAuthModes); err != nil { + invalidParams.AddNested("PublishAuthModes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateDataSourceInput(v *CreateDataSourceInput) error { if v == nil { return nil @@ -2117,6 +2541,21 @@ func validateOpDeleteApiCacheInput(v *DeleteApiCacheInput) error { } } +func validateOpDeleteApiInput(v *DeleteApiInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteApiInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteApiKeyInput(v *DeleteApiKeyInput) error { if v == nil { return nil @@ -2135,6 +2574,24 @@ func validateOpDeleteApiKeyInput(v *DeleteApiKeyInput) error { } } +func validateOpDeleteChannelNamespaceInput(v *DeleteChannelNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteChannelNamespaceInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDataSourceInput(v *DeleteDataSourceInput) error { if v == nil { return nil @@ -2379,6 +2836,39 @@ func validateOpGetApiCacheInput(v *GetApiCacheInput) error { } } +func validateOpGetApiInput(v *GetApiInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetApiInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetChannelNamespaceInput(v *GetChannelNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetChannelNamespaceInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetDataSourceInput(v *GetDataSourceInput) error { if v == nil { return nil @@ -2583,6 +3073,21 @@ func validateOpListApiKeysInput(v *ListApiKeysInput) error { } } +func validateOpListChannelNamespacesInput(v *ListChannelNamespacesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListChannelNamespacesInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListDataSourcesInput(v *ListDataSourcesInput) error { if v == nil { return nil @@ -2846,6 +3351,29 @@ func validateOpUpdateApiCacheInput(v *UpdateApiCacheInput) error { } } +func validateOpUpdateApiInput(v *UpdateApiInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateApiInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.EventConfig != nil { + if err := validateEventConfig(v.EventConfig); err != nil { + invalidParams.AddNested("EventConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateApiKeyInput(v *UpdateApiKeyInput) error { if v == nil { return nil @@ -2864,6 +3392,34 @@ func validateOpUpdateApiKeyInput(v *UpdateApiKeyInput) error { } } +func validateOpUpdateChannelNamespaceInput(v *UpdateChannelNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateChannelNamespaceInput"} + if v.ApiId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApiId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.SubscribeAuthModes != nil { + if err := validateAuthModes(v.SubscribeAuthModes); err != nil { + invalidParams.AddNested("SubscribeAuthModes", err.(smithy.InvalidParamsError)) + } + } + if v.PublishAuthModes != nil { + if err := validateAuthModes(v.PublishAuthModes); err != nil { + invalidParams.AddNested("PublishAuthModes", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateDataSourceInput(v *UpdateDataSourceInput) error { if v == nil { return nil @@ -2975,9 +3531,6 @@ func validateOpUpdateGraphqlApiInput(v *UpdateGraphqlApiInput) error { invalidParams.AddNested("LogConfig", err.(smithy.InvalidParamsError)) } } - if len(v.AuthenticationType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("AuthenticationType")) - } if v.UserPoolConfig != nil { if err := validateUserPoolConfig(v.UserPoolConfig); err != nil { invalidParams.AddNested("UserPoolConfig", err.(smithy.InvalidParamsError)) diff --git a/service/connect/types/types.go b/service/connect/types/types.go index bdc89a27dc8..2d3f0c17b3d 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -6289,6 +6289,11 @@ type UserHierarchyGroupSearchFilter struct { // For Amazon Connect instances that are created with the EXISTING_DIRECTORY // identity management type, FirstName , LastName , and Email cannot be updated // from within Amazon Connect because they are managed by the directory. +// +// The FirstName and LastName length constraints below apply only to instances +// using SAML for identity management. If you are using Amazon Connect for identity +// management, the length constraints are 1-255 for FirstName , and 1-256 for +// LastName . type UserIdentityInfo struct { // The email address. If you are using SAML for identity management and include diff --git a/service/datasync/api_op_CreateAgent.go b/service/datasync/api_op_CreateAgent.go index 2a79a6dd300..3925d4e605b 100644 --- a/service/datasync/api_op_CreateAgent.go +++ b/service/datasync/api_op_CreateAgent.go @@ -11,21 +11,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Activates an DataSync agent that you've deployed in your storage environment. -// The activation process associates the agent with your Amazon Web Services -// account. +// Activates an DataSync agent that you deploy in your storage environment. The +// activation process associates the agent with your Amazon Web Services account. // -// If you haven't deployed an agent yet, see the following topics to learn more: +// If you haven't deployed an agent yet, see [Do I need a DataSync agent?] // -// [Agent requirements] -// -// [Create an agent] -// -// If you're transferring between Amazon Web Services storage services, you don't -// need a DataSync agent. -// -// [Agent requirements]: https://docs.aws.amazon.com/datasync/latest/userguide/agent-requirements.html -// [Create an agent]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-agent.html +// [Do I need a DataSync agent?]: https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html func (c *Client) CreateAgent(ctx context.Context, params *CreateAgentInput, optFns ...func(*Options)) (*CreateAgentOutput, error) { if params == nil { params = &CreateAgentInput{} @@ -45,39 +36,37 @@ func (c *Client) CreateAgent(ctx context.Context, params *CreateAgentInput, optF type CreateAgentInput struct { // Specifies your DataSync agent's activation key. If you don't have an activation - // key, see [Activate your agent]. + // key, see [Activating your agent]. // - // [Activate your agent]: https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html + // [Activating your agent]: https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html // // This member is required. ActivationKey *string - // Specifies a name for your agent. You can see this name in the DataSync console. + // Specifies a name for your agent. We recommend specifying a name that you can + // remember. AgentName *string - // Specifies the Amazon Resource Name (ARN) of the security group that protects - // your task's [network interfaces]when [using a virtual private cloud (VPC) endpoint]. You can only specify one ARN. - // - // [network interfaces]: https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html#required-network-interfaces - // [using a virtual private cloud (VPC) endpoint]: https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#choose-service-endpoint-vpc + // Specifies the Amazon Resource Name (ARN) of the security group that allows + // traffic between your agent and VPC service endpoint. You can only specify one + // ARN. SecurityGroupArns []string - // Specifies the ARN of the subnet where you want to run your DataSync task when - // using a VPC endpoint. This is the subnet where DataSync creates and manages the [network interfaces] - // for your transfer. You can only specify one ARN. - // - // [network interfaces]: https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html#required-network-interfaces + // Specifies the ARN of the subnet where your VPC service endpoint is located. You + // can only specify one ARN. SubnetArns []string // Specifies labels that help you categorize, filter, and search for your Amazon // Web Services resources. We recommend creating at least one tag for your agent. Tags []types.TagListEntry - // Specifies the ID of the VPC endpoint that you want your agent to connect to. - // For example, a VPC endpoint ID looks like vpce-01234d5aff67890e1 . + // Specifies the ID of the [VPC service endpoint] that you're using. For example, a VPC endpoint ID + // looks like vpce-01234d5aff67890e1 . + // + // The VPC service endpoint you use must include the DataSync service name (for + // example, com.amazonaws.us-east-2.datasync ). // - // The VPC endpoint you use must include the DataSync service name (for example, - // com.amazonaws.us-east-2.datasync ). + // [VPC service endpoint]: https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#datasync-in-vpc VpcEndpointId *string noSmithyDocumentSerde diff --git a/service/datasync/api_op_CreateLocationEfs.go b/service/datasync/api_op_CreateLocationEfs.go index 56f85c21a50..0e23a76f800 100644 --- a/service/datasync/api_op_CreateLocationEfs.go +++ b/service/datasync/api_op_CreateLocationEfs.go @@ -35,38 +35,51 @@ func (c *Client) CreateLocationEfs(ctx context.Context, params *CreateLocationEf // CreateLocationEfsRequest type CreateLocationEfsInput struct { - // Specifies the subnet and security groups DataSync uses to access your Amazon - // EFS file system. + // Specifies the subnet and security groups DataSync uses to connect to one of + // your Amazon EFS file system's [mount targets]. + // + // [mount targets]: https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html // // This member is required. Ec2Config *types.Ec2Config - // Specifies the ARN for the Amazon EFS file system. + // Specifies the ARN for your Amazon EFS file system. // // This member is required. EfsFilesystemArn *string // Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses - // to access the Amazon EFS file system. + // to mount your Amazon EFS file system. + // + // For more information, see [Accessing restricted file systems]. + // + // [Accessing restricted file systems]: https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html#create-efs-location-iam AccessPointArn *string - // Specifies an Identity and Access Management (IAM) role that DataSync assumes - // when mounting the Amazon EFS file system. + // Specifies an Identity and Access Management (IAM) role that allows DataSync to + // access your Amazon EFS file system. + // + // For information on creating this role, see [Creating a DataSync IAM role for file system access]. + // + // [Creating a DataSync IAM role for file system access]: https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html#create-efs-location-iam-role FileSystemAccessRoleArn *string // Specifies whether you want DataSync to use Transport Layer Security (TLS) 1.2 - // encryption when it copies data to or from the Amazon EFS file system. + // encryption when it transfers data to or from your Amazon EFS file system. // // If you specify an access point using AccessPointArn or an IAM role using // FileSystemAccessRoleArn , you must set this parameter to TLS1_2 . InTransitEncryption types.EfsInTransitEncryption // Specifies a mount path for your Amazon EFS file system. This is where DataSync - // reads or writes data (depending on if this is a source or destination location). - // By default, DataSync uses the root directory, but you can also include - // subdirectories. + // reads or writes data (depending on if this is a source or destination location) + // on your file system. + // + // By default, DataSync uses the root directory (or [access point] if you provide one by using + // AccessPointArn ). You can also include subdirectories using forward slashes (for + // example, /path/to/folder ). // - // You must specify a value with forward slashes (for example, /path/to/folder ). + // [access point]: https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html Subdirectory *string // Specifies the key-value pair that represents a tag that you want to add to the diff --git a/service/datasync/api_op_CreateLocationFsxWindows.go b/service/datasync/api_op_CreateLocationFsxWindows.go index e83f34477a8..0954238e04c 100644 --- a/service/datasync/api_op_CreateLocationFsxWindows.go +++ b/service/datasync/api_op_CreateLocationFsxWindows.go @@ -48,8 +48,12 @@ type CreateLocationFsxWindowsInput struct { // This member is required. Password *string - // Specifies the ARNs of the security groups that provide access to your file - // system's preferred subnet. + // Specifies the ARNs of the Amazon EC2 security groups that provide access to + // your file system's preferred subnet. + // + // The security groups that you specify must be able to communicate with your file + // system's security groups. For information about configuring security groups for + // file system access, see the [Amazon FSx for Windows File Server User Guide]. // // If you choose a security group that doesn't allow connections from within // itself, do one of the following: @@ -59,6 +63,8 @@ type CreateLocationFsxWindowsInput struct { // - Choose a different security group that can communicate with the mount // target's security group. // + // [Amazon FSx for Windows File Server User Guide]: https://docs.aws.amazon.com/fsx/latest/WindowsGuide/limit-access-security-groups.html + // // This member is required. SecurityGroupArns []string diff --git a/service/datasync/api_op_CreateLocationHdfs.go b/service/datasync/api_op_CreateLocationHdfs.go index 89127289510..db48de0031a 100644 --- a/service/datasync/api_op_CreateLocationHdfs.go +++ b/service/datasync/api_op_CreateLocationHdfs.go @@ -34,8 +34,8 @@ func (c *Client) CreateLocationHdfs(ctx context.Context, params *CreateLocationH type CreateLocationHdfsInput struct { - // The Amazon Resource Names (ARNs) of the agents that are used to connect to the - // HDFS cluster. + // The Amazon Resource Names (ARNs) of the DataSync agents that can connect to + // your HDFS cluster. // // This member is required. AgentArns []string @@ -114,7 +114,7 @@ type CreateLocationHdfsInput struct { type CreateLocationHdfsOutput struct { - // The ARN of the source HDFS cluster location that's created. + // The ARN of the source HDFS cluster location that you create. LocationArn *string // Metadata pertaining to the operation's result. diff --git a/service/datasync/api_op_CreateLocationNfs.go b/service/datasync/api_op_CreateLocationNfs.go index 913619d73dc..40f5725a210 100644 --- a/service/datasync/api_op_CreateLocationNfs.go +++ b/service/datasync/api_op_CreateLocationNfs.go @@ -39,12 +39,12 @@ func (c *Client) CreateLocationNfs(ctx context.Context, params *CreateLocationNf // CreateLocationNfsRequest type CreateLocationNfsInput struct { - // Specifies the Amazon Resource Name (ARN) of the DataSync agent that want to - // connect to your NFS file server. + // Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect + // to your NFS file server. // - // You can specify more than one agent. For more information, see [Using multiple agents for transfers]. + // You can specify more than one agent. For more information, see [Using multiple DataSync agents]. // - // [Using multiple agents for transfers]: https://docs.aws.amazon.com/datasync/latest/userguide/multiple-agents.html + // [Using multiple DataSync agents]: https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents // // This member is required. OnPremConfig *types.OnPremConfig diff --git a/service/datasync/api_op_CreateLocationObjectStorage.go b/service/datasync/api_op_CreateLocationObjectStorage.go index 8ced873c5b5..7b97e2ea926 100644 --- a/service/datasync/api_op_CreateLocationObjectStorage.go +++ b/service/datasync/api_op_CreateLocationObjectStorage.go @@ -37,7 +37,7 @@ func (c *Client) CreateLocationObjectStorage(ctx context.Context, params *Create type CreateLocationObjectStorageInput struct { // Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can - // securely connect with your location. + // connect with your object storage system. // // This member is required. AgentArns []string diff --git a/service/datasync/api_op_CreateLocationSmb.go b/service/datasync/api_op_CreateLocationSmb.go index 3849c537250..88d89b4f341 100644 --- a/service/datasync/api_op_CreateLocationSmb.go +++ b/service/datasync/api_op_CreateLocationSmb.go @@ -35,8 +35,8 @@ func (c *Client) CreateLocationSmb(ctx context.Context, params *CreateLocationSm // CreateLocationSmbRequest type CreateLocationSmbInput struct { - // Specifies the DataSync agent (or agents) which you want to connect to your SMB - // file server. You specify an agent by using its Amazon Resource Name (ARN). + // Specifies the DataSync agent (or agents) that can connect to your SMB file + // server. You specify an agent by using its Amazon Resource Name (ARN). // // This member is required. AgentArns []string diff --git a/service/datasync/api_op_CreateTask.go b/service/datasync/api_op_CreateTask.go index fad5a00989f..b1b7395db5d 100644 --- a/service/datasync/api_op_CreateTask.go +++ b/service/datasync/api_op_CreateTask.go @@ -51,6 +51,9 @@ type CreateTaskInput struct { // Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for // monitoring your task. + // + // For Enhanced mode tasks, you don't need to specify anything. DataSync + // automatically sends logs to a CloudWatch log group named /aws/datasync . CloudWatchLogGroupArn *string // Specifies exclude filters that define the files, objects, and folders in your @@ -60,9 +63,9 @@ type CreateTaskInput struct { // [Specifying what DataSync transfers by using filters]: https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html Excludes []types.FilterRule - // Specifies include filters define the files, objects, and folders in your source - // location that you want DataSync to transfer. For more information and examples, - // see [Specifying what DataSync transfers by using filters]. + // Specifies include filters that define the files, objects, and folders in your + // source location that you want DataSync to transfer. For more information and + // examples, see [Specifying what DataSync transfers by using filters]. // // [Specifying what DataSync transfers by using filters]: https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html Includes []types.FilterRule @@ -97,6 +100,24 @@ type CreateTaskInput struct { // DataSync resources. Tags []types.TagListEntry + // Specifies one of the following task modes for your data transfer: + // + // - ENHANCED - Transfer virtually unlimited numbers of objects with enhanced + // metrics, more detailed logs, and higher performance than Basic mode. Currently + // available for transfers between Amazon S3 locations. + // + // To create an Enhanced mode task, the IAM role that you use to call the + // CreateTask operation must have the iam:CreateServiceLinkedRole permission. + // + // - BASIC (default) - Transfer files or objects between Amazon Web Services + // storage and on-premises, edge, or other cloud storage. DataSync [quotas]apply. + // + // For more information, see [Understanding task mode differences]. + // + // [Understanding task mode differences]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html#task-mode-differences + // [quotas]: https://docs.aws.amazon.com/datasync/latest/userguide/datasync-limits.html + TaskMode types.TaskMode + // Specifies how you want to configure a task report, which provides detailed // information about your DataSync transfer. For more information, see [Monitoring your DataSync transfers with task reports]. // diff --git a/service/datasync/api_op_DescribeLocationEfs.go b/service/datasync/api_op_DescribeLocationEfs.go index 6eb48382076..d44e1e579e4 100644 --- a/service/datasync/api_op_DescribeLocationEfs.go +++ b/service/datasync/api_op_DescribeLocationEfs.go @@ -46,21 +46,31 @@ type DescribeLocationEfsOutput struct { // The ARN of the access point that DataSync uses to access the Amazon EFS file // system. + // + // For more information, see [Accessing restricted file systems]. + // + // [Accessing restricted file systems]: https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html#create-efs-location-iam AccessPointArn *string // The time that the location was created. CreationTime *time.Time - // The subnet and security groups that DataSync uses to access your Amazon EFS - // file system. + // The subnet and security groups that DataSync uses to connect to one of your + // Amazon EFS file system's [mount targets]. + // + // [mount targets]: https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html Ec2Config *types.Ec2Config - // The Identity and Access Management (IAM) role that DataSync assumes when - // mounting the Amazon EFS file system. + // The Identity and Access Management (IAM) role that allows DataSync to access + // your Amazon EFS file system. + // + // For more information, see [Creating a DataSync IAM role for file system access]. + // + // [Creating a DataSync IAM role for file system access]: https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html#create-efs-location-iam-role FileSystemAccessRoleArn *string - // Describes whether DataSync uses Transport Layer Security (TLS) encryption when - // copying data to or from the Amazon EFS file system. + // Indicates whether DataSync uses Transport Layer Security (TLS) encryption when + // transferring data to or from the Amazon EFS file system. InTransitEncryption types.EfsInTransitEncryption // The ARN of the Amazon EFS file system location. diff --git a/service/datasync/api_op_DescribeLocationFsxWindows.go b/service/datasync/api_op_DescribeLocationFsxWindows.go index acd65ccd1e8..fce2c2b5322 100644 --- a/service/datasync/api_op_DescribeLocationFsxWindows.go +++ b/service/datasync/api_op_DescribeLocationFsxWindows.go @@ -55,8 +55,13 @@ type DescribeLocationFsxWindowsOutput struct { // location. LocationUri *string - // The ARNs of the security groups that are configured for the FSx for Windows - // File Server file system. + // The ARNs of the Amazon EC2 security groups that provide access to your file + // system's preferred subnet. + // + // For information about configuring security groups for file system access, see + // the [Amazon FSx for Windows File Server User Guide]. + // + // [Amazon FSx for Windows File Server User Guide]: https://docs.aws.amazon.com/fsx/latest/WindowsGuide/limit-access-security-groups.html SecurityGroupArns []string // The user with the permissions to mount and access the FSx for Windows File diff --git a/service/datasync/api_op_DescribeLocationNfs.go b/service/datasync/api_op_DescribeLocationNfs.go index 78b51687287..8854a6109e3 100644 --- a/service/datasync/api_op_DescribeLocationNfs.go +++ b/service/datasync/api_op_DescribeLocationNfs.go @@ -56,7 +56,8 @@ type DescribeLocationNfsOutput struct { // The mount options that DataSync uses to mount your NFS file server. MountOptions *types.NfsMountOptions - // The DataSync agents that are connecting to a Network File System (NFS) location. + // The DataSync agents that can connect to your Network File System (NFS) file + // server. OnPremConfig *types.OnPremConfig // Metadata pertaining to the operation's result. diff --git a/service/datasync/api_op_DescribeTask.go b/service/datasync/api_op_DescribeTask.go index ed0c252a1a5..f382edfc783 100644 --- a/service/datasync/api_op_DescribeTask.go +++ b/service/datasync/api_op_DescribeTask.go @@ -47,9 +47,9 @@ type DescribeTaskOutput struct { // The Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring // your task. // - // For more information, see [Monitoring DataSync with Amazon CloudWatch]. + // For more information, see [Monitoring data transfers with CloudWatch Logs]. // - // [Monitoring DataSync with Amazon CloudWatch]: https://docs.aws.amazon.com/datasync/latest/userguide/monitor-datasync.html + // [Monitoring data transfers with CloudWatch Logs]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-logging.html CloudWatchLogGroupArn *string // The time that the task was created. @@ -132,6 +132,11 @@ type DescribeTaskOutput struct { // The ARN of your task. TaskArn *string + // The task mode that you're using. For more information, see [Choosing a task mode for your data transfer]. + // + // [Choosing a task mode for your data transfer]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + TaskMode types.TaskMode + // The configuration of your task report, which provides detailed information // about your DataSync transfer. For more information, see [Monitoring your DataSync transfers with task reports]. // diff --git a/service/datasync/api_op_DescribeTaskExecution.go b/service/datasync/api_op_DescribeTaskExecution.go index 5c3f63b1696..7e0c110ca82 100644 --- a/service/datasync/api_op_DescribeTaskExecution.go +++ b/service/datasync/api_op_DescribeTaskExecution.go @@ -13,8 +13,14 @@ import ( ) // Provides information about an execution of your DataSync task. You can use this -// operation to help monitor the progress of an ongoing transfer or check the +// operation to help monitor the progress of an ongoing data transfer or check the // results of the transfer. +// +// Some DescribeTaskExecution response elements are only relevant to a specific +// task mode. For information, see [Understanding task mode differences]and [Understanding data transfer performance metrics]. +// +// [Understanding task mode differences]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html#task-mode-differences +// [Understanding data transfer performance metrics]: https://docs.aws.amazon.com/datasync/latest/userguide/transfer-performance-metrics.html func (c *Client) DescribeTaskExecution(ctx context.Context, params *DescribeTaskExecutionInput, optFns ...func(*Options)) (*DescribeTaskExecutionOutput, error) { if params == nil { params = &DescribeTaskExecutionInput{} @@ -45,33 +51,63 @@ type DescribeTaskExecutionInput struct { // DescribeTaskExecutionResponse type DescribeTaskExecutionOutput struct { - // The physical number of bytes transferred over the network after compression was - // applied. In most cases, this number is less than BytesTransferred unless the - // data isn't compressible. + // The number of physical bytes that DataSync transfers over the network after + // compression (if compression is possible). This number is typically less than [BytesTransferred] + // unless the data isn't compressible. + // + // Not currently supported with [Enhanced mode tasks]. + // + // [BytesTransferred]: https://docs.aws.amazon.com/datasync/latest/userguide/API_DescribeTaskExecution.html#DataSync-DescribeTaskExecution-response-BytesTransferred + // [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html BytesCompressed int64 - // The total number of bytes that are involved in the transfer. For the number of - // bytes sent over the network, see BytesCompressed . + // The number of bytes that DataSync sends to the network before compression (if + // compression is possible). For the number of bytes transferred over the network, + // see [BytesCompressed]. + // + // [BytesCompressed]: https://docs.aws.amazon.com/datasync/latest/userguide/API_DescribeTaskExecution.html#DataSync-DescribeTaskExecution-response-BytesCompressed BytesTransferred int64 - // The number of logical bytes written to the destination location. + // The number of logical bytes that DataSync actually writes to the destination + // location. BytesWritten int64 - // The estimated physical number of bytes that will transfer over the network. + // The number of logical bytes that DataSync expects to write to the destination + // location. EstimatedBytesToTransfer int64 - // The expected number of files, objects, and directories that DataSync will - // delete in your destination location. If you don't [configure your task]to delete data in the - // destination that isn't in the source, the value is always 0 . + // The number of files, objects, and directories that DataSync expects to delete + // in your destination location. If you don't [configure your task]to delete data in the destination + // that isn't in the source, the value is always 0 . // // [configure your task]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html EstimatedFilesToDelete int64 - // The expected number of files, objects, and directories that DataSync will - // transfer over the network. This value is calculated during the task execution's - // PREPARING phase before the TRANSFERRING phase. The calculation is based on - // comparing the content of the source and destination locations and finding the - // difference that needs to be transferred. + // The number of files, objects, and directories that DataSync expects to transfer + // over the network. This value is calculated during the task execution's PREPARING[step] + // before the TRANSFERRING step. + // + // How this gets calculated depends primarily on your task’s [transfer mode] configuration: + // + // - If TranserMode is set to CHANGED - The calculation is based on comparing the + // content of the source and destination locations and determining the difference + // that needs to be transferred. The difference can include: + // + // - Anything that's added or modified at the source location. + // + // - Anything that's in both locations and modified at the destination after an + // initial transfer (unless [OverwriteMode]is set to NEVER ). + // + // - (Basic task mode only) The number of items that DataSync expects to delete + // (if [PreserveDeletedFiles]is set to REMOVE ). + // + // - If TranserMode is set to ALL - The calculation is based only on the items + // that DataSync finds at the source location. + // + // [transfer mode]: https://docs.aws.amazon.com/datasync/latest/userguide/API_Options.html#DataSync-Type-Options-TransferMode + // [OverwriteMode]: https://docs.aws.amazon.com/datasync/latest/userguide/API_Options.html#DataSync-Type-Options-OverwriteMode + // [step]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses + // [PreserveDeletedFiles]: https://docs.aws.amazon.com/datasync/latest/userguide/API_Options.html#DataSync-Type-Options-PreserveDeletedFiles EstimatedFilesToTransfer int64 // A list of filter rules that exclude specific data during your transfer. For @@ -80,30 +116,59 @@ type DescribeTaskExecutionOutput struct { // [Filtering data transferred by DataSync]: https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html Excludes []types.FilterRule - // The number of files, objects, and directories that DataSync deleted in your - // destination location. If you don't [configure your task]to delete data in the destination that isn't - // in the source, the value is always 0 . + // The number of files, objects, and directories that DataSync actually deletes in + // your destination location. If you don't [configure your task]to delete data in the destination that + // isn't in the source, the value is always 0 . // // [configure your task]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html FilesDeleted int64 - // The number of files, objects, and directories that DataSync skipped during your + // The number of objects that DataSync fails to prepare, transfer, verify, and + // delete during your task execution. + // + // Applies only to [Enhanced mode tasks]. + // + // [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + FilesFailed *types.TaskExecutionFilesFailedDetail + + // The number of objects that DataSync finds at your locations. + // + // Applies only to [Enhanced mode tasks]. + // + // [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + FilesListed *types.TaskExecutionFilesListedDetail + + // The number of objects that DataSync will attempt to transfer after comparing + // your source and destination locations. + // + // Applies only to [Enhanced mode tasks]. + // + // This metric isn't applicable if you configure your task to [transfer all data]. In that scenario, + // DataSync copies everything from the source to the destination without comparing + // differences between the locations. + // + // [transfer all data]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html#task-option-transfer-mode + // [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + FilesPrepared int64 + + // The number of files, objects, and directories that DataSync skips during your // transfer. FilesSkipped int64 - // The actual number of files, objects, and directories that DataSync transferred + // The number of files, objects, and directories that DataSync actually transfers // over the network. This value is updated periodically during the task execution's - // TRANSFERRING phase when something is read from the source and sent over the - // network. + // TRANSFERRING[step] when something is read from the source and sent over the network. // // If DataSync fails to transfer something, this value can be less than // EstimatedFilesToTransfer . In some cases, this value can also be greater than // EstimatedFilesToTransfer . This element is implementation-specific for some - // location types, so don't use it as an exact indication of what transferred or to - // monitor your task execution. + // location types, so don't use it as an exact indication of what's transferring or + // to monitor your task execution. + // + // [step]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses FilesTransferred int64 - // The number of files, objects, and directories that DataSync verified during + // The number of files, objects, and directories that DataSync verifies during // your transfer. // // When you configure your task to [verify only the data that's transferred], DataSync doesn't verify directories in some @@ -162,6 +227,11 @@ type DescribeTaskExecutionOutput struct { // arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2 . TaskExecutionArn *string + // The task mode that you're using. For more information, see [Choosing a task mode for your data transfer]. + // + // [Choosing a task mode for your data transfer]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + TaskMode types.TaskMode + // The configuration of your task report, which provides detailed information // about for your DataSync transfer. For more information, see [Creating a task report]. // diff --git a/service/datasync/api_op_StartTaskExecution.go b/service/datasync/api_op_StartTaskExecution.go index 6c56ad5066d..b27857692d0 100644 --- a/service/datasync/api_op_StartTaskExecution.go +++ b/service/datasync/api_op_StartTaskExecution.go @@ -14,7 +14,7 @@ import ( // Starts an DataSync transfer task. For each task, you can only run one task // execution at a time. // -// There are several phases to a task execution. For more information, see [Task execution statuses]. +// There are several steps to a task execution. For more information, see [Task execution statuses]. // // If you're planning to transfer data to or from an Amazon S3 location, review [how DataSync can affect your S3 request charges] // and the [DataSync pricing page]before you begin. diff --git a/service/datasync/api_op_UpdateLocationHdfs.go b/service/datasync/api_op_UpdateLocationHdfs.go index b5e55f2717d..85f8311d287 100644 --- a/service/datasync/api_op_UpdateLocationHdfs.go +++ b/service/datasync/api_op_UpdateLocationHdfs.go @@ -35,7 +35,8 @@ type UpdateLocationHdfsInput struct { // This member is required. LocationArn *string - // The ARNs of the agents that are used to connect to the HDFS cluster. + // The Amazon Resource Names (ARNs) of the DataSync agents that can connect to + // your HDFS cluster. AgentArns []string // The type of authentication used to determine the identity of the user. diff --git a/service/datasync/api_op_UpdateLocationNfs.go b/service/datasync/api_op_UpdateLocationNfs.go index 9fa934af064..7d767bf84db 100644 --- a/service/datasync/api_op_UpdateLocationNfs.go +++ b/service/datasync/api_op_UpdateLocationNfs.go @@ -43,7 +43,8 @@ type UpdateLocationNfsInput struct { // Specifies how DataSync can access a location using the NFS protocol. MountOptions *types.NfsMountOptions - // The DataSync agents that are connecting to a Network File System (NFS) location. + // The DataSync agents that can connect to your Network File System (NFS) file + // server. OnPremConfig *types.OnPremConfig // Specifies the export path in your NFS file server that you want DataSync to diff --git a/service/datasync/api_op_UpdateLocationObjectStorage.go b/service/datasync/api_op_UpdateLocationObjectStorage.go index 011462295c0..92b05784c03 100644 --- a/service/datasync/api_op_UpdateLocationObjectStorage.go +++ b/service/datasync/api_op_UpdateLocationObjectStorage.go @@ -40,7 +40,7 @@ type UpdateLocationObjectStorageInput struct { AccessKey *string // Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can - // securely connect with your location. + // connect with your object storage system. AgentArns []string // Specifies the secret key (for example, a password) if credentials are required diff --git a/service/datasync/api_op_UpdateLocationSmb.go b/service/datasync/api_op_UpdateLocationSmb.go index 6065ee9c2fd..c9e084ec105 100644 --- a/service/datasync/api_op_UpdateLocationSmb.go +++ b/service/datasync/api_op_UpdateLocationSmb.go @@ -35,8 +35,8 @@ type UpdateLocationSmbInput struct { // This member is required. LocationArn *string - // Specifies the DataSync agent (or agents) which you want to connect to your SMB - // file server. You specify an agent by using its Amazon Resource Name (ARN). + // Specifies the DataSync agent (or agents) that can connect to your SMB file + // server. You specify an agent by using its Amazon Resource Name (ARN). AgentArns []string // Specifies the Windows domain name that your SMB file server belongs to. diff --git a/service/datasync/api_op_UpdateTask.go b/service/datasync/api_op_UpdateTask.go index 78e4f2b3ef3..db76f62a7c0 100644 --- a/service/datasync/api_op_UpdateTask.go +++ b/service/datasync/api_op_UpdateTask.go @@ -38,6 +38,15 @@ type UpdateTaskInput struct { // Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for // monitoring your task. + // + // For Enhanced mode tasks, you must use /aws/datasync as your log group name. For + // example: + // + // arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:* + // + // For more information, see [Monitoring data transfers with CloudWatch Logs]. + // + // [Monitoring data transfers with CloudWatch Logs]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-logging.html CloudWatchLogGroupArn *string // Specifies exclude filters that define the files, objects, and folders in your diff --git a/service/datasync/deserializers.go b/service/datasync/deserializers.go index 1d9b6d01357..6ee2dcf3ba2 100644 --- a/service/datasync/deserializers.go +++ b/service/datasync/deserializers.go @@ -10776,6 +10776,146 @@ func awsAwsjson11_deserializeDocumentTagListEntry(v **types.TagListEntry, value return nil } +func awsAwsjson11_deserializeDocumentTaskExecutionFilesFailedDetail(v **types.TaskExecutionFilesFailedDetail, 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.TaskExecutionFilesFailedDetail + if *v == nil { + sv = &types.TaskExecutionFilesFailedDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Delete": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Delete = i64 + } + + case "Prepare": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Prepare = i64 + } + + case "Transfer": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Transfer = i64 + } + + case "Verify": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Verify = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTaskExecutionFilesListedDetail(v **types.TaskExecutionFilesListedDetail, 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.TaskExecutionFilesListedDetail + if *v == nil { + sv = &types.TaskExecutionFilesListedDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AtDestinationForDelete": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AtDestinationForDelete = i64 + } + + case "AtSource": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.AtSource = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTaskExecutionList(v *[]types.TaskExecutionListEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10850,6 +10990,15 @@ func awsAwsjson11_deserializeDocumentTaskExecutionListEntry(v **types.TaskExecut sv.TaskExecutionArn = ptr.String(jtv) } + case "TaskMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskMode to be of type string, got %T instead", value) + } + sv.TaskMode = types.TaskMode(jtv) + } + default: _, _ = key, value @@ -11070,6 +11219,15 @@ func awsAwsjson11_deserializeDocumentTaskListEntry(v **types.TaskListEntry, valu sv.TaskArn = ptr.String(jtv) } + case "TaskMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskMode to be of type string, got %T instead", value) + } + sv.TaskMode = types.TaskMode(jtv) + } + default: _, _ = key, value @@ -13680,6 +13838,29 @@ func awsAwsjson11_deserializeOpDocumentDescribeTaskExecutionOutput(v **DescribeT sv.FilesDeleted = i64 } + case "FilesFailed": + if err := awsAwsjson11_deserializeDocumentTaskExecutionFilesFailedDetail(&sv.FilesFailed, value); err != nil { + return err + } + + case "FilesListed": + if err := awsAwsjson11_deserializeDocumentTaskExecutionFilesListedDetail(&sv.FilesListed, value); err != nil { + return err + } + + case "FilesPrepared": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FilesPrepared = i64 + } + case "FilesSkipped": if value != nil { jtv, ok := value.(json.Number) @@ -13778,6 +13959,15 @@ func awsAwsjson11_deserializeOpDocumentDescribeTaskExecutionOutput(v **DescribeT sv.TaskExecutionArn = ptr.String(jtv) } + case "TaskMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskMode to be of type string, got %T instead", value) + } + sv.TaskMode = types.TaskMode(jtv) + } + case "TaskReportConfig": if err := awsAwsjson11_deserializeDocumentTaskReportConfig(&sv.TaskReportConfig, value); err != nil { return err @@ -13951,6 +14141,15 @@ func awsAwsjson11_deserializeOpDocumentDescribeTaskOutput(v **DescribeTaskOutput sv.TaskArn = ptr.String(jtv) } + case "TaskMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskMode to be of type string, got %T instead", value) + } + sv.TaskMode = types.TaskMode(jtv) + } + case "TaskReportConfig": if err := awsAwsjson11_deserializeDocumentTaskReportConfig(&sv.TaskReportConfig, value); err != nil { return err diff --git a/service/datasync/serializers.go b/service/datasync/serializers.go index 51f26fb2a0b..35f1b15f2b7 100644 --- a/service/datasync/serializers.go +++ b/service/datasync/serializers.go @@ -5137,6 +5137,11 @@ func awsAwsjson11_serializeOpDocumentCreateTaskInput(v *CreateTaskInput, value s } } + if len(v.TaskMode) > 0 { + ok := object.Key("TaskMode") + ok.String(string(v.TaskMode)) + } + if v.TaskReportConfig != nil { ok := object.Key("TaskReportConfig") if err := awsAwsjson11_serializeDocumentTaskReportConfig(v.TaskReportConfig, ok); err != nil { diff --git a/service/datasync/types/enums.go b/service/datasync/types/enums.go index 8c29101d44b..2903e69ef4c 100644 --- a/service/datasync/types/enums.go +++ b/service/datasync/types/enums.go @@ -880,6 +880,25 @@ func (TaskFilterName) Values() []TaskFilterName { } } +type TaskMode string + +// Enum values for TaskMode +const ( + TaskModeBasic TaskMode = "BASIC" + TaskModeEnhanced TaskMode = "ENHANCED" +) + +// Values returns all known values for TaskMode. 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 (TaskMode) Values() []TaskMode { + return []TaskMode{ + "BASIC", + "ENHANCED", + } +} + type TaskQueueing string // Enum values for TaskQueueing diff --git a/service/datasync/types/types.go b/service/datasync/types/types.go index 117ae07b09b..d4fcff0f708 100644 --- a/service/datasync/types/types.go +++ b/service/datasync/types/types.go @@ -130,8 +130,10 @@ type DiscoveryServerConfiguration struct { noSmithyDocumentSerde } -// The subnet and security groups that DataSync uses to access your Amazon EFS -// file system. +// The subnet and security groups that DataSync uses to connect to one of your +// Amazon EFS file system's [mount targets]. +// +// [mount targets]: https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html type Ec2Config struct { // Specifies the Amazon Resource Names (ARNs) of the security groups associated @@ -627,11 +629,16 @@ type NfsMountOptions struct { noSmithyDocumentSerde } -// The DataSync agents that are connecting to a Network File System (NFS) location. +// The DataSync agents that can connect to your Network File System (NFS) file +// server. type OnPremConfig struct { - // The Amazon Resource Names (ARNs) of the agents connecting to a transfer - // location. + // The Amazon Resource Names (ARNs) of the DataSync agents that can connect to + // your NFS file server. + // + // You can specify more than one agent. For more information, see [Using multiple DataSync agents]. + // + // [Using multiple DataSync agents]: https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents // // This member is required. AgentArns []string @@ -660,7 +667,7 @@ type Options struct { // only do this on a best-effort basis. // // - BEST_EFFORT (default) - DataSync attempts to preserve the original Atime - // attribute on all source files (that is, the version before the PREPARING phase + // attribute on all source files (that is, the version before the PREPARING steps // of the task execution). This option is recommended. // // - NONE - Ignores Atime . @@ -672,6 +679,10 @@ type Options struct { // Limits the bandwidth used by a DataSync task. For example, if you want DataSync // to use a maximum of 1 MB, set this value to 1048576 ( =1024*1024 ). + // + // Not applicable to [Enhanced mode tasks]. + // + // [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html BytesPerSecond *int64 // Specifies the POSIX group ID (GID) of the file's owners. @@ -681,9 +692,9 @@ type Options struct { // // - NONE - Ignores UID and GID. // - // For more information, see [Metadata copied by DataSync]. + // For more information, see [Understanding how DataSync handles file and object metadata]. // - // [Metadata copied by DataSync]: https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied + // [Understanding how DataSync handles file and object metadata]: https://docs.aws.amazon.com/datasync/latest/userguide/metadata-copied.html Gid Gid // Specifies the type of logs that DataSync publishes to a Amazon CloudWatch Logs @@ -700,7 +711,7 @@ type Options struct { LogLevel LogLevel // Specifies whether to preserve metadata indicating the last time that a file was - // written to before the PREPARING phase of your task execution. This option is + // written to before the PREPARING step of your task execution. This option is // required when you need to run the a task more than once. // // - PRESERVE (default) - Preserves original Mtime , which is recommended. @@ -737,7 +748,7 @@ type Options struct { // Specifies which users or groups can access a file for a specific purpose such // as reading, writing, or execution of the file. // - // For more information, see [Metadata copied by DataSync]. + // For more information, see [Understanding how DataSync handles file and object metadata]. // // - PRESERVE (default) - Preserves POSIX-style permissions, which is recommended. // @@ -745,7 +756,7 @@ type Options struct { // // DataSync can preserve extant permissions of a source location. // - // [Metadata copied by DataSync]: https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied + // [Understanding how DataSync handles file and object metadata]: https://docs.aws.amazon.com/datasync/latest/userguide/metadata-copied.html PosixPermissions PosixPermissions // Specifies whether files in the destination location that don't exist in the @@ -783,7 +794,7 @@ type Options struct { // // This value is only used for transfers between SMB and Amazon FSx for Windows // File Server locations or between two FSx for Windows File Server locations. For - // more information, see [how DataSync handles metadata]. + // more information, see [Understanding how DataSync handles file and object metadata]. // // - OWNER_DACL (default) - For each copied object, DataSync copies the following // metadata: @@ -817,7 +828,7 @@ type Options struct { // configuration. // // [FSx for Windows File Server]: https://docs.aws.amazon.com/datasync/latest/userguide/create-fsx-location.html#create-fsx-windows-location-permissions - // [how DataSync handles metadata]: https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html + // [Understanding how DataSync handles file and object metadata]: https://docs.aws.amazon.com/datasync/latest/userguide/metadata-copied.html // [SMB]: https://docs.aws.amazon.com/datasync/latest/userguide/create-smb-location.html#configuring-smb-permissions // [FSx for ONTAP]: https://docs.aws.amazon.com/datasync/latest/userguide/create-ontap-location.html#create-ontap-location-smb SecurityDescriptorCopyFlags SmbSecurityDescriptorCopyFlags @@ -828,12 +839,13 @@ type Options struct { // [running multiple tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#running-multiple-tasks TaskQueueing TaskQueueing - // Determines whether DataSync transfers only the data and metadata that differ - // between the source and the destination location or transfers all the content - // from the source (without comparing what's in the destination). + // Specifies whether DataSync transfers only the data (including metadata) that + // differs between locations following an initial copy or transfers all data every + // time you run the task. If you're planning on recurring transfers, you might only + // want to transfer what's changed since your previous task execution. // - // - CHANGED (default) - DataSync copies only data or metadata that is new or - // different content from the source location to the destination location. + // - CHANGED (default) - After your initial full transfer, DataSync copies only + // the data and metadata that differs between the source and destination location. // // - ALL - DataSync copies everything in the source to the destination without // comparing differences between the locations. @@ -851,32 +863,39 @@ type Options struct { // [Metadata copied by DataSync]: https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Uid Uid - // Specifies how and when DataSync checks the integrity of your data during a - // transfer. + // Specifies if and how DataSync checks the integrity of your data at the end of + // your transfer. // // - ONLY_FILES_TRANSFERRED (recommended) - DataSync calculates the checksum of - // transferred files and metadata at the source location. At the end of the + // transferred data (including metadata) at the source location. At the end of the // transfer, DataSync then compares this checksum to the checksum calculated on - // those files at the destination. + // that data at the destination. + // + // This is the default option for [Enhanced mode tasks]. // // We recommend this option when transferring to S3 Glacier Flexible Retrieval or // S3 Glacier Deep Archive storage classes. For more information, see [Storage class considerations with Amazon S3 locations]. // - // - POINT_IN_TIME_CONSISTENT (default) - At the end of the transfer, DataSync - // scans the entire source and destination to verify that both locations are fully + // - POINT_IN_TIME_CONSISTENT - At the end of the transfer, DataSync checks the + // entire source and destination to verify that both locations are fully // synchronized. // + // The is the default option for [Basic mode tasks]and isn't currently supported with Enhanced mode + // tasks. + // // If you use a [manifest], DataSync only scans and verifies what's listed in the manifest. // // You can't use this option when transferring to S3 Glacier Flexible Retrieval or // S3 Glacier Deep Archive storage classes. For more information, see [Storage class considerations with Amazon S3 locations]. // - // - NONE - DataSync doesn't run additional verification at the end of the - // transfer. All data transmissions are still integrity-checked with checksum - // verification during the transfer. + // - NONE - DataSync performs data integrity checks only during your transfer. + // Unlike other options, there's no additional verification at the end of your + // transfer. // // [Storage class considerations with Amazon S3 locations]: https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes // [manifest]: https://docs.aws.amazon.com/datasync/latest/userguide/transferring-with-manifest.html + // [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + // [Basic mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html VerifyMode VerifyMode noSmithyDocumentSerde @@ -919,7 +938,7 @@ type PrivateLinkConfig struct { // Specifies the VPC endpoint provided by [Amazon Web Services PrivateLink] that your agent connects to. // - // [Amazon Web Services PrivateLink]: https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html + // [Amazon Web Services PrivateLink]: https://docs.aws.amazon.com/vpc/latest/privatelink/privatelink-share-your-services.html PrivateLinkEndpoint *string // Specifies the Amazon Resource Names (ARN) of the security group that provides @@ -1246,6 +1265,62 @@ type TagListEntry struct { noSmithyDocumentSerde } +// The number of objects that DataSync fails to prepare, transfer, verify, and +// delete during your task execution. +// +// Applies only to [Enhanced mode tasks]. +// +// [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html +type TaskExecutionFilesFailedDetail struct { + + // The number of objects that DataSync fails to delete during your task execution. + Delete int64 + + // The number of objects that DataSync fails to prepare during your task execution. + Prepare int64 + + // The number of objects that DataSync fails to transfer during your task + // execution. + Transfer int64 + + // The number of objects that DataSync fails to verify during your task execution. + Verify int64 + + noSmithyDocumentSerde +} + +// The number of objects that DataSync finds at your locations. +// +// Applies only to [Enhanced mode tasks]. +// +// [Enhanced mode tasks]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html +type TaskExecutionFilesListedDetail struct { + + // The number of objects that DataSync finds at your destination location. This + // metric is only applicable if you [configure your task]to delete data in the destination that isn't + // in the source. + // + // [configure your task]: https://docs.aws.amazon.com/datasync/latest/userguide/configure-metadata.html#task-option-file-object-handling + AtDestinationForDelete int64 + + // The number of objects that DataSync finds at your source location. + // + // - With a [manifest], DataSync lists only what's in your manifest (and not everything at + // your source location). + // + // - With an include [filter], DataSync lists only what matches the filter at your + // source location. + // + // - With an exclude filter, DataSync lists everything at your source location + // before applying the filter. + // + // [filter]: https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html + // [manifest]: https://docs.aws.amazon.com/datasync/latest/userguide/transferring-with-manifest.html + AtSource int64 + + noSmithyDocumentSerde +} + // Represents a single entry in a list of DataSync task executions that's returned // with the [ListTaskExecutions]operation. // @@ -1260,42 +1335,75 @@ type TaskExecutionListEntry struct { // The Amazon Resource Name (ARN) of a task execution. TaskExecutionArn *string + // The task mode that you're using. For more information, see [Choosing a task mode for your data transfer]. + // + // [Choosing a task mode for your data transfer]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + TaskMode TaskMode + noSmithyDocumentSerde } -// Describes the detailed result of a TaskExecution operation. This result -// includes the time in milliseconds spent in each phase, the status of the task -// execution, and the errors encountered. +// Provides detailed information about the result of your DataSync task execution. type TaskExecutionResultDetail struct { - // Errors that DataSync encountered during execution of the task. You can use this - // error code to help troubleshoot issues. + // An error that DataSync encountered during your task execution. You can use this + // information to help [troubleshoot issues]. + // + // [troubleshoot issues]: https://docs.aws.amazon.com/datasync/latest/userguide/troubleshooting-datasync-locations-tasks.html ErrorCode *string - // Detailed description of an error that was encountered during the task - // execution. You can use this information to help troubleshoot issues. + // The detailed description of an error that DataSync encountered during your task + // execution. You can use this information to help [troubleshoot issues]. + // + // [troubleshoot issues]: https://docs.aws.amazon.com/datasync/latest/userguide/troubleshooting-datasync-locations-tasks.html ErrorDetail *string - // The total time in milliseconds that DataSync spent in the PREPARING phase. + // The time in milliseconds that your task execution was in the PREPARING step. + // For more information, see [Task execution statuses]. + // + // For Enhanced mode tasks, the value is always 0 . For more information, see [How DataSync prepares your data transfer]. + // + // [Task execution statuses]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses + // [How DataSync prepares your data transfer]: https://docs.aws.amazon.com/datasync/latest/userguide/how-datasync-transfer-works.html#how-datasync-prepares PrepareDuration *int64 - // The status of the PREPARING phase. + // The status of the PREPARING step for your task execution. For more information, + // see [Task execution statuses]. + // + // [Task execution statuses]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses PrepareStatus PhaseStatus - // The total time in milliseconds that DataSync took to transfer the file from the - // source to the destination location. + // The time in milliseconds that your task execution ran. TotalDuration *int64 - // The total time in milliseconds that DataSync spent in the TRANSFERRING phase. + // The time in milliseconds that your task execution was in the TRANSFERRING step. + // For more information, see [Task execution statuses]. + // + // For Enhanced mode tasks, the value is always 0 . For more information, see [How DataSync transfers your data]. + // + // [Task execution statuses]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses + // [How DataSync transfers your data]: https://docs.aws.amazon.com/datasync/latest/userguide/how-datasync-transfer-works.html#how-datasync-transfers TransferDuration *int64 - // The status of the TRANSFERRING phase. + // The status of the TRANSFERRING step for your task execution. For more + // information, see [Task execution statuses]. + // + // [Task execution statuses]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses TransferStatus PhaseStatus - // The total time in milliseconds that DataSync spent in the VERIFYING phase. + // The time in milliseconds that your task execution was in the VERIFYING step. + // For more information, see [Task execution statuses]. + // + // For Enhanced mode tasks, the value is always 0 . For more information, see [How DataSync verifies your data's integrity]. + // + // [Task execution statuses]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses + // [How DataSync verifies your data's integrity]: https://docs.aws.amazon.com/datasync/latest/userguide/how-datasync-transfer-works.html#how-verifying-works VerifyDuration *int64 - // The status of the VERIFYING phase. + // The status of the VERIFYING step for your task execution. For more information, + // see [Task execution statuses]. + // + // [Task execution statuses]: https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#understand-task-execution-statuses VerifyStatus PhaseStatus noSmithyDocumentSerde @@ -1349,6 +1457,11 @@ type TaskListEntry struct { // The Amazon Resource Name (ARN) of the task. TaskArn *string + // The task mode that you're using. For more information, see [Choosing a task mode for your data transfer]. + // + // [Choosing a task mode for your data transfer]: https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html + TaskMode TaskMode + noSmithyDocumentSerde } @@ -1407,10 +1520,23 @@ type TaskReportConfig struct { // [schedule]: https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html type TaskSchedule struct { - // Specifies your task schedule by using a cron expression in UTC time. For - // information about cron expression syntax, see the [Amazon EventBridge User Guide]. + // Specifies your task schedule by using a cron or rate expression. + // + // Use cron expressions for task schedules that run on a specific time and day. + // For example, the following cron expression creates a task schedule that runs at + // 8 AM on the first Wednesday of every month: + // + // cron(0 8 * * 3#1) + // + // Use rate expressions for task schedules that run on a regular interval. For + // example, the following rate expression creates a task schedule that runs every + // 12 hours: + // + // rate(12 hours) + // + // For information about cron and rate expression syntax, see the [Amazon EventBridge User Guide]. // - // [Amazon EventBridge User Guide]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cron-expressions.html + // [Amazon EventBridge User Guide]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html // // This member is required. ScheduleExpression *string diff --git a/service/ec2/api_op_AssociateSecurityGroupVpc.go b/service/ec2/api_op_AssociateSecurityGroupVpc.go new file mode 100644 index 00000000000..92d2712313e --- /dev/null +++ b/service/ec2/api_op_AssociateSecurityGroupVpc.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a security group with another VPC in the same Region. This enables +// you to use the same security group with network interfaces and instances in the +// specified VPC. +// +// - The VPC you want to associate the security group with must be in the same +// Region. +// +// - You can associate the security group with another VPC if your account owns +// the VPC or if the VPC was shared with you. +// +// - You must own the security group and the VPC that it was created in. +// +// - You cannot use this feature with default security groups. +// +// - You cannot use this feature with the default VPC. +func (c *Client) AssociateSecurityGroupVpc(ctx context.Context, params *AssociateSecurityGroupVpcInput, optFns ...func(*Options)) (*AssociateSecurityGroupVpcOutput, error) { + if params == nil { + params = &AssociateSecurityGroupVpcInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateSecurityGroupVpc", params, optFns, c.addOperationAssociateSecurityGroupVpcMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateSecurityGroupVpcOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateSecurityGroupVpcInput struct { + + // A security group ID. + // + // This member is required. + GroupId *string + + // A VPC ID. + // + // This member is required. + VpcId *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 AssociateSecurityGroupVpcOutput struct { + + // The state of the association. + State types.SecurityGroupVpcAssociationState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateSecurityGroupVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpAssociateSecurityGroupVpc{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpAssociateSecurityGroupVpc{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateSecurityGroupVpc"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAssociateSecurityGroupVpcValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateSecurityGroupVpc(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociateSecurityGroupVpc(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssociateSecurityGroupVpc", + } +} diff --git a/service/ec2/api_op_CreateNetworkInterface.go b/service/ec2/api_op_CreateNetworkInterface.go index 43726eaef3a..3d5327ce381 100644 --- a/service/ec2/api_op_CreateNetworkInterface.go +++ b/service/ec2/api_op_CreateNetworkInterface.go @@ -80,7 +80,10 @@ type CreateNetworkInterfaceInput struct { // The type of network interface. The default is interface . // - // The only supported values are interface , efa , and trunk . + // If you specify efa-only , do not assign any IP addresses to the network + // interface. EFA-only network interfaces do not support IP addresses. + // + // The only supported values are interface , efa , efa-only , and trunk . InterfaceType types.NetworkInterfaceCreationType // The number of IPv4 prefixes that Amazon Web Services automatically assigns to diff --git a/service/ec2/api_op_CreateSecurityGroup.go b/service/ec2/api_op_CreateSecurityGroup.go index 44601f4e13e..8c6a5903bbe 100644 --- a/service/ec2/api_op_CreateSecurityGroup.go +++ b/service/ec2/api_op_CreateSecurityGroup.go @@ -87,6 +87,9 @@ type CreateSecurityGroupOutput struct { // The ID of the security group. GroupId *string + // The security group ARN. + SecurityGroupArn *string + // The tags assigned to the security group. Tags []types.Tag diff --git a/service/ec2/api_op_CreateTrafficMirrorSession.go b/service/ec2/api_op_CreateTrafficMirrorSession.go index 30df756c1c6..9d8ed178c70 100644 --- a/service/ec2/api_op_CreateTrafficMirrorSession.go +++ b/service/ec2/api_op_CreateTrafficMirrorSession.go @@ -24,7 +24,7 @@ import ( // By default, no traffic is mirrored. Use [CreateTrafficMirrorFilter] to create filter rules that specify // the traffic to mirror. // -// [CreateTrafficMirrorFilter]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorFilter.htm +// [CreateTrafficMirrorFilter]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorFilter.html func (c *Client) CreateTrafficMirrorSession(ctx context.Context, params *CreateTrafficMirrorSessionInput, optFns ...func(*Options)) (*CreateTrafficMirrorSessionOutput, error) { if params == nil { params = &CreateTrafficMirrorSessionInput{} diff --git a/service/ec2/api_op_DeleteSecurityGroup.go b/service/ec2/api_op_DeleteSecurityGroup.go index 210016c2c48..2515cb81f73 100644 --- a/service/ec2/api_op_DeleteSecurityGroup.go +++ b/service/ec2/api_op_DeleteSecurityGroup.go @@ -13,8 +13,8 @@ import ( // Deletes a security group. // // If you attempt to delete a security group that is associated with an instance -// or network interface or is referenced by another security group in the same VPC, -// the operation fails with DependencyViolation . +// or network interface, is referenced by another security group in the same VPC, +// or has a VPC association, the operation fails with DependencyViolation . func (c *Client) DeleteSecurityGroup(ctx context.Context, params *DeleteSecurityGroupInput, optFns ...func(*Options)) (*DeleteSecurityGroupOutput, error) { if params == nil { params = &DeleteSecurityGroupInput{} diff --git a/service/ec2/api_op_DescribeInstanceTypes.go b/service/ec2/api_op_DescribeInstanceTypes.go index d6cce5787b7..aa15e536c57 100644 --- a/service/ec2/api_op_DescribeInstanceTypes.go +++ b/service/ec2/api_op_DescribeInstanceTypes.go @@ -161,7 +161,8 @@ type DescribeInstanceTypesInput struct { // // - supported-root-device-type - The root device type ( ebs | instance-store ). // - // - supported-usage-class - The usage class ( on-demand | spot ). + // - supported-usage-class - The usage class ( on-demand | spot | capacity-block + // ). // // - supported-virtualization-type - The virtualization type ( hvm | paravirtual // ). diff --git a/service/ec2/api_op_DescribeNetworkInterfaces.go b/service/ec2/api_op_DescribeNetworkInterfaces.go index 49b6a78645c..68b379cfac1 100644 --- a/service/ec2/api_op_DescribeNetworkInterfaces.go +++ b/service/ec2/api_op_DescribeNetworkInterfaces.go @@ -109,8 +109,8 @@ type DescribeNetworkInterfacesInput struct { // // - interface-type - The type of network interface ( api_gateway_managed | // aws_codestar_connections_managed | branch | ec2_instance_connect_endpoint | - // efa | efs | gateway_load_balancer | gateway_load_balancer_endpoint | - // global_accelerator_managed | interface | iot_rules_managed | lambda | + // efa | efa-only | efs | gateway_load_balancer | gateway_load_balancer_endpoint + // | global_accelerator_managed | interface | iot_rules_managed | lambda | // load_balancer | nat_gateway | network_load_balancer | quicksight | // transit_gateway | trunk | vpc_endpoint ). // diff --git a/service/ec2/api_op_DescribeSecurityGroupReferences.go b/service/ec2/api_op_DescribeSecurityGroupReferences.go index e0c54d71cd5..ce5ee798a9e 100644 --- a/service/ec2/api_op_DescribeSecurityGroupReferences.go +++ b/service/ec2/api_op_DescribeSecurityGroupReferences.go @@ -11,8 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes the VPCs on the other side of a VPC peering connection that are -// referencing the security groups you've specified in this request. +// Describes the VPCs on the other side of a VPC peering or Transit Gateway +// connection that are referencing the security groups you've specified in this +// request. func (c *Client) DescribeSecurityGroupReferences(ctx context.Context, params *DescribeSecurityGroupReferencesInput, optFns ...func(*Options)) (*DescribeSecurityGroupReferencesOutput, error) { if params == nil { params = &DescribeSecurityGroupReferencesInput{} diff --git a/service/ec2/api_op_DescribeSecurityGroupVpcAssociations.go b/service/ec2/api_op_DescribeSecurityGroupVpcAssociations.go new file mode 100644 index 00000000000..e14bf082da8 --- /dev/null +++ b/service/ec2/api_op_DescribeSecurityGroupVpcAssociations.go @@ -0,0 +1,291 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes security group VPC associations made with [AssociateSecurityGroupVpc]. +// +// [AssociateSecurityGroupVpc]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateSecurityGroupVpc.html +func (c *Client) DescribeSecurityGroupVpcAssociations(ctx context.Context, params *DescribeSecurityGroupVpcAssociationsInput, optFns ...func(*Options)) (*DescribeSecurityGroupVpcAssociationsOutput, error) { + if params == nil { + params = &DescribeSecurityGroupVpcAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityGroupVpcAssociations", params, optFns, c.addOperationDescribeSecurityGroupVpcAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeSecurityGroupVpcAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeSecurityGroupVpcAssociationsInput struct { + + // 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 + + // Security group VPC association filters. + // + // - group-id : The security group ID. + // + // - vpc-id : The ID of the associated VPC. + // + // - vpc-owner-id : The account ID of the VPC owner. + // + // - state : The state of the association. + // + // - tag: : The key/value combination of a tag assigned to the resource. Use the + // tag key in the filter name and the tag value as the filter value. For example, + // to find all resources that have a tag with the key Owner and the value TeamA , + // specify tag:Owner for the filter name and TeamA for the filter value. + // + // - tag-key : The key of a tag assigned to the resource. Use this filter to find + // all resources assigned a tag with a specific key, regardless of the tag value. + Filters []types.Filter + + // 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]. + // + // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination + MaxResults *int32 + + // The token returned from a previous paginated request. Pagination continues from + // the end of the items returned by the previous request. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeSecurityGroupVpcAssociationsOutput struct { + + // The token to include in another request to get the next page of items. This + // value is null when there are no more items to return. + NextToken *string + + // The security group VPC associations. + SecurityGroupVpcAssociations []types.SecurityGroupVpcAssociation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeSecurityGroupVpcAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSecurityGroupVpcAssociations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityGroupVpcAssociations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeSecurityGroupVpcAssociationsPaginatorOptions is the paginator options +// for DescribeSecurityGroupVpcAssociations +type DescribeSecurityGroupVpcAssociationsPaginatorOptions 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]. + // + // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination + 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 +} + +// DescribeSecurityGroupVpcAssociationsPaginator is a paginator for +// DescribeSecurityGroupVpcAssociations +type DescribeSecurityGroupVpcAssociationsPaginator struct { + options DescribeSecurityGroupVpcAssociationsPaginatorOptions + client DescribeSecurityGroupVpcAssociationsAPIClient + params *DescribeSecurityGroupVpcAssociationsInput + nextToken *string + firstPage bool +} + +// NewDescribeSecurityGroupVpcAssociationsPaginator returns a new +// DescribeSecurityGroupVpcAssociationsPaginator +func NewDescribeSecurityGroupVpcAssociationsPaginator(client DescribeSecurityGroupVpcAssociationsAPIClient, params *DescribeSecurityGroupVpcAssociationsInput, optFns ...func(*DescribeSecurityGroupVpcAssociationsPaginatorOptions)) *DescribeSecurityGroupVpcAssociationsPaginator { + if params == nil { + params = &DescribeSecurityGroupVpcAssociationsInput{} + } + + options := DescribeSecurityGroupVpcAssociationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeSecurityGroupVpcAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSecurityGroupVpcAssociationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeSecurityGroupVpcAssociations page. +func (p *DescribeSecurityGroupVpcAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSecurityGroupVpcAssociationsOutput, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeSecurityGroupVpcAssociations(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 +} + +// DescribeSecurityGroupVpcAssociationsAPIClient is a client that implements the +// DescribeSecurityGroupVpcAssociations operation. +type DescribeSecurityGroupVpcAssociationsAPIClient interface { + DescribeSecurityGroupVpcAssociations(context.Context, *DescribeSecurityGroupVpcAssociationsInput, ...func(*Options)) (*DescribeSecurityGroupVpcAssociationsOutput, error) +} + +var _ DescribeSecurityGroupVpcAssociationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeSecurityGroupVpcAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeSecurityGroupVpcAssociations", + } +} diff --git a/service/ec2/api_op_DescribeStaleSecurityGroups.go b/service/ec2/api_op_DescribeStaleSecurityGroups.go index 6c9da2d6ef4..f88dab16c94 100644 --- a/service/ec2/api_op_DescribeStaleSecurityGroups.go +++ b/service/ec2/api_op_DescribeStaleSecurityGroups.go @@ -11,10 +11,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes the stale security group rules for security groups in a specified -// VPC. Rules are stale when they reference a deleted security group in a peered -// VPC. Rules can also be stale if they reference a security group in a peer VPC -// for which the VPC peering connection has been deleted. +// Describes the stale security group rules for security groups referenced across +// a VPC peering connection, transit gateway connection, or with a security group +// VPC association. Rules are stale when they reference a deleted security group. +// Rules can also be stale if they reference a security group in a peer VPC for +// which the VPC peering connection has been deleted, across a transit gateway +// where the transit gateway has been deleted (or [the transit gateway security group referencing feature]has been disabled), or if a +// security group VPC association has been disassociated. +// +// [the transit gateway security group referencing feature]: https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security func (c *Client) DescribeStaleSecurityGroups(ctx context.Context, params *DescribeStaleSecurityGroupsInput, optFns ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) { if params == nil { params = &DescribeStaleSecurityGroupsInput{} @@ -59,8 +64,8 @@ type DescribeStaleSecurityGroupsInput struct { type DescribeStaleSecurityGroupsOutput struct { - // The token to include in another request to get the next page of items. If there - // are no additional items to return, the string is empty. + // The token to include in another request to get the next page of items. This + // value is null when there are no more items to return. NextToken *string // Information about the stale security groups. diff --git a/service/ec2/api_op_DisassociateSecurityGroupVpc.go b/service/ec2/api_op_DisassociateSecurityGroupVpc.go new file mode 100644 index 00000000000..2aa815e1373 --- /dev/null +++ b/service/ec2/api_op_DisassociateSecurityGroupVpc.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates a security group from a VPC. You cannot disassociate the security +// group if any Elastic network interfaces in the associated VPC are still +// associated with the security group. +// +// Note that the disassociation is asynchronous and you can check the status of +// the request with [DescribeSecurityGroupVpcAssociations]. +// +// [DescribeSecurityGroupVpcAssociations]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroupVpcAssociations.html +func (c *Client) DisassociateSecurityGroupVpc(ctx context.Context, params *DisassociateSecurityGroupVpcInput, optFns ...func(*Options)) (*DisassociateSecurityGroupVpcOutput, error) { + if params == nil { + params = &DisassociateSecurityGroupVpcInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateSecurityGroupVpc", params, optFns, c.addOperationDisassociateSecurityGroupVpcMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateSecurityGroupVpcOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateSecurityGroupVpcInput struct { + + // A security group ID. + // + // This member is required. + GroupId *string + + // A VPC ID. + // + // This member is required. + VpcId *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 DisassociateSecurityGroupVpcOutput struct { + + // The state of the disassociation. + State types.SecurityGroupVpcAssociationState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociateSecurityGroupVpcMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpDisassociateSecurityGroupVpc{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisassociateSecurityGroupVpc{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateSecurityGroupVpc"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDisassociateSecurityGroupVpcValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateSecurityGroupVpc(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociateSecurityGroupVpc(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisassociateSecurityGroupVpc", + } +} diff --git a/service/ec2/api_op_RevokeSecurityGroupEgress.go b/service/ec2/api_op_RevokeSecurityGroupEgress.go index 9d93afc1461..49237b56a8c 100644 --- a/service/ec2/api_op_RevokeSecurityGroupEgress.go +++ b/service/ec2/api_op_RevokeSecurityGroupEgress.go @@ -95,6 +95,9 @@ type RevokeSecurityGroupEgressOutput struct { // Returns true if the request succeeds; otherwise, returns an error. Return *bool + // Details about the revoked security group rules. + RevokedSecurityGroupRules []types.RevokedSecurityGroupRule + // The outbound rules that were unknown to the service. In some cases, // unknownIpPermissionSet might be in a different format from the request // parameter. diff --git a/service/ec2/api_op_RevokeSecurityGroupIngress.go b/service/ec2/api_op_RevokeSecurityGroupIngress.go index 1ec6805fc13..66b7d3331aa 100644 --- a/service/ec2/api_op_RevokeSecurityGroupIngress.go +++ b/service/ec2/api_op_RevokeSecurityGroupIngress.go @@ -109,6 +109,9 @@ type RevokeSecurityGroupIngressOutput struct { // Returns true if the request succeeds; otherwise, returns an error. Return *bool + // Details about the revoked security group rules. + RevokedSecurityGroupRules []types.RevokedSecurityGroupRule + // The inbound rules that were unknown to the service. In some cases, // unknownIpPermissionSet might be in a different format from the request // parameter. diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index f6b202e6190..13a4e364ab7 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -2576,14 +2576,14 @@ func awsEc2query_deserializeOpErrorAssociateRouteTable(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpAssociateSubnetCidrBlock struct { +type awsEc2query_deserializeOpAssociateSecurityGroupVpc struct { } -func (*awsEc2query_deserializeOpAssociateSubnetCidrBlock) ID() string { +func (*awsEc2query_deserializeOpAssociateSecurityGroupVpc) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAssociateSubnetCidrBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAssociateSecurityGroupVpc) 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) @@ -2601,9 +2601,9 @@ func (m *awsEc2query_deserializeOpAssociateSubnetCidrBlock) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateSubnetCidrBlock(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAssociateSecurityGroupVpc(response, &metadata) } - output := &AssociateSubnetCidrBlockOutput{} + output := &AssociateSecurityGroupVpcOutput{} out.Result = output var buff [1024]byte @@ -2624,7 +2624,7 @@ func (m *awsEc2query_deserializeOpAssociateSubnetCidrBlock) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateSubnetCidrBlockOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAssociateSecurityGroupVpcOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2638,7 +2638,7 @@ func (m *awsEc2query_deserializeOpAssociateSubnetCidrBlock) HandleDeserialize(ct return out, metadata, err } -func awsEc2query_deserializeOpErrorAssociateSubnetCidrBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAssociateSecurityGroupVpc(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)} @@ -2671,14 +2671,14 @@ func awsEc2query_deserializeOpErrorAssociateSubnetCidrBlock(response *smithyhttp } } -type awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain struct { +type awsEc2query_deserializeOpAssociateSubnetCidrBlock struct { } -func (*awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) ID() string { +func (*awsEc2query_deserializeOpAssociateSubnetCidrBlock) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAssociateSubnetCidrBlock) 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) @@ -2696,9 +2696,9 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayMulticastDomain(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAssociateSubnetCidrBlock(response, &metadata) } - output := &AssociateTransitGatewayMulticastDomainOutput{} + output := &AssociateSubnetCidrBlockOutput{} out.Result = output var buff [1024]byte @@ -2719,7 +2719,7 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) Handle } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayMulticastDomainOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAssociateSubnetCidrBlockOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2733,7 +2733,7 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) Handle return out, metadata, err } -func awsEc2query_deserializeOpErrorAssociateTransitGatewayMulticastDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAssociateSubnetCidrBlock(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)} @@ -2766,14 +2766,14 @@ func awsEc2query_deserializeOpErrorAssociateTransitGatewayMulticastDomain(respon } } -type awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable struct { +type awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain struct { } -func (*awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) ID() string { +func (*awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAssociateTransitGatewayMulticastDomain) 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) @@ -2791,9 +2791,9 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayPolicyTable(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayMulticastDomain(response, &metadata) } - output := &AssociateTransitGatewayPolicyTableOutput{} + output := &AssociateTransitGatewayMulticastDomainOutput{} out.Result = output var buff [1024]byte @@ -2814,7 +2814,7 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) HandleDese } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayPolicyTableOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayMulticastDomainOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2828,7 +2828,7 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) HandleDese return out, metadata, err } -func awsEc2query_deserializeOpErrorAssociateTransitGatewayPolicyTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAssociateTransitGatewayMulticastDomain(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)} @@ -2861,14 +2861,14 @@ func awsEc2query_deserializeOpErrorAssociateTransitGatewayPolicyTable(response * } } -type awsEc2query_deserializeOpAssociateTransitGatewayRouteTable struct { +type awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable struct { } -func (*awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) ID() string { +func (*awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAssociateTransitGatewayPolicyTable) 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) @@ -2886,9 +2886,9 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayRouteTable(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayPolicyTable(response, &metadata) } - output := &AssociateTransitGatewayRouteTableOutput{} + output := &AssociateTransitGatewayPolicyTableOutput{} out.Result = output var buff [1024]byte @@ -2909,7 +2909,7 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayRouteTableOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayPolicyTableOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2923,7 +2923,7 @@ func (m *awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorAssociateTransitGatewayRouteTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAssociateTransitGatewayPolicyTable(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)} @@ -2956,14 +2956,14 @@ func awsEc2query_deserializeOpErrorAssociateTransitGatewayRouteTable(response *s } } -type awsEc2query_deserializeOpAssociateTrunkInterface struct { +type awsEc2query_deserializeOpAssociateTransitGatewayRouteTable struct { } -func (*awsEc2query_deserializeOpAssociateTrunkInterface) ID() string { +func (*awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAssociateTrunkInterface) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAssociateTransitGatewayRouteTable) 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) @@ -2981,9 +2981,9 @@ func (m *awsEc2query_deserializeOpAssociateTrunkInterface) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateTrunkInterface(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAssociateTransitGatewayRouteTable(response, &metadata) } - output := &AssociateTrunkInterfaceOutput{} + output := &AssociateTransitGatewayRouteTableOutput{} out.Result = output var buff [1024]byte @@ -3004,7 +3004,7 @@ func (m *awsEc2query_deserializeOpAssociateTrunkInterface) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateTrunkInterfaceOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAssociateTransitGatewayRouteTableOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3018,7 +3018,7 @@ func (m *awsEc2query_deserializeOpAssociateTrunkInterface) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorAssociateTrunkInterface(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAssociateTransitGatewayRouteTable(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)} @@ -3051,14 +3051,14 @@ func awsEc2query_deserializeOpErrorAssociateTrunkInterface(response *smithyhttp. } } -type awsEc2query_deserializeOpAssociateVpcCidrBlock struct { +type awsEc2query_deserializeOpAssociateTrunkInterface struct { } -func (*awsEc2query_deserializeOpAssociateVpcCidrBlock) ID() string { +func (*awsEc2query_deserializeOpAssociateTrunkInterface) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAssociateVpcCidrBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAssociateTrunkInterface) 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) @@ -3076,9 +3076,9 @@ func (m *awsEc2query_deserializeOpAssociateVpcCidrBlock) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAssociateVpcCidrBlock(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAssociateTrunkInterface(response, &metadata) } - output := &AssociateVpcCidrBlockOutput{} + output := &AssociateTrunkInterfaceOutput{} out.Result = output var buff [1024]byte @@ -3099,7 +3099,7 @@ func (m *awsEc2query_deserializeOpAssociateVpcCidrBlock) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAssociateVpcCidrBlockOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAssociateTrunkInterfaceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3113,7 +3113,7 @@ func (m *awsEc2query_deserializeOpAssociateVpcCidrBlock) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorAssociateVpcCidrBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAssociateTrunkInterface(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)} @@ -3146,14 +3146,14 @@ func awsEc2query_deserializeOpErrorAssociateVpcCidrBlock(response *smithyhttp.Re } } -type awsEc2query_deserializeOpAttachClassicLinkVpc struct { +type awsEc2query_deserializeOpAssociateVpcCidrBlock struct { } -func (*awsEc2query_deserializeOpAttachClassicLinkVpc) ID() string { +func (*awsEc2query_deserializeOpAssociateVpcCidrBlock) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAttachClassicLinkVpc) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAssociateVpcCidrBlock) 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) @@ -3171,9 +3171,9 @@ func (m *awsEc2query_deserializeOpAttachClassicLinkVpc) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachClassicLinkVpc(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAssociateVpcCidrBlock(response, &metadata) } - output := &AttachClassicLinkVpcOutput{} + output := &AssociateVpcCidrBlockOutput{} out.Result = output var buff [1024]byte @@ -3194,7 +3194,7 @@ func (m *awsEc2query_deserializeOpAttachClassicLinkVpc) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachClassicLinkVpcOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAssociateVpcCidrBlockOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3208,79 +3208,7 @@ func (m *awsEc2query_deserializeOpAttachClassicLinkVpc) HandleDeserialize(ctx co return out, metadata, err } -func awsEc2query_deserializeOpErrorAttachClassicLinkVpc(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_deserializeOpAttachInternetGateway struct { -} - -func (*awsEc2query_deserializeOpAttachInternetGateway) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpAttachInternetGateway) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - 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_deserializeOpErrorAttachInternetGateway(response, &metadata) - } - output := &AttachInternetGatewayOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorAttachInternetGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAssociateVpcCidrBlock(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)} @@ -3313,14 +3241,14 @@ func awsEc2query_deserializeOpErrorAttachInternetGateway(response *smithyhttp.Re } } -type awsEc2query_deserializeOpAttachNetworkInterface struct { +type awsEc2query_deserializeOpAttachClassicLinkVpc struct { } -func (*awsEc2query_deserializeOpAttachNetworkInterface) ID() string { +func (*awsEc2query_deserializeOpAttachClassicLinkVpc) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAttachNetworkInterface) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAttachClassicLinkVpc) 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) @@ -3338,9 +3266,9 @@ func (m *awsEc2query_deserializeOpAttachNetworkInterface) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachNetworkInterface(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAttachClassicLinkVpc(response, &metadata) } - output := &AttachNetworkInterfaceOutput{} + output := &AttachClassicLinkVpcOutput{} out.Result = output var buff [1024]byte @@ -3361,7 +3289,7 @@ func (m *awsEc2query_deserializeOpAttachNetworkInterface) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachNetworkInterfaceOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAttachClassicLinkVpcOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3375,7 +3303,7 @@ func (m *awsEc2query_deserializeOpAttachNetworkInterface) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorAttachNetworkInterface(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAttachClassicLinkVpc(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)} @@ -3408,14 +3336,14 @@ func awsEc2query_deserializeOpErrorAttachNetworkInterface(response *smithyhttp.R } } -type awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider struct { +type awsEc2query_deserializeOpAttachInternetGateway struct { } -func (*awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider) ID() string { +func (*awsEc2query_deserializeOpAttachInternetGateway) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAttachInternetGateway) 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) @@ -3433,44 +3361,21 @@ func (m *awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachVerifiedAccessTrustProvider(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAttachInternetGateway(response, &metadata) } - output := &AttachVerifiedAccessTrustProviderOutput{} + output := &AttachInternetGatewayOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentAttachVerifiedAccessTrustProviderOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorAttachVerifiedAccessTrustProvider(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAttachInternetGateway(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)} @@ -3503,14 +3408,14 @@ func awsEc2query_deserializeOpErrorAttachVerifiedAccessTrustProvider(response *s } } -type awsEc2query_deserializeOpAttachVolume struct { +type awsEc2query_deserializeOpAttachNetworkInterface struct { } -func (*awsEc2query_deserializeOpAttachVolume) ID() string { +func (*awsEc2query_deserializeOpAttachNetworkInterface) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAttachVolume) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAttachNetworkInterface) 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) @@ -3528,9 +3433,9 @@ func (m *awsEc2query_deserializeOpAttachVolume) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachVolume(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAttachNetworkInterface(response, &metadata) } - output := &AttachVolumeOutput{} + output := &AttachNetworkInterfaceOutput{} out.Result = output var buff [1024]byte @@ -3551,7 +3456,7 @@ func (m *awsEc2query_deserializeOpAttachVolume) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachVolumeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAttachNetworkInterfaceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3565,7 +3470,7 @@ func (m *awsEc2query_deserializeOpAttachVolume) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsEc2query_deserializeOpErrorAttachVolume(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAttachNetworkInterface(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)} @@ -3598,14 +3503,14 @@ func awsEc2query_deserializeOpErrorAttachVolume(response *smithyhttp.Response, m } } -type awsEc2query_deserializeOpAttachVpnGateway struct { +type awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider struct { } -func (*awsEc2query_deserializeOpAttachVpnGateway) ID() string { +func (*awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAttachVpnGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAttachVerifiedAccessTrustProvider) 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) @@ -3623,9 +3528,9 @@ func (m *awsEc2query_deserializeOpAttachVpnGateway) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAttachVpnGateway(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAttachVerifiedAccessTrustProvider(response, &metadata) } - output := &AttachVpnGatewayOutput{} + output := &AttachVerifiedAccessTrustProviderOutput{} out.Result = output var buff [1024]byte @@ -3646,7 +3551,7 @@ func (m *awsEc2query_deserializeOpAttachVpnGateway) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAttachVpnGatewayOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAttachVerifiedAccessTrustProviderOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3660,7 +3565,7 @@ func (m *awsEc2query_deserializeOpAttachVpnGateway) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorAttachVpnGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAttachVerifiedAccessTrustProvider(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)} @@ -3693,14 +3598,14 @@ func awsEc2query_deserializeOpErrorAttachVpnGateway(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpAuthorizeClientVpnIngress struct { +type awsEc2query_deserializeOpAttachVolume struct { } -func (*awsEc2query_deserializeOpAuthorizeClientVpnIngress) ID() string { +func (*awsEc2query_deserializeOpAttachVolume) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpAuthorizeClientVpnIngress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpAttachVolume) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3718,9 +3623,9 @@ func (m *awsEc2query_deserializeOpAuthorizeClientVpnIngress) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorAuthorizeClientVpnIngress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorAttachVolume(response, &metadata) } - output := &AuthorizeClientVpnIngressOutput{} + output := &AttachVolumeOutput{} out.Result = output var buff [1024]byte @@ -3741,7 +3646,7 @@ func (m *awsEc2query_deserializeOpAuthorizeClientVpnIngress) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentAuthorizeClientVpnIngressOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentAttachVolumeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3755,7 +3660,197 @@ func (m *awsEc2query_deserializeOpAuthorizeClientVpnIngress) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorAuthorizeClientVpnIngress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorAttachVolume(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_deserializeOpAttachVpnGateway struct { +} + +func (*awsEc2query_deserializeOpAttachVpnGateway) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpAttachVpnGateway) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorAttachVpnGateway(response, &metadata) + } + output := &AttachVpnGatewayOutput{} + 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_deserializeOpDocumentAttachVpnGatewayOutput(&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_deserializeOpErrorAttachVpnGateway(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_deserializeOpAuthorizeClientVpnIngress struct { +} + +func (*awsEc2query_deserializeOpAuthorizeClientVpnIngress) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpAuthorizeClientVpnIngress) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorAuthorizeClientVpnIngress(response, &metadata) + } + output := &AuthorizeClientVpnIngressOutput{} + 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_deserializeOpDocumentAuthorizeClientVpnIngressOutput(&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_deserializeOpErrorAuthorizeClientVpnIngress(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)} @@ -30573,14 +30668,14 @@ func awsEc2query_deserializeOpErrorDescribeSecurityGroups(response *smithyhttp.R } } -type awsEc2query_deserializeOpDescribeSnapshotAttribute struct { +type awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations struct { } -func (*awsEc2query_deserializeOpDescribeSnapshotAttribute) ID() string { +func (*awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeSnapshotAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeSecurityGroupVpcAssociations) 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) @@ -30598,9 +30693,9 @@ func (m *awsEc2query_deserializeOpDescribeSnapshotAttribute) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshotAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeSecurityGroupVpcAssociations(response, &metadata) } - output := &DescribeSnapshotAttributeOutput{} + output := &DescribeSecurityGroupVpcAssociationsOutput{} out.Result = output var buff [1024]byte @@ -30621,7 +30716,7 @@ func (m *awsEc2query_deserializeOpDescribeSnapshotAttribute) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSnapshotAttributeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeSecurityGroupVpcAssociationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30635,7 +30730,7 @@ func (m *awsEc2query_deserializeOpDescribeSnapshotAttribute) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeSnapshotAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeSecurityGroupVpcAssociations(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)} @@ -30668,14 +30763,14 @@ func awsEc2query_deserializeOpErrorDescribeSnapshotAttribute(response *smithyhtt } } -type awsEc2query_deserializeOpDescribeSnapshots struct { +type awsEc2query_deserializeOpDescribeSnapshotAttribute struct { } -func (*awsEc2query_deserializeOpDescribeSnapshots) ID() string { +func (*awsEc2query_deserializeOpDescribeSnapshotAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeSnapshots) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeSnapshotAttribute) 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) @@ -30693,9 +30788,9 @@ func (m *awsEc2query_deserializeOpDescribeSnapshots) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshots(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshotAttribute(response, &metadata) } - output := &DescribeSnapshotsOutput{} + output := &DescribeSnapshotAttributeOutput{} out.Result = output var buff [1024]byte @@ -30716,7 +30811,7 @@ func (m *awsEc2query_deserializeOpDescribeSnapshots) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSnapshotsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeSnapshotAttributeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30730,7 +30825,7 @@ func (m *awsEc2query_deserializeOpDescribeSnapshots) HandleDeserialize(ctx conte return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeSnapshots(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeSnapshotAttribute(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)} @@ -30763,14 +30858,14 @@ func awsEc2query_deserializeOpErrorDescribeSnapshots(response *smithyhttp.Respon } } -type awsEc2query_deserializeOpDescribeSnapshotTierStatus struct { +type awsEc2query_deserializeOpDescribeSnapshots struct { } -func (*awsEc2query_deserializeOpDescribeSnapshotTierStatus) ID() string { +func (*awsEc2query_deserializeOpDescribeSnapshots) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeSnapshotTierStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeSnapshots) 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) @@ -30788,9 +30883,9 @@ func (m *awsEc2query_deserializeOpDescribeSnapshotTierStatus) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshotTierStatus(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshots(response, &metadata) } - output := &DescribeSnapshotTierStatusOutput{} + output := &DescribeSnapshotsOutput{} out.Result = output var buff [1024]byte @@ -30811,7 +30906,7 @@ func (m *awsEc2query_deserializeOpDescribeSnapshotTierStatus) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSnapshotTierStatusOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeSnapshotsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30825,7 +30920,7 @@ func (m *awsEc2query_deserializeOpDescribeSnapshotTierStatus) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeSnapshotTierStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeSnapshots(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)} @@ -30858,14 +30953,14 @@ func awsEc2query_deserializeOpErrorDescribeSnapshotTierStatus(response *smithyht } } -type awsEc2query_deserializeOpDescribeSpotDatafeedSubscription struct { +type awsEc2query_deserializeOpDescribeSnapshotTierStatus struct { } -func (*awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) ID() string { +func (*awsEc2query_deserializeOpDescribeSnapshotTierStatus) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeSnapshotTierStatus) 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) @@ -30883,9 +30978,9 @@ func (m *awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotDatafeedSubscription(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeSnapshotTierStatus(response, &metadata) } - output := &DescribeSpotDatafeedSubscriptionOutput{} + output := &DescribeSnapshotTierStatusOutput{} out.Result = output var buff [1024]byte @@ -30906,7 +31001,7 @@ func (m *awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotDatafeedSubscriptionOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeSnapshotTierStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30920,7 +31015,7 @@ func (m *awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) HandleDeseri return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeSpotDatafeedSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeSnapshotTierStatus(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)} @@ -30953,14 +31048,14 @@ func awsEc2query_deserializeOpErrorDescribeSpotDatafeedSubscription(response *sm } } -type awsEc2query_deserializeOpDescribeSpotFleetInstances struct { +type awsEc2query_deserializeOpDescribeSpotDatafeedSubscription struct { } -func (*awsEc2query_deserializeOpDescribeSpotFleetInstances) ID() string { +func (*awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeSpotFleetInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeSpotDatafeedSubscription) 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) @@ -30978,9 +31073,9 @@ func (m *awsEc2query_deserializeOpDescribeSpotFleetInstances) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotFleetInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotDatafeedSubscription(response, &metadata) } - output := &DescribeSpotFleetInstancesOutput{} + output := &DescribeSpotDatafeedSubscriptionOutput{} out.Result = output var buff [1024]byte @@ -31001,7 +31096,7 @@ func (m *awsEc2query_deserializeOpDescribeSpotFleetInstances) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDescribeSpotFleetInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDescribeSpotDatafeedSubscriptionOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -31015,7 +31110,7 @@ func (m *awsEc2query_deserializeOpDescribeSpotFleetInstances) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorDescribeSpotFleetInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDescribeSpotDatafeedSubscription(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)} @@ -31048,14 +31143,14 @@ func awsEc2query_deserializeOpErrorDescribeSpotFleetInstances(response *smithyht } } -type awsEc2query_deserializeOpDescribeSpotFleetRequestHistory struct { +type awsEc2query_deserializeOpDescribeSpotFleetInstances struct { } -func (*awsEc2query_deserializeOpDescribeSpotFleetRequestHistory) ID() string { +func (*awsEc2query_deserializeOpDescribeSpotFleetInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDescribeSpotFleetRequestHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDescribeSpotFleetInstances) 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) @@ -31073,9 +31168,104 @@ func (m *awsEc2query_deserializeOpDescribeSpotFleetRequestHistory) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotFleetRequestHistory(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDescribeSpotFleetInstances(response, &metadata) } - output := &DescribeSpotFleetRequestHistoryOutput{} + output := &DescribeSpotFleetInstancesOutput{} + 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_deserializeOpDocumentDescribeSpotFleetInstancesOutput(&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_deserializeOpErrorDescribeSpotFleetInstances(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_deserializeOpDescribeSpotFleetRequestHistory struct { +} + +func (*awsEc2query_deserializeOpDescribeSpotFleetRequestHistory) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDescribeSpotFleetRequestHistory) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDescribeSpotFleetRequestHistory(response, &metadata) + } + output := &DescribeSpotFleetRequestHistoryOutput{} out.Result = output var buff [1024]byte @@ -38225,14 +38415,14 @@ func awsEc2query_deserializeOpErrorDisassociateRouteTable(response *smithyhttp.R } } -type awsEc2query_deserializeOpDisassociateSubnetCidrBlock struct { +type awsEc2query_deserializeOpDisassociateSecurityGroupVpc struct { } -func (*awsEc2query_deserializeOpDisassociateSubnetCidrBlock) ID() string { +func (*awsEc2query_deserializeOpDisassociateSecurityGroupVpc) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDisassociateSubnetCidrBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateSecurityGroupVpc) 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) @@ -38250,9 +38440,9 @@ func (m *awsEc2query_deserializeOpDisassociateSubnetCidrBlock) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateSubnetCidrBlock(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateSecurityGroupVpc(response, &metadata) } - output := &DisassociateSubnetCidrBlockOutput{} + output := &DisassociateSecurityGroupVpcOutput{} out.Result = output var buff [1024]byte @@ -38273,7 +38463,7 @@ func (m *awsEc2query_deserializeOpDisassociateSubnetCidrBlock) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateSubnetCidrBlockOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateSecurityGroupVpcOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38287,7 +38477,7 @@ func (m *awsEc2query_deserializeOpDisassociateSubnetCidrBlock) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorDisassociateSubnetCidrBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateSecurityGroupVpc(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)} @@ -38320,14 +38510,14 @@ func awsEc2query_deserializeOpErrorDisassociateSubnetCidrBlock(response *smithyh } } -type awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain struct { +type awsEc2query_deserializeOpDisassociateSubnetCidrBlock struct { } -func (*awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) ID() string { +func (*awsEc2query_deserializeOpDisassociateSubnetCidrBlock) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateSubnetCidrBlock) 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) @@ -38345,9 +38535,9 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayMulticastDomain(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateSubnetCidrBlock(response, &metadata) } - output := &DisassociateTransitGatewayMulticastDomainOutput{} + output := &DisassociateSubnetCidrBlockOutput{} out.Result = output var buff [1024]byte @@ -38368,7 +38558,7 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) Han } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayMulticastDomainOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateSubnetCidrBlockOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38382,7 +38572,7 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) Han return out, metadata, err } -func awsEc2query_deserializeOpErrorDisassociateTransitGatewayMulticastDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateSubnetCidrBlock(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)} @@ -38415,14 +38605,14 @@ func awsEc2query_deserializeOpErrorDisassociateTransitGatewayMulticastDomain(res } } -type awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable struct { +type awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain struct { } -func (*awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) ID() string { +func (*awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateTransitGatewayMulticastDomain) 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) @@ -38440,9 +38630,9 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayPolicyTable(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayMulticastDomain(response, &metadata) } - output := &DisassociateTransitGatewayPolicyTableOutput{} + output := &DisassociateTransitGatewayMulticastDomainOutput{} out.Result = output var buff [1024]byte @@ -38463,7 +38653,7 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) HandleD } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayPolicyTableOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayMulticastDomainOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38477,7 +38667,7 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) HandleD return out, metadata, err } -func awsEc2query_deserializeOpErrorDisassociateTransitGatewayPolicyTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateTransitGatewayMulticastDomain(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)} @@ -38510,14 +38700,14 @@ func awsEc2query_deserializeOpErrorDisassociateTransitGatewayPolicyTable(respons } } -type awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable struct { +type awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable struct { } -func (*awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) ID() string { +func (*awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateTransitGatewayPolicyTable) 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) @@ -38535,9 +38725,9 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayRouteTable(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayPolicyTable(response, &metadata) } - output := &DisassociateTransitGatewayRouteTableOutput{} + output := &DisassociateTransitGatewayPolicyTableOutput{} out.Result = output var buff [1024]byte @@ -38558,7 +38748,7 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) HandleDe } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayRouteTableOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayPolicyTableOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38572,7 +38762,7 @@ func (m *awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) HandleDe return out, metadata, err } -func awsEc2query_deserializeOpErrorDisassociateTransitGatewayRouteTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateTransitGatewayPolicyTable(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)} @@ -38605,14 +38795,14 @@ func awsEc2query_deserializeOpErrorDisassociateTransitGatewayRouteTable(response } } -type awsEc2query_deserializeOpDisassociateTrunkInterface struct { +type awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable struct { } -func (*awsEc2query_deserializeOpDisassociateTrunkInterface) ID() string { +func (*awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDisassociateTrunkInterface) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateTransitGatewayRouteTable) 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) @@ -38630,9 +38820,9 @@ func (m *awsEc2query_deserializeOpDisassociateTrunkInterface) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateTrunkInterface(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateTransitGatewayRouteTable(response, &metadata) } - output := &DisassociateTrunkInterfaceOutput{} + output := &DisassociateTransitGatewayRouteTableOutput{} out.Result = output var buff [1024]byte @@ -38653,7 +38843,7 @@ func (m *awsEc2query_deserializeOpDisassociateTrunkInterface) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateTrunkInterfaceOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateTransitGatewayRouteTableOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38667,7 +38857,7 @@ func (m *awsEc2query_deserializeOpDisassociateTrunkInterface) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorDisassociateTrunkInterface(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateTransitGatewayRouteTable(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)} @@ -38700,14 +38890,14 @@ func awsEc2query_deserializeOpErrorDisassociateTrunkInterface(response *smithyht } } -type awsEc2query_deserializeOpDisassociateVpcCidrBlock struct { +type awsEc2query_deserializeOpDisassociateTrunkInterface struct { } -func (*awsEc2query_deserializeOpDisassociateVpcCidrBlock) ID() string { +func (*awsEc2query_deserializeOpDisassociateTrunkInterface) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpDisassociateVpcCidrBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateTrunkInterface) 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) @@ -38725,9 +38915,9 @@ func (m *awsEc2query_deserializeOpDisassociateVpcCidrBlock) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorDisassociateVpcCidrBlock(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateTrunkInterface(response, &metadata) } - output := &DisassociateVpcCidrBlockOutput{} + output := &DisassociateTrunkInterfaceOutput{} out.Result = output var buff [1024]byte @@ -38748,7 +38938,7 @@ func (m *awsEc2query_deserializeOpDisassociateVpcCidrBlock) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentDisassociateVpcCidrBlockOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateTrunkInterfaceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38762,7 +38952,7 @@ func (m *awsEc2query_deserializeOpDisassociateVpcCidrBlock) HandleDeserialize(ct return out, metadata, err } -func awsEc2query_deserializeOpErrorDisassociateVpcCidrBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateTrunkInterface(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)} @@ -38795,14 +38985,14 @@ func awsEc2query_deserializeOpErrorDisassociateVpcCidrBlock(response *smithyhttp } } -type awsEc2query_deserializeOpEnableAddressTransfer struct { +type awsEc2query_deserializeOpDisassociateVpcCidrBlock struct { } -func (*awsEc2query_deserializeOpEnableAddressTransfer) ID() string { +func (*awsEc2query_deserializeOpDisassociateVpcCidrBlock) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableAddressTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpDisassociateVpcCidrBlock) 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) @@ -38820,9 +39010,9 @@ func (m *awsEc2query_deserializeOpEnableAddressTransfer) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableAddressTransfer(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorDisassociateVpcCidrBlock(response, &metadata) } - output := &EnableAddressTransferOutput{} + output := &DisassociateVpcCidrBlockOutput{} out.Result = output var buff [1024]byte @@ -38843,7 +39033,7 @@ func (m *awsEc2query_deserializeOpEnableAddressTransfer) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableAddressTransferOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentDisassociateVpcCidrBlockOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38857,7 +39047,7 @@ func (m *awsEc2query_deserializeOpEnableAddressTransfer) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableAddressTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorDisassociateVpcCidrBlock(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)} @@ -38890,14 +39080,14 @@ func awsEc2query_deserializeOpErrorEnableAddressTransfer(response *smithyhttp.Re } } -type awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription struct { +type awsEc2query_deserializeOpEnableAddressTransfer struct { } -func (*awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) ID() string { +func (*awsEc2query_deserializeOpEnableAddressTransfer) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableAddressTransfer) 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) @@ -38915,9 +39105,9 @@ func (m *awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableAwsNetworkPerformanceMetricSubscription(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableAddressTransfer(response, &metadata) } - output := &EnableAwsNetworkPerformanceMetricSubscriptionOutput{} + output := &EnableAddressTransferOutput{} out.Result = output var buff [1024]byte @@ -38938,7 +39128,7 @@ func (m *awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableAwsNetworkPerformanceMetricSubscriptionOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableAddressTransferOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38952,7 +39142,7 @@ func (m *awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableAwsNetworkPerformanceMetricSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableAddressTransfer(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)} @@ -38985,14 +39175,14 @@ func awsEc2query_deserializeOpErrorEnableAwsNetworkPerformanceMetricSubscription } } -type awsEc2query_deserializeOpEnableEbsEncryptionByDefault struct { +type awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription struct { } -func (*awsEc2query_deserializeOpEnableEbsEncryptionByDefault) ID() string { +func (*awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableEbsEncryptionByDefault) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableAwsNetworkPerformanceMetricSubscription) 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) @@ -39010,9 +39200,9 @@ func (m *awsEc2query_deserializeOpEnableEbsEncryptionByDefault) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableEbsEncryptionByDefault(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableAwsNetworkPerformanceMetricSubscription(response, &metadata) } - output := &EnableEbsEncryptionByDefaultOutput{} + output := &EnableAwsNetworkPerformanceMetricSubscriptionOutput{} out.Result = output var buff [1024]byte @@ -39033,7 +39223,7 @@ func (m *awsEc2query_deserializeOpEnableEbsEncryptionByDefault) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableEbsEncryptionByDefaultOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableAwsNetworkPerformanceMetricSubscriptionOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39047,7 +39237,7 @@ func (m *awsEc2query_deserializeOpEnableEbsEncryptionByDefault) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableEbsEncryptionByDefault(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableAwsNetworkPerformanceMetricSubscription(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)} @@ -39080,14 +39270,14 @@ func awsEc2query_deserializeOpErrorEnableEbsEncryptionByDefault(response *smithy } } -type awsEc2query_deserializeOpEnableFastLaunch struct { +type awsEc2query_deserializeOpEnableEbsEncryptionByDefault struct { } -func (*awsEc2query_deserializeOpEnableFastLaunch) ID() string { +func (*awsEc2query_deserializeOpEnableEbsEncryptionByDefault) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableFastLaunch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableEbsEncryptionByDefault) 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) @@ -39105,9 +39295,9 @@ func (m *awsEc2query_deserializeOpEnableFastLaunch) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableFastLaunch(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableEbsEncryptionByDefault(response, &metadata) } - output := &EnableFastLaunchOutput{} + output := &EnableEbsEncryptionByDefaultOutput{} out.Result = output var buff [1024]byte @@ -39128,7 +39318,7 @@ func (m *awsEc2query_deserializeOpEnableFastLaunch) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableFastLaunchOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableEbsEncryptionByDefaultOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39142,7 +39332,7 @@ func (m *awsEc2query_deserializeOpEnableFastLaunch) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableFastLaunch(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableEbsEncryptionByDefault(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)} @@ -39175,14 +39365,14 @@ func awsEc2query_deserializeOpErrorEnableFastLaunch(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpEnableFastSnapshotRestores struct { +type awsEc2query_deserializeOpEnableFastLaunch struct { } -func (*awsEc2query_deserializeOpEnableFastSnapshotRestores) ID() string { +func (*awsEc2query_deserializeOpEnableFastLaunch) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableFastSnapshotRestores) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableFastLaunch) 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) @@ -39200,9 +39390,9 @@ func (m *awsEc2query_deserializeOpEnableFastSnapshotRestores) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableFastLaunch(response, &metadata) } - output := &EnableFastSnapshotRestoresOutput{} + output := &EnableFastLaunchOutput{} out.Result = output var buff [1024]byte @@ -39223,7 +39413,7 @@ func (m *awsEc2query_deserializeOpEnableFastSnapshotRestores) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableFastSnapshotRestoresOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableFastLaunchOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39237,7 +39427,7 @@ func (m *awsEc2query_deserializeOpEnableFastSnapshotRestores) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableFastLaunch(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)} @@ -39270,14 +39460,14 @@ func awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(response *smithyht } } -type awsEc2query_deserializeOpEnableImage struct { +type awsEc2query_deserializeOpEnableFastSnapshotRestores struct { } -func (*awsEc2query_deserializeOpEnableImage) ID() string { +func (*awsEc2query_deserializeOpEnableFastSnapshotRestores) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableFastSnapshotRestores) 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) @@ -39295,9 +39485,9 @@ func (m *awsEc2query_deserializeOpEnableImage) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImage(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(response, &metadata) } - output := &EnableImageOutput{} + output := &EnableFastSnapshotRestoresOutput{} out.Result = output var buff [1024]byte @@ -39318,7 +39508,7 @@ func (m *awsEc2query_deserializeOpEnableImage) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableFastSnapshotRestoresOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39332,7 +39522,7 @@ func (m *awsEc2query_deserializeOpEnableImage) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableFastSnapshotRestores(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)} @@ -39365,14 +39555,14 @@ func awsEc2query_deserializeOpErrorEnableImage(response *smithyhttp.Response, me } } -type awsEc2query_deserializeOpEnableImageBlockPublicAccess struct { +type awsEc2query_deserializeOpEnableImage struct { } -func (*awsEc2query_deserializeOpEnableImageBlockPublicAccess) ID() string { +func (*awsEc2query_deserializeOpEnableImage) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableImageBlockPublicAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -39390,9 +39580,9 @@ func (m *awsEc2query_deserializeOpEnableImageBlockPublicAccess) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImageBlockPublicAccess(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableImage(response, &metadata) } - output := &EnableImageBlockPublicAccessOutput{} + output := &EnableImageOutput{} out.Result = output var buff [1024]byte @@ -39413,7 +39603,7 @@ func (m *awsEc2query_deserializeOpEnableImageBlockPublicAccess) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageBlockPublicAccessOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableImageOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39427,7 +39617,7 @@ func (m *awsEc2query_deserializeOpEnableImageBlockPublicAccess) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableImageBlockPublicAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -39460,14 +39650,14 @@ func awsEc2query_deserializeOpErrorEnableImageBlockPublicAccess(response *smithy } } -type awsEc2query_deserializeOpEnableImageDeprecation struct { +type awsEc2query_deserializeOpEnableImageBlockPublicAccess struct { } -func (*awsEc2query_deserializeOpEnableImageDeprecation) ID() string { +func (*awsEc2query_deserializeOpEnableImageBlockPublicAccess) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableImageDeprecation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableImageBlockPublicAccess) 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) @@ -39485,9 +39675,9 @@ func (m *awsEc2query_deserializeOpEnableImageDeprecation) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImageDeprecation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableImageBlockPublicAccess(response, &metadata) } - output := &EnableImageDeprecationOutput{} + output := &EnableImageBlockPublicAccessOutput{} out.Result = output var buff [1024]byte @@ -39508,7 +39698,7 @@ func (m *awsEc2query_deserializeOpEnableImageDeprecation) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageDeprecationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableImageBlockPublicAccessOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39522,7 +39712,7 @@ func (m *awsEc2query_deserializeOpEnableImageDeprecation) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableImageDeprecation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableImageBlockPublicAccess(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)} @@ -39555,14 +39745,14 @@ func awsEc2query_deserializeOpErrorEnableImageDeprecation(response *smithyhttp.R } } -type awsEc2query_deserializeOpEnableImageDeregistrationProtection struct { +type awsEc2query_deserializeOpEnableImageDeprecation struct { } -func (*awsEc2query_deserializeOpEnableImageDeregistrationProtection) ID() string { +func (*awsEc2query_deserializeOpEnableImageDeprecation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableImageDeregistrationProtection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableImageDeprecation) 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) @@ -39580,9 +39770,9 @@ func (m *awsEc2query_deserializeOpEnableImageDeregistrationProtection) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableImageDeregistrationProtection(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableImageDeprecation(response, &metadata) } - output := &EnableImageDeregistrationProtectionOutput{} + output := &EnableImageDeprecationOutput{} out.Result = output var buff [1024]byte @@ -39603,7 +39793,7 @@ func (m *awsEc2query_deserializeOpEnableImageDeregistrationProtection) HandleDes } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableImageDeregistrationProtectionOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableImageDeprecationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39617,7 +39807,7 @@ func (m *awsEc2query_deserializeOpEnableImageDeregistrationProtection) HandleDes return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableImageDeregistrationProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableImageDeprecation(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)} @@ -39650,14 +39840,14 @@ func awsEc2query_deserializeOpErrorEnableImageDeregistrationProtection(response } } -type awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount struct { +type awsEc2query_deserializeOpEnableImageDeregistrationProtection struct { } -func (*awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) ID() string { +func (*awsEc2query_deserializeOpEnableImageDeregistrationProtection) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableImageDeregistrationProtection) 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) @@ -39675,9 +39865,9 @@ func (m *awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableIpamOrganizationAdminAccount(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableImageDeregistrationProtection(response, &metadata) } - output := &EnableIpamOrganizationAdminAccountOutput{} + output := &EnableImageDeregistrationProtectionOutput{} out.Result = output var buff [1024]byte @@ -39698,7 +39888,7 @@ func (m *awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) HandleDese } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableIpamOrganizationAdminAccountOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableImageDeregistrationProtectionOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39712,7 +39902,7 @@ func (m *awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) HandleDese return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableIpamOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableImageDeregistrationProtection(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)} @@ -39745,14 +39935,14 @@ func awsEc2query_deserializeOpErrorEnableIpamOrganizationAdminAccount(response * } } -type awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing struct { +type awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount struct { } -func (*awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) ID() string { +func (*awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableIpamOrganizationAdminAccount) 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) @@ -39770,9 +39960,9 @@ func (m *awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableReachabilityAnalyzerOrganizationSharing(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableIpamOrganizationAdminAccount(response, &metadata) } - output := &EnableReachabilityAnalyzerOrganizationSharingOutput{} + output := &EnableIpamOrganizationAdminAccountOutput{} out.Result = output var buff [1024]byte @@ -39793,7 +39983,7 @@ func (m *awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableReachabilityAnalyzerOrganizationSharingOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableIpamOrganizationAdminAccountOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39807,7 +39997,7 @@ func (m *awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableReachabilityAnalyzerOrganizationSharing(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableIpamOrganizationAdminAccount(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)} @@ -39840,14 +40030,14 @@ func awsEc2query_deserializeOpErrorEnableReachabilityAnalyzerOrganizationSharing } } -type awsEc2query_deserializeOpEnableSerialConsoleAccess struct { +type awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing struct { } -func (*awsEc2query_deserializeOpEnableSerialConsoleAccess) ID() string { +func (*awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableSerialConsoleAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableReachabilityAnalyzerOrganizationSharing) 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) @@ -39865,9 +40055,9 @@ func (m *awsEc2query_deserializeOpEnableSerialConsoleAccess) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableReachabilityAnalyzerOrganizationSharing(response, &metadata) } - output := &EnableSerialConsoleAccessOutput{} + output := &EnableReachabilityAnalyzerOrganizationSharingOutput{} out.Result = output var buff [1024]byte @@ -39888,7 +40078,7 @@ func (m *awsEc2query_deserializeOpEnableSerialConsoleAccess) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableSerialConsoleAccessOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableReachabilityAnalyzerOrganizationSharingOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39902,7 +40092,7 @@ func (m *awsEc2query_deserializeOpEnableSerialConsoleAccess) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableReachabilityAnalyzerOrganizationSharing(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)} @@ -39935,14 +40125,14 @@ func awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(response *smithyhtt } } -type awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess struct { +type awsEc2query_deserializeOpEnableSerialConsoleAccess struct { } -func (*awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) ID() string { +func (*awsEc2query_deserializeOpEnableSerialConsoleAccess) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableSerialConsoleAccess) 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) @@ -39960,9 +40150,9 @@ func (m *awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(response, &metadata) } - output := &EnableSnapshotBlockPublicAccessOutput{} + output := &EnableSerialConsoleAccessOutput{} out.Result = output var buff [1024]byte @@ -39983,7 +40173,7 @@ func (m *awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableSnapshotBlockPublicAccessOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableSerialConsoleAccessOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39997,7 +40187,7 @@ func (m *awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) HandleDeseria return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(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)} @@ -40030,14 +40220,14 @@ func awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(response *smi } } -type awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation struct { +type awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess struct { } -func (*awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) ID() string { +func (*awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) 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) @@ -40055,9 +40245,9 @@ func (m *awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableTransitGatewayRouteTablePropagation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(response, &metadata) } - output := &EnableTransitGatewayRouteTablePropagationOutput{} + output := &EnableSnapshotBlockPublicAccessOutput{} out.Result = output var buff [1024]byte @@ -40078,7 +40268,7 @@ func (m *awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) Han } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentEnableTransitGatewayRouteTablePropagationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableSnapshotBlockPublicAccessOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40092,7 +40282,7 @@ func (m *awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) Han return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableTransitGatewayRouteTablePropagation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(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)} @@ -40125,14 +40315,14 @@ func awsEc2query_deserializeOpErrorEnableTransitGatewayRouteTablePropagation(res } } -type awsEc2query_deserializeOpEnableVgwRoutePropagation struct { +type awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation struct { } -func (*awsEc2query_deserializeOpEnableVgwRoutePropagation) ID() string { +func (*awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableVgwRoutePropagation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation) 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) @@ -40150,93 +40340,44 @@ func (m *awsEc2query_deserializeOpEnableVgwRoutePropagation) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableVgwRoutePropagation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableTransitGatewayRouteTablePropagation(response, &metadata) } - output := &EnableVgwRoutePropagationOutput{} + output := &EnableTransitGatewayRouteTablePropagationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorEnableVgwRoutePropagation(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)} + 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 } - 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, + 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(), } - return genericError - } -} -type awsEc2query_deserializeOpEnableVolumeIO struct { -} - -func (*awsEc2query_deserializeOpEnableVolumeIO) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpEnableVolumeIO) 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) + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentEnableTransitGatewayRouteTablePropagationOutput(&output, decoder) if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - 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_deserializeOpErrorEnableVolumeIO(response, &metadata) - } - output := &EnableVolumeIOOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + var 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_deserializeOpErrorEnableVolumeIO(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableTransitGatewayRouteTablePropagation(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)} @@ -40269,14 +40410,14 @@ func awsEc2query_deserializeOpErrorEnableVolumeIO(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpEnableVpcClassicLink struct { +type awsEc2query_deserializeOpEnableVgwRoutePropagation struct { } -func (*awsEc2query_deserializeOpEnableVpcClassicLink) ID() string { +func (*awsEc2query_deserializeOpEnableVgwRoutePropagation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableVpcClassicLink) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableVgwRoutePropagation) 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) @@ -40294,44 +40435,21 @@ func (m *awsEc2query_deserializeOpEnableVpcClassicLink) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableVpcClassicLink(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableVgwRoutePropagation(response, &metadata) } - output := &EnableVpcClassicLinkOutput{} + output := &EnableVgwRoutePropagationOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentEnableVpcClassicLinkOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableVpcClassicLink(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableVgwRoutePropagation(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)} @@ -40364,14 +40482,14 @@ func awsEc2query_deserializeOpErrorEnableVpcClassicLink(response *smithyhttp.Res } } -type awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport struct { +type awsEc2query_deserializeOpEnableVolumeIO struct { } -func (*awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport) ID() string { +func (*awsEc2query_deserializeOpEnableVolumeIO) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableVolumeIO) 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) @@ -40389,44 +40507,21 @@ func (m *awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorEnableVpcClassicLinkDnsSupport(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableVolumeIO(response, &metadata) } - output := &EnableVpcClassicLinkDnsSupportOutput{} + output := &EnableVolumeIOOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentEnableVpcClassicLinkDnsSupportOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorEnableVpcClassicLinkDnsSupport(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableVolumeIO(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)} @@ -40459,14 +40554,14 @@ func awsEc2query_deserializeOpErrorEnableVpcClassicLinkDnsSupport(response *smit } } -type awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList struct { +type awsEc2query_deserializeOpEnableVpcClassicLink struct { } -func (*awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList) ID() string { +func (*awsEc2query_deserializeOpEnableVpcClassicLink) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableVpcClassicLink) 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) @@ -40484,9 +40579,9 @@ func (m *awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportClientVpnClientCertificateRevocationList(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableVpcClassicLink(response, &metadata) } - output := &ExportClientVpnClientCertificateRevocationListOutput{} + output := &EnableVpcClassicLinkOutput{} out.Result = output var buff [1024]byte @@ -40507,7 +40602,7 @@ func (m *awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportClientVpnClientCertificateRevocationListOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableVpcClassicLinkOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40521,7 +40616,7 @@ func (m *awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList return out, metadata, err } -func awsEc2query_deserializeOpErrorExportClientVpnClientCertificateRevocationList(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableVpcClassicLink(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)} @@ -40554,14 +40649,14 @@ func awsEc2query_deserializeOpErrorExportClientVpnClientCertificateRevocationLis } } -type awsEc2query_deserializeOpExportClientVpnClientConfiguration struct { +type awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport struct { } -func (*awsEc2query_deserializeOpExportClientVpnClientConfiguration) ID() string { +func (*awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpExportClientVpnClientConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpEnableVpcClassicLinkDnsSupport) 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) @@ -40579,9 +40674,9 @@ func (m *awsEc2query_deserializeOpExportClientVpnClientConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportClientVpnClientConfiguration(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorEnableVpcClassicLinkDnsSupport(response, &metadata) } - output := &ExportClientVpnClientConfigurationOutput{} + output := &EnableVpcClassicLinkDnsSupportOutput{} out.Result = output var buff [1024]byte @@ -40602,7 +40697,7 @@ func (m *awsEc2query_deserializeOpExportClientVpnClientConfiguration) HandleDese } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportClientVpnClientConfigurationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentEnableVpcClassicLinkDnsSupportOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40616,7 +40711,7 @@ func (m *awsEc2query_deserializeOpExportClientVpnClientConfiguration) HandleDese return out, metadata, err } -func awsEc2query_deserializeOpErrorExportClientVpnClientConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorEnableVpcClassicLinkDnsSupport(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)} @@ -40649,14 +40744,14 @@ func awsEc2query_deserializeOpErrorExportClientVpnClientConfiguration(response * } } -type awsEc2query_deserializeOpExportImage struct { +type awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList struct { } -func (*awsEc2query_deserializeOpExportImage) ID() string { +func (*awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpExportImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpExportClientVpnClientCertificateRevocationList) 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) @@ -40674,9 +40769,9 @@ func (m *awsEc2query_deserializeOpExportImage) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportImage(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorExportClientVpnClientCertificateRevocationList(response, &metadata) } - output := &ExportImageOutput{} + output := &ExportClientVpnClientCertificateRevocationListOutput{} out.Result = output var buff [1024]byte @@ -40697,7 +40792,7 @@ func (m *awsEc2query_deserializeOpExportImage) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportImageOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentExportClientVpnClientCertificateRevocationListOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40711,7 +40806,7 @@ func (m *awsEc2query_deserializeOpExportImage) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsEc2query_deserializeOpErrorExportImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorExportClientVpnClientCertificateRevocationList(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)} @@ -40744,14 +40839,14 @@ func awsEc2query_deserializeOpErrorExportImage(response *smithyhttp.Response, me } } -type awsEc2query_deserializeOpExportTransitGatewayRoutes struct { +type awsEc2query_deserializeOpExportClientVpnClientConfiguration struct { } -func (*awsEc2query_deserializeOpExportTransitGatewayRoutes) ID() string { +func (*awsEc2query_deserializeOpExportClientVpnClientConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpExportTransitGatewayRoutes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpExportClientVpnClientConfiguration) 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) @@ -40769,9 +40864,9 @@ func (m *awsEc2query_deserializeOpExportTransitGatewayRoutes) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorExportTransitGatewayRoutes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorExportClientVpnClientConfiguration(response, &metadata) } - output := &ExportTransitGatewayRoutesOutput{} + output := &ExportClientVpnClientConfigurationOutput{} out.Result = output var buff [1024]byte @@ -40792,7 +40887,7 @@ func (m *awsEc2query_deserializeOpExportTransitGatewayRoutes) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentExportTransitGatewayRoutesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentExportClientVpnClientConfigurationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40806,7 +40901,7 @@ func (m *awsEc2query_deserializeOpExportTransitGatewayRoutes) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorExportTransitGatewayRoutes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorExportClientVpnClientConfiguration(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)} @@ -40839,14 +40934,14 @@ func awsEc2query_deserializeOpErrorExportTransitGatewayRoutes(response *smithyht } } -type awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles struct { +type awsEc2query_deserializeOpExportImage struct { } -func (*awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) ID() string { +func (*awsEc2query_deserializeOpExportImage) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpExportImage) 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) @@ -40864,9 +40959,9 @@ func (m *awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetAssociatedEnclaveCertificateIamRoles(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorExportImage(response, &metadata) } - output := &GetAssociatedEnclaveCertificateIamRolesOutput{} + output := &ExportImageOutput{} out.Result = output var buff [1024]byte @@ -40887,7 +40982,7 @@ func (m *awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) Handl } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetAssociatedEnclaveCertificateIamRolesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentExportImageOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40901,7 +40996,7 @@ func (m *awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) Handl return out, metadata, err } -func awsEc2query_deserializeOpErrorGetAssociatedEnclaveCertificateIamRoles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorExportImage(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)} @@ -40934,14 +41029,14 @@ func awsEc2query_deserializeOpErrorGetAssociatedEnclaveCertificateIamRoles(respo } } -type awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs struct { +type awsEc2query_deserializeOpExportTransitGatewayRoutes struct { } -func (*awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) ID() string { +func (*awsEc2query_deserializeOpExportTransitGatewayRoutes) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpExportTransitGatewayRoutes) 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) @@ -40959,9 +41054,9 @@ func (m *awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetAssociatedIpv6PoolCidrs(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorExportTransitGatewayRoutes(response, &metadata) } - output := &GetAssociatedIpv6PoolCidrsOutput{} + output := &ExportTransitGatewayRoutesOutput{} out.Result = output var buff [1024]byte @@ -40982,7 +41077,7 @@ func (m *awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetAssociatedIpv6PoolCidrsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentExportTransitGatewayRoutesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40996,7 +41091,7 @@ func (m *awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorGetAssociatedIpv6PoolCidrs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorExportTransitGatewayRoutes(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)} @@ -41029,14 +41124,14 @@ func awsEc2query_deserializeOpErrorGetAssociatedIpv6PoolCidrs(response *smithyht } } -type awsEc2query_deserializeOpGetAwsNetworkPerformanceData struct { +type awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles struct { } -func (*awsEc2query_deserializeOpGetAwsNetworkPerformanceData) ID() string { +func (*awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetAwsNetworkPerformanceData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetAssociatedEnclaveCertificateIamRoles) 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) @@ -41054,9 +41149,9 @@ func (m *awsEc2query_deserializeOpGetAwsNetworkPerformanceData) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetAwsNetworkPerformanceData(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetAssociatedEnclaveCertificateIamRoles(response, &metadata) } - output := &GetAwsNetworkPerformanceDataOutput{} + output := &GetAssociatedEnclaveCertificateIamRolesOutput{} out.Result = output var buff [1024]byte @@ -41077,7 +41172,7 @@ func (m *awsEc2query_deserializeOpGetAwsNetworkPerformanceData) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetAwsNetworkPerformanceDataOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetAssociatedEnclaveCertificateIamRolesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41091,7 +41186,7 @@ func (m *awsEc2query_deserializeOpGetAwsNetworkPerformanceData) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorGetAwsNetworkPerformanceData(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetAssociatedEnclaveCertificateIamRoles(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)} @@ -41124,14 +41219,14 @@ func awsEc2query_deserializeOpErrorGetAwsNetworkPerformanceData(response *smithy } } -type awsEc2query_deserializeOpGetCapacityReservationUsage struct { +type awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs struct { } -func (*awsEc2query_deserializeOpGetCapacityReservationUsage) ID() string { +func (*awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetCapacityReservationUsage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetAssociatedIpv6PoolCidrs) 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) @@ -41149,9 +41244,9 @@ func (m *awsEc2query_deserializeOpGetCapacityReservationUsage) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetCapacityReservationUsage(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetAssociatedIpv6PoolCidrs(response, &metadata) } - output := &GetCapacityReservationUsageOutput{} + output := &GetAssociatedIpv6PoolCidrsOutput{} out.Result = output var buff [1024]byte @@ -41172,7 +41267,7 @@ func (m *awsEc2query_deserializeOpGetCapacityReservationUsage) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetCapacityReservationUsageOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetAssociatedIpv6PoolCidrsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41186,7 +41281,7 @@ func (m *awsEc2query_deserializeOpGetCapacityReservationUsage) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorGetCapacityReservationUsage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetAssociatedIpv6PoolCidrs(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)} @@ -41219,14 +41314,14 @@ func awsEc2query_deserializeOpErrorGetCapacityReservationUsage(response *smithyh } } -type awsEc2query_deserializeOpGetCoipPoolUsage struct { +type awsEc2query_deserializeOpGetAwsNetworkPerformanceData struct { } -func (*awsEc2query_deserializeOpGetCoipPoolUsage) ID() string { +func (*awsEc2query_deserializeOpGetAwsNetworkPerformanceData) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetCoipPoolUsage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetAwsNetworkPerformanceData) 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) @@ -41244,9 +41339,9 @@ func (m *awsEc2query_deserializeOpGetCoipPoolUsage) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetCoipPoolUsage(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetAwsNetworkPerformanceData(response, &metadata) } - output := &GetCoipPoolUsageOutput{} + output := &GetAwsNetworkPerformanceDataOutput{} out.Result = output var buff [1024]byte @@ -41267,7 +41362,7 @@ func (m *awsEc2query_deserializeOpGetCoipPoolUsage) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetCoipPoolUsageOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetAwsNetworkPerformanceDataOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41281,7 +41376,7 @@ func (m *awsEc2query_deserializeOpGetCoipPoolUsage) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorGetCoipPoolUsage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetAwsNetworkPerformanceData(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)} @@ -41314,14 +41409,14 @@ func awsEc2query_deserializeOpErrorGetCoipPoolUsage(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpGetConsoleOutput struct { +type awsEc2query_deserializeOpGetCapacityReservationUsage struct { } -func (*awsEc2query_deserializeOpGetConsoleOutput) ID() string { +func (*awsEc2query_deserializeOpGetCapacityReservationUsage) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetConsoleOutput) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetCapacityReservationUsage) 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) @@ -41339,9 +41434,9 @@ func (m *awsEc2query_deserializeOpGetConsoleOutput) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetConsoleOutput(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetCapacityReservationUsage(response, &metadata) } - output := &GetConsoleOutputOutput{} + output := &GetCapacityReservationUsageOutput{} out.Result = output var buff [1024]byte @@ -41362,7 +41457,7 @@ func (m *awsEc2query_deserializeOpGetConsoleOutput) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetConsoleOutputOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetCapacityReservationUsageOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41376,7 +41471,7 @@ func (m *awsEc2query_deserializeOpGetConsoleOutput) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorGetConsoleOutput(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetCapacityReservationUsage(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)} @@ -41409,14 +41504,14 @@ func awsEc2query_deserializeOpErrorGetConsoleOutput(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpGetConsoleScreenshot struct { +type awsEc2query_deserializeOpGetCoipPoolUsage struct { } -func (*awsEc2query_deserializeOpGetConsoleScreenshot) ID() string { +func (*awsEc2query_deserializeOpGetCoipPoolUsage) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetConsoleScreenshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetCoipPoolUsage) 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) @@ -41434,9 +41529,9 @@ func (m *awsEc2query_deserializeOpGetConsoleScreenshot) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetConsoleScreenshot(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetCoipPoolUsage(response, &metadata) } - output := &GetConsoleScreenshotOutput{} + output := &GetCoipPoolUsageOutput{} out.Result = output var buff [1024]byte @@ -41457,7 +41552,7 @@ func (m *awsEc2query_deserializeOpGetConsoleScreenshot) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetConsoleScreenshotOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetCoipPoolUsageOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41471,7 +41566,7 @@ func (m *awsEc2query_deserializeOpGetConsoleScreenshot) HandleDeserialize(ctx co return out, metadata, err } -func awsEc2query_deserializeOpErrorGetConsoleScreenshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetCoipPoolUsage(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)} @@ -41504,14 +41599,14 @@ func awsEc2query_deserializeOpErrorGetConsoleScreenshot(response *smithyhttp.Res } } -type awsEc2query_deserializeOpGetDefaultCreditSpecification struct { +type awsEc2query_deserializeOpGetConsoleOutput struct { } -func (*awsEc2query_deserializeOpGetDefaultCreditSpecification) ID() string { +func (*awsEc2query_deserializeOpGetConsoleOutput) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetDefaultCreditSpecification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetConsoleOutput) 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) @@ -41529,9 +41624,9 @@ func (m *awsEc2query_deserializeOpGetDefaultCreditSpecification) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetDefaultCreditSpecification(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetConsoleOutput(response, &metadata) } - output := &GetDefaultCreditSpecificationOutput{} + output := &GetConsoleOutputOutput{} out.Result = output var buff [1024]byte @@ -41552,7 +41647,7 @@ func (m *awsEc2query_deserializeOpGetDefaultCreditSpecification) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetDefaultCreditSpecificationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetConsoleOutputOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41566,7 +41661,7 @@ func (m *awsEc2query_deserializeOpGetDefaultCreditSpecification) HandleDeseriali return out, metadata, err } -func awsEc2query_deserializeOpErrorGetDefaultCreditSpecification(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetConsoleOutput(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)} @@ -41599,14 +41694,14 @@ func awsEc2query_deserializeOpErrorGetDefaultCreditSpecification(response *smith } } -type awsEc2query_deserializeOpGetEbsDefaultKmsKeyId struct { +type awsEc2query_deserializeOpGetConsoleScreenshot struct { } -func (*awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) ID() string { +func (*awsEc2query_deserializeOpGetConsoleScreenshot) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetConsoleScreenshot) 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) @@ -41624,9 +41719,9 @@ func (m *awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetEbsDefaultKmsKeyId(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetConsoleScreenshot(response, &metadata) } - output := &GetEbsDefaultKmsKeyIdOutput{} + output := &GetConsoleScreenshotOutput{} out.Result = output var buff [1024]byte @@ -41647,7 +41742,7 @@ func (m *awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetEbsDefaultKmsKeyIdOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetConsoleScreenshotOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41661,7 +41756,7 @@ func (m *awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorGetEbsDefaultKmsKeyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetConsoleScreenshot(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)} @@ -41694,14 +41789,14 @@ func awsEc2query_deserializeOpErrorGetEbsDefaultKmsKeyId(response *smithyhttp.Re } } -type awsEc2query_deserializeOpGetEbsEncryptionByDefault struct { +type awsEc2query_deserializeOpGetDefaultCreditSpecification struct { } -func (*awsEc2query_deserializeOpGetEbsEncryptionByDefault) ID() string { +func (*awsEc2query_deserializeOpGetDefaultCreditSpecification) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetEbsEncryptionByDefault) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetDefaultCreditSpecification) 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) @@ -41719,9 +41814,9 @@ func (m *awsEc2query_deserializeOpGetEbsEncryptionByDefault) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetEbsEncryptionByDefault(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetDefaultCreditSpecification(response, &metadata) } - output := &GetEbsEncryptionByDefaultOutput{} + output := &GetDefaultCreditSpecificationOutput{} out.Result = output var buff [1024]byte @@ -41742,7 +41837,7 @@ func (m *awsEc2query_deserializeOpGetEbsEncryptionByDefault) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetEbsEncryptionByDefaultOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetDefaultCreditSpecificationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41756,7 +41851,7 @@ func (m *awsEc2query_deserializeOpGetEbsEncryptionByDefault) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorGetEbsEncryptionByDefault(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetDefaultCreditSpecification(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)} @@ -41789,14 +41884,14 @@ func awsEc2query_deserializeOpErrorGetEbsEncryptionByDefault(response *smithyhtt } } -type awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate struct { +type awsEc2query_deserializeOpGetEbsDefaultKmsKeyId struct { } -func (*awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) ID() string { +func (*awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetEbsDefaultKmsKeyId) 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) @@ -41814,9 +41909,9 @@ func (m *awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetFlowLogsIntegrationTemplate(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetEbsDefaultKmsKeyId(response, &metadata) } - output := &GetFlowLogsIntegrationTemplateOutput{} + output := &GetEbsDefaultKmsKeyIdOutput{} out.Result = output var buff [1024]byte @@ -41837,7 +41932,7 @@ func (m *awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetFlowLogsIntegrationTemplateOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetEbsDefaultKmsKeyIdOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41851,7 +41946,7 @@ func (m *awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) HandleDeserial return out, metadata, err } -func awsEc2query_deserializeOpErrorGetFlowLogsIntegrationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetEbsDefaultKmsKeyId(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)} @@ -41884,14 +41979,14 @@ func awsEc2query_deserializeOpErrorGetFlowLogsIntegrationTemplate(response *smit } } -type awsEc2query_deserializeOpGetGroupsForCapacityReservation struct { +type awsEc2query_deserializeOpGetEbsEncryptionByDefault struct { } -func (*awsEc2query_deserializeOpGetGroupsForCapacityReservation) ID() string { +func (*awsEc2query_deserializeOpGetEbsEncryptionByDefault) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetGroupsForCapacityReservation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetEbsEncryptionByDefault) 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) @@ -41909,9 +42004,9 @@ func (m *awsEc2query_deserializeOpGetGroupsForCapacityReservation) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetGroupsForCapacityReservation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetEbsEncryptionByDefault(response, &metadata) } - output := &GetGroupsForCapacityReservationOutput{} + output := &GetEbsEncryptionByDefaultOutput{} out.Result = output var buff [1024]byte @@ -41932,7 +42027,7 @@ func (m *awsEc2query_deserializeOpGetGroupsForCapacityReservation) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetGroupsForCapacityReservationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetEbsEncryptionByDefaultOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41946,7 +42041,7 @@ func (m *awsEc2query_deserializeOpGetGroupsForCapacityReservation) HandleDeseria return out, metadata, err } -func awsEc2query_deserializeOpErrorGetGroupsForCapacityReservation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetEbsEncryptionByDefault(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)} @@ -41979,14 +42074,14 @@ func awsEc2query_deserializeOpErrorGetGroupsForCapacityReservation(response *smi } } -type awsEc2query_deserializeOpGetHostReservationPurchasePreview struct { +type awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate struct { } -func (*awsEc2query_deserializeOpGetHostReservationPurchasePreview) ID() string { +func (*awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetHostReservationPurchasePreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetFlowLogsIntegrationTemplate) 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) @@ -42004,9 +42099,9 @@ func (m *awsEc2query_deserializeOpGetHostReservationPurchasePreview) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetHostReservationPurchasePreview(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetFlowLogsIntegrationTemplate(response, &metadata) } - output := &GetHostReservationPurchasePreviewOutput{} + output := &GetFlowLogsIntegrationTemplateOutput{} out.Result = output var buff [1024]byte @@ -42027,7 +42122,7 @@ func (m *awsEc2query_deserializeOpGetHostReservationPurchasePreview) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetHostReservationPurchasePreviewOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetFlowLogsIntegrationTemplateOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42041,7 +42136,7 @@ func (m *awsEc2query_deserializeOpGetHostReservationPurchasePreview) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorGetHostReservationPurchasePreview(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetFlowLogsIntegrationTemplate(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)} @@ -42074,14 +42169,14 @@ func awsEc2query_deserializeOpErrorGetHostReservationPurchasePreview(response *s } } -type awsEc2query_deserializeOpGetImageBlockPublicAccessState struct { +type awsEc2query_deserializeOpGetGroupsForCapacityReservation struct { } -func (*awsEc2query_deserializeOpGetImageBlockPublicAccessState) ID() string { +func (*awsEc2query_deserializeOpGetGroupsForCapacityReservation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetImageBlockPublicAccessState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetGroupsForCapacityReservation) 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) @@ -42099,9 +42194,9 @@ func (m *awsEc2query_deserializeOpGetImageBlockPublicAccessState) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetImageBlockPublicAccessState(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetGroupsForCapacityReservation(response, &metadata) } - output := &GetImageBlockPublicAccessStateOutput{} + output := &GetGroupsForCapacityReservationOutput{} out.Result = output var buff [1024]byte @@ -42122,7 +42217,7 @@ func (m *awsEc2query_deserializeOpGetImageBlockPublicAccessState) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetImageBlockPublicAccessStateOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetGroupsForCapacityReservationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42136,7 +42231,7 @@ func (m *awsEc2query_deserializeOpGetImageBlockPublicAccessState) HandleDeserial return out, metadata, err } -func awsEc2query_deserializeOpErrorGetImageBlockPublicAccessState(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetGroupsForCapacityReservation(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)} @@ -42169,14 +42264,14 @@ func awsEc2query_deserializeOpErrorGetImageBlockPublicAccessState(response *smit } } -type awsEc2query_deserializeOpGetInstanceMetadataDefaults struct { +type awsEc2query_deserializeOpGetHostReservationPurchasePreview struct { } -func (*awsEc2query_deserializeOpGetInstanceMetadataDefaults) ID() string { +func (*awsEc2query_deserializeOpGetHostReservationPurchasePreview) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetInstanceMetadataDefaults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetHostReservationPurchasePreview) 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) @@ -42194,9 +42289,9 @@ func (m *awsEc2query_deserializeOpGetInstanceMetadataDefaults) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetHostReservationPurchasePreview(response, &metadata) } - output := &GetInstanceMetadataDefaultsOutput{} + output := &GetHostReservationPurchasePreviewOutput{} out.Result = output var buff [1024]byte @@ -42217,7 +42312,7 @@ func (m *awsEc2query_deserializeOpGetInstanceMetadataDefaults) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceMetadataDefaultsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetHostReservationPurchasePreviewOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42231,7 +42326,7 @@ func (m *awsEc2query_deserializeOpGetInstanceMetadataDefaults) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetHostReservationPurchasePreview(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)} @@ -42264,14 +42359,14 @@ func awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(response *smithyh } } -type awsEc2query_deserializeOpGetInstanceTpmEkPub struct { +type awsEc2query_deserializeOpGetImageBlockPublicAccessState struct { } -func (*awsEc2query_deserializeOpGetInstanceTpmEkPub) ID() string { +func (*awsEc2query_deserializeOpGetImageBlockPublicAccessState) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetInstanceTpmEkPub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetImageBlockPublicAccessState) 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) @@ -42289,9 +42384,9 @@ func (m *awsEc2query_deserializeOpGetInstanceTpmEkPub) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetImageBlockPublicAccessState(response, &metadata) } - output := &GetInstanceTpmEkPubOutput{} + output := &GetImageBlockPublicAccessStateOutput{} out.Result = output var buff [1024]byte @@ -42312,7 +42407,7 @@ func (m *awsEc2query_deserializeOpGetInstanceTpmEkPub) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceTpmEkPubOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetImageBlockPublicAccessStateOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42326,7 +42421,7 @@ func (m *awsEc2query_deserializeOpGetInstanceTpmEkPub) HandleDeserialize(ctx con return out, metadata, err } -func awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetImageBlockPublicAccessState(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)} @@ -42359,14 +42454,14 @@ func awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements struct { +type awsEc2query_deserializeOpGetInstanceMetadataDefaults struct { } -func (*awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) ID() string { +func (*awsEc2query_deserializeOpGetInstanceMetadataDefaults) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetInstanceMetadataDefaults) 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) @@ -42384,9 +42479,9 @@ func (m *awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) Hand } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceTypesFromInstanceRequirements(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(response, &metadata) } - output := &GetInstanceTypesFromInstanceRequirementsOutput{} + output := &GetInstanceMetadataDefaultsOutput{} out.Result = output var buff [1024]byte @@ -42407,7 +42502,7 @@ func (m *awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) Hand } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceTypesFromInstanceRequirementsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetInstanceMetadataDefaultsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42421,7 +42516,7 @@ func (m *awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) Hand return out, metadata, err } -func awsEc2query_deserializeOpErrorGetInstanceTypesFromInstanceRequirements(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(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)} @@ -42454,14 +42549,14 @@ func awsEc2query_deserializeOpErrorGetInstanceTypesFromInstanceRequirements(resp } } -type awsEc2query_deserializeOpGetInstanceUefiData struct { +type awsEc2query_deserializeOpGetInstanceTpmEkPub struct { } -func (*awsEc2query_deserializeOpGetInstanceUefiData) ID() string { +func (*awsEc2query_deserializeOpGetInstanceTpmEkPub) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetInstanceUefiData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetInstanceTpmEkPub) 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) @@ -42479,9 +42574,9 @@ func (m *awsEc2query_deserializeOpGetInstanceUefiData) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetInstanceUefiData(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(response, &metadata) } - output := &GetInstanceUefiDataOutput{} + output := &GetInstanceTpmEkPubOutput{} out.Result = output var buff [1024]byte @@ -42502,7 +42597,7 @@ func (m *awsEc2query_deserializeOpGetInstanceUefiData) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetInstanceUefiDataOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetInstanceTpmEkPubOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42516,7 +42611,7 @@ func (m *awsEc2query_deserializeOpGetInstanceUefiData) HandleDeserialize(ctx con return out, metadata, err } -func awsEc2query_deserializeOpErrorGetInstanceUefiData(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(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)} @@ -42549,14 +42644,14 @@ func awsEc2query_deserializeOpErrorGetInstanceUefiData(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpGetIpamAddressHistory struct { +type awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements struct { } -func (*awsEc2query_deserializeOpGetIpamAddressHistory) ID() string { +func (*awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetIpamAddressHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements) 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) @@ -42574,9 +42669,9 @@ func (m *awsEc2query_deserializeOpGetIpamAddressHistory) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamAddressHistory(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetInstanceTypesFromInstanceRequirements(response, &metadata) } - output := &GetIpamAddressHistoryOutput{} + output := &GetInstanceTypesFromInstanceRequirementsOutput{} out.Result = output var buff [1024]byte @@ -42597,7 +42692,7 @@ func (m *awsEc2query_deserializeOpGetIpamAddressHistory) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamAddressHistoryOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetInstanceTypesFromInstanceRequirementsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42611,7 +42706,7 @@ func (m *awsEc2query_deserializeOpGetIpamAddressHistory) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorGetIpamAddressHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetInstanceTypesFromInstanceRequirements(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)} @@ -42644,14 +42739,14 @@ func awsEc2query_deserializeOpErrorGetIpamAddressHistory(response *smithyhttp.Re } } -type awsEc2query_deserializeOpGetIpamDiscoveredAccounts struct { +type awsEc2query_deserializeOpGetInstanceUefiData struct { } -func (*awsEc2query_deserializeOpGetIpamDiscoveredAccounts) ID() string { +func (*awsEc2query_deserializeOpGetInstanceUefiData) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetIpamDiscoveredAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetInstanceUefiData) 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) @@ -42669,9 +42764,9 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredAccounts) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetInstanceUefiData(response, &metadata) } - output := &GetIpamDiscoveredAccountsOutput{} + output := &GetInstanceUefiDataOutput{} out.Result = output var buff [1024]byte @@ -42692,7 +42787,7 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredAccounts) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredAccountsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetInstanceUefiDataOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42706,7 +42801,7 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredAccounts) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetInstanceUefiData(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)} @@ -42739,14 +42834,14 @@ func awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(response *smithyhtt } } -type awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses struct { +type awsEc2query_deserializeOpGetIpamAddressHistory struct { } -func (*awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) ID() string { +func (*awsEc2query_deserializeOpGetIpamAddressHistory) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetIpamAddressHistory) 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) @@ -42764,9 +42859,9 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetIpamAddressHistory(response, &metadata) } - output := &GetIpamDiscoveredPublicAddressesOutput{} + output := &GetIpamAddressHistoryOutput{} out.Result = output var buff [1024]byte @@ -42787,7 +42882,7 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredPublicAddressesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetIpamAddressHistoryOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42801,7 +42896,7 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) HandleDeseri return out, metadata, err } -func awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetIpamAddressHistory(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)} @@ -42834,14 +42929,14 @@ func awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(response *sm } } -type awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs struct { +type awsEc2query_deserializeOpGetIpamDiscoveredAccounts struct { } -func (*awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) ID() string { +func (*awsEc2query_deserializeOpGetIpamDiscoveredAccounts) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetIpamDiscoveredAccounts) 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) @@ -42859,9 +42954,9 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredResourceCidrs(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(response, &metadata) } - output := &GetIpamDiscoveredResourceCidrsOutput{} + output := &GetIpamDiscoveredAccountsOutput{} out.Result = output var buff [1024]byte @@ -42882,7 +42977,7 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredResourceCidrsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredAccountsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42896,7 +42991,7 @@ func (m *awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) HandleDeserial return out, metadata, err } -func awsEc2query_deserializeOpErrorGetIpamDiscoveredResourceCidrs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetIpamDiscoveredAccounts(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)} @@ -42929,14 +43024,14 @@ func awsEc2query_deserializeOpErrorGetIpamDiscoveredResourceCidrs(response *smit } } -type awsEc2query_deserializeOpGetIpamPoolAllocations struct { +type awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses struct { } -func (*awsEc2query_deserializeOpGetIpamPoolAllocations) ID() string { +func (*awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetIpamPoolAllocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetIpamDiscoveredPublicAddresses) 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) @@ -42954,9 +43049,9 @@ func (m *awsEc2query_deserializeOpGetIpamPoolAllocations) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamPoolAllocations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(response, &metadata) } - output := &GetIpamPoolAllocationsOutput{} + output := &GetIpamDiscoveredPublicAddressesOutput{} out.Result = output var buff [1024]byte @@ -42977,7 +43072,7 @@ func (m *awsEc2query_deserializeOpGetIpamPoolAllocations) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamPoolAllocationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredPublicAddressesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -42991,7 +43086,7 @@ func (m *awsEc2query_deserializeOpGetIpamPoolAllocations) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorGetIpamPoolAllocations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetIpamDiscoveredPublicAddresses(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)} @@ -43024,14 +43119,14 @@ func awsEc2query_deserializeOpErrorGetIpamPoolAllocations(response *smithyhttp.R } } -type awsEc2query_deserializeOpGetIpamPoolCidrs struct { +type awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs struct { } -func (*awsEc2query_deserializeOpGetIpamPoolCidrs) ID() string { +func (*awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetIpamPoolCidrs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetIpamDiscoveredResourceCidrs) 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) @@ -43049,9 +43144,9 @@ func (m *awsEc2query_deserializeOpGetIpamPoolCidrs) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamPoolCidrs(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetIpamDiscoveredResourceCidrs(response, &metadata) } - output := &GetIpamPoolCidrsOutput{} + output := &GetIpamDiscoveredResourceCidrsOutput{} out.Result = output var buff [1024]byte @@ -43072,7 +43167,7 @@ func (m *awsEc2query_deserializeOpGetIpamPoolCidrs) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamPoolCidrsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetIpamDiscoveredResourceCidrsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43086,7 +43181,7 @@ func (m *awsEc2query_deserializeOpGetIpamPoolCidrs) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorGetIpamPoolCidrs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetIpamDiscoveredResourceCidrs(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)} @@ -43119,14 +43214,14 @@ func awsEc2query_deserializeOpErrorGetIpamPoolCidrs(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpGetIpamResourceCidrs struct { +type awsEc2query_deserializeOpGetIpamPoolAllocations struct { } -func (*awsEc2query_deserializeOpGetIpamResourceCidrs) ID() string { +func (*awsEc2query_deserializeOpGetIpamPoolAllocations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetIpamResourceCidrs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetIpamPoolAllocations) 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) @@ -43144,9 +43239,9 @@ func (m *awsEc2query_deserializeOpGetIpamResourceCidrs) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetIpamResourceCidrs(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetIpamPoolAllocations(response, &metadata) } - output := &GetIpamResourceCidrsOutput{} + output := &GetIpamPoolAllocationsOutput{} out.Result = output var buff [1024]byte @@ -43167,7 +43262,7 @@ func (m *awsEc2query_deserializeOpGetIpamResourceCidrs) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetIpamResourceCidrsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetIpamPoolAllocationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43181,7 +43276,7 @@ func (m *awsEc2query_deserializeOpGetIpamResourceCidrs) HandleDeserialize(ctx co return out, metadata, err } -func awsEc2query_deserializeOpErrorGetIpamResourceCidrs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetIpamPoolAllocations(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)} @@ -43214,14 +43309,14 @@ func awsEc2query_deserializeOpErrorGetIpamResourceCidrs(response *smithyhttp.Res } } -type awsEc2query_deserializeOpGetLaunchTemplateData struct { +type awsEc2query_deserializeOpGetIpamPoolCidrs struct { } -func (*awsEc2query_deserializeOpGetLaunchTemplateData) ID() string { +func (*awsEc2query_deserializeOpGetIpamPoolCidrs) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetLaunchTemplateData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetIpamPoolCidrs) 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) @@ -43239,9 +43334,9 @@ func (m *awsEc2query_deserializeOpGetLaunchTemplateData) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetLaunchTemplateData(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetIpamPoolCidrs(response, &metadata) } - output := &GetLaunchTemplateDataOutput{} + output := &GetIpamPoolCidrsOutput{} out.Result = output var buff [1024]byte @@ -43262,7 +43357,7 @@ func (m *awsEc2query_deserializeOpGetLaunchTemplateData) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetLaunchTemplateDataOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetIpamPoolCidrsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43276,7 +43371,7 @@ func (m *awsEc2query_deserializeOpGetLaunchTemplateData) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorGetLaunchTemplateData(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetIpamPoolCidrs(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)} @@ -43309,14 +43404,14 @@ func awsEc2query_deserializeOpErrorGetLaunchTemplateData(response *smithyhttp.Re } } -type awsEc2query_deserializeOpGetManagedPrefixListAssociations struct { +type awsEc2query_deserializeOpGetIpamResourceCidrs struct { } -func (*awsEc2query_deserializeOpGetManagedPrefixListAssociations) ID() string { +func (*awsEc2query_deserializeOpGetIpamResourceCidrs) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetManagedPrefixListAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetIpamResourceCidrs) 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) @@ -43334,9 +43429,9 @@ func (m *awsEc2query_deserializeOpGetManagedPrefixListAssociations) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetManagedPrefixListAssociations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetIpamResourceCidrs(response, &metadata) } - output := &GetManagedPrefixListAssociationsOutput{} + output := &GetIpamResourceCidrsOutput{} out.Result = output var buff [1024]byte @@ -43357,7 +43452,7 @@ func (m *awsEc2query_deserializeOpGetManagedPrefixListAssociations) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetManagedPrefixListAssociationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetIpamResourceCidrsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43371,7 +43466,7 @@ func (m *awsEc2query_deserializeOpGetManagedPrefixListAssociations) HandleDeseri return out, metadata, err } -func awsEc2query_deserializeOpErrorGetManagedPrefixListAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetIpamResourceCidrs(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)} @@ -43404,14 +43499,14 @@ func awsEc2query_deserializeOpErrorGetManagedPrefixListAssociations(response *sm } } -type awsEc2query_deserializeOpGetManagedPrefixListEntries struct { +type awsEc2query_deserializeOpGetLaunchTemplateData struct { } -func (*awsEc2query_deserializeOpGetManagedPrefixListEntries) ID() string { +func (*awsEc2query_deserializeOpGetLaunchTemplateData) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetManagedPrefixListEntries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetLaunchTemplateData) 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) @@ -43429,9 +43524,9 @@ func (m *awsEc2query_deserializeOpGetManagedPrefixListEntries) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetManagedPrefixListEntries(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetLaunchTemplateData(response, &metadata) } - output := &GetManagedPrefixListEntriesOutput{} + output := &GetLaunchTemplateDataOutput{} out.Result = output var buff [1024]byte @@ -43452,7 +43547,7 @@ func (m *awsEc2query_deserializeOpGetManagedPrefixListEntries) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetManagedPrefixListEntriesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetLaunchTemplateDataOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43466,7 +43561,7 @@ func (m *awsEc2query_deserializeOpGetManagedPrefixListEntries) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorGetManagedPrefixListEntries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetLaunchTemplateData(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)} @@ -43499,14 +43594,14 @@ func awsEc2query_deserializeOpErrorGetManagedPrefixListEntries(response *smithyh } } -type awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings struct { +type awsEc2query_deserializeOpGetManagedPrefixListAssociations struct { } -func (*awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) ID() string { +func (*awsEc2query_deserializeOpGetManagedPrefixListAssociations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetManagedPrefixListAssociations) 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) @@ -43524,9 +43619,9 @@ func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeAnalysisFindings(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetManagedPrefixListAssociations(response, &metadata) } - output := &GetNetworkInsightsAccessScopeAnalysisFindingsOutput{} + output := &GetManagedPrefixListAssociationsOutput{} out.Result = output var buff [1024]byte @@ -43547,7 +43642,7 @@ func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeAnalysisFindingsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetManagedPrefixListAssociationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43561,7 +43656,7 @@ func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) return out, metadata, err } -func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeAnalysisFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetManagedPrefixListAssociations(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)} @@ -43594,14 +43689,14 @@ func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeAnalysisFindings } } -type awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent struct { +type awsEc2query_deserializeOpGetManagedPrefixListEntries struct { } -func (*awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) ID() string { +func (*awsEc2query_deserializeOpGetManagedPrefixListEntries) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetManagedPrefixListEntries) 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) @@ -43619,9 +43714,9 @@ func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeContent(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetManagedPrefixListEntries(response, &metadata) } - output := &GetNetworkInsightsAccessScopeContentOutput{} + output := &GetManagedPrefixListEntriesOutput{} out.Result = output var buff [1024]byte @@ -43642,7 +43737,7 @@ func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) HandleDe } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeContentOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetManagedPrefixListEntriesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43656,7 +43751,7 @@ func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) HandleDe return out, metadata, err } -func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetManagedPrefixListEntries(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)} @@ -43689,14 +43784,14 @@ func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeContent(response } } -type awsEc2query_deserializeOpGetPasswordData struct { +type awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings struct { } -func (*awsEc2query_deserializeOpGetPasswordData) ID() string { +func (*awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetPasswordData) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeAnalysisFindings) 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) @@ -43714,9 +43809,9 @@ func (m *awsEc2query_deserializeOpGetPasswordData) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetPasswordData(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeAnalysisFindings(response, &metadata) } - output := &GetPasswordDataOutput{} + output := &GetNetworkInsightsAccessScopeAnalysisFindingsOutput{} out.Result = output var buff [1024]byte @@ -43737,7 +43832,7 @@ func (m *awsEc2query_deserializeOpGetPasswordData) HandleDeserialize(ctx context } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetPasswordDataOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeAnalysisFindingsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43751,7 +43846,7 @@ func (m *awsEc2query_deserializeOpGetPasswordData) HandleDeserialize(ctx context return out, metadata, err } -func awsEc2query_deserializeOpErrorGetPasswordData(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeAnalysisFindings(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)} @@ -43784,14 +43879,14 @@ func awsEc2query_deserializeOpErrorGetPasswordData(response *smithyhttp.Response } } -type awsEc2query_deserializeOpGetReservedInstancesExchangeQuote struct { +type awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent struct { } -func (*awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) ID() string { +func (*awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetNetworkInsightsAccessScopeContent) 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) @@ -43809,9 +43904,9 @@ func (m *awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetReservedInstancesExchangeQuote(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeContent(response, &metadata) } - output := &GetReservedInstancesExchangeQuoteOutput{} + output := &GetNetworkInsightsAccessScopeContentOutput{} out.Result = output var buff [1024]byte @@ -43832,7 +43927,7 @@ func (m *awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetReservedInstancesExchangeQuoteOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetNetworkInsightsAccessScopeContentOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43846,7 +43941,7 @@ func (m *awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorGetReservedInstancesExchangeQuote(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetNetworkInsightsAccessScopeContent(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)} @@ -43879,14 +43974,14 @@ func awsEc2query_deserializeOpErrorGetReservedInstancesExchangeQuote(response *s } } -type awsEc2query_deserializeOpGetSecurityGroupsForVpc struct { +type awsEc2query_deserializeOpGetPasswordData struct { } -func (*awsEc2query_deserializeOpGetSecurityGroupsForVpc) ID() string { +func (*awsEc2query_deserializeOpGetPasswordData) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetSecurityGroupsForVpc) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetPasswordData) 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) @@ -43904,9 +43999,9 @@ func (m *awsEc2query_deserializeOpGetSecurityGroupsForVpc) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSecurityGroupsForVpc(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetPasswordData(response, &metadata) } - output := &GetSecurityGroupsForVpcOutput{} + output := &GetPasswordDataOutput{} out.Result = output var buff [1024]byte @@ -43927,7 +44022,7 @@ func (m *awsEc2query_deserializeOpGetSecurityGroupsForVpc) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSecurityGroupsForVpcOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetPasswordDataOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -43941,7 +44036,7 @@ func (m *awsEc2query_deserializeOpGetSecurityGroupsForVpc) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorGetSecurityGroupsForVpc(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetPasswordData(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)} @@ -43974,14 +44069,14 @@ func awsEc2query_deserializeOpErrorGetSecurityGroupsForVpc(response *smithyhttp. } } -type awsEc2query_deserializeOpGetSerialConsoleAccessStatus struct { +type awsEc2query_deserializeOpGetReservedInstancesExchangeQuote struct { } -func (*awsEc2query_deserializeOpGetSerialConsoleAccessStatus) ID() string { +func (*awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetSerialConsoleAccessStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetReservedInstancesExchangeQuote) 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) @@ -43999,9 +44094,9 @@ func (m *awsEc2query_deserializeOpGetSerialConsoleAccessStatus) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetReservedInstancesExchangeQuote(response, &metadata) } - output := &GetSerialConsoleAccessStatusOutput{} + output := &GetReservedInstancesExchangeQuoteOutput{} out.Result = output var buff [1024]byte @@ -44022,7 +44117,7 @@ func (m *awsEc2query_deserializeOpGetSerialConsoleAccessStatus) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSerialConsoleAccessStatusOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetReservedInstancesExchangeQuoteOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44036,7 +44131,7 @@ func (m *awsEc2query_deserializeOpGetSerialConsoleAccessStatus) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetReservedInstancesExchangeQuote(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)} @@ -44069,14 +44164,14 @@ func awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(response *smithy } } -type awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState struct { +type awsEc2query_deserializeOpGetSecurityGroupsForVpc struct { } -func (*awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) ID() string { +func (*awsEc2query_deserializeOpGetSecurityGroupsForVpc) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetSecurityGroupsForVpc) 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) @@ -44094,9 +44189,9 @@ func (m *awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetSecurityGroupsForVpc(response, &metadata) } - output := &GetSnapshotBlockPublicAccessStateOutput{} + output := &GetSecurityGroupsForVpcOutput{} out.Result = output var buff [1024]byte @@ -44117,7 +44212,7 @@ func (m *awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSnapshotBlockPublicAccessStateOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetSecurityGroupsForVpcOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44131,7 +44226,7 @@ func (m *awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetSecurityGroupsForVpc(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)} @@ -44164,14 +44259,14 @@ func awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(response *s } } -type awsEc2query_deserializeOpGetSpotPlacementScores struct { +type awsEc2query_deserializeOpGetSerialConsoleAccessStatus struct { } -func (*awsEc2query_deserializeOpGetSpotPlacementScores) ID() string { +func (*awsEc2query_deserializeOpGetSerialConsoleAccessStatus) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetSpotPlacementScores) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetSerialConsoleAccessStatus) 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) @@ -44189,9 +44284,9 @@ func (m *awsEc2query_deserializeOpGetSpotPlacementScores) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSpotPlacementScores(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(response, &metadata) } - output := &GetSpotPlacementScoresOutput{} + output := &GetSerialConsoleAccessStatusOutput{} out.Result = output var buff [1024]byte @@ -44212,7 +44307,7 @@ func (m *awsEc2query_deserializeOpGetSpotPlacementScores) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSpotPlacementScoresOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetSerialConsoleAccessStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44226,7 +44321,7 @@ func (m *awsEc2query_deserializeOpGetSpotPlacementScores) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorGetSpotPlacementScores(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(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)} @@ -44259,14 +44354,14 @@ func awsEc2query_deserializeOpErrorGetSpotPlacementScores(response *smithyhttp.R } } -type awsEc2query_deserializeOpGetSubnetCidrReservations struct { +type awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState struct { } -func (*awsEc2query_deserializeOpGetSubnetCidrReservations) ID() string { +func (*awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetSubnetCidrReservations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) 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) @@ -44284,9 +44379,9 @@ func (m *awsEc2query_deserializeOpGetSubnetCidrReservations) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetSubnetCidrReservations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(response, &metadata) } - output := &GetSubnetCidrReservationsOutput{} + output := &GetSnapshotBlockPublicAccessStateOutput{} out.Result = output var buff [1024]byte @@ -44307,7 +44402,7 @@ func (m *awsEc2query_deserializeOpGetSubnetCidrReservations) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetSubnetCidrReservationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetSnapshotBlockPublicAccessStateOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44321,7 +44416,7 @@ func (m *awsEc2query_deserializeOpGetSubnetCidrReservations) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorGetSubnetCidrReservations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(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)} @@ -44354,14 +44449,14 @@ func awsEc2query_deserializeOpErrorGetSubnetCidrReservations(response *smithyhtt } } -type awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations struct { +type awsEc2query_deserializeOpGetSpotPlacementScores struct { } -func (*awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) ID() string { +func (*awsEc2query_deserializeOpGetSpotPlacementScores) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetSpotPlacementScores) 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) @@ -44379,9 +44474,9 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayAttachmentPropagations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetSpotPlacementScores(response, &metadata) } - output := &GetTransitGatewayAttachmentPropagationsOutput{} + output := &GetSpotPlacementScoresOutput{} out.Result = output var buff [1024]byte @@ -44402,7 +44497,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) Handl } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayAttachmentPropagationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetSpotPlacementScoresOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44416,7 +44511,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) Handl return out, metadata, err } -func awsEc2query_deserializeOpErrorGetTransitGatewayAttachmentPropagations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetSpotPlacementScores(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)} @@ -44449,14 +44544,14 @@ func awsEc2query_deserializeOpErrorGetTransitGatewayAttachmentPropagations(respo } } -type awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations struct { +type awsEc2query_deserializeOpGetSubnetCidrReservations struct { } -func (*awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) ID() string { +func (*awsEc2query_deserializeOpGetSubnetCidrReservations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetSubnetCidrReservations) 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) @@ -44474,9 +44569,9 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayMulticastDomainAssociations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetSubnetCidrReservations(response, &metadata) } - output := &GetTransitGatewayMulticastDomainAssociationsOutput{} + output := &GetSubnetCidrReservationsOutput{} out.Result = output var buff [1024]byte @@ -44497,7 +44592,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayMulticastDomainAssociationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetSubnetCidrReservationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44511,7 +44606,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) return out, metadata, err } -func awsEc2query_deserializeOpErrorGetTransitGatewayMulticastDomainAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetSubnetCidrReservations(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)} @@ -44544,14 +44639,14 @@ func awsEc2query_deserializeOpErrorGetTransitGatewayMulticastDomainAssociations( } } -type awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations struct { +type awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations struct { } -func (*awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) ID() string { +func (*awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetTransitGatewayAttachmentPropagations) 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) @@ -44569,9 +44664,9 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) Hand } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableAssociations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayAttachmentPropagations(response, &metadata) } - output := &GetTransitGatewayPolicyTableAssociationsOutput{} + output := &GetTransitGatewayAttachmentPropagationsOutput{} out.Result = output var buff [1024]byte @@ -44592,7 +44687,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) Hand } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableAssociationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetTransitGatewayAttachmentPropagationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44606,7 +44701,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) Hand return out, metadata, err } -func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetTransitGatewayAttachmentPropagations(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)} @@ -44639,14 +44734,14 @@ func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableAssociations(resp } } -type awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries struct { +type awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations struct { } -func (*awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) ID() string { +func (*awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetTransitGatewayMulticastDomainAssociations) 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) @@ -44664,9 +44759,9 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableEntries(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayMulticastDomainAssociations(response, &metadata) } - output := &GetTransitGatewayPolicyTableEntriesOutput{} + output := &GetTransitGatewayMulticastDomainAssociationsOutput{} out.Result = output var buff [1024]byte @@ -44687,7 +44782,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) HandleDes } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableEntriesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetTransitGatewayMulticastDomainAssociationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44701,7 +44796,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) HandleDes return out, metadata, err } -func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableEntries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetTransitGatewayMulticastDomainAssociations(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)} @@ -44734,14 +44829,14 @@ func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableEntries(response } } -type awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences struct { +type awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations struct { } -func (*awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) ID() string { +func (*awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableAssociations) 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) @@ -44759,9 +44854,9 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPrefixListReferences(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableAssociations(response, &metadata) } - output := &GetTransitGatewayPrefixListReferencesOutput{} + output := &GetTransitGatewayPolicyTableAssociationsOutput{} out.Result = output var buff [1024]byte @@ -44782,7 +44877,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) HandleD } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayPrefixListReferencesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableAssociationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44796,7 +44891,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) HandleD return out, metadata, err } -func awsEc2query_deserializeOpErrorGetTransitGatewayPrefixListReferences(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableAssociations(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)} @@ -44829,14 +44924,14 @@ func awsEc2query_deserializeOpErrorGetTransitGatewayPrefixListReferences(respons } } -type awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations struct { +type awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries struct { } -func (*awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) ID() string { +func (*awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetTransitGatewayPolicyTableEntries) 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) @@ -44854,9 +44949,9 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayRouteTableAssociations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableEntries(response, &metadata) } - output := &GetTransitGatewayRouteTableAssociationsOutput{} + output := &GetTransitGatewayPolicyTableEntriesOutput{} out.Result = output var buff [1024]byte @@ -44877,7 +44972,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) Handl } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTableAssociationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetTransitGatewayPolicyTableEntriesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44891,7 +44986,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) Handl return out, metadata, err } -func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTableAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetTransitGatewayPolicyTableEntries(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)} @@ -44924,14 +45019,14 @@ func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTableAssociations(respo } } -type awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations struct { +type awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences struct { } -func (*awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) ID() string { +func (*awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetTransitGatewayPrefixListReferences) 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) @@ -44949,9 +45044,9 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayRouteTablePropagations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayPrefixListReferences(response, &metadata) } - output := &GetTransitGatewayRouteTablePropagationsOutput{} + output := &GetTransitGatewayPrefixListReferencesOutput{} out.Result = output var buff [1024]byte @@ -44972,7 +45067,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) Handl } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTablePropagationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetTransitGatewayPrefixListReferencesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -44986,7 +45081,7 @@ func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) Handl return out, metadata, err } -func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTablePropagations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetTransitGatewayPrefixListReferences(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)} @@ -45019,14 +45114,14 @@ func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTablePropagations(respo } } -type awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy struct { +type awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations struct { } -func (*awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) ID() string { +func (*awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTableAssociations) 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) @@ -45044,9 +45139,9 @@ func (m *awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointPolicy(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayRouteTableAssociations(response, &metadata) } - output := &GetVerifiedAccessEndpointPolicyOutput{} + output := &GetTransitGatewayRouteTableAssociationsOutput{} out.Result = output var buff [1024]byte @@ -45067,7 +45162,7 @@ func (m *awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVerifiedAccessEndpointPolicyOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTableAssociationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45081,7 +45176,7 @@ func (m *awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) HandleDeseria return out, metadata, err } -func awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTableAssociations(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)} @@ -45114,14 +45209,14 @@ func awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointPolicy(response *smi } } -type awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy struct { +type awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations struct { } -func (*awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) ID() string { +func (*awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetTransitGatewayRouteTablePropagations) 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) @@ -45139,9 +45234,9 @@ func (m *awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVerifiedAccessGroupPolicy(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetTransitGatewayRouteTablePropagations(response, &metadata) } - output := &GetVerifiedAccessGroupPolicyOutput{} + output := &GetTransitGatewayRouteTablePropagationsOutput{} out.Result = output var buff [1024]byte @@ -45162,7 +45257,7 @@ func (m *awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVerifiedAccessGroupPolicyOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetTransitGatewayRouteTablePropagationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45176,7 +45271,7 @@ func (m *awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorGetVerifiedAccessGroupPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetTransitGatewayRouteTablePropagations(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)} @@ -45209,14 +45304,14 @@ func awsEc2query_deserializeOpErrorGetVerifiedAccessGroupPolicy(response *smithy } } -type awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration struct { +type awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy struct { } -func (*awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) ID() string { +func (*awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetVerifiedAccessEndpointPolicy) 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) @@ -45234,9 +45329,9 @@ func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVpnConnectionDeviceSampleConfiguration(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointPolicy(response, &metadata) } - output := &GetVpnConnectionDeviceSampleConfigurationOutput{} + output := &GetVerifiedAccessEndpointPolicyOutput{} out.Result = output var buff [1024]byte @@ -45257,7 +45352,7 @@ func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) Han } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceSampleConfigurationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetVerifiedAccessEndpointPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45271,7 +45366,7 @@ func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) Han return out, metadata, err } -func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceSampleConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetVerifiedAccessEndpointPolicy(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)} @@ -45304,14 +45399,14 @@ func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceSampleConfiguration(res } } -type awsEc2query_deserializeOpGetVpnConnectionDeviceTypes struct { +type awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy struct { } -func (*awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) ID() string { +func (*awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetVerifiedAccessGroupPolicy) 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) @@ -45329,9 +45424,9 @@ func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetVerifiedAccessGroupPolicy(response, &metadata) } - output := &GetVpnConnectionDeviceTypesOutput{} + output := &GetVerifiedAccessGroupPolicyOutput{} out.Result = output var buff [1024]byte @@ -45352,7 +45447,7 @@ func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceTypesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetVerifiedAccessGroupPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45366,7 +45461,7 @@ func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetVerifiedAccessGroupPolicy(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)} @@ -45399,14 +45494,14 @@ func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(response *smithyh } } -type awsEc2query_deserializeOpGetVpnTunnelReplacementStatus struct { +type awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration struct { } -func (*awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) ID() string { +func (*awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceSampleConfiguration) 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) @@ -45424,9 +45519,9 @@ func (m *awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetVpnConnectionDeviceSampleConfiguration(response, &metadata) } - output := &GetVpnTunnelReplacementStatusOutput{} + output := &GetVpnConnectionDeviceSampleConfigurationOutput{} out.Result = output var buff [1024]byte @@ -45447,7 +45542,7 @@ func (m *awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentGetVpnTunnelReplacementStatusOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceSampleConfigurationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45461,7 +45556,7 @@ func (m *awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) HandleDeseriali return out, metadata, err } -func awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceSampleConfiguration(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)} @@ -45494,14 +45589,14 @@ func awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(response *smith } } -type awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList struct { +type awsEc2query_deserializeOpGetVpnConnectionDeviceTypes struct { } -func (*awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList) ID() string { +func (*awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetVpnConnectionDeviceTypes) 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) @@ -45519,9 +45614,9 @@ func (m *awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportClientVpnClientCertificateRevocationList(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(response, &metadata) } - output := &ImportClientVpnClientCertificateRevocationListOutput{} + output := &GetVpnConnectionDeviceTypesOutput{} out.Result = output var buff [1024]byte @@ -45542,7 +45637,7 @@ func (m *awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportClientVpnClientCertificateRevocationListOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetVpnConnectionDeviceTypesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45556,7 +45651,7 @@ func (m *awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList return out, metadata, err } -func awsEc2query_deserializeOpErrorImportClientVpnClientCertificateRevocationList(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetVpnConnectionDeviceTypes(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)} @@ -45589,14 +45684,14 @@ func awsEc2query_deserializeOpErrorImportClientVpnClientCertificateRevocationLis } } -type awsEc2query_deserializeOpImportImage struct { +type awsEc2query_deserializeOpGetVpnTunnelReplacementStatus struct { } -func (*awsEc2query_deserializeOpImportImage) ID() string { +func (*awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpImportImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpGetVpnTunnelReplacementStatus) 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) @@ -45614,9 +45709,9 @@ func (m *awsEc2query_deserializeOpImportImage) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportImage(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(response, &metadata) } - output := &ImportImageOutput{} + output := &GetVpnTunnelReplacementStatusOutput{} out.Result = output var buff [1024]byte @@ -45637,7 +45732,7 @@ func (m *awsEc2query_deserializeOpImportImage) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportImageOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentGetVpnTunnelReplacementStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45651,7 +45746,7 @@ func (m *awsEc2query_deserializeOpImportImage) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsEc2query_deserializeOpErrorImportImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorGetVpnTunnelReplacementStatus(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)} @@ -45684,14 +45779,14 @@ func awsEc2query_deserializeOpErrorImportImage(response *smithyhttp.Response, me } } -type awsEc2query_deserializeOpImportInstance struct { +type awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList struct { } -func (*awsEc2query_deserializeOpImportInstance) ID() string { +func (*awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpImportInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpImportClientVpnClientCertificateRevocationList) 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) @@ -45709,9 +45804,9 @@ func (m *awsEc2query_deserializeOpImportInstance) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportInstance(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorImportClientVpnClientCertificateRevocationList(response, &metadata) } - output := &ImportInstanceOutput{} + output := &ImportClientVpnClientCertificateRevocationListOutput{} out.Result = output var buff [1024]byte @@ -45732,7 +45827,7 @@ func (m *awsEc2query_deserializeOpImportInstance) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportInstanceOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentImportClientVpnClientCertificateRevocationListOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45746,7 +45841,7 @@ func (m *awsEc2query_deserializeOpImportInstance) HandleDeserialize(ctx context. return out, metadata, err } -func awsEc2query_deserializeOpErrorImportInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorImportClientVpnClientCertificateRevocationList(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)} @@ -45779,14 +45874,14 @@ func awsEc2query_deserializeOpErrorImportInstance(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpImportKeyPair struct { +type awsEc2query_deserializeOpImportImage struct { } -func (*awsEc2query_deserializeOpImportKeyPair) ID() string { +func (*awsEc2query_deserializeOpImportImage) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpImportKeyPair) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpImportImage) 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) @@ -45804,9 +45899,9 @@ func (m *awsEc2query_deserializeOpImportKeyPair) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportKeyPair(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorImportImage(response, &metadata) } - output := &ImportKeyPairOutput{} + output := &ImportImageOutput{} out.Result = output var buff [1024]byte @@ -45827,7 +45922,7 @@ func (m *awsEc2query_deserializeOpImportKeyPair) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportKeyPairOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentImportImageOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45841,7 +45936,7 @@ func (m *awsEc2query_deserializeOpImportKeyPair) HandleDeserialize(ctx context.C return out, metadata, err } -func awsEc2query_deserializeOpErrorImportKeyPair(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorImportImage(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)} @@ -45874,14 +45969,14 @@ func awsEc2query_deserializeOpErrorImportKeyPair(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpImportSnapshot struct { +type awsEc2query_deserializeOpImportInstance struct { } -func (*awsEc2query_deserializeOpImportSnapshot) ID() string { +func (*awsEc2query_deserializeOpImportInstance) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpImportSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpImportInstance) 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) @@ -45899,9 +45994,9 @@ func (m *awsEc2query_deserializeOpImportSnapshot) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportSnapshot(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorImportInstance(response, &metadata) } - output := &ImportSnapshotOutput{} + output := &ImportInstanceOutput{} out.Result = output var buff [1024]byte @@ -45922,7 +46017,7 @@ func (m *awsEc2query_deserializeOpImportSnapshot) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportSnapshotOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentImportInstanceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -45936,7 +46031,7 @@ func (m *awsEc2query_deserializeOpImportSnapshot) HandleDeserialize(ctx context. return out, metadata, err } -func awsEc2query_deserializeOpErrorImportSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorImportInstance(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)} @@ -45969,14 +46064,14 @@ func awsEc2query_deserializeOpErrorImportSnapshot(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpImportVolume struct { +type awsEc2query_deserializeOpImportKeyPair struct { } -func (*awsEc2query_deserializeOpImportVolume) ID() string { +func (*awsEc2query_deserializeOpImportKeyPair) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpImportVolume) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpImportKeyPair) 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) @@ -45994,9 +46089,9 @@ func (m *awsEc2query_deserializeOpImportVolume) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorImportVolume(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorImportKeyPair(response, &metadata) } - output := &ImportVolumeOutput{} + output := &ImportKeyPairOutput{} out.Result = output var buff [1024]byte @@ -46017,7 +46112,7 @@ func (m *awsEc2query_deserializeOpImportVolume) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentImportVolumeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentImportKeyPairOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46031,7 +46126,7 @@ func (m *awsEc2query_deserializeOpImportVolume) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsEc2query_deserializeOpErrorImportVolume(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorImportKeyPair(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)} @@ -46064,14 +46159,14 @@ func awsEc2query_deserializeOpErrorImportVolume(response *smithyhttp.Response, m } } -type awsEc2query_deserializeOpListImagesInRecycleBin struct { +type awsEc2query_deserializeOpImportSnapshot struct { } -func (*awsEc2query_deserializeOpListImagesInRecycleBin) ID() string { +func (*awsEc2query_deserializeOpImportSnapshot) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpListImagesInRecycleBin) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpImportSnapshot) 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) @@ -46089,9 +46184,9 @@ func (m *awsEc2query_deserializeOpListImagesInRecycleBin) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorListImagesInRecycleBin(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorImportSnapshot(response, &metadata) } - output := &ListImagesInRecycleBinOutput{} + output := &ImportSnapshotOutput{} out.Result = output var buff [1024]byte @@ -46112,7 +46207,7 @@ func (m *awsEc2query_deserializeOpListImagesInRecycleBin) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentListImagesInRecycleBinOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentImportSnapshotOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46126,7 +46221,7 @@ func (m *awsEc2query_deserializeOpListImagesInRecycleBin) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorListImagesInRecycleBin(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorImportSnapshot(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)} @@ -46159,14 +46254,14 @@ func awsEc2query_deserializeOpErrorListImagesInRecycleBin(response *smithyhttp.R } } -type awsEc2query_deserializeOpListSnapshotsInRecycleBin struct { +type awsEc2query_deserializeOpImportVolume struct { } -func (*awsEc2query_deserializeOpListSnapshotsInRecycleBin) ID() string { +func (*awsEc2query_deserializeOpImportVolume) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpListSnapshotsInRecycleBin) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpImportVolume) 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) @@ -46184,9 +46279,9 @@ func (m *awsEc2query_deserializeOpListSnapshotsInRecycleBin) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorListSnapshotsInRecycleBin(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorImportVolume(response, &metadata) } - output := &ListSnapshotsInRecycleBinOutput{} + output := &ImportVolumeOutput{} out.Result = output var buff [1024]byte @@ -46207,7 +46302,7 @@ func (m *awsEc2query_deserializeOpListSnapshotsInRecycleBin) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentListSnapshotsInRecycleBinOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentImportVolumeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46221,7 +46316,7 @@ func (m *awsEc2query_deserializeOpListSnapshotsInRecycleBin) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorListSnapshotsInRecycleBin(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorImportVolume(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)} @@ -46254,14 +46349,14 @@ func awsEc2query_deserializeOpErrorListSnapshotsInRecycleBin(response *smithyhtt } } -type awsEc2query_deserializeOpLockSnapshot struct { +type awsEc2query_deserializeOpListImagesInRecycleBin struct { } -func (*awsEc2query_deserializeOpLockSnapshot) ID() string { +func (*awsEc2query_deserializeOpListImagesInRecycleBin) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpLockSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpListImagesInRecycleBin) 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) @@ -46279,9 +46374,9 @@ func (m *awsEc2query_deserializeOpLockSnapshot) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorLockSnapshot(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorListImagesInRecycleBin(response, &metadata) } - output := &LockSnapshotOutput{} + output := &ListImagesInRecycleBinOutput{} out.Result = output var buff [1024]byte @@ -46302,7 +46397,7 @@ func (m *awsEc2query_deserializeOpLockSnapshot) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentLockSnapshotOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentListImagesInRecycleBinOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46316,7 +46411,7 @@ func (m *awsEc2query_deserializeOpLockSnapshot) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsEc2query_deserializeOpErrorLockSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorListImagesInRecycleBin(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)} @@ -46349,14 +46444,14 @@ func awsEc2query_deserializeOpErrorLockSnapshot(response *smithyhttp.Response, m } } -type awsEc2query_deserializeOpModifyAddressAttribute struct { +type awsEc2query_deserializeOpListSnapshotsInRecycleBin struct { } -func (*awsEc2query_deserializeOpModifyAddressAttribute) ID() string { +func (*awsEc2query_deserializeOpListSnapshotsInRecycleBin) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyAddressAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpListSnapshotsInRecycleBin) 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) @@ -46374,9 +46469,9 @@ func (m *awsEc2query_deserializeOpModifyAddressAttribute) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyAddressAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorListSnapshotsInRecycleBin(response, &metadata) } - output := &ModifyAddressAttributeOutput{} + output := &ListSnapshotsInRecycleBinOutput{} out.Result = output var buff [1024]byte @@ -46397,7 +46492,7 @@ func (m *awsEc2query_deserializeOpModifyAddressAttribute) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyAddressAttributeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentListSnapshotsInRecycleBinOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46411,7 +46506,7 @@ func (m *awsEc2query_deserializeOpModifyAddressAttribute) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyAddressAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorListSnapshotsInRecycleBin(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)} @@ -46444,14 +46539,14 @@ func awsEc2query_deserializeOpErrorModifyAddressAttribute(response *smithyhttp.R } } -type awsEc2query_deserializeOpModifyAvailabilityZoneGroup struct { +type awsEc2query_deserializeOpLockSnapshot struct { } -func (*awsEc2query_deserializeOpModifyAvailabilityZoneGroup) ID() string { +func (*awsEc2query_deserializeOpLockSnapshot) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyAvailabilityZoneGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpLockSnapshot) 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) @@ -46469,9 +46564,9 @@ func (m *awsEc2query_deserializeOpModifyAvailabilityZoneGroup) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyAvailabilityZoneGroup(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorLockSnapshot(response, &metadata) } - output := &ModifyAvailabilityZoneGroupOutput{} + output := &LockSnapshotOutput{} out.Result = output var buff [1024]byte @@ -46492,7 +46587,7 @@ func (m *awsEc2query_deserializeOpModifyAvailabilityZoneGroup) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyAvailabilityZoneGroupOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentLockSnapshotOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46506,7 +46601,7 @@ func (m *awsEc2query_deserializeOpModifyAvailabilityZoneGroup) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyAvailabilityZoneGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorLockSnapshot(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)} @@ -46539,14 +46634,14 @@ func awsEc2query_deserializeOpErrorModifyAvailabilityZoneGroup(response *smithyh } } -type awsEc2query_deserializeOpModifyCapacityReservation struct { +type awsEc2query_deserializeOpModifyAddressAttribute struct { } -func (*awsEc2query_deserializeOpModifyCapacityReservation) ID() string { +func (*awsEc2query_deserializeOpModifyAddressAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyCapacityReservation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyAddressAttribute) 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) @@ -46564,9 +46659,9 @@ func (m *awsEc2query_deserializeOpModifyCapacityReservation) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyCapacityReservation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyAddressAttribute(response, &metadata) } - output := &ModifyCapacityReservationOutput{} + output := &ModifyAddressAttributeOutput{} out.Result = output var buff [1024]byte @@ -46587,7 +46682,7 @@ func (m *awsEc2query_deserializeOpModifyCapacityReservation) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyCapacityReservationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyAddressAttributeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46601,7 +46696,7 @@ func (m *awsEc2query_deserializeOpModifyCapacityReservation) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyCapacityReservation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyAddressAttribute(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)} @@ -46634,14 +46729,14 @@ func awsEc2query_deserializeOpErrorModifyCapacityReservation(response *smithyhtt } } -type awsEc2query_deserializeOpModifyCapacityReservationFleet struct { +type awsEc2query_deserializeOpModifyAvailabilityZoneGroup struct { } -func (*awsEc2query_deserializeOpModifyCapacityReservationFleet) ID() string { +func (*awsEc2query_deserializeOpModifyAvailabilityZoneGroup) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyCapacityReservationFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyAvailabilityZoneGroup) 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) @@ -46659,9 +46754,9 @@ func (m *awsEc2query_deserializeOpModifyCapacityReservationFleet) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyCapacityReservationFleet(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyAvailabilityZoneGroup(response, &metadata) } - output := &ModifyCapacityReservationFleetOutput{} + output := &ModifyAvailabilityZoneGroupOutput{} out.Result = output var buff [1024]byte @@ -46682,7 +46777,7 @@ func (m *awsEc2query_deserializeOpModifyCapacityReservationFleet) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyCapacityReservationFleetOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyAvailabilityZoneGroupOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46696,7 +46791,7 @@ func (m *awsEc2query_deserializeOpModifyCapacityReservationFleet) HandleDeserial return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyCapacityReservationFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyAvailabilityZoneGroup(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)} @@ -46729,14 +46824,14 @@ func awsEc2query_deserializeOpErrorModifyCapacityReservationFleet(response *smit } } -type awsEc2query_deserializeOpModifyClientVpnEndpoint struct { +type awsEc2query_deserializeOpModifyCapacityReservation struct { } -func (*awsEc2query_deserializeOpModifyClientVpnEndpoint) ID() string { +func (*awsEc2query_deserializeOpModifyCapacityReservation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyClientVpnEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyCapacityReservation) 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) @@ -46754,9 +46849,9 @@ func (m *awsEc2query_deserializeOpModifyClientVpnEndpoint) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyClientVpnEndpoint(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyCapacityReservation(response, &metadata) } - output := &ModifyClientVpnEndpointOutput{} + output := &ModifyCapacityReservationOutput{} out.Result = output var buff [1024]byte @@ -46777,7 +46872,7 @@ func (m *awsEc2query_deserializeOpModifyClientVpnEndpoint) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyClientVpnEndpointOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyCapacityReservationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46791,7 +46886,7 @@ func (m *awsEc2query_deserializeOpModifyClientVpnEndpoint) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyClientVpnEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyCapacityReservation(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)} @@ -46824,14 +46919,14 @@ func awsEc2query_deserializeOpErrorModifyClientVpnEndpoint(response *smithyhttp. } } -type awsEc2query_deserializeOpModifyDefaultCreditSpecification struct { +type awsEc2query_deserializeOpModifyCapacityReservationFleet struct { } -func (*awsEc2query_deserializeOpModifyDefaultCreditSpecification) ID() string { +func (*awsEc2query_deserializeOpModifyCapacityReservationFleet) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyDefaultCreditSpecification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyCapacityReservationFleet) 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) @@ -46849,9 +46944,9 @@ func (m *awsEc2query_deserializeOpModifyDefaultCreditSpecification) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyDefaultCreditSpecification(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyCapacityReservationFleet(response, &metadata) } - output := &ModifyDefaultCreditSpecificationOutput{} + output := &ModifyCapacityReservationFleetOutput{} out.Result = output var buff [1024]byte @@ -46872,7 +46967,7 @@ func (m *awsEc2query_deserializeOpModifyDefaultCreditSpecification) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyDefaultCreditSpecificationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyCapacityReservationFleetOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46886,7 +46981,7 @@ func (m *awsEc2query_deserializeOpModifyDefaultCreditSpecification) HandleDeseri return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyDefaultCreditSpecification(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyCapacityReservationFleet(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)} @@ -46919,14 +47014,14 @@ func awsEc2query_deserializeOpErrorModifyDefaultCreditSpecification(response *sm } } -type awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId struct { +type awsEc2query_deserializeOpModifyClientVpnEndpoint struct { } -func (*awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) ID() string { +func (*awsEc2query_deserializeOpModifyClientVpnEndpoint) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyClientVpnEndpoint) 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) @@ -46944,9 +47039,9 @@ func (m *awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyEbsDefaultKmsKeyId(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyClientVpnEndpoint(response, &metadata) } - output := &ModifyEbsDefaultKmsKeyIdOutput{} + output := &ModifyClientVpnEndpointOutput{} out.Result = output var buff [1024]byte @@ -46967,7 +47062,7 @@ func (m *awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyEbsDefaultKmsKeyIdOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyClientVpnEndpointOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -46981,7 +47076,7 @@ func (m *awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) HandleDeserialize(ct return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyEbsDefaultKmsKeyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyClientVpnEndpoint(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)} @@ -47014,14 +47109,14 @@ func awsEc2query_deserializeOpErrorModifyEbsDefaultKmsKeyId(response *smithyhttp } } -type awsEc2query_deserializeOpModifyFleet struct { +type awsEc2query_deserializeOpModifyDefaultCreditSpecification struct { } -func (*awsEc2query_deserializeOpModifyFleet) ID() string { +func (*awsEc2query_deserializeOpModifyDefaultCreditSpecification) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyDefaultCreditSpecification) 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) @@ -47039,9 +47134,9 @@ func (m *awsEc2query_deserializeOpModifyFleet) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyFleet(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyDefaultCreditSpecification(response, &metadata) } - output := &ModifyFleetOutput{} + output := &ModifyDefaultCreditSpecificationOutput{} out.Result = output var buff [1024]byte @@ -47062,7 +47157,7 @@ func (m *awsEc2query_deserializeOpModifyFleet) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyFleetOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyDefaultCreditSpecificationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -47076,7 +47171,7 @@ func (m *awsEc2query_deserializeOpModifyFleet) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyDefaultCreditSpecification(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)} @@ -47109,14 +47204,14 @@ func awsEc2query_deserializeOpErrorModifyFleet(response *smithyhttp.Response, me } } -type awsEc2query_deserializeOpModifyFpgaImageAttribute struct { +type awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId struct { } -func (*awsEc2query_deserializeOpModifyFpgaImageAttribute) ID() string { +func (*awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyFpgaImageAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyEbsDefaultKmsKeyId) 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) @@ -47134,9 +47229,9 @@ func (m *awsEc2query_deserializeOpModifyFpgaImageAttribute) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyFpgaImageAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyEbsDefaultKmsKeyId(response, &metadata) } - output := &ModifyFpgaImageAttributeOutput{} + output := &ModifyEbsDefaultKmsKeyIdOutput{} out.Result = output var buff [1024]byte @@ -47157,7 +47252,7 @@ func (m *awsEc2query_deserializeOpModifyFpgaImageAttribute) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyFpgaImageAttributeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyEbsDefaultKmsKeyIdOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -47171,7 +47266,7 @@ func (m *awsEc2query_deserializeOpModifyFpgaImageAttribute) HandleDeserialize(ct return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyFpgaImageAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyEbsDefaultKmsKeyId(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)} @@ -47204,14 +47299,14 @@ func awsEc2query_deserializeOpErrorModifyFpgaImageAttribute(response *smithyhttp } } -type awsEc2query_deserializeOpModifyHosts struct { +type awsEc2query_deserializeOpModifyFleet struct { } -func (*awsEc2query_deserializeOpModifyHosts) ID() string { +func (*awsEc2query_deserializeOpModifyFleet) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyHosts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyFleet) 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) @@ -47229,9 +47324,9 @@ func (m *awsEc2query_deserializeOpModifyHosts) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyHosts(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyFleet(response, &metadata) } - output := &ModifyHostsOutput{} + output := &ModifyFleetOutput{} out.Result = output var buff [1024]byte @@ -47252,7 +47347,7 @@ func (m *awsEc2query_deserializeOpModifyHosts) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyHostsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyFleetOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -47266,7 +47361,7 @@ func (m *awsEc2query_deserializeOpModifyHosts) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyHosts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyFleet(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)} @@ -47299,14 +47394,14 @@ func awsEc2query_deserializeOpErrorModifyHosts(response *smithyhttp.Response, me } } -type awsEc2query_deserializeOpModifyIdentityIdFormat struct { +type awsEc2query_deserializeOpModifyFpgaImageAttribute struct { } -func (*awsEc2query_deserializeOpModifyIdentityIdFormat) ID() string { +func (*awsEc2query_deserializeOpModifyFpgaImageAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyIdentityIdFormat) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyFpgaImageAttribute) 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) @@ -47324,21 +47419,44 @@ func (m *awsEc2query_deserializeOpModifyIdentityIdFormat) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIdentityIdFormat(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyFpgaImageAttribute(response, &metadata) } - output := &ModifyIdentityIdFormatOutput{} + output := &ModifyFpgaImageAttributeOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentModifyFpgaImageAttributeOutput(&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_deserializeOpErrorModifyIdentityIdFormat(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyFpgaImageAttribute(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)} @@ -47371,14 +47489,14 @@ func awsEc2query_deserializeOpErrorModifyIdentityIdFormat(response *smithyhttp.R } } -type awsEc2query_deserializeOpModifyIdFormat struct { +type awsEc2query_deserializeOpModifyHosts struct { } -func (*awsEc2query_deserializeOpModifyIdFormat) ID() string { +func (*awsEc2query_deserializeOpModifyHosts) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyIdFormat) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyHosts) 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) @@ -47396,21 +47514,44 @@ func (m *awsEc2query_deserializeOpModifyIdFormat) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIdFormat(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyHosts(response, &metadata) } - output := &ModifyIdFormatOutput{} + output := &ModifyHostsOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentModifyHostsOutput(&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_deserializeOpErrorModifyIdFormat(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyHosts(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)} @@ -47443,14 +47584,14 @@ func awsEc2query_deserializeOpErrorModifyIdFormat(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpModifyImageAttribute struct { +type awsEc2query_deserializeOpModifyIdentityIdFormat struct { } -func (*awsEc2query_deserializeOpModifyImageAttribute) ID() string { +func (*awsEc2query_deserializeOpModifyIdentityIdFormat) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyImageAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyIdentityIdFormat) 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) @@ -47468,9 +47609,9 @@ func (m *awsEc2query_deserializeOpModifyImageAttribute) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyImageAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyIdentityIdFormat(response, &metadata) } - output := &ModifyImageAttributeOutput{} + output := &ModifyIdentityIdFormatOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -47482,7 +47623,7 @@ func (m *awsEc2query_deserializeOpModifyImageAttribute) HandleDeserialize(ctx co return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyImageAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyIdentityIdFormat(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)} @@ -47515,14 +47656,14 @@ func awsEc2query_deserializeOpErrorModifyImageAttribute(response *smithyhttp.Res } } -type awsEc2query_deserializeOpModifyInstanceAttribute struct { +type awsEc2query_deserializeOpModifyIdFormat struct { } -func (*awsEc2query_deserializeOpModifyInstanceAttribute) ID() string { +func (*awsEc2query_deserializeOpModifyIdFormat) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyIdFormat) 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) @@ -47540,9 +47681,9 @@ func (m *awsEc2query_deserializeOpModifyInstanceAttribute) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyIdFormat(response, &metadata) } - output := &ModifyInstanceAttributeOutput{} + output := &ModifyIdFormatOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -47554,7 +47695,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceAttribute) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyIdFormat(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)} @@ -47587,14 +47728,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceAttribute(response *smithyhttp. } } -type awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes struct { +type awsEc2query_deserializeOpModifyImageAttribute struct { } -func (*awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes) ID() string { +func (*awsEc2query_deserializeOpModifyImageAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyImageAttribute) 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) @@ -47612,44 +47753,21 @@ func (m *awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCapacityReservationAttributes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyImageAttribute(response, &metadata) } - output := &ModifyInstanceCapacityReservationAttributesOutput{} + output := &ModifyImageAttributeOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentModifyInstanceCapacityReservationAttributesOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceCapacityReservationAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyImageAttribute(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)} @@ -47682,14 +47800,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceCapacityReservationAttributes(r } } -type awsEc2query_deserializeOpModifyInstanceCpuOptions struct { +type awsEc2query_deserializeOpModifyInstanceAttribute struct { } -func (*awsEc2query_deserializeOpModifyInstanceCpuOptions) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceCpuOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceAttribute) 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) @@ -47707,44 +47825,21 @@ func (m *awsEc2query_deserializeOpModifyInstanceCpuOptions) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCpuOptions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceAttribute(response, &metadata) } - output := &ModifyInstanceCpuOptionsOutput{} + output := &ModifyInstanceAttributeOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentModifyInstanceCpuOptionsOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceCpuOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceAttribute(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)} @@ -47777,14 +47872,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceCpuOptions(response *smithyhttp } } -type awsEc2query_deserializeOpModifyInstanceCreditSpecification struct { +type awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes struct { } -func (*awsEc2query_deserializeOpModifyInstanceCreditSpecification) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceCreditSpecification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceCapacityReservationAttributes) 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) @@ -47802,9 +47897,9 @@ func (m *awsEc2query_deserializeOpModifyInstanceCreditSpecification) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCreditSpecification(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCapacityReservationAttributes(response, &metadata) } - output := &ModifyInstanceCreditSpecificationOutput{} + output := &ModifyInstanceCapacityReservationAttributesOutput{} out.Result = output var buff [1024]byte @@ -47825,7 +47920,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceCreditSpecification) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceCreditSpecificationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceCapacityReservationAttributesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -47839,7 +47934,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceCreditSpecification) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceCreditSpecification(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceCapacityReservationAttributes(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)} @@ -47872,14 +47967,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceCreditSpecification(response *s } } -type awsEc2query_deserializeOpModifyInstanceEventStartTime struct { +type awsEc2query_deserializeOpModifyInstanceCpuOptions struct { } -func (*awsEc2query_deserializeOpModifyInstanceEventStartTime) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceCpuOptions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceEventStartTime) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceCpuOptions) 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) @@ -47897,9 +47992,9 @@ func (m *awsEc2query_deserializeOpModifyInstanceEventStartTime) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceEventStartTime(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCpuOptions(response, &metadata) } - output := &ModifyInstanceEventStartTimeOutput{} + output := &ModifyInstanceCpuOptionsOutput{} out.Result = output var buff [1024]byte @@ -47920,7 +48015,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceEventStartTime) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceEventStartTimeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceCpuOptionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -47934,7 +48029,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceEventStartTime) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceEventStartTime(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceCpuOptions(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)} @@ -47967,14 +48062,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceEventStartTime(response *smithy } } -type awsEc2query_deserializeOpModifyInstanceEventWindow struct { +type awsEc2query_deserializeOpModifyInstanceCreditSpecification struct { } -func (*awsEc2query_deserializeOpModifyInstanceEventWindow) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceCreditSpecification) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceEventWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceCreditSpecification) 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) @@ -47992,9 +48087,9 @@ func (m *awsEc2query_deserializeOpModifyInstanceEventWindow) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceEventWindow(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceCreditSpecification(response, &metadata) } - output := &ModifyInstanceEventWindowOutput{} + output := &ModifyInstanceCreditSpecificationOutput{} out.Result = output var buff [1024]byte @@ -48015,7 +48110,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceEventWindow) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceEventWindowOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceCreditSpecificationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48029,7 +48124,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceEventWindow) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceEventWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceCreditSpecification(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)} @@ -48062,14 +48157,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceEventWindow(response *smithyhtt } } -type awsEc2query_deserializeOpModifyInstanceMaintenanceOptions struct { +type awsEc2query_deserializeOpModifyInstanceEventStartTime struct { } -func (*awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceEventStartTime) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceEventStartTime) 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) @@ -48087,9 +48182,9 @@ func (m *awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMaintenanceOptions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceEventStartTime(response, &metadata) } - output := &ModifyInstanceMaintenanceOptionsOutput{} + output := &ModifyInstanceEventStartTimeOutput{} out.Result = output var buff [1024]byte @@ -48110,7 +48205,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceMaintenanceOptionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceEventStartTimeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48124,7 +48219,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) HandleDeseri return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceMaintenanceOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceEventStartTime(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)} @@ -48157,14 +48252,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceMaintenanceOptions(response *sm } } -type awsEc2query_deserializeOpModifyInstanceMetadataDefaults struct { +type awsEc2query_deserializeOpModifyInstanceEventWindow struct { } -func (*awsEc2query_deserializeOpModifyInstanceMetadataDefaults) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceEventWindow) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceMetadataDefaults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceEventWindow) 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) @@ -48182,9 +48277,9 @@ func (m *awsEc2query_deserializeOpModifyInstanceMetadataDefaults) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMetadataDefaults(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceEventWindow(response, &metadata) } - output := &ModifyInstanceMetadataDefaultsOutput{} + output := &ModifyInstanceEventWindowOutput{} out.Result = output var buff [1024]byte @@ -48205,7 +48300,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceMetadataDefaults) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceMetadataDefaultsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceEventWindowOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48219,7 +48314,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceMetadataDefaults) HandleDeserial return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceMetadataDefaults(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceEventWindow(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)} @@ -48252,14 +48347,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceMetadataDefaults(response *smit } } -type awsEc2query_deserializeOpModifyInstanceMetadataOptions struct { +type awsEc2query_deserializeOpModifyInstanceMaintenanceOptions struct { } -func (*awsEc2query_deserializeOpModifyInstanceMetadataOptions) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstanceMetadataOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceMaintenanceOptions) 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) @@ -48277,9 +48372,9 @@ func (m *awsEc2query_deserializeOpModifyInstanceMetadataOptions) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMetadataOptions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMaintenanceOptions(response, &metadata) } - output := &ModifyInstanceMetadataOptionsOutput{} + output := &ModifyInstanceMaintenanceOptionsOutput{} out.Result = output var buff [1024]byte @@ -48300,7 +48395,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceMetadataOptions) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstanceMetadataOptionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceMaintenanceOptionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48314,7 +48409,7 @@ func (m *awsEc2query_deserializeOpModifyInstanceMetadataOptions) HandleDeseriali return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstanceMetadataOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceMaintenanceOptions(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)} @@ -48347,14 +48442,14 @@ func awsEc2query_deserializeOpErrorModifyInstanceMetadataOptions(response *smith } } -type awsEc2query_deserializeOpModifyInstancePlacement struct { +type awsEc2query_deserializeOpModifyInstanceMetadataDefaults struct { } -func (*awsEc2query_deserializeOpModifyInstancePlacement) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceMetadataDefaults) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyInstancePlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceMetadataDefaults) 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) @@ -48372,9 +48467,9 @@ func (m *awsEc2query_deserializeOpModifyInstancePlacement) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyInstancePlacement(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMetadataDefaults(response, &metadata) } - output := &ModifyInstancePlacementOutput{} + output := &ModifyInstanceMetadataDefaultsOutput{} out.Result = output var buff [1024]byte @@ -48395,7 +48490,7 @@ func (m *awsEc2query_deserializeOpModifyInstancePlacement) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyInstancePlacementOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceMetadataDefaultsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48409,7 +48504,7 @@ func (m *awsEc2query_deserializeOpModifyInstancePlacement) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyInstancePlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceMetadataDefaults(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)} @@ -48442,14 +48537,14 @@ func awsEc2query_deserializeOpErrorModifyInstancePlacement(response *smithyhttp. } } -type awsEc2query_deserializeOpModifyIpam struct { +type awsEc2query_deserializeOpModifyInstanceMetadataOptions struct { } -func (*awsEc2query_deserializeOpModifyIpam) ID() string { +func (*awsEc2query_deserializeOpModifyInstanceMetadataOptions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyIpam) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstanceMetadataOptions) 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) @@ -48467,9 +48562,9 @@ func (m *awsEc2query_deserializeOpModifyIpam) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpam(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstanceMetadataOptions(response, &metadata) } - output := &ModifyIpamOutput{} + output := &ModifyInstanceMetadataOptionsOutput{} out.Result = output var buff [1024]byte @@ -48490,7 +48585,7 @@ func (m *awsEc2query_deserializeOpModifyIpam) HandleDeserialize(ctx context.Cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstanceMetadataOptionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48504,7 +48599,7 @@ func (m *awsEc2query_deserializeOpModifyIpam) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyIpam(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstanceMetadataOptions(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)} @@ -48537,14 +48632,14 @@ func awsEc2query_deserializeOpErrorModifyIpam(response *smithyhttp.Response, met } } -type awsEc2query_deserializeOpModifyIpamPool struct { +type awsEc2query_deserializeOpModifyInstancePlacement struct { } -func (*awsEc2query_deserializeOpModifyIpamPool) ID() string { +func (*awsEc2query_deserializeOpModifyInstancePlacement) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyIpamPool) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyInstancePlacement) 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) @@ -48562,9 +48657,9 @@ func (m *awsEc2query_deserializeOpModifyIpamPool) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamPool(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyInstancePlacement(response, &metadata) } - output := &ModifyIpamPoolOutput{} + output := &ModifyInstancePlacementOutput{} out.Result = output var buff [1024]byte @@ -48585,7 +48680,7 @@ func (m *awsEc2query_deserializeOpModifyIpamPool) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamPoolOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyInstancePlacementOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48599,7 +48694,7 @@ func (m *awsEc2query_deserializeOpModifyIpamPool) HandleDeserialize(ctx context. return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyIpamPool(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyInstancePlacement(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)} @@ -48632,14 +48727,14 @@ func awsEc2query_deserializeOpErrorModifyIpamPool(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpModifyIpamResourceCidr struct { +type awsEc2query_deserializeOpModifyIpam struct { } -func (*awsEc2query_deserializeOpModifyIpamResourceCidr) ID() string { +func (*awsEc2query_deserializeOpModifyIpam) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyIpamResourceCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyIpam) 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) @@ -48657,9 +48752,9 @@ func (m *awsEc2query_deserializeOpModifyIpamResourceCidr) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamResourceCidr(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyIpam(response, &metadata) } - output := &ModifyIpamResourceCidrOutput{} + output := &ModifyIpamOutput{} out.Result = output var buff [1024]byte @@ -48680,7 +48775,7 @@ func (m *awsEc2query_deserializeOpModifyIpamResourceCidr) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamResourceCidrOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyIpamOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48694,7 +48789,7 @@ func (m *awsEc2query_deserializeOpModifyIpamResourceCidr) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyIpamResourceCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyIpam(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)} @@ -48727,14 +48822,14 @@ func awsEc2query_deserializeOpErrorModifyIpamResourceCidr(response *smithyhttp.R } } -type awsEc2query_deserializeOpModifyIpamResourceDiscovery struct { +type awsEc2query_deserializeOpModifyIpamPool struct { } -func (*awsEc2query_deserializeOpModifyIpamResourceDiscovery) ID() string { +func (*awsEc2query_deserializeOpModifyIpamPool) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyIpamResourceDiscovery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyIpamPool) 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) @@ -48752,9 +48847,9 @@ func (m *awsEc2query_deserializeOpModifyIpamResourceDiscovery) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamResourceDiscovery(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyIpamPool(response, &metadata) } - output := &ModifyIpamResourceDiscoveryOutput{} + output := &ModifyIpamPoolOutput{} out.Result = output var buff [1024]byte @@ -48775,7 +48870,7 @@ func (m *awsEc2query_deserializeOpModifyIpamResourceDiscovery) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamResourceDiscoveryOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyIpamPoolOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48789,7 +48884,7 @@ func (m *awsEc2query_deserializeOpModifyIpamResourceDiscovery) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyIpamResourceDiscovery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyIpamPool(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)} @@ -48822,14 +48917,14 @@ func awsEc2query_deserializeOpErrorModifyIpamResourceDiscovery(response *smithyh } } -type awsEc2query_deserializeOpModifyIpamScope struct { +type awsEc2query_deserializeOpModifyIpamResourceCidr struct { } -func (*awsEc2query_deserializeOpModifyIpamScope) ID() string { +func (*awsEc2query_deserializeOpModifyIpamResourceCidr) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyIpamScope) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyIpamResourceCidr) 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) @@ -48847,9 +48942,9 @@ func (m *awsEc2query_deserializeOpModifyIpamScope) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyIpamScope(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyIpamResourceCidr(response, &metadata) } - output := &ModifyIpamScopeOutput{} + output := &ModifyIpamResourceCidrOutput{} out.Result = output var buff [1024]byte @@ -48870,7 +48965,7 @@ func (m *awsEc2query_deserializeOpModifyIpamScope) HandleDeserialize(ctx context } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyIpamScopeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyIpamResourceCidrOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48884,7 +48979,7 @@ func (m *awsEc2query_deserializeOpModifyIpamScope) HandleDeserialize(ctx context return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyIpamScope(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyIpamResourceCidr(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)} @@ -48917,14 +49012,14 @@ func awsEc2query_deserializeOpErrorModifyIpamScope(response *smithyhttp.Response } } -type awsEc2query_deserializeOpModifyLaunchTemplate struct { +type awsEc2query_deserializeOpModifyIpamResourceDiscovery struct { } -func (*awsEc2query_deserializeOpModifyLaunchTemplate) ID() string { +func (*awsEc2query_deserializeOpModifyIpamResourceDiscovery) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyLaunchTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyIpamResourceDiscovery) 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) @@ -48942,9 +49037,9 @@ func (m *awsEc2query_deserializeOpModifyLaunchTemplate) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyLaunchTemplate(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyIpamResourceDiscovery(response, &metadata) } - output := &ModifyLaunchTemplateOutput{} + output := &ModifyIpamResourceDiscoveryOutput{} out.Result = output var buff [1024]byte @@ -48965,7 +49060,7 @@ func (m *awsEc2query_deserializeOpModifyLaunchTemplate) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyLaunchTemplateOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyIpamResourceDiscoveryOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -48979,7 +49074,7 @@ func (m *awsEc2query_deserializeOpModifyLaunchTemplate) HandleDeserialize(ctx co return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyLaunchTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyIpamResourceDiscovery(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)} @@ -49012,14 +49107,14 @@ func awsEc2query_deserializeOpErrorModifyLaunchTemplate(response *smithyhttp.Res } } -type awsEc2query_deserializeOpModifyLocalGatewayRoute struct { +type awsEc2query_deserializeOpModifyIpamScope struct { } -func (*awsEc2query_deserializeOpModifyLocalGatewayRoute) ID() string { +func (*awsEc2query_deserializeOpModifyIpamScope) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyLocalGatewayRoute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyIpamScope) 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) @@ -49037,9 +49132,9 @@ func (m *awsEc2query_deserializeOpModifyLocalGatewayRoute) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyLocalGatewayRoute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyIpamScope(response, &metadata) } - output := &ModifyLocalGatewayRouteOutput{} + output := &ModifyIpamScopeOutput{} out.Result = output var buff [1024]byte @@ -49060,7 +49155,7 @@ func (m *awsEc2query_deserializeOpModifyLocalGatewayRoute) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyLocalGatewayRouteOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyIpamScopeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -49074,7 +49169,7 @@ func (m *awsEc2query_deserializeOpModifyLocalGatewayRoute) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyLocalGatewayRoute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyIpamScope(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)} @@ -49107,14 +49202,14 @@ func awsEc2query_deserializeOpErrorModifyLocalGatewayRoute(response *smithyhttp. } } -type awsEc2query_deserializeOpModifyManagedPrefixList struct { +type awsEc2query_deserializeOpModifyLaunchTemplate struct { } -func (*awsEc2query_deserializeOpModifyManagedPrefixList) ID() string { +func (*awsEc2query_deserializeOpModifyLaunchTemplate) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyManagedPrefixList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyLaunchTemplate) 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) @@ -49132,9 +49227,9 @@ func (m *awsEc2query_deserializeOpModifyManagedPrefixList) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyManagedPrefixList(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyLaunchTemplate(response, &metadata) } - output := &ModifyManagedPrefixListOutput{} + output := &ModifyLaunchTemplateOutput{} out.Result = output var buff [1024]byte @@ -49155,7 +49250,7 @@ func (m *awsEc2query_deserializeOpModifyManagedPrefixList) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyManagedPrefixListOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyLaunchTemplateOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -49169,79 +49264,7 @@ func (m *awsEc2query_deserializeOpModifyManagedPrefixList) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyManagedPrefixList(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_deserializeOpModifyNetworkInterfaceAttribute struct { -} - -func (*awsEc2query_deserializeOpModifyNetworkInterfaceAttribute) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpModifyNetworkInterfaceAttribute) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - 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_deserializeOpErrorModifyNetworkInterfaceAttribute(response, &metadata) - } - output := &ModifyNetworkInterfaceAttributeOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorModifyNetworkInterfaceAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyLaunchTemplate(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)} @@ -49274,14 +49297,14 @@ func awsEc2query_deserializeOpErrorModifyNetworkInterfaceAttribute(response *smi } } -type awsEc2query_deserializeOpModifyPrivateDnsNameOptions struct { +type awsEc2query_deserializeOpModifyLocalGatewayRoute struct { } -func (*awsEc2query_deserializeOpModifyPrivateDnsNameOptions) ID() string { +func (*awsEc2query_deserializeOpModifyLocalGatewayRoute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyPrivateDnsNameOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyLocalGatewayRoute) 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) @@ -49299,9 +49322,9 @@ func (m *awsEc2query_deserializeOpModifyPrivateDnsNameOptions) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyPrivateDnsNameOptions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyLocalGatewayRoute(response, &metadata) } - output := &ModifyPrivateDnsNameOptionsOutput{} + output := &ModifyLocalGatewayRouteOutput{} out.Result = output var buff [1024]byte @@ -49322,7 +49345,7 @@ func (m *awsEc2query_deserializeOpModifyPrivateDnsNameOptions) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyPrivateDnsNameOptionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyLocalGatewayRouteOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -49336,7 +49359,7 @@ func (m *awsEc2query_deserializeOpModifyPrivateDnsNameOptions) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyPrivateDnsNameOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyLocalGatewayRoute(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)} @@ -49369,14 +49392,14 @@ func awsEc2query_deserializeOpErrorModifyPrivateDnsNameOptions(response *smithyh } } -type awsEc2query_deserializeOpModifyReservedInstances struct { +type awsEc2query_deserializeOpModifyManagedPrefixList struct { } -func (*awsEc2query_deserializeOpModifyReservedInstances) ID() string { +func (*awsEc2query_deserializeOpModifyManagedPrefixList) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyReservedInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyManagedPrefixList) 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) @@ -49394,9 +49417,9 @@ func (m *awsEc2query_deserializeOpModifyReservedInstances) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyReservedInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyManagedPrefixList(response, &metadata) } - output := &ModifyReservedInstancesOutput{} + output := &ModifyManagedPrefixListOutput{} out.Result = output var buff [1024]byte @@ -49417,7 +49440,7 @@ func (m *awsEc2query_deserializeOpModifyReservedInstances) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyReservedInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyManagedPrefixListOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -49431,7 +49454,7 @@ func (m *awsEc2query_deserializeOpModifyReservedInstances) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyReservedInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyManagedPrefixList(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)} @@ -49464,14 +49487,14 @@ func awsEc2query_deserializeOpErrorModifyReservedInstances(response *smithyhttp. } } -type awsEc2query_deserializeOpModifySecurityGroupRules struct { +type awsEc2query_deserializeOpModifyNetworkInterfaceAttribute struct { } -func (*awsEc2query_deserializeOpModifySecurityGroupRules) ID() string { +func (*awsEc2query_deserializeOpModifyNetworkInterfaceAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifySecurityGroupRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyNetworkInterfaceAttribute) 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) @@ -49489,44 +49512,21 @@ func (m *awsEc2query_deserializeOpModifySecurityGroupRules) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySecurityGroupRules(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyNetworkInterfaceAttribute(response, &metadata) } - output := &ModifySecurityGroupRulesOutput{} + output := &ModifyNetworkInterfaceAttributeOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentModifySecurityGroupRulesOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorModifySecurityGroupRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyNetworkInterfaceAttribute(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)} @@ -49559,14 +49559,14 @@ func awsEc2query_deserializeOpErrorModifySecurityGroupRules(response *smithyhttp } } -type awsEc2query_deserializeOpModifySnapshotAttribute struct { +type awsEc2query_deserializeOpModifyPrivateDnsNameOptions struct { } -func (*awsEc2query_deserializeOpModifySnapshotAttribute) ID() string { +func (*awsEc2query_deserializeOpModifyPrivateDnsNameOptions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifySnapshotAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyPrivateDnsNameOptions) 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) @@ -49584,21 +49584,44 @@ func (m *awsEc2query_deserializeOpModifySnapshotAttribute) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySnapshotAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyPrivateDnsNameOptions(response, &metadata) } - output := &ModifySnapshotAttributeOutput{} + output := &ModifyPrivateDnsNameOptionsOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } } + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentModifyPrivateDnsNameOptionsOutput(&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_deserializeOpErrorModifySnapshotAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyPrivateDnsNameOptions(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)} @@ -49631,14 +49654,14 @@ func awsEc2query_deserializeOpErrorModifySnapshotAttribute(response *smithyhttp. } } -type awsEc2query_deserializeOpModifySnapshotTier struct { +type awsEc2query_deserializeOpModifyReservedInstances struct { } -func (*awsEc2query_deserializeOpModifySnapshotTier) ID() string { +func (*awsEc2query_deserializeOpModifyReservedInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifySnapshotTier) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyReservedInstances) 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) @@ -49656,9 +49679,9 @@ func (m *awsEc2query_deserializeOpModifySnapshotTier) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySnapshotTier(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyReservedInstances(response, &metadata) } - output := &ModifySnapshotTierOutput{} + output := &ModifyReservedInstancesOutput{} out.Result = output var buff [1024]byte @@ -49679,7 +49702,7 @@ func (m *awsEc2query_deserializeOpModifySnapshotTier) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifySnapshotTierOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyReservedInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -49693,7 +49716,7 @@ func (m *awsEc2query_deserializeOpModifySnapshotTier) HandleDeserialize(ctx cont return out, metadata, err } -func awsEc2query_deserializeOpErrorModifySnapshotTier(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyReservedInstances(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)} @@ -49726,14 +49749,14 @@ func awsEc2query_deserializeOpErrorModifySnapshotTier(response *smithyhttp.Respo } } -type awsEc2query_deserializeOpModifySpotFleetRequest struct { +type awsEc2query_deserializeOpModifySecurityGroupRules struct { } -func (*awsEc2query_deserializeOpModifySpotFleetRequest) ID() string { +func (*awsEc2query_deserializeOpModifySecurityGroupRules) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifySpotFleetRequest) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifySecurityGroupRules) 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) @@ -49751,9 +49774,9 @@ func (m *awsEc2query_deserializeOpModifySpotFleetRequest) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySpotFleetRequest(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifySecurityGroupRules(response, &metadata) } - output := &ModifySpotFleetRequestOutput{} + output := &ModifySecurityGroupRulesOutput{} out.Result = output var buff [1024]byte @@ -49774,7 +49797,7 @@ func (m *awsEc2query_deserializeOpModifySpotFleetRequest) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifySpotFleetRequestOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifySecurityGroupRulesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -49788,7 +49811,7 @@ func (m *awsEc2query_deserializeOpModifySpotFleetRequest) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifySpotFleetRequest(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifySecurityGroupRules(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)} @@ -49821,14 +49844,14 @@ func awsEc2query_deserializeOpErrorModifySpotFleetRequest(response *smithyhttp.R } } -type awsEc2query_deserializeOpModifySubnetAttribute struct { +type awsEc2query_deserializeOpModifySnapshotAttribute struct { } -func (*awsEc2query_deserializeOpModifySubnetAttribute) ID() string { +func (*awsEc2query_deserializeOpModifySnapshotAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifySubnetAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifySnapshotAttribute) 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) @@ -49846,9 +49869,9 @@ func (m *awsEc2query_deserializeOpModifySubnetAttribute) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifySubnetAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifySnapshotAttribute(response, &metadata) } - output := &ModifySubnetAttributeOutput{} + output := &ModifySnapshotAttributeOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -49860,7 +49883,7 @@ func (m *awsEc2query_deserializeOpModifySubnetAttribute) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorModifySubnetAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifySnapshotAttribute(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)} @@ -49893,14 +49916,14 @@ func awsEc2query_deserializeOpErrorModifySubnetAttribute(response *smithyhttp.Re } } -type awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices struct { +type awsEc2query_deserializeOpModifySnapshotTier struct { } -func (*awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) ID() string { +func (*awsEc2query_deserializeOpModifySnapshotTier) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifySnapshotTier) 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) @@ -49918,9 +49941,9 @@ func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) Hand } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterNetworkServices(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifySnapshotTier(response, &metadata) } - output := &ModifyTrafficMirrorFilterNetworkServicesOutput{} + output := &ModifySnapshotTierOutput{} out.Result = output var buff [1024]byte @@ -49941,7 +49964,7 @@ func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) Hand } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterNetworkServicesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifySnapshotTierOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -49955,7 +49978,7 @@ func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) Hand return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterNetworkServices(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifySnapshotTier(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)} @@ -49988,14 +50011,14 @@ func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterNetworkServices(resp } } -type awsEc2query_deserializeOpModifyTrafficMirrorFilterRule struct { +type awsEc2query_deserializeOpModifySpotFleetRequest struct { } -func (*awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) ID() string { +func (*awsEc2query_deserializeOpModifySpotFleetRequest) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifySpotFleetRequest) 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) @@ -50013,9 +50036,9 @@ func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterRule(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifySpotFleetRequest(response, &metadata) } - output := &ModifyTrafficMirrorFilterRuleOutput{} + output := &ModifySpotFleetRequestOutput{} out.Result = output var buff [1024]byte @@ -50036,7 +50059,7 @@ func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterRuleOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifySpotFleetRequestOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50050,7 +50073,7 @@ func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) HandleDeseriali return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifySpotFleetRequest(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)} @@ -50083,14 +50106,14 @@ func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterRule(response *smith } } -type awsEc2query_deserializeOpModifyTrafficMirrorSession struct { +type awsEc2query_deserializeOpModifySubnetAttribute struct { } -func (*awsEc2query_deserializeOpModifyTrafficMirrorSession) ID() string { +func (*awsEc2query_deserializeOpModifySubnetAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyTrafficMirrorSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifySubnetAttribute) 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) @@ -50108,44 +50131,21 @@ func (m *awsEc2query_deserializeOpModifyTrafficMirrorSession) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorSession(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifySubnetAttribute(response, &metadata) } - output := &ModifyTrafficMirrorSessionOutput{} + output := &ModifySubnetAttributeOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentModifyTrafficMirrorSessionOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyTrafficMirrorSession(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifySubnetAttribute(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)} @@ -50178,14 +50178,14 @@ func awsEc2query_deserializeOpErrorModifyTrafficMirrorSession(response *smithyht } } -type awsEc2query_deserializeOpModifyTransitGateway struct { +type awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices struct { } -func (*awsEc2query_deserializeOpModifyTransitGateway) ID() string { +func (*awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyTransitGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterNetworkServices) 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) @@ -50203,9 +50203,9 @@ func (m *awsEc2query_deserializeOpModifyTransitGateway) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGateway(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterNetworkServices(response, &metadata) } - output := &ModifyTransitGatewayOutput{} + output := &ModifyTrafficMirrorFilterNetworkServicesOutput{} out.Result = output var buff [1024]byte @@ -50226,7 +50226,7 @@ func (m *awsEc2query_deserializeOpModifyTransitGateway) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTransitGatewayOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterNetworkServicesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50240,7 +50240,7 @@ func (m *awsEc2query_deserializeOpModifyTransitGateway) HandleDeserialize(ctx co return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyTransitGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterNetworkServices(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)} @@ -50273,14 +50273,14 @@ func awsEc2query_deserializeOpErrorModifyTransitGateway(response *smithyhttp.Res } } -type awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference struct { +type awsEc2query_deserializeOpModifyTrafficMirrorFilterRule struct { } -func (*awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) ID() string { +func (*awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyTrafficMirrorFilterRule) 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) @@ -50298,9 +50298,9 @@ func (m *awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGatewayPrefixListReference(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterRule(response, &metadata) } - output := &ModifyTransitGatewayPrefixListReferenceOutput{} + output := &ModifyTrafficMirrorFilterRuleOutput{} out.Result = output var buff [1024]byte @@ -50321,7 +50321,7 @@ func (m *awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) Handl } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTransitGatewayPrefixListReferenceOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorFilterRuleOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50335,7 +50335,7 @@ func (m *awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) Handl return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyTransitGatewayPrefixListReference(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyTrafficMirrorFilterRule(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)} @@ -50368,14 +50368,14 @@ func awsEc2query_deserializeOpErrorModifyTransitGatewayPrefixListReference(respo } } -type awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment struct { +type awsEc2query_deserializeOpModifyTrafficMirrorSession struct { } -func (*awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) ID() string { +func (*awsEc2query_deserializeOpModifyTrafficMirrorSession) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyTrafficMirrorSession) 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) @@ -50393,9 +50393,9 @@ func (m *awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGatewayVpcAttachment(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyTrafficMirrorSession(response, &metadata) } - output := &ModifyTransitGatewayVpcAttachmentOutput{} + output := &ModifyTrafficMirrorSessionOutput{} out.Result = output var buff [1024]byte @@ -50416,7 +50416,7 @@ func (m *awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyTransitGatewayVpcAttachmentOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyTrafficMirrorSessionOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50430,7 +50430,7 @@ func (m *awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyTransitGatewayVpcAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyTrafficMirrorSession(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)} @@ -50463,14 +50463,14 @@ func awsEc2query_deserializeOpErrorModifyTransitGatewayVpcAttachment(response *s } } -type awsEc2query_deserializeOpModifyVerifiedAccessEndpoint struct { +type awsEc2query_deserializeOpModifyTransitGateway struct { } -func (*awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) ID() string { +func (*awsEc2query_deserializeOpModifyTransitGateway) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyTransitGateway) 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) @@ -50488,9 +50488,9 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpoint(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGateway(response, &metadata) } - output := &ModifyVerifiedAccessEndpointOutput{} + output := &ModifyTransitGatewayOutput{} out.Result = output var buff [1024]byte @@ -50511,7 +50511,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyTransitGatewayOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50525,7 +50525,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyTransitGateway(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)} @@ -50558,14 +50558,14 @@ func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpoint(response *smithy } } -type awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy struct { +type awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference struct { } -func (*awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) ID() string { +func (*awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyTransitGatewayPrefixListReference) 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) @@ -50583,9 +50583,9 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpointPolicy(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGatewayPrefixListReference(response, &metadata) } - output := &ModifyVerifiedAccessEndpointPolicyOutput{} + output := &ModifyTransitGatewayPrefixListReferenceOutput{} out.Result = output var buff [1024]byte @@ -50606,7 +50606,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) HandleDese } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointPolicyOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyTransitGatewayPrefixListReferenceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50620,7 +50620,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) HandleDese return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpointPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyTransitGatewayPrefixListReference(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)} @@ -50653,14 +50653,14 @@ func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpointPolicy(response * } } -type awsEc2query_deserializeOpModifyVerifiedAccessGroup struct { +type awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment struct { } -func (*awsEc2query_deserializeOpModifyVerifiedAccessGroup) ID() string { +func (*awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyTransitGatewayVpcAttachment) 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) @@ -50678,9 +50678,9 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroup) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessGroup(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyTransitGatewayVpcAttachment(response, &metadata) } - output := &ModifyVerifiedAccessGroupOutput{} + output := &ModifyTransitGatewayVpcAttachmentOutput{} out.Result = output var buff [1024]byte @@ -50701,7 +50701,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroup) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyTransitGatewayVpcAttachmentOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50715,7 +50715,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroup) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyTransitGatewayVpcAttachment(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)} @@ -50748,14 +50748,14 @@ func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroup(response *smithyhtt } } -type awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy struct { +type awsEc2query_deserializeOpModifyVerifiedAccessEndpoint struct { } -func (*awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) ID() string { +func (*awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpoint) 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) @@ -50773,9 +50773,9 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessGroupPolicy(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpoint(response, &metadata) } - output := &ModifyVerifiedAccessGroupPolicyOutput{} + output := &ModifyVerifiedAccessEndpointOutput{} out.Result = output var buff [1024]byte @@ -50796,7 +50796,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupPolicyOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50810,7 +50810,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) HandleDeseria return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroupPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpoint(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)} @@ -50843,14 +50843,14 @@ func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroupPolicy(response *smi } } -type awsEc2query_deserializeOpModifyVerifiedAccessInstance struct { +type awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy struct { } -func (*awsEc2query_deserializeOpModifyVerifiedAccessInstance) ID() string { +func (*awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVerifiedAccessEndpointPolicy) 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) @@ -50868,9 +50868,9 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstance) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessInstance(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpointPolicy(response, &metadata) } - output := &ModifyVerifiedAccessInstanceOutput{} + output := &ModifyVerifiedAccessEndpointPolicyOutput{} out.Result = output var buff [1024]byte @@ -50891,7 +50891,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstance) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessEndpointPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -50905,7 +50905,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstance) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVerifiedAccessEndpointPolicy(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)} @@ -50938,14 +50938,14 @@ func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstance(response *smithy } } -type awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration struct { +type awsEc2query_deserializeOpModifyVerifiedAccessGroup struct { } -func (*awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration) ID() string { +func (*awsEc2query_deserializeOpModifyVerifiedAccessGroup) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroup) 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) @@ -50963,9 +50963,9 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfigurati } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessInstanceLoggingConfiguration(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessGroup(response, &metadata) } - output := &ModifyVerifiedAccessInstanceLoggingConfigurationOutput{} + output := &ModifyVerifiedAccessGroupOutput{} out.Result = output var buff [1024]byte @@ -50986,7 +50986,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfigurati } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceLoggingConfigurationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51000,7 +51000,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfigurati return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstanceLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroup(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)} @@ -51033,14 +51033,14 @@ func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstanceLoggingConfigurat } } -type awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider struct { +type awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy struct { } -func (*awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) ID() string { +func (*awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVerifiedAccessGroupPolicy) 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) @@ -51058,9 +51058,9 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessTrustProvider(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessGroupPolicy(response, &metadata) } - output := &ModifyVerifiedAccessTrustProviderOutput{} + output := &ModifyVerifiedAccessGroupPolicyOutput{} out.Result = output var buff [1024]byte @@ -51081,7 +51081,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessTrustProviderOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessGroupPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51095,7 +51095,7 @@ func (m *awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVerifiedAccessTrustProvider(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVerifiedAccessGroupPolicy(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)} @@ -51128,14 +51128,14 @@ func awsEc2query_deserializeOpErrorModifyVerifiedAccessTrustProvider(response *s } } -type awsEc2query_deserializeOpModifyVolume struct { +type awsEc2query_deserializeOpModifyVerifiedAccessInstance struct { } -func (*awsEc2query_deserializeOpModifyVolume) ID() string { +func (*awsEc2query_deserializeOpModifyVerifiedAccessInstance) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVolume) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstance) 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) @@ -51153,9 +51153,9 @@ func (m *awsEc2query_deserializeOpModifyVolume) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVolume(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessInstance(response, &metadata) } - output := &ModifyVolumeOutput{} + output := &ModifyVerifiedAccessInstanceOutput{} out.Result = output var buff [1024]byte @@ -51176,7 +51176,7 @@ func (m *awsEc2query_deserializeOpModifyVolume) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVolumeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51190,7 +51190,7 @@ func (m *awsEc2query_deserializeOpModifyVolume) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVolume(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstance(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)} @@ -51223,14 +51223,14 @@ func awsEc2query_deserializeOpErrorModifyVolume(response *smithyhttp.Response, m } } -type awsEc2query_deserializeOpModifyVolumeAttribute struct { +type awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration struct { } -func (*awsEc2query_deserializeOpModifyVolumeAttribute) ID() string { +func (*awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVolumeAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVerifiedAccessInstanceLoggingConfiguration) 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) @@ -51248,21 +51248,44 @@ func (m *awsEc2query_deserializeOpModifyVolumeAttribute) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVolumeAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessInstanceLoggingConfiguration(response, &metadata) } - output := &ModifyVolumeAttributeOutput{} + output := &ModifyVerifiedAccessInstanceLoggingConfigurationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessInstanceLoggingConfigurationOutput(&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_deserializeOpErrorModifyVolumeAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVerifiedAccessInstanceLoggingConfiguration(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)} @@ -51295,14 +51318,14 @@ func awsEc2query_deserializeOpErrorModifyVolumeAttribute(response *smithyhttp.Re } } -type awsEc2query_deserializeOpModifyVpcAttribute struct { +type awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider struct { } -func (*awsEc2query_deserializeOpModifyVpcAttribute) ID() string { +func (*awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVerifiedAccessTrustProvider) 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) @@ -51320,21 +51343,44 @@ func (m *awsEc2query_deserializeOpModifyVpcAttribute) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVerifiedAccessTrustProvider(response, &metadata) } - output := &ModifyVpcAttributeOutput{} + output := &ModifyVerifiedAccessTrustProviderOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } } + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentModifyVerifiedAccessTrustProviderOutput(&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_deserializeOpErrorModifyVpcAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVerifiedAccessTrustProvider(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)} @@ -51367,14 +51413,14 @@ func awsEc2query_deserializeOpErrorModifyVpcAttribute(response *smithyhttp.Respo } } -type awsEc2query_deserializeOpModifyVpcEndpoint struct { +type awsEc2query_deserializeOpModifyVolume struct { } -func (*awsEc2query_deserializeOpModifyVpcEndpoint) ID() string { +func (*awsEc2query_deserializeOpModifyVolume) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVolume) 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) @@ -51392,9 +51438,9 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpoint) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpoint(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVolume(response, &metadata) } - output := &ModifyVpcEndpointOutput{} + output := &ModifyVolumeOutput{} out.Result = output var buff [1024]byte @@ -51415,7 +51461,7 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpoint) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVolumeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51429,7 +51475,7 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpoint) HandleDeserialize(ctx conte return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpcEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVolume(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)} @@ -51462,14 +51508,14 @@ func awsEc2query_deserializeOpErrorModifyVpcEndpoint(response *smithyhttp.Respon } } -type awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification struct { +type awsEc2query_deserializeOpModifyVolumeAttribute struct { } -func (*awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification) ID() string { +func (*awsEc2query_deserializeOpModifyVolumeAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVolumeAttribute) 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) @@ -51487,44 +51533,21 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointConnectionNotification(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVolumeAttribute(response, &metadata) } - output := &ModifyVpcEndpointConnectionNotificationOutput{} + output := &ModifyVolumeAttributeOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentModifyVpcEndpointConnectionNotificationOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpcEndpointConnectionNotification(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVolumeAttribute(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)} @@ -51557,14 +51580,14 @@ func awsEc2query_deserializeOpErrorModifyVpcEndpointConnectionNotification(respo } } -type awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration struct { +type awsEc2query_deserializeOpModifyVpcAttribute struct { } -func (*awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration) ID() string { +func (*awsEc2query_deserializeOpModifyVpcAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcAttribute) 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) @@ -51582,44 +51605,21 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServiceConfiguration(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcAttribute(response, &metadata) } - output := &ModifyVpcEndpointServiceConfigurationOutput{} + output := &ModifyVpcAttributeOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentModifyVpcEndpointServiceConfigurationOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpcEndpointServiceConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcAttribute(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)} @@ -51652,14 +51652,14 @@ func awsEc2query_deserializeOpErrorModifyVpcEndpointServiceConfiguration(respons } } -type awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility struct { +type awsEc2query_deserializeOpModifyVpcEndpoint struct { } -func (*awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) ID() string { +func (*awsEc2query_deserializeOpModifyVpcEndpoint) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcEndpoint) 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) @@ -51677,9 +51677,9 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServicePayerResponsibility(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpoint(response, &metadata) } - output := &ModifyVpcEndpointServicePayerResponsibilityOutput{} + output := &ModifyVpcEndpointOutput{} out.Result = output var buff [1024]byte @@ -51700,7 +51700,7 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) H } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePayerResponsibilityOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpcEndpointOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51714,7 +51714,7 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) H return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePayerResponsibility(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcEndpoint(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)} @@ -51747,14 +51747,14 @@ func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePayerResponsibility(r } } -type awsEc2query_deserializeOpModifyVpcEndpointServicePermissions struct { +type awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification struct { } -func (*awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) ID() string { +func (*awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcEndpointConnectionNotification) 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) @@ -51772,9 +51772,9 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServicePermissions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointConnectionNotification(response, &metadata) } - output := &ModifyVpcEndpointServicePermissionsOutput{} + output := &ModifyVpcEndpointConnectionNotificationOutput{} out.Result = output var buff [1024]byte @@ -51795,7 +51795,7 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) HandleDes } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePermissionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpcEndpointConnectionNotificationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51809,7 +51809,7 @@ func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) HandleDes return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcEndpointConnectionNotification(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)} @@ -51842,14 +51842,14 @@ func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePermissions(response } } -type awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions struct { +type awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration struct { } -func (*awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) ID() string { +func (*awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcEndpointServiceConfiguration) 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) @@ -51867,9 +51867,9 @@ func (m *awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcPeeringConnectionOptions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServiceConfiguration(response, &metadata) } - output := &ModifyVpcPeeringConnectionOptionsOutput{} + output := &ModifyVpcEndpointServiceConfigurationOutput{} out.Result = output var buff [1024]byte @@ -51890,7 +51890,7 @@ func (m *awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcPeeringConnectionOptionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServiceConfigurationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51904,7 +51904,7 @@ func (m *awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpcPeeringConnectionOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcEndpointServiceConfiguration(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)} @@ -51937,14 +51937,14 @@ func awsEc2query_deserializeOpErrorModifyVpcPeeringConnectionOptions(response *s } } -type awsEc2query_deserializeOpModifyVpcTenancy struct { +type awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility struct { } -func (*awsEc2query_deserializeOpModifyVpcTenancy) ID() string { +func (*awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpcTenancy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePayerResponsibility) 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) @@ -51962,9 +51962,9 @@ func (m *awsEc2query_deserializeOpModifyVpcTenancy) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpcTenancy(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServicePayerResponsibility(response, &metadata) } - output := &ModifyVpcTenancyOutput{} + output := &ModifyVpcEndpointServicePayerResponsibilityOutput{} out.Result = output var buff [1024]byte @@ -51985,7 +51985,7 @@ func (m *awsEc2query_deserializeOpModifyVpcTenancy) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpcTenancyOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePayerResponsibilityOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -51999,7 +51999,7 @@ func (m *awsEc2query_deserializeOpModifyVpcTenancy) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpcTenancy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePayerResponsibility(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)} @@ -52032,14 +52032,14 @@ func awsEc2query_deserializeOpErrorModifyVpcTenancy(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpModifyVpnConnection struct { +type awsEc2query_deserializeOpModifyVpcEndpointServicePermissions struct { } -func (*awsEc2query_deserializeOpModifyVpnConnection) ID() string { +func (*awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpnConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcEndpointServicePermissions) 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) @@ -52057,9 +52057,9 @@ func (m *awsEc2query_deserializeOpModifyVpnConnection) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnConnection(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcEndpointServicePermissions(response, &metadata) } - output := &ModifyVpnConnectionOutput{} + output := &ModifyVpcEndpointServicePermissionsOutput{} out.Result = output var buff [1024]byte @@ -52080,7 +52080,7 @@ func (m *awsEc2query_deserializeOpModifyVpnConnection) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnConnectionOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpcEndpointServicePermissionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52094,7 +52094,7 @@ func (m *awsEc2query_deserializeOpModifyVpnConnection) HandleDeserialize(ctx con return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpnConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcEndpointServicePermissions(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)} @@ -52127,14 +52127,14 @@ func awsEc2query_deserializeOpErrorModifyVpnConnection(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpModifyVpnConnectionOptions struct { +type awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions struct { } -func (*awsEc2query_deserializeOpModifyVpnConnectionOptions) ID() string { +func (*awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpnConnectionOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcPeeringConnectionOptions) 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) @@ -52152,9 +52152,9 @@ func (m *awsEc2query_deserializeOpModifyVpnConnectionOptions) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnConnectionOptions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcPeeringConnectionOptions(response, &metadata) } - output := &ModifyVpnConnectionOptionsOutput{} + output := &ModifyVpcPeeringConnectionOptionsOutput{} out.Result = output var buff [1024]byte @@ -52175,7 +52175,7 @@ func (m *awsEc2query_deserializeOpModifyVpnConnectionOptions) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnConnectionOptionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpcPeeringConnectionOptionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52189,7 +52189,7 @@ func (m *awsEc2query_deserializeOpModifyVpnConnectionOptions) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpnConnectionOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcPeeringConnectionOptions(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)} @@ -52222,14 +52222,14 @@ func awsEc2query_deserializeOpErrorModifyVpnConnectionOptions(response *smithyht } } -type awsEc2query_deserializeOpModifyVpnTunnelCertificate struct { +type awsEc2query_deserializeOpModifyVpcTenancy struct { } -func (*awsEc2query_deserializeOpModifyVpnTunnelCertificate) ID() string { +func (*awsEc2query_deserializeOpModifyVpcTenancy) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpnTunnelCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpcTenancy) 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) @@ -52247,9 +52247,9 @@ func (m *awsEc2query_deserializeOpModifyVpnTunnelCertificate) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnTunnelCertificate(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpcTenancy(response, &metadata) } - output := &ModifyVpnTunnelCertificateOutput{} + output := &ModifyVpcTenancyOutput{} out.Result = output var buff [1024]byte @@ -52270,7 +52270,7 @@ func (m *awsEc2query_deserializeOpModifyVpnTunnelCertificate) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnTunnelCertificateOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpcTenancyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52284,7 +52284,7 @@ func (m *awsEc2query_deserializeOpModifyVpnTunnelCertificate) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpnTunnelCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpcTenancy(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)} @@ -52317,14 +52317,14 @@ func awsEc2query_deserializeOpErrorModifyVpnTunnelCertificate(response *smithyht } } -type awsEc2query_deserializeOpModifyVpnTunnelOptions struct { +type awsEc2query_deserializeOpModifyVpnConnection struct { } -func (*awsEc2query_deserializeOpModifyVpnTunnelOptions) ID() string { +func (*awsEc2query_deserializeOpModifyVpnConnection) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpModifyVpnTunnelOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpnConnection) 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) @@ -52342,9 +52342,9 @@ func (m *awsEc2query_deserializeOpModifyVpnTunnelOptions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorModifyVpnTunnelOptions(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpnConnection(response, &metadata) } - output := &ModifyVpnTunnelOptionsOutput{} + output := &ModifyVpnConnectionOutput{} out.Result = output var buff [1024]byte @@ -52365,7 +52365,7 @@ func (m *awsEc2query_deserializeOpModifyVpnTunnelOptions) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentModifyVpnTunnelOptionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpnConnectionOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52379,7 +52379,7 @@ func (m *awsEc2query_deserializeOpModifyVpnTunnelOptions) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorModifyVpnTunnelOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpnConnection(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)} @@ -52412,14 +52412,14 @@ func awsEc2query_deserializeOpErrorModifyVpnTunnelOptions(response *smithyhttp.R } } -type awsEc2query_deserializeOpMonitorInstances struct { +type awsEc2query_deserializeOpModifyVpnConnectionOptions struct { } -func (*awsEc2query_deserializeOpMonitorInstances) ID() string { +func (*awsEc2query_deserializeOpModifyVpnConnectionOptions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpMonitorInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpnConnectionOptions) 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) @@ -52437,9 +52437,9 @@ func (m *awsEc2query_deserializeOpMonitorInstances) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMonitorInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpnConnectionOptions(response, &metadata) } - output := &MonitorInstancesOutput{} + output := &ModifyVpnConnectionOptionsOutput{} out.Result = output var buff [1024]byte @@ -52460,7 +52460,7 @@ func (m *awsEc2query_deserializeOpMonitorInstances) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMonitorInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpnConnectionOptionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52474,7 +52474,7 @@ func (m *awsEc2query_deserializeOpMonitorInstances) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorMonitorInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpnConnectionOptions(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)} @@ -52507,14 +52507,14 @@ func awsEc2query_deserializeOpErrorMonitorInstances(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpMoveAddressToVpc struct { +type awsEc2query_deserializeOpModifyVpnTunnelCertificate struct { } -func (*awsEc2query_deserializeOpMoveAddressToVpc) ID() string { +func (*awsEc2query_deserializeOpModifyVpnTunnelCertificate) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpMoveAddressToVpc) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpnTunnelCertificate) 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) @@ -52532,9 +52532,9 @@ func (m *awsEc2query_deserializeOpMoveAddressToVpc) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMoveAddressToVpc(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpnTunnelCertificate(response, &metadata) } - output := &MoveAddressToVpcOutput{} + output := &ModifyVpnTunnelCertificateOutput{} out.Result = output var buff [1024]byte @@ -52555,7 +52555,7 @@ func (m *awsEc2query_deserializeOpMoveAddressToVpc) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMoveAddressToVpcOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpnTunnelCertificateOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52569,7 +52569,7 @@ func (m *awsEc2query_deserializeOpMoveAddressToVpc) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorMoveAddressToVpc(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpnTunnelCertificate(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)} @@ -52602,14 +52602,14 @@ func awsEc2query_deserializeOpErrorMoveAddressToVpc(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpMoveByoipCidrToIpam struct { +type awsEc2query_deserializeOpModifyVpnTunnelOptions struct { } -func (*awsEc2query_deserializeOpMoveByoipCidrToIpam) ID() string { +func (*awsEc2query_deserializeOpModifyVpnTunnelOptions) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpMoveByoipCidrToIpam) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpModifyVpnTunnelOptions) 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) @@ -52627,9 +52627,9 @@ func (m *awsEc2query_deserializeOpMoveByoipCidrToIpam) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMoveByoipCidrToIpam(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorModifyVpnTunnelOptions(response, &metadata) } - output := &MoveByoipCidrToIpamOutput{} + output := &ModifyVpnTunnelOptionsOutput{} out.Result = output var buff [1024]byte @@ -52650,7 +52650,7 @@ func (m *awsEc2query_deserializeOpMoveByoipCidrToIpam) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMoveByoipCidrToIpamOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentModifyVpnTunnelOptionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52664,7 +52664,7 @@ func (m *awsEc2query_deserializeOpMoveByoipCidrToIpam) HandleDeserialize(ctx con return out, metadata, err } -func awsEc2query_deserializeOpErrorMoveByoipCidrToIpam(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorModifyVpnTunnelOptions(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)} @@ -52697,14 +52697,14 @@ func awsEc2query_deserializeOpErrorMoveByoipCidrToIpam(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpMoveCapacityReservationInstances struct { +type awsEc2query_deserializeOpMonitorInstances struct { } -func (*awsEc2query_deserializeOpMoveCapacityReservationInstances) ID() string { +func (*awsEc2query_deserializeOpMonitorInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpMoveCapacityReservationInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpMonitorInstances) 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) @@ -52722,9 +52722,9 @@ func (m *awsEc2query_deserializeOpMoveCapacityReservationInstances) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorMoveCapacityReservationInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorMonitorInstances(response, &metadata) } - output := &MoveCapacityReservationInstancesOutput{} + output := &MonitorInstancesOutput{} out.Result = output var buff [1024]byte @@ -52745,7 +52745,7 @@ func (m *awsEc2query_deserializeOpMoveCapacityReservationInstances) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentMoveCapacityReservationInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentMonitorInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52759,7 +52759,7 @@ func (m *awsEc2query_deserializeOpMoveCapacityReservationInstances) HandleDeseri return out, metadata, err } -func awsEc2query_deserializeOpErrorMoveCapacityReservationInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorMonitorInstances(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)} @@ -52792,14 +52792,14 @@ func awsEc2query_deserializeOpErrorMoveCapacityReservationInstances(response *sm } } -type awsEc2query_deserializeOpProvisionByoipCidr struct { +type awsEc2query_deserializeOpMoveAddressToVpc struct { } -func (*awsEc2query_deserializeOpProvisionByoipCidr) ID() string { +func (*awsEc2query_deserializeOpMoveAddressToVpc) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpMoveAddressToVpc) 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) @@ -52817,9 +52817,9 @@ func (m *awsEc2query_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionByoipCidr(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorMoveAddressToVpc(response, &metadata) } - output := &ProvisionByoipCidrOutput{} + output := &MoveAddressToVpcOutput{} out.Result = output var buff [1024]byte @@ -52840,7 +52840,7 @@ func (m *awsEc2query_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionByoipCidrOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentMoveAddressToVpcOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52854,7 +52854,7 @@ func (m *awsEc2query_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx cont return out, metadata, err } -func awsEc2query_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorMoveAddressToVpc(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)} @@ -52887,14 +52887,14 @@ func awsEc2query_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Respo } } -type awsEc2query_deserializeOpProvisionIpamByoasn struct { +type awsEc2query_deserializeOpMoveByoipCidrToIpam struct { } -func (*awsEc2query_deserializeOpProvisionIpamByoasn) ID() string { +func (*awsEc2query_deserializeOpMoveByoipCidrToIpam) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpProvisionIpamByoasn) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpMoveByoipCidrToIpam) 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) @@ -52912,9 +52912,9 @@ func (m *awsEc2query_deserializeOpProvisionIpamByoasn) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionIpamByoasn(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorMoveByoipCidrToIpam(response, &metadata) } - output := &ProvisionIpamByoasnOutput{} + output := &MoveByoipCidrToIpamOutput{} out.Result = output var buff [1024]byte @@ -52935,7 +52935,7 @@ func (m *awsEc2query_deserializeOpProvisionIpamByoasn) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionIpamByoasnOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentMoveByoipCidrToIpamOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -52949,7 +52949,7 @@ func (m *awsEc2query_deserializeOpProvisionIpamByoasn) HandleDeserialize(ctx con return out, metadata, err } -func awsEc2query_deserializeOpErrorProvisionIpamByoasn(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorMoveByoipCidrToIpam(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)} @@ -52982,14 +52982,14 @@ func awsEc2query_deserializeOpErrorProvisionIpamByoasn(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpProvisionIpamPoolCidr struct { +type awsEc2query_deserializeOpMoveCapacityReservationInstances struct { } -func (*awsEc2query_deserializeOpProvisionIpamPoolCidr) ID() string { +func (*awsEc2query_deserializeOpMoveCapacityReservationInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpProvisionIpamPoolCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpMoveCapacityReservationInstances) 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) @@ -53007,9 +53007,9 @@ func (m *awsEc2query_deserializeOpProvisionIpamPoolCidr) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionIpamPoolCidr(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorMoveCapacityReservationInstances(response, &metadata) } - output := &ProvisionIpamPoolCidrOutput{} + output := &MoveCapacityReservationInstancesOutput{} out.Result = output var buff [1024]byte @@ -53030,7 +53030,7 @@ func (m *awsEc2query_deserializeOpProvisionIpamPoolCidr) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionIpamPoolCidrOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentMoveCapacityReservationInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53044,7 +53044,7 @@ func (m *awsEc2query_deserializeOpProvisionIpamPoolCidr) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorProvisionIpamPoolCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorMoveCapacityReservationInstances(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)} @@ -53077,14 +53077,14 @@ func awsEc2query_deserializeOpErrorProvisionIpamPoolCidr(response *smithyhttp.Re } } -type awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr struct { +type awsEc2query_deserializeOpProvisionByoipCidr struct { } -func (*awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) ID() string { +func (*awsEc2query_deserializeOpProvisionByoipCidr) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpProvisionByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -53102,9 +53102,9 @@ func (m *awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorProvisionPublicIpv4PoolCidr(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorProvisionByoipCidr(response, &metadata) } - output := &ProvisionPublicIpv4PoolCidrOutput{} + output := &ProvisionByoipCidrOutput{} out.Result = output var buff [1024]byte @@ -53125,7 +53125,7 @@ func (m *awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentProvisionPublicIpv4PoolCidrOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentProvisionByoipCidrOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53139,7 +53139,7 @@ func (m *awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) HandleDeserialize return out, metadata, err } -func awsEc2query_deserializeOpErrorProvisionPublicIpv4PoolCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorProvisionByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -53172,14 +53172,14 @@ func awsEc2query_deserializeOpErrorProvisionPublicIpv4PoolCidr(response *smithyh } } -type awsEc2query_deserializeOpPurchaseCapacityBlock struct { +type awsEc2query_deserializeOpProvisionIpamByoasn struct { } -func (*awsEc2query_deserializeOpPurchaseCapacityBlock) ID() string { +func (*awsEc2query_deserializeOpProvisionIpamByoasn) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpPurchaseCapacityBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpProvisionIpamByoasn) 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) @@ -53197,9 +53197,9 @@ func (m *awsEc2query_deserializeOpPurchaseCapacityBlock) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseCapacityBlock(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorProvisionIpamByoasn(response, &metadata) } - output := &PurchaseCapacityBlockOutput{} + output := &ProvisionIpamByoasnOutput{} out.Result = output var buff [1024]byte @@ -53220,7 +53220,7 @@ func (m *awsEc2query_deserializeOpPurchaseCapacityBlock) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseCapacityBlockOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentProvisionIpamByoasnOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53234,7 +53234,7 @@ func (m *awsEc2query_deserializeOpPurchaseCapacityBlock) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorPurchaseCapacityBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorProvisionIpamByoasn(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)} @@ -53267,14 +53267,14 @@ func awsEc2query_deserializeOpErrorPurchaseCapacityBlock(response *smithyhttp.Re } } -type awsEc2query_deserializeOpPurchaseHostReservation struct { +type awsEc2query_deserializeOpProvisionIpamPoolCidr struct { } -func (*awsEc2query_deserializeOpPurchaseHostReservation) ID() string { +func (*awsEc2query_deserializeOpProvisionIpamPoolCidr) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpPurchaseHostReservation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpProvisionIpamPoolCidr) 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) @@ -53292,9 +53292,9 @@ func (m *awsEc2query_deserializeOpPurchaseHostReservation) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseHostReservation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorProvisionIpamPoolCidr(response, &metadata) } - output := &PurchaseHostReservationOutput{} + output := &ProvisionIpamPoolCidrOutput{} out.Result = output var buff [1024]byte @@ -53315,7 +53315,7 @@ func (m *awsEc2query_deserializeOpPurchaseHostReservation) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseHostReservationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentProvisionIpamPoolCidrOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53329,7 +53329,7 @@ func (m *awsEc2query_deserializeOpPurchaseHostReservation) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorPurchaseHostReservation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorProvisionIpamPoolCidr(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)} @@ -53362,14 +53362,14 @@ func awsEc2query_deserializeOpErrorPurchaseHostReservation(response *smithyhttp. } } -type awsEc2query_deserializeOpPurchaseReservedInstancesOffering struct { +type awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr struct { } -func (*awsEc2query_deserializeOpPurchaseReservedInstancesOffering) ID() string { +func (*awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpPurchaseReservedInstancesOffering) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpProvisionPublicIpv4PoolCidr) 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) @@ -53387,9 +53387,9 @@ func (m *awsEc2query_deserializeOpPurchaseReservedInstancesOffering) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseReservedInstancesOffering(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorProvisionPublicIpv4PoolCidr(response, &metadata) } - output := &PurchaseReservedInstancesOfferingOutput{} + output := &ProvisionPublicIpv4PoolCidrOutput{} out.Result = output var buff [1024]byte @@ -53410,7 +53410,7 @@ func (m *awsEc2query_deserializeOpPurchaseReservedInstancesOffering) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseReservedInstancesOfferingOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentProvisionPublicIpv4PoolCidrOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53424,7 +53424,7 @@ func (m *awsEc2query_deserializeOpPurchaseReservedInstancesOffering) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorPurchaseReservedInstancesOffering(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorProvisionPublicIpv4PoolCidr(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)} @@ -53457,14 +53457,14 @@ func awsEc2query_deserializeOpErrorPurchaseReservedInstancesOffering(response *s } } -type awsEc2query_deserializeOpPurchaseScheduledInstances struct { +type awsEc2query_deserializeOpPurchaseCapacityBlock struct { } -func (*awsEc2query_deserializeOpPurchaseScheduledInstances) ID() string { +func (*awsEc2query_deserializeOpPurchaseCapacityBlock) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpPurchaseScheduledInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpPurchaseCapacityBlock) 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) @@ -53482,9 +53482,9 @@ func (m *awsEc2query_deserializeOpPurchaseScheduledInstances) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorPurchaseScheduledInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorPurchaseCapacityBlock(response, &metadata) } - output := &PurchaseScheduledInstancesOutput{} + output := &PurchaseCapacityBlockOutput{} out.Result = output var buff [1024]byte @@ -53505,7 +53505,7 @@ func (m *awsEc2query_deserializeOpPurchaseScheduledInstances) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentPurchaseScheduledInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentPurchaseCapacityBlockOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53519,7 +53519,7 @@ func (m *awsEc2query_deserializeOpPurchaseScheduledInstances) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorPurchaseScheduledInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorPurchaseCapacityBlock(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)} @@ -53552,14 +53552,14 @@ func awsEc2query_deserializeOpErrorPurchaseScheduledInstances(response *smithyht } } -type awsEc2query_deserializeOpRebootInstances struct { +type awsEc2query_deserializeOpPurchaseHostReservation struct { } -func (*awsEc2query_deserializeOpRebootInstances) ID() string { +func (*awsEc2query_deserializeOpPurchaseHostReservation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRebootInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpPurchaseHostReservation) 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) @@ -53577,21 +53577,44 @@ func (m *awsEc2query_deserializeOpRebootInstances) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRebootInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorPurchaseHostReservation(response, &metadata) } - output := &RebootInstancesOutput{} + output := &PurchaseHostReservationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } } + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentPurchaseHostReservationOutput(&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_deserializeOpErrorRebootInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorPurchaseHostReservation(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)} @@ -53624,14 +53647,14 @@ func awsEc2query_deserializeOpErrorRebootInstances(response *smithyhttp.Response } } -type awsEc2query_deserializeOpRegisterImage struct { +type awsEc2query_deserializeOpPurchaseReservedInstancesOffering struct { } -func (*awsEc2query_deserializeOpRegisterImage) ID() string { +func (*awsEc2query_deserializeOpPurchaseReservedInstancesOffering) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRegisterImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpPurchaseReservedInstancesOffering) 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) @@ -53649,9 +53672,9 @@ func (m *awsEc2query_deserializeOpRegisterImage) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterImage(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorPurchaseReservedInstancesOffering(response, &metadata) } - output := &RegisterImageOutput{} + output := &PurchaseReservedInstancesOfferingOutput{} out.Result = output var buff [1024]byte @@ -53672,7 +53695,7 @@ func (m *awsEc2query_deserializeOpRegisterImage) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRegisterImageOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentPurchaseReservedInstancesOfferingOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53686,7 +53709,7 @@ func (m *awsEc2query_deserializeOpRegisterImage) HandleDeserialize(ctx context.C return out, metadata, err } -func awsEc2query_deserializeOpErrorRegisterImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorPurchaseReservedInstancesOffering(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)} @@ -53719,14 +53742,14 @@ func awsEc2query_deserializeOpErrorRegisterImage(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes struct { +type awsEc2query_deserializeOpPurchaseScheduledInstances struct { } -func (*awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) ID() string { +func (*awsEc2query_deserializeOpPurchaseScheduledInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpPurchaseScheduledInstances) 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) @@ -53744,9 +53767,9 @@ func (m *awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterInstanceEventNotificationAttributes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorPurchaseScheduledInstances(response, &metadata) } - output := &RegisterInstanceEventNotificationAttributesOutput{} + output := &PurchaseScheduledInstancesOutput{} out.Result = output var buff [1024]byte @@ -53767,7 +53790,7 @@ func (m *awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) H } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRegisterInstanceEventNotificationAttributesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentPurchaseScheduledInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53781,7 +53804,7 @@ func (m *awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) H return out, metadata, err } -func awsEc2query_deserializeOpErrorRegisterInstanceEventNotificationAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorPurchaseScheduledInstances(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)} @@ -53814,14 +53837,14 @@ func awsEc2query_deserializeOpErrorRegisterInstanceEventNotificationAttributes(r } } -type awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers struct { +type awsEc2query_deserializeOpRebootInstances struct { } -func (*awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers) ID() string { +func (*awsEc2query_deserializeOpRebootInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRebootInstances) 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) @@ -53839,44 +53862,21 @@ func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupMembers(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRebootInstances(response, &metadata) } - output := &RegisterTransitGatewayMulticastGroupMembersOutput{} + output := &RebootInstancesOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentRegisterTransitGatewayMulticastGroupMembersOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRebootInstances(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)} @@ -53909,14 +53909,14 @@ func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupMembers(r } } -type awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources struct { +type awsEc2query_deserializeOpRegisterImage struct { } -func (*awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) ID() string { +func (*awsEc2query_deserializeOpRegisterImage) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRegisterImage) 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) @@ -53934,9 +53934,9 @@ func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) H } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupSources(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRegisterImage(response, &metadata) } - output := &RegisterTransitGatewayMulticastGroupSourcesOutput{} + output := &RegisterImageOutput{} out.Result = output var buff [1024]byte @@ -53957,7 +53957,7 @@ func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) H } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRegisterTransitGatewayMulticastGroupSourcesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRegisterImageOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -53971,7 +53971,7 @@ func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) H return out, metadata, err } -func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupSources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRegisterImage(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)} @@ -54004,14 +54004,14 @@ func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupSources(r } } -type awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership struct { +type awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes struct { } -func (*awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) ID() string { +func (*awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRegisterInstanceEventNotificationAttributes) 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) @@ -54029,9 +54029,9 @@ func (m *awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectCapacityReservationBillingOwnership(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRegisterInstanceEventNotificationAttributes(response, &metadata) } - output := &RejectCapacityReservationBillingOwnershipOutput{} + output := &RegisterInstanceEventNotificationAttributesOutput{} out.Result = output var buff [1024]byte @@ -54052,7 +54052,7 @@ func (m *awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) Han } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectCapacityReservationBillingOwnershipOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRegisterInstanceEventNotificationAttributesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54066,7 +54066,7 @@ func (m *awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) Han return out, metadata, err } -func awsEc2query_deserializeOpErrorRejectCapacityReservationBillingOwnership(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRegisterInstanceEventNotificationAttributes(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)} @@ -54099,14 +54099,14 @@ func awsEc2query_deserializeOpErrorRejectCapacityReservationBillingOwnership(res } } -type awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations struct { +type awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers struct { } -func (*awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations) ID() string { +func (*awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupMembers) 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) @@ -54124,9 +54124,9 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociation } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayMulticastDomainAssociations(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupMembers(response, &metadata) } - output := &RejectTransitGatewayMulticastDomainAssociationsOutput{} + output := &RegisterTransitGatewayMulticastGroupMembersOutput{} out.Result = output var buff [1024]byte @@ -54147,7 +54147,7 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociation } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectTransitGatewayMulticastDomainAssociationsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRegisterTransitGatewayMulticastGroupMembersOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54161,7 +54161,7 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociation return out, metadata, err } -func awsEc2query_deserializeOpErrorRejectTransitGatewayMulticastDomainAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupMembers(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)} @@ -54194,14 +54194,14 @@ func awsEc2query_deserializeOpErrorRejectTransitGatewayMulticastDomainAssociatio } } -type awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment struct { +type awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources struct { } -func (*awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) ID() string { +func (*awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRegisterTransitGatewayMulticastGroupSources) 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) @@ -54219,9 +54219,9 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayPeeringAttachment(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupSources(response, &metadata) } - output := &RejectTransitGatewayPeeringAttachmentOutput{} + output := &RegisterTransitGatewayMulticastGroupSourcesOutput{} out.Result = output var buff [1024]byte @@ -54242,7 +54242,7 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) HandleD } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectTransitGatewayPeeringAttachmentOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRegisterTransitGatewayMulticastGroupSourcesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54256,7 +54256,7 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) HandleD return out, metadata, err } -func awsEc2query_deserializeOpErrorRejectTransitGatewayPeeringAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRegisterTransitGatewayMulticastGroupSources(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)} @@ -54289,14 +54289,14 @@ func awsEc2query_deserializeOpErrorRejectTransitGatewayPeeringAttachment(respons } } -type awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment struct { +type awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership struct { } -func (*awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) ID() string { +func (*awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRejectCapacityReservationBillingOwnership) 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) @@ -54314,9 +54314,9 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayVpcAttachment(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRejectCapacityReservationBillingOwnership(response, &metadata) } - output := &RejectTransitGatewayVpcAttachmentOutput{} + output := &RejectCapacityReservationBillingOwnershipOutput{} out.Result = output var buff [1024]byte @@ -54337,7 +54337,7 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectTransitGatewayVpcAttachmentOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRejectCapacityReservationBillingOwnershipOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54351,7 +54351,7 @@ func (m *awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) HandleDeser return out, metadata, err } -func awsEc2query_deserializeOpErrorRejectTransitGatewayVpcAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRejectCapacityReservationBillingOwnership(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)} @@ -54384,14 +54384,14 @@ func awsEc2query_deserializeOpErrorRejectTransitGatewayVpcAttachment(response *s } } -type awsEc2query_deserializeOpRejectVpcEndpointConnections struct { +type awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations struct { } -func (*awsEc2query_deserializeOpRejectVpcEndpointConnections) ID() string { +func (*awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRejectVpcEndpointConnections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRejectTransitGatewayMulticastDomainAssociations) 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) @@ -54409,9 +54409,9 @@ func (m *awsEc2query_deserializeOpRejectVpcEndpointConnections) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectVpcEndpointConnections(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayMulticastDomainAssociations(response, &metadata) } - output := &RejectVpcEndpointConnectionsOutput{} + output := &RejectTransitGatewayMulticastDomainAssociationsOutput{} out.Result = output var buff [1024]byte @@ -54432,7 +54432,7 @@ func (m *awsEc2query_deserializeOpRejectVpcEndpointConnections) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectVpcEndpointConnectionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRejectTransitGatewayMulticastDomainAssociationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54446,7 +54446,7 @@ func (m *awsEc2query_deserializeOpRejectVpcEndpointConnections) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorRejectVpcEndpointConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRejectTransitGatewayMulticastDomainAssociations(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)} @@ -54479,14 +54479,14 @@ func awsEc2query_deserializeOpErrorRejectVpcEndpointConnections(response *smithy } } -type awsEc2query_deserializeOpRejectVpcPeeringConnection struct { +type awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment struct { } -func (*awsEc2query_deserializeOpRejectVpcPeeringConnection) ID() string { +func (*awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRejectVpcPeeringConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRejectTransitGatewayPeeringAttachment) 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) @@ -54504,9 +54504,9 @@ func (m *awsEc2query_deserializeOpRejectVpcPeeringConnection) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRejectVpcPeeringConnection(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayPeeringAttachment(response, &metadata) } - output := &RejectVpcPeeringConnectionOutput{} + output := &RejectTransitGatewayPeeringAttachmentOutput{} out.Result = output var buff [1024]byte @@ -54527,7 +54527,7 @@ func (m *awsEc2query_deserializeOpRejectVpcPeeringConnection) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRejectVpcPeeringConnectionOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRejectTransitGatewayPeeringAttachmentOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54541,7 +54541,7 @@ func (m *awsEc2query_deserializeOpRejectVpcPeeringConnection) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorRejectVpcPeeringConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRejectTransitGatewayPeeringAttachment(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)} @@ -54574,14 +54574,14 @@ func awsEc2query_deserializeOpErrorRejectVpcPeeringConnection(response *smithyht } } -type awsEc2query_deserializeOpReleaseAddress struct { +type awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment struct { } -func (*awsEc2query_deserializeOpReleaseAddress) ID() string { +func (*awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReleaseAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRejectTransitGatewayVpcAttachment) 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) @@ -54599,21 +54599,44 @@ func (m *awsEc2query_deserializeOpReleaseAddress) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReleaseAddress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRejectTransitGatewayVpcAttachment(response, &metadata) } - output := &ReleaseAddressOutput{} + output := &RejectTransitGatewayVpcAttachmentOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } } + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentRejectTransitGatewayVpcAttachmentOutput(&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_deserializeOpErrorReleaseAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRejectTransitGatewayVpcAttachment(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)} @@ -54646,14 +54669,14 @@ func awsEc2query_deserializeOpErrorReleaseAddress(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpReleaseHosts struct { +type awsEc2query_deserializeOpRejectVpcEndpointConnections struct { } -func (*awsEc2query_deserializeOpReleaseHosts) ID() string { +func (*awsEc2query_deserializeOpRejectVpcEndpointConnections) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReleaseHosts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRejectVpcEndpointConnections) 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) @@ -54671,9 +54694,9 @@ func (m *awsEc2query_deserializeOpReleaseHosts) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReleaseHosts(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRejectVpcEndpointConnections(response, &metadata) } - output := &ReleaseHostsOutput{} + output := &RejectVpcEndpointConnectionsOutput{} out.Result = output var buff [1024]byte @@ -54694,7 +54717,7 @@ func (m *awsEc2query_deserializeOpReleaseHosts) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReleaseHostsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRejectVpcEndpointConnectionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54708,7 +54731,7 @@ func (m *awsEc2query_deserializeOpReleaseHosts) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsEc2query_deserializeOpErrorReleaseHosts(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRejectVpcEndpointConnections(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)} @@ -54741,14 +54764,14 @@ func awsEc2query_deserializeOpErrorReleaseHosts(response *smithyhttp.Response, m } } -type awsEc2query_deserializeOpReleaseIpamPoolAllocation struct { +type awsEc2query_deserializeOpRejectVpcPeeringConnection struct { } -func (*awsEc2query_deserializeOpReleaseIpamPoolAllocation) ID() string { +func (*awsEc2query_deserializeOpRejectVpcPeeringConnection) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReleaseIpamPoolAllocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRejectVpcPeeringConnection) 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) @@ -54766,9 +54789,9 @@ func (m *awsEc2query_deserializeOpReleaseIpamPoolAllocation) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReleaseIpamPoolAllocation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRejectVpcPeeringConnection(response, &metadata) } - output := &ReleaseIpamPoolAllocationOutput{} + output := &RejectVpcPeeringConnectionOutput{} out.Result = output var buff [1024]byte @@ -54789,7 +54812,7 @@ func (m *awsEc2query_deserializeOpReleaseIpamPoolAllocation) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReleaseIpamPoolAllocationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRejectVpcPeeringConnectionOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54803,7 +54826,7 @@ func (m *awsEc2query_deserializeOpReleaseIpamPoolAllocation) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorReleaseIpamPoolAllocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRejectVpcPeeringConnection(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)} @@ -54836,14 +54859,14 @@ func awsEc2query_deserializeOpErrorReleaseIpamPoolAllocation(response *smithyhtt } } -type awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation struct { +type awsEc2query_deserializeOpReleaseAddress struct { } -func (*awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation) ID() string { +func (*awsEc2query_deserializeOpReleaseAddress) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReleaseAddress) 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) @@ -54861,44 +54884,21 @@ func (m *awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceIamInstanceProfileAssociation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReleaseAddress(response, &metadata) } - output := &ReplaceIamInstanceProfileAssociationOutput{} + output := &ReleaseAddressOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentReplaceIamInstanceProfileAssociationOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorReplaceIamInstanceProfileAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReleaseAddress(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)} @@ -54931,14 +54931,14 @@ func awsEc2query_deserializeOpErrorReplaceIamInstanceProfileAssociation(response } } -type awsEc2query_deserializeOpReplaceNetworkAclAssociation struct { +type awsEc2query_deserializeOpReleaseHosts struct { } -func (*awsEc2query_deserializeOpReplaceNetworkAclAssociation) ID() string { +func (*awsEc2query_deserializeOpReleaseHosts) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReplaceNetworkAclAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReleaseHosts) 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) @@ -54956,9 +54956,9 @@ func (m *awsEc2query_deserializeOpReplaceNetworkAclAssociation) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceNetworkAclAssociation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReleaseHosts(response, &metadata) } - output := &ReplaceNetworkAclAssociationOutput{} + output := &ReleaseHostsOutput{} out.Result = output var buff [1024]byte @@ -54979,7 +54979,7 @@ func (m *awsEc2query_deserializeOpReplaceNetworkAclAssociation) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceNetworkAclAssociationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentReleaseHostsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -54993,7 +54993,7 @@ func (m *awsEc2query_deserializeOpReplaceNetworkAclAssociation) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorReplaceNetworkAclAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReleaseHosts(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)} @@ -55026,14 +55026,14 @@ func awsEc2query_deserializeOpErrorReplaceNetworkAclAssociation(response *smithy } } -type awsEc2query_deserializeOpReplaceNetworkAclEntry struct { +type awsEc2query_deserializeOpReleaseIpamPoolAllocation struct { } -func (*awsEc2query_deserializeOpReplaceNetworkAclEntry) ID() string { +func (*awsEc2query_deserializeOpReleaseIpamPoolAllocation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReplaceNetworkAclEntry) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReleaseIpamPoolAllocation) 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) @@ -55051,21 +55051,44 @@ func (m *awsEc2query_deserializeOpReplaceNetworkAclEntry) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceNetworkAclEntry(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReleaseIpamPoolAllocation(response, &metadata) } - output := &ReplaceNetworkAclEntryOutput{} + output := &ReleaseIpamPoolAllocationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentReleaseIpamPoolAllocationOutput(&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_deserializeOpErrorReplaceNetworkAclEntry(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReleaseIpamPoolAllocation(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)} @@ -55098,14 +55121,14 @@ func awsEc2query_deserializeOpErrorReplaceNetworkAclEntry(response *smithyhttp.R } } -type awsEc2query_deserializeOpReplaceRoute struct { +type awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation struct { } -func (*awsEc2query_deserializeOpReplaceRoute) ID() string { +func (*awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReplaceRoute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReplaceIamInstanceProfileAssociation) 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) @@ -55123,21 +55146,44 @@ func (m *awsEc2query_deserializeOpReplaceRoute) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceRoute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReplaceIamInstanceProfileAssociation(response, &metadata) } - output := &ReplaceRouteOutput{} + output := &ReplaceIamInstanceProfileAssociationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } } + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentReplaceIamInstanceProfileAssociationOutput(&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_deserializeOpErrorReplaceRoute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReplaceIamInstanceProfileAssociation(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)} @@ -55170,14 +55216,14 @@ func awsEc2query_deserializeOpErrorReplaceRoute(response *smithyhttp.Response, m } } -type awsEc2query_deserializeOpReplaceRouteTableAssociation struct { +type awsEc2query_deserializeOpReplaceNetworkAclAssociation struct { } -func (*awsEc2query_deserializeOpReplaceRouteTableAssociation) ID() string { +func (*awsEc2query_deserializeOpReplaceNetworkAclAssociation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReplaceRouteTableAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReplaceNetworkAclAssociation) 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) @@ -55195,9 +55241,9 @@ func (m *awsEc2query_deserializeOpReplaceRouteTableAssociation) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceRouteTableAssociation(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReplaceNetworkAclAssociation(response, &metadata) } - output := &ReplaceRouteTableAssociationOutput{} + output := &ReplaceNetworkAclAssociationOutput{} out.Result = output var buff [1024]byte @@ -55218,7 +55264,7 @@ func (m *awsEc2query_deserializeOpReplaceRouteTableAssociation) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceRouteTableAssociationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentReplaceNetworkAclAssociationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -55232,7 +55278,7 @@ func (m *awsEc2query_deserializeOpReplaceRouteTableAssociation) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorReplaceRouteTableAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReplaceNetworkAclAssociation(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)} @@ -55265,14 +55311,14 @@ func awsEc2query_deserializeOpErrorReplaceRouteTableAssociation(response *smithy } } -type awsEc2query_deserializeOpReplaceTransitGatewayRoute struct { +type awsEc2query_deserializeOpReplaceNetworkAclEntry struct { } -func (*awsEc2query_deserializeOpReplaceTransitGatewayRoute) ID() string { +func (*awsEc2query_deserializeOpReplaceNetworkAclEntry) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReplaceTransitGatewayRoute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReplaceNetworkAclEntry) 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) @@ -55290,44 +55336,93 @@ func (m *awsEc2query_deserializeOpReplaceTransitGatewayRoute) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReplaceNetworkAclEntry(response, &metadata) } - output := &ReplaceTransitGatewayRouteOutput{} + output := &ReplaceNetworkAclEntryOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceTransitGatewayRouteOutput(&output, decoder) + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorReplaceNetworkAclEntry(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 { - 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 + } + 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_deserializeOpReplaceRoute struct { +} + +func (*awsEc2query_deserializeOpReplaceRoute) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpReplaceRoute) 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 } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorReplaceRoute(response, &metadata) + } + output := &ReplaceRouteOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + return out, metadata, err } -func awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReplaceRoute(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)} @@ -55360,14 +55455,14 @@ func awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(response *smithyht } } -type awsEc2query_deserializeOpReplaceVpnTunnel struct { +type awsEc2query_deserializeOpReplaceRouteTableAssociation struct { } -func (*awsEc2query_deserializeOpReplaceVpnTunnel) ID() string { +func (*awsEc2query_deserializeOpReplaceRouteTableAssociation) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReplaceVpnTunnel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReplaceRouteTableAssociation) 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) @@ -55385,9 +55480,9 @@ func (m *awsEc2query_deserializeOpReplaceVpnTunnel) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReplaceVpnTunnel(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReplaceRouteTableAssociation(response, &metadata) } - output := &ReplaceVpnTunnelOutput{} + output := &ReplaceRouteTableAssociationOutput{} out.Result = output var buff [1024]byte @@ -55408,7 +55503,7 @@ func (m *awsEc2query_deserializeOpReplaceVpnTunnel) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentReplaceVpnTunnelOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentReplaceRouteTableAssociationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -55422,7 +55517,7 @@ func (m *awsEc2query_deserializeOpReplaceVpnTunnel) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorReplaceVpnTunnel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReplaceRouteTableAssociation(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)} @@ -55455,14 +55550,14 @@ func awsEc2query_deserializeOpErrorReplaceVpnTunnel(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpReportInstanceStatus struct { +type awsEc2query_deserializeOpReplaceTransitGatewayRoute struct { } -func (*awsEc2query_deserializeOpReportInstanceStatus) ID() string { +func (*awsEc2query_deserializeOpReplaceTransitGatewayRoute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpReportInstanceStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReplaceTransitGatewayRoute) 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) @@ -55480,21 +55575,44 @@ func (m *awsEc2query_deserializeOpReportInstanceStatus) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorReportInstanceStatus(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(response, &metadata) } - output := &ReportInstanceStatusOutput{} + output := &ReplaceTransitGatewayRouteOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentReplaceTransitGatewayRouteOutput(&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_deserializeOpErrorReportInstanceStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReplaceTransitGatewayRoute(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)} @@ -55527,14 +55645,14 @@ func awsEc2query_deserializeOpErrorReportInstanceStatus(response *smithyhttp.Res } } -type awsEc2query_deserializeOpRequestSpotFleet struct { +type awsEc2query_deserializeOpReplaceVpnTunnel struct { } -func (*awsEc2query_deserializeOpRequestSpotFleet) ID() string { +func (*awsEc2query_deserializeOpReplaceVpnTunnel) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRequestSpotFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReplaceVpnTunnel) 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) @@ -55552,9 +55670,9 @@ func (m *awsEc2query_deserializeOpRequestSpotFleet) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRequestSpotFleet(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReplaceVpnTunnel(response, &metadata) } - output := &RequestSpotFleetOutput{} + output := &ReplaceVpnTunnelOutput{} out.Result = output var buff [1024]byte @@ -55575,7 +55693,7 @@ func (m *awsEc2query_deserializeOpRequestSpotFleet) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRequestSpotFleetOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentReplaceVpnTunnelOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -55589,7 +55707,7 @@ func (m *awsEc2query_deserializeOpRequestSpotFleet) HandleDeserialize(ctx contex return out, metadata, err } -func awsEc2query_deserializeOpErrorRequestSpotFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReplaceVpnTunnel(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)} @@ -55622,14 +55740,14 @@ func awsEc2query_deserializeOpErrorRequestSpotFleet(response *smithyhttp.Respons } } -type awsEc2query_deserializeOpRequestSpotInstances struct { +type awsEc2query_deserializeOpReportInstanceStatus struct { } -func (*awsEc2query_deserializeOpRequestSpotInstances) ID() string { +func (*awsEc2query_deserializeOpReportInstanceStatus) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRequestSpotInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpReportInstanceStatus) 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) @@ -55647,44 +55765,21 @@ func (m *awsEc2query_deserializeOpRequestSpotInstances) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRequestSpotInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorReportInstanceStatus(response, &metadata) } - output := &RequestSpotInstancesOutput{} + output := &ReportInstanceStatusOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentRequestSpotInstancesOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorRequestSpotInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorReportInstanceStatus(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)} @@ -55717,14 +55812,14 @@ func awsEc2query_deserializeOpErrorRequestSpotInstances(response *smithyhttp.Res } } -type awsEc2query_deserializeOpResetAddressAttribute struct { +type awsEc2query_deserializeOpRequestSpotFleet struct { } -func (*awsEc2query_deserializeOpResetAddressAttribute) ID() string { +func (*awsEc2query_deserializeOpRequestSpotFleet) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpResetAddressAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRequestSpotFleet) 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) @@ -55742,9 +55837,9 @@ func (m *awsEc2query_deserializeOpResetAddressAttribute) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetAddressAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRequestSpotFleet(response, &metadata) } - output := &ResetAddressAttributeOutput{} + output := &RequestSpotFleetOutput{} out.Result = output var buff [1024]byte @@ -55765,7 +55860,7 @@ func (m *awsEc2query_deserializeOpResetAddressAttribute) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentResetAddressAttributeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRequestSpotFleetOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -55779,7 +55874,7 @@ func (m *awsEc2query_deserializeOpResetAddressAttribute) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorResetAddressAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRequestSpotFleet(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)} @@ -55812,14 +55907,14 @@ func awsEc2query_deserializeOpErrorResetAddressAttribute(response *smithyhttp.Re } } -type awsEc2query_deserializeOpResetEbsDefaultKmsKeyId struct { +type awsEc2query_deserializeOpRequestSpotInstances struct { } -func (*awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) ID() string { +func (*awsEc2query_deserializeOpRequestSpotInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRequestSpotInstances) 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) @@ -55837,9 +55932,9 @@ func (m *awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetEbsDefaultKmsKeyId(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRequestSpotInstances(response, &metadata) } - output := &ResetEbsDefaultKmsKeyIdOutput{} + output := &RequestSpotInstancesOutput{} out.Result = output var buff [1024]byte @@ -55860,7 +55955,7 @@ func (m *awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentResetEbsDefaultKmsKeyIdOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRequestSpotInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -55874,7 +55969,7 @@ func (m *awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorResetEbsDefaultKmsKeyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRequestSpotInstances(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)} @@ -55907,14 +56002,14 @@ func awsEc2query_deserializeOpErrorResetEbsDefaultKmsKeyId(response *smithyhttp. } } -type awsEc2query_deserializeOpResetFpgaImageAttribute struct { +type awsEc2query_deserializeOpResetAddressAttribute struct { } -func (*awsEc2query_deserializeOpResetFpgaImageAttribute) ID() string { +func (*awsEc2query_deserializeOpResetAddressAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpResetFpgaImageAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpResetAddressAttribute) 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) @@ -55932,9 +56027,9 @@ func (m *awsEc2query_deserializeOpResetFpgaImageAttribute) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetFpgaImageAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorResetAddressAttribute(response, &metadata) } - output := &ResetFpgaImageAttributeOutput{} + output := &ResetAddressAttributeOutput{} out.Result = output var buff [1024]byte @@ -55955,7 +56050,7 @@ func (m *awsEc2query_deserializeOpResetFpgaImageAttribute) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentResetFpgaImageAttributeOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentResetAddressAttributeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -55969,7 +56064,7 @@ func (m *awsEc2query_deserializeOpResetFpgaImageAttribute) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorResetFpgaImageAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorResetAddressAttribute(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)} @@ -56002,14 +56097,14 @@ func awsEc2query_deserializeOpErrorResetFpgaImageAttribute(response *smithyhttp. } } -type awsEc2query_deserializeOpResetImageAttribute struct { +type awsEc2query_deserializeOpResetEbsDefaultKmsKeyId struct { } -func (*awsEc2query_deserializeOpResetImageAttribute) ID() string { +func (*awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpResetImageAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpResetEbsDefaultKmsKeyId) 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) @@ -56027,21 +56122,44 @@ func (m *awsEc2query_deserializeOpResetImageAttribute) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetImageAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorResetEbsDefaultKmsKeyId(response, &metadata) } - output := &ResetImageAttributeOutput{} + output := &ResetEbsDefaultKmsKeyIdOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } } + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentResetEbsDefaultKmsKeyIdOutput(&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_deserializeOpErrorResetImageAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorResetEbsDefaultKmsKeyId(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)} @@ -56074,14 +56192,14 @@ func awsEc2query_deserializeOpErrorResetImageAttribute(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpResetInstanceAttribute struct { +type awsEc2query_deserializeOpResetFpgaImageAttribute struct { } -func (*awsEc2query_deserializeOpResetInstanceAttribute) ID() string { +func (*awsEc2query_deserializeOpResetFpgaImageAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpResetInstanceAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpResetFpgaImageAttribute) 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) @@ -56099,21 +56217,44 @@ func (m *awsEc2query_deserializeOpResetInstanceAttribute) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetInstanceAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorResetFpgaImageAttribute(response, &metadata) } - output := &ResetInstanceAttributeOutput{} + output := &ResetFpgaImageAttributeOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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 discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentResetFpgaImageAttributeOutput(&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_deserializeOpErrorResetInstanceAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorResetFpgaImageAttribute(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)} @@ -56146,14 +56287,14 @@ func awsEc2query_deserializeOpErrorResetInstanceAttribute(response *smithyhttp.R } } -type awsEc2query_deserializeOpResetNetworkInterfaceAttribute struct { +type awsEc2query_deserializeOpResetImageAttribute struct { } -func (*awsEc2query_deserializeOpResetNetworkInterfaceAttribute) ID() string { +func (*awsEc2query_deserializeOpResetImageAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpResetNetworkInterfaceAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpResetImageAttribute) 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) @@ -56171,9 +56312,9 @@ func (m *awsEc2query_deserializeOpResetNetworkInterfaceAttribute) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetNetworkInterfaceAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorResetImageAttribute(response, &metadata) } - output := &ResetNetworkInterfaceAttributeOutput{} + output := &ResetImageAttributeOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -56185,7 +56326,7 @@ func (m *awsEc2query_deserializeOpResetNetworkInterfaceAttribute) HandleDeserial return out, metadata, err } -func awsEc2query_deserializeOpErrorResetNetworkInterfaceAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorResetImageAttribute(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)} @@ -56218,14 +56359,14 @@ func awsEc2query_deserializeOpErrorResetNetworkInterfaceAttribute(response *smit } } -type awsEc2query_deserializeOpResetSnapshotAttribute struct { +type awsEc2query_deserializeOpResetInstanceAttribute struct { } -func (*awsEc2query_deserializeOpResetSnapshotAttribute) ID() string { +func (*awsEc2query_deserializeOpResetInstanceAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpResetSnapshotAttribute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpResetInstanceAttribute) 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) @@ -56243,9 +56384,9 @@ func (m *awsEc2query_deserializeOpResetSnapshotAttribute) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorResetSnapshotAttribute(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorResetInstanceAttribute(response, &metadata) } - output := &ResetSnapshotAttributeOutput{} + output := &ResetInstanceAttributeOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -56257,7 +56398,7 @@ func (m *awsEc2query_deserializeOpResetSnapshotAttribute) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorResetSnapshotAttribute(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorResetInstanceAttribute(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)} @@ -56290,14 +56431,14 @@ func awsEc2query_deserializeOpErrorResetSnapshotAttribute(response *smithyhttp.R } } -type awsEc2query_deserializeOpRestoreAddressToClassic struct { +type awsEc2query_deserializeOpResetNetworkInterfaceAttribute struct { } -func (*awsEc2query_deserializeOpRestoreAddressToClassic) ID() string { +func (*awsEc2query_deserializeOpResetNetworkInterfaceAttribute) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRestoreAddressToClassic) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpResetNetworkInterfaceAttribute) 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) @@ -56315,44 +56456,93 @@ func (m *awsEc2query_deserializeOpRestoreAddressToClassic) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreAddressToClassic(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorResetNetworkInterfaceAttribute(response, &metadata) } - output := &RestoreAddressToClassicOutput{} + output := &ResetNetworkInterfaceAttributeOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreAddressToClassicOutput(&output, decoder) + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorResetNetworkInterfaceAttribute(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 { - 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 + } + 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_deserializeOpResetSnapshotAttribute struct { +} + +func (*awsEc2query_deserializeOpResetSnapshotAttribute) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpResetSnapshotAttribute) 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 } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorResetSnapshotAttribute(response, &metadata) + } + output := &ResetSnapshotAttributeOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + return out, metadata, err } -func awsEc2query_deserializeOpErrorRestoreAddressToClassic(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorResetSnapshotAttribute(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)} @@ -56385,14 +56575,14 @@ func awsEc2query_deserializeOpErrorRestoreAddressToClassic(response *smithyhttp. } } -type awsEc2query_deserializeOpRestoreImageFromRecycleBin struct { +type awsEc2query_deserializeOpRestoreAddressToClassic struct { } -func (*awsEc2query_deserializeOpRestoreImageFromRecycleBin) ID() string { +func (*awsEc2query_deserializeOpRestoreAddressToClassic) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRestoreImageFromRecycleBin) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRestoreAddressToClassic) 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) @@ -56410,9 +56600,9 @@ func (m *awsEc2query_deserializeOpRestoreImageFromRecycleBin) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreImageFromRecycleBin(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRestoreAddressToClassic(response, &metadata) } - output := &RestoreImageFromRecycleBinOutput{} + output := &RestoreAddressToClassicOutput{} out.Result = output var buff [1024]byte @@ -56433,7 +56623,7 @@ func (m *awsEc2query_deserializeOpRestoreImageFromRecycleBin) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreImageFromRecycleBinOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRestoreAddressToClassicOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -56447,7 +56637,7 @@ func (m *awsEc2query_deserializeOpRestoreImageFromRecycleBin) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorRestoreImageFromRecycleBin(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRestoreAddressToClassic(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)} @@ -56480,14 +56670,14 @@ func awsEc2query_deserializeOpErrorRestoreImageFromRecycleBin(response *smithyht } } -type awsEc2query_deserializeOpRestoreManagedPrefixListVersion struct { +type awsEc2query_deserializeOpRestoreImageFromRecycleBin struct { } -func (*awsEc2query_deserializeOpRestoreManagedPrefixListVersion) ID() string { +func (*awsEc2query_deserializeOpRestoreImageFromRecycleBin) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRestoreManagedPrefixListVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRestoreImageFromRecycleBin) 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) @@ -56505,9 +56695,9 @@ func (m *awsEc2query_deserializeOpRestoreManagedPrefixListVersion) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreManagedPrefixListVersion(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRestoreImageFromRecycleBin(response, &metadata) } - output := &RestoreManagedPrefixListVersionOutput{} + output := &RestoreImageFromRecycleBinOutput{} out.Result = output var buff [1024]byte @@ -56528,7 +56718,7 @@ func (m *awsEc2query_deserializeOpRestoreManagedPrefixListVersion) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreManagedPrefixListVersionOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRestoreImageFromRecycleBinOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -56542,7 +56732,7 @@ func (m *awsEc2query_deserializeOpRestoreManagedPrefixListVersion) HandleDeseria return out, metadata, err } -func awsEc2query_deserializeOpErrorRestoreManagedPrefixListVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRestoreImageFromRecycleBin(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)} @@ -56575,14 +56765,14 @@ func awsEc2query_deserializeOpErrorRestoreManagedPrefixListVersion(response *smi } } -type awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin struct { +type awsEc2query_deserializeOpRestoreManagedPrefixListVersion struct { } -func (*awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) ID() string { +func (*awsEc2query_deserializeOpRestoreManagedPrefixListVersion) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRestoreManagedPrefixListVersion) 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) @@ -56600,9 +56790,9 @@ func (m *awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreSnapshotFromRecycleBin(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRestoreManagedPrefixListVersion(response, &metadata) } - output := &RestoreSnapshotFromRecycleBinOutput{} + output := &RestoreManagedPrefixListVersionOutput{} out.Result = output var buff [1024]byte @@ -56623,7 +56813,7 @@ func (m *awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreSnapshotFromRecycleBinOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRestoreManagedPrefixListVersionOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -56637,7 +56827,7 @@ func (m *awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) HandleDeseriali return out, metadata, err } -func awsEc2query_deserializeOpErrorRestoreSnapshotFromRecycleBin(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRestoreManagedPrefixListVersion(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)} @@ -56670,14 +56860,14 @@ func awsEc2query_deserializeOpErrorRestoreSnapshotFromRecycleBin(response *smith } } -type awsEc2query_deserializeOpRestoreSnapshotTier struct { +type awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin struct { } -func (*awsEc2query_deserializeOpRestoreSnapshotTier) ID() string { +func (*awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRestoreSnapshotTier) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRestoreSnapshotFromRecycleBin) 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) @@ -56695,9 +56885,9 @@ func (m *awsEc2query_deserializeOpRestoreSnapshotTier) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRestoreSnapshotTier(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRestoreSnapshotFromRecycleBin(response, &metadata) } - output := &RestoreSnapshotTierOutput{} + output := &RestoreSnapshotFromRecycleBinOutput{} out.Result = output var buff [1024]byte @@ -56718,7 +56908,7 @@ func (m *awsEc2query_deserializeOpRestoreSnapshotTier) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRestoreSnapshotTierOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRestoreSnapshotFromRecycleBinOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -56732,7 +56922,7 @@ func (m *awsEc2query_deserializeOpRestoreSnapshotTier) HandleDeserialize(ctx con return out, metadata, err } -func awsEc2query_deserializeOpErrorRestoreSnapshotTier(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRestoreSnapshotFromRecycleBin(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)} @@ -56765,14 +56955,14 @@ func awsEc2query_deserializeOpErrorRestoreSnapshotTier(response *smithyhttp.Resp } } -type awsEc2query_deserializeOpRevokeClientVpnIngress struct { +type awsEc2query_deserializeOpRestoreSnapshotTier struct { } -func (*awsEc2query_deserializeOpRevokeClientVpnIngress) ID() string { +func (*awsEc2query_deserializeOpRestoreSnapshotTier) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRevokeClientVpnIngress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRestoreSnapshotTier) 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) @@ -56790,9 +56980,9 @@ func (m *awsEc2query_deserializeOpRevokeClientVpnIngress) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRevokeClientVpnIngress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRestoreSnapshotTier(response, &metadata) } - output := &RevokeClientVpnIngressOutput{} + output := &RestoreSnapshotTierOutput{} out.Result = output var buff [1024]byte @@ -56813,7 +57003,7 @@ func (m *awsEc2query_deserializeOpRevokeClientVpnIngress) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRevokeClientVpnIngressOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRestoreSnapshotTierOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -56827,7 +57017,7 @@ func (m *awsEc2query_deserializeOpRevokeClientVpnIngress) HandleDeserialize(ctx return out, metadata, err } -func awsEc2query_deserializeOpErrorRevokeClientVpnIngress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRestoreSnapshotTier(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)} @@ -56860,14 +57050,14 @@ func awsEc2query_deserializeOpErrorRevokeClientVpnIngress(response *smithyhttp.R } } -type awsEc2query_deserializeOpRevokeSecurityGroupEgress struct { +type awsEc2query_deserializeOpRevokeClientVpnIngress struct { } -func (*awsEc2query_deserializeOpRevokeSecurityGroupEgress) ID() string { +func (*awsEc2query_deserializeOpRevokeClientVpnIngress) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRevokeSecurityGroupEgress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRevokeClientVpnIngress) 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) @@ -56885,9 +57075,9 @@ func (m *awsEc2query_deserializeOpRevokeSecurityGroupEgress) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRevokeSecurityGroupEgress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRevokeClientVpnIngress(response, &metadata) } - output := &RevokeSecurityGroupEgressOutput{} + output := &RevokeClientVpnIngressOutput{} out.Result = output var buff [1024]byte @@ -56908,7 +57098,7 @@ func (m *awsEc2query_deserializeOpRevokeSecurityGroupEgress) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRevokeSecurityGroupEgressOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRevokeClientVpnIngressOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -56922,7 +57112,7 @@ func (m *awsEc2query_deserializeOpRevokeSecurityGroupEgress) HandleDeserialize(c return out, metadata, err } -func awsEc2query_deserializeOpErrorRevokeSecurityGroupEgress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRevokeClientVpnIngress(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)} @@ -56955,14 +57145,14 @@ func awsEc2query_deserializeOpErrorRevokeSecurityGroupEgress(response *smithyhtt } } -type awsEc2query_deserializeOpRevokeSecurityGroupIngress struct { +type awsEc2query_deserializeOpRevokeSecurityGroupEgress struct { } -func (*awsEc2query_deserializeOpRevokeSecurityGroupIngress) ID() string { +func (*awsEc2query_deserializeOpRevokeSecurityGroupEgress) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRevokeSecurityGroupIngress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRevokeSecurityGroupEgress) 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) @@ -56980,9 +57170,9 @@ func (m *awsEc2query_deserializeOpRevokeSecurityGroupIngress) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRevokeSecurityGroupIngress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRevokeSecurityGroupEgress(response, &metadata) } - output := &RevokeSecurityGroupIngressOutput{} + output := &RevokeSecurityGroupEgressOutput{} out.Result = output var buff [1024]byte @@ -57003,7 +57193,7 @@ func (m *awsEc2query_deserializeOpRevokeSecurityGroupIngress) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRevokeSecurityGroupIngressOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRevokeSecurityGroupEgressOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57017,7 +57207,7 @@ func (m *awsEc2query_deserializeOpRevokeSecurityGroupIngress) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorRevokeSecurityGroupIngress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRevokeSecurityGroupEgress(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)} @@ -57050,14 +57240,14 @@ func awsEc2query_deserializeOpErrorRevokeSecurityGroupIngress(response *smithyht } } -type awsEc2query_deserializeOpRunInstances struct { +type awsEc2query_deserializeOpRevokeSecurityGroupIngress struct { } -func (*awsEc2query_deserializeOpRunInstances) ID() string { +func (*awsEc2query_deserializeOpRevokeSecurityGroupIngress) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRunInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRevokeSecurityGroupIngress) 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) @@ -57075,9 +57265,9 @@ func (m *awsEc2query_deserializeOpRunInstances) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRunInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRevokeSecurityGroupIngress(response, &metadata) } - output := &RunInstancesOutput{} + output := &RevokeSecurityGroupIngressOutput{} out.Result = output var buff [1024]byte @@ -57098,7 +57288,7 @@ func (m *awsEc2query_deserializeOpRunInstances) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRunInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRevokeSecurityGroupIngressOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57112,7 +57302,7 @@ func (m *awsEc2query_deserializeOpRunInstances) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsEc2query_deserializeOpErrorRunInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRevokeSecurityGroupIngress(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)} @@ -57145,14 +57335,14 @@ func awsEc2query_deserializeOpErrorRunInstances(response *smithyhttp.Response, m } } -type awsEc2query_deserializeOpRunScheduledInstances struct { +type awsEc2query_deserializeOpRunInstances struct { } -func (*awsEc2query_deserializeOpRunScheduledInstances) ID() string { +func (*awsEc2query_deserializeOpRunInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpRunScheduledInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRunInstances) 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) @@ -57170,9 +57360,9 @@ func (m *awsEc2query_deserializeOpRunScheduledInstances) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorRunScheduledInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRunInstances(response, &metadata) } - output := &RunScheduledInstancesOutput{} + output := &RunInstancesOutput{} out.Result = output var buff [1024]byte @@ -57193,7 +57383,7 @@ func (m *awsEc2query_deserializeOpRunScheduledInstances) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentRunScheduledInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRunInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57207,7 +57397,7 @@ func (m *awsEc2query_deserializeOpRunScheduledInstances) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorRunScheduledInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRunInstances(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)} @@ -57240,14 +57430,14 @@ func awsEc2query_deserializeOpErrorRunScheduledInstances(response *smithyhttp.Re } } -type awsEc2query_deserializeOpSearchLocalGatewayRoutes struct { +type awsEc2query_deserializeOpRunScheduledInstances struct { } -func (*awsEc2query_deserializeOpSearchLocalGatewayRoutes) ID() string { +func (*awsEc2query_deserializeOpRunScheduledInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpSearchLocalGatewayRoutes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpRunScheduledInstances) 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) @@ -57265,9 +57455,9 @@ func (m *awsEc2query_deserializeOpSearchLocalGatewayRoutes) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorSearchLocalGatewayRoutes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorRunScheduledInstances(response, &metadata) } - output := &SearchLocalGatewayRoutesOutput{} + output := &RunScheduledInstancesOutput{} out.Result = output var buff [1024]byte @@ -57288,7 +57478,7 @@ func (m *awsEc2query_deserializeOpSearchLocalGatewayRoutes) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentSearchLocalGatewayRoutesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentRunScheduledInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57302,7 +57492,7 @@ func (m *awsEc2query_deserializeOpSearchLocalGatewayRoutes) HandleDeserialize(ct return out, metadata, err } -func awsEc2query_deserializeOpErrorSearchLocalGatewayRoutes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorRunScheduledInstances(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)} @@ -57335,14 +57525,14 @@ func awsEc2query_deserializeOpErrorSearchLocalGatewayRoutes(response *smithyhttp } } -type awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups struct { +type awsEc2query_deserializeOpSearchLocalGatewayRoutes struct { } -func (*awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) ID() string { +func (*awsEc2query_deserializeOpSearchLocalGatewayRoutes) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpSearchLocalGatewayRoutes) 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) @@ -57360,9 +57550,9 @@ func (m *awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorSearchTransitGatewayMulticastGroups(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorSearchLocalGatewayRoutes(response, &metadata) } - output := &SearchTransitGatewayMulticastGroupsOutput{} + output := &SearchLocalGatewayRoutesOutput{} out.Result = output var buff [1024]byte @@ -57383,7 +57573,7 @@ func (m *awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) HandleDes } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentSearchTransitGatewayMulticastGroupsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentSearchLocalGatewayRoutesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57397,7 +57587,7 @@ func (m *awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) HandleDes return out, metadata, err } -func awsEc2query_deserializeOpErrorSearchTransitGatewayMulticastGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorSearchLocalGatewayRoutes(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)} @@ -57430,14 +57620,14 @@ func awsEc2query_deserializeOpErrorSearchTransitGatewayMulticastGroups(response } } -type awsEc2query_deserializeOpSearchTransitGatewayRoutes struct { +type awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups struct { } -func (*awsEc2query_deserializeOpSearchTransitGatewayRoutes) ID() string { +func (*awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpSearchTransitGatewayRoutes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpSearchTransitGatewayMulticastGroups) 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) @@ -57455,9 +57645,9 @@ func (m *awsEc2query_deserializeOpSearchTransitGatewayRoutes) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorSearchTransitGatewayRoutes(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorSearchTransitGatewayMulticastGroups(response, &metadata) } - output := &SearchTransitGatewayRoutesOutput{} + output := &SearchTransitGatewayMulticastGroupsOutput{} out.Result = output var buff [1024]byte @@ -57478,7 +57668,7 @@ func (m *awsEc2query_deserializeOpSearchTransitGatewayRoutes) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentSearchTransitGatewayRoutesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentSearchTransitGatewayMulticastGroupsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57492,79 +57682,7 @@ func (m *awsEc2query_deserializeOpSearchTransitGatewayRoutes) HandleDeserialize( return out, metadata, err } -func awsEc2query_deserializeOpErrorSearchTransitGatewayRoutes(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_deserializeOpSendDiagnosticInterrupt struct { -} - -func (*awsEc2query_deserializeOpSendDiagnosticInterrupt) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpSendDiagnosticInterrupt) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - 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_deserializeOpErrorSendDiagnosticInterrupt(response, &metadata) - } - output := &SendDiagnosticInterruptOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorSendDiagnosticInterrupt(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorSearchTransitGatewayMulticastGroups(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)} @@ -57597,14 +57715,14 @@ func awsEc2query_deserializeOpErrorSendDiagnosticInterrupt(response *smithyhttp. } } -type awsEc2query_deserializeOpStartInstances struct { +type awsEc2query_deserializeOpSearchTransitGatewayRoutes struct { } -func (*awsEc2query_deserializeOpStartInstances) ID() string { +func (*awsEc2query_deserializeOpSearchTransitGatewayRoutes) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpStartInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpSearchTransitGatewayRoutes) 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) @@ -57622,9 +57740,9 @@ func (m *awsEc2query_deserializeOpStartInstances) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorSearchTransitGatewayRoutes(response, &metadata) } - output := &StartInstancesOutput{} + output := &SearchTransitGatewayRoutesOutput{} out.Result = output var buff [1024]byte @@ -57645,7 +57763,7 @@ func (m *awsEc2query_deserializeOpStartInstances) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentSearchTransitGatewayRoutesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57659,7 +57777,7 @@ func (m *awsEc2query_deserializeOpStartInstances) HandleDeserialize(ctx context. return out, metadata, err } -func awsEc2query_deserializeOpErrorStartInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorSearchTransitGatewayRoutes(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)} @@ -57692,14 +57810,14 @@ func awsEc2query_deserializeOpErrorStartInstances(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis struct { +type awsEc2query_deserializeOpSendDiagnosticInterrupt struct { } -func (*awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis) ID() string { +func (*awsEc2query_deserializeOpSendDiagnosticInterrupt) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpSendDiagnosticInterrupt) 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) @@ -57717,44 +57835,21 @@ func (m *awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartNetworkInsightsAccessScopeAnalysis(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorSendDiagnosticInterrupt(response, &metadata) } - output := &StartNetworkInsightsAccessScopeAnalysisOutput{} + output := &SendDiagnosticInterruptOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentStartNetworkInsightsAccessScopeAnalysisOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorStartNetworkInsightsAccessScopeAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorSendDiagnosticInterrupt(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)} @@ -57787,14 +57882,14 @@ func awsEc2query_deserializeOpErrorStartNetworkInsightsAccessScopeAnalysis(respo } } -type awsEc2query_deserializeOpStartNetworkInsightsAnalysis struct { +type awsEc2query_deserializeOpStartInstances struct { } -func (*awsEc2query_deserializeOpStartNetworkInsightsAnalysis) ID() string { +func (*awsEc2query_deserializeOpStartInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpStartNetworkInsightsAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpStartInstances) 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) @@ -57812,9 +57907,9 @@ func (m *awsEc2query_deserializeOpStartNetworkInsightsAnalysis) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartNetworkInsightsAnalysis(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorStartInstances(response, &metadata) } - output := &StartNetworkInsightsAnalysisOutput{} + output := &StartInstancesOutput{} out.Result = output var buff [1024]byte @@ -57835,7 +57930,7 @@ func (m *awsEc2query_deserializeOpStartNetworkInsightsAnalysis) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartNetworkInsightsAnalysisOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentStartInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57849,7 +57944,7 @@ func (m *awsEc2query_deserializeOpStartNetworkInsightsAnalysis) HandleDeserializ return out, metadata, err } -func awsEc2query_deserializeOpErrorStartNetworkInsightsAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorStartInstances(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)} @@ -57882,14 +57977,14 @@ func awsEc2query_deserializeOpErrorStartNetworkInsightsAnalysis(response *smithy } } -type awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification struct { +type awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis struct { } -func (*awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) ID() string { +func (*awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpStartNetworkInsightsAccessScopeAnalysis) 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) @@ -57907,9 +58002,9 @@ func (m *awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStartVpcEndpointServicePrivateDnsVerification(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorStartNetworkInsightsAccessScopeAnalysis(response, &metadata) } - output := &StartVpcEndpointServicePrivateDnsVerificationOutput{} + output := &StartNetworkInsightsAccessScopeAnalysisOutput{} out.Result = output var buff [1024]byte @@ -57930,7 +58025,7 @@ func (m *awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStartVpcEndpointServicePrivateDnsVerificationOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentStartNetworkInsightsAccessScopeAnalysisOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -57944,7 +58039,7 @@ func (m *awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) return out, metadata, err } -func awsEc2query_deserializeOpErrorStartVpcEndpointServicePrivateDnsVerification(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorStartNetworkInsightsAccessScopeAnalysis(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)} @@ -57977,14 +58072,14 @@ func awsEc2query_deserializeOpErrorStartVpcEndpointServicePrivateDnsVerification } } -type awsEc2query_deserializeOpStopInstances struct { +type awsEc2query_deserializeOpStartNetworkInsightsAnalysis struct { } -func (*awsEc2query_deserializeOpStopInstances) ID() string { +func (*awsEc2query_deserializeOpStartNetworkInsightsAnalysis) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpStopInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpStartNetworkInsightsAnalysis) 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) @@ -58002,9 +58097,9 @@ func (m *awsEc2query_deserializeOpStopInstances) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorStopInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorStartNetworkInsightsAnalysis(response, &metadata) } - output := &StopInstancesOutput{} + output := &StartNetworkInsightsAnalysisOutput{} out.Result = output var buff [1024]byte @@ -58025,7 +58120,7 @@ func (m *awsEc2query_deserializeOpStopInstances) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentStopInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentStartNetworkInsightsAnalysisOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58039,7 +58134,7 @@ func (m *awsEc2query_deserializeOpStopInstances) HandleDeserialize(ctx context.C return out, metadata, err } -func awsEc2query_deserializeOpErrorStopInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorStartNetworkInsightsAnalysis(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)} @@ -58072,14 +58167,14 @@ func awsEc2query_deserializeOpErrorStopInstances(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpTerminateClientVpnConnections struct { +type awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification struct { } -func (*awsEc2query_deserializeOpTerminateClientVpnConnections) ID() string { +func (*awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpTerminateClientVpnConnections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpStartVpcEndpointServicePrivateDnsVerification) 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) @@ -58097,9 +58192,9 @@ func (m *awsEc2query_deserializeOpTerminateClientVpnConnections) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorTerminateClientVpnConnections(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorStartVpcEndpointServicePrivateDnsVerification(response, &metadata) } - output := &TerminateClientVpnConnectionsOutput{} + output := &StartVpcEndpointServicePrivateDnsVerificationOutput{} out.Result = output var buff [1024]byte @@ -58120,7 +58215,7 @@ func (m *awsEc2query_deserializeOpTerminateClientVpnConnections) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentTerminateClientVpnConnectionsOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentStartVpcEndpointServicePrivateDnsVerificationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58134,7 +58229,7 @@ func (m *awsEc2query_deserializeOpTerminateClientVpnConnections) HandleDeseriali return out, metadata, err } -func awsEc2query_deserializeOpErrorTerminateClientVpnConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorStartVpcEndpointServicePrivateDnsVerification(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)} @@ -58167,14 +58262,14 @@ func awsEc2query_deserializeOpErrorTerminateClientVpnConnections(response *smith } } -type awsEc2query_deserializeOpTerminateInstances struct { +type awsEc2query_deserializeOpStopInstances struct { } -func (*awsEc2query_deserializeOpTerminateInstances) ID() string { +func (*awsEc2query_deserializeOpStopInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpTerminateInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpStopInstances) 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) @@ -58192,9 +58287,9 @@ func (m *awsEc2query_deserializeOpTerminateInstances) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorTerminateInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorStopInstances(response, &metadata) } - output := &TerminateInstancesOutput{} + output := &StopInstancesOutput{} out.Result = output var buff [1024]byte @@ -58215,7 +58310,7 @@ func (m *awsEc2query_deserializeOpTerminateInstances) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentTerminateInstancesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentStopInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58229,7 +58324,7 @@ func (m *awsEc2query_deserializeOpTerminateInstances) HandleDeserialize(ctx cont return out, metadata, err } -func awsEc2query_deserializeOpErrorTerminateInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorStopInstances(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)} @@ -58262,14 +58357,14 @@ func awsEc2query_deserializeOpErrorTerminateInstances(response *smithyhttp.Respo } } -type awsEc2query_deserializeOpUnassignIpv6Addresses struct { +type awsEc2query_deserializeOpTerminateClientVpnConnections struct { } -func (*awsEc2query_deserializeOpUnassignIpv6Addresses) ID() string { +func (*awsEc2query_deserializeOpTerminateClientVpnConnections) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpUnassignIpv6Addresses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpTerminateClientVpnConnections) 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) @@ -58287,9 +58382,9 @@ func (m *awsEc2query_deserializeOpUnassignIpv6Addresses) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnassignIpv6Addresses(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorTerminateClientVpnConnections(response, &metadata) } - output := &UnassignIpv6AddressesOutput{} + output := &TerminateClientVpnConnectionsOutput{} out.Result = output var buff [1024]byte @@ -58310,7 +58405,7 @@ func (m *awsEc2query_deserializeOpUnassignIpv6Addresses) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUnassignIpv6AddressesOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentTerminateClientVpnConnectionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58324,79 +58419,7 @@ func (m *awsEc2query_deserializeOpUnassignIpv6Addresses) HandleDeserialize(ctx c return out, metadata, err } -func awsEc2query_deserializeOpErrorUnassignIpv6Addresses(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_deserializeOpUnassignPrivateIpAddresses struct { -} - -func (*awsEc2query_deserializeOpUnassignPrivateIpAddresses) ID() string { - return "OperationDeserializer" -} - -func (m *awsEc2query_deserializeOpUnassignPrivateIpAddresses) 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 - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - 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_deserializeOpErrorUnassignPrivateIpAddresses(response, &metadata) - } - output := &UnassignPrivateIpAddressesOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsEc2query_deserializeOpErrorUnassignPrivateIpAddresses(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorTerminateClientVpnConnections(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)} @@ -58429,14 +58452,14 @@ func awsEc2query_deserializeOpErrorUnassignPrivateIpAddresses(response *smithyht } } -type awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress struct { +type awsEc2query_deserializeOpTerminateInstances struct { } -func (*awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) ID() string { +func (*awsEc2query_deserializeOpTerminateInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpTerminateInstances) 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) @@ -58454,9 +58477,9 @@ func (m *awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnassignPrivateNatGatewayAddress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorTerminateInstances(response, &metadata) } - output := &UnassignPrivateNatGatewayAddressOutput{} + output := &TerminateInstancesOutput{} out.Result = output var buff [1024]byte @@ -58477,7 +58500,7 @@ func (m *awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUnassignPrivateNatGatewayAddressOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentTerminateInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58491,7 +58514,7 @@ func (m *awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) HandleDeseri return out, metadata, err } -func awsEc2query_deserializeOpErrorUnassignPrivateNatGatewayAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorTerminateInstances(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)} @@ -58524,14 +58547,14 @@ func awsEc2query_deserializeOpErrorUnassignPrivateNatGatewayAddress(response *sm } } -type awsEc2query_deserializeOpUnlockSnapshot struct { +type awsEc2query_deserializeOpUnassignIpv6Addresses struct { } -func (*awsEc2query_deserializeOpUnlockSnapshot) ID() string { +func (*awsEc2query_deserializeOpUnassignIpv6Addresses) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpUnlockSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpUnassignIpv6Addresses) 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) @@ -58549,9 +58572,9 @@ func (m *awsEc2query_deserializeOpUnlockSnapshot) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnlockSnapshot(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorUnassignIpv6Addresses(response, &metadata) } - output := &UnlockSnapshotOutput{} + output := &UnassignIpv6AddressesOutput{} out.Result = output var buff [1024]byte @@ -58572,7 +58595,7 @@ func (m *awsEc2query_deserializeOpUnlockSnapshot) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUnlockSnapshotOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentUnassignIpv6AddressesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58586,7 +58609,7 @@ func (m *awsEc2query_deserializeOpUnlockSnapshot) HandleDeserialize(ctx context. return out, metadata, err } -func awsEc2query_deserializeOpErrorUnlockSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorUnassignIpv6Addresses(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)} @@ -58619,14 +58642,14 @@ func awsEc2query_deserializeOpErrorUnlockSnapshot(response *smithyhttp.Response, } } -type awsEc2query_deserializeOpUnmonitorInstances struct { +type awsEc2query_deserializeOpUnassignPrivateIpAddresses struct { } -func (*awsEc2query_deserializeOpUnmonitorInstances) ID() string { +func (*awsEc2query_deserializeOpUnassignPrivateIpAddresses) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpUnmonitorInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpUnassignPrivateIpAddresses) 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) @@ -58644,44 +58667,21 @@ func (m *awsEc2query_deserializeOpUnmonitorInstances) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUnmonitorInstances(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorUnassignPrivateIpAddresses(response, &metadata) } - output := &UnmonitorInstancesOutput{} + output := &UnassignPrivateIpAddressesOutput{} 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) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 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_deserializeOpDocumentUnmonitorInstancesOutput(&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(), + Err: fmt.Errorf("failed to discard response body, %w", err), } - return out, metadata, err } return out, metadata, err } -func awsEc2query_deserializeOpErrorUnmonitorInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorUnassignPrivateIpAddresses(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)} @@ -58714,14 +58714,14 @@ func awsEc2query_deserializeOpErrorUnmonitorInstances(response *smithyhttp.Respo } } -type awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress struct { +type awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress struct { } -func (*awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) ID() string { +func (*awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpUnassignPrivateNatGatewayAddress) 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) @@ -58739,9 +58739,9 @@ func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsEgress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorUnassignPrivateNatGatewayAddress(response, &metadata) } - output := &UpdateSecurityGroupRuleDescriptionsEgressOutput{} + output := &UnassignPrivateNatGatewayAddressOutput{} out.Result = output var buff [1024]byte @@ -58762,7 +58762,7 @@ func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) Han } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsEgressOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentUnassignPrivateNatGatewayAddressOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58776,7 +58776,7 @@ func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) Han return out, metadata, err } -func awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsEgress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorUnassignPrivateNatGatewayAddress(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)} @@ -58809,14 +58809,14 @@ func awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsEgress(res } } -type awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress struct { +type awsEc2query_deserializeOpUnlockSnapshot struct { } -func (*awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) ID() string { +func (*awsEc2query_deserializeOpUnlockSnapshot) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpUnlockSnapshot) 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) @@ -58834,9 +58834,9 @@ func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) Ha } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsIngress(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorUnlockSnapshot(response, &metadata) } - output := &UpdateSecurityGroupRuleDescriptionsIngressOutput{} + output := &UnlockSnapshotOutput{} out.Result = output var buff [1024]byte @@ -58857,7 +58857,7 @@ func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) Ha } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsIngressOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentUnlockSnapshotOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58871,7 +58871,7 @@ func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) Ha return out, metadata, err } -func awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsIngress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorUnlockSnapshot(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)} @@ -58904,14 +58904,14 @@ func awsEc2query_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsIngress(re } } -type awsEc2query_deserializeOpWithdrawByoipCidr struct { +type awsEc2query_deserializeOpUnmonitorInstances struct { } -func (*awsEc2query_deserializeOpWithdrawByoipCidr) ID() string { +func (*awsEc2query_deserializeOpUnmonitorInstances) ID() string { return "OperationDeserializer" } -func (m *awsEc2query_deserializeOpWithdrawByoipCidr) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsEc2query_deserializeOpUnmonitorInstances) 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) @@ -58929,9 +58929,9 @@ func (m *awsEc2query_deserializeOpWithdrawByoipCidr) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsEc2query_deserializeOpErrorWithdrawByoipCidr(response, &metadata) + return out, metadata, awsEc2query_deserializeOpErrorUnmonitorInstances(response, &metadata) } - output := &WithdrawByoipCidrOutput{} + output := &UnmonitorInstancesOutput{} out.Result = output var buff [1024]byte @@ -58952,7 +58952,7 @@ func (m *awsEc2query_deserializeOpWithdrawByoipCidr) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsEc2query_deserializeOpDocumentWithdrawByoipCidrOutput(&output, decoder) + err = awsEc2query_deserializeOpDocumentUnmonitorInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -58966,7 +58966,292 @@ func (m *awsEc2query_deserializeOpWithdrawByoipCidr) HandleDeserialize(ctx conte return out, metadata, err } -func awsEc2query_deserializeOpErrorWithdrawByoipCidr(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsEc2query_deserializeOpErrorUnmonitorInstances(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_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress struct { +} + +func (*awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsEgress) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsEgress(response, &metadata) + } + output := &UpdateSecurityGroupRuleDescriptionsEgressOutput{} + 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_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsEgressOutput(&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_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsEgress(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_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress struct { +} + +func (*awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpUpdateSecurityGroupRuleDescriptionsIngress) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsIngress(response, &metadata) + } + output := &UpdateSecurityGroupRuleDescriptionsIngressOutput{} + 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_deserializeOpDocumentUpdateSecurityGroupRuleDescriptionsIngressOutput(&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_deserializeOpErrorUpdateSecurityGroupRuleDescriptionsIngress(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_deserializeOpWithdrawByoipCidr struct { +} + +func (*awsEc2query_deserializeOpWithdrawByoipCidr) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpWithdrawByoipCidr) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorWithdrawByoipCidr(response, &metadata) + } + output := &WithdrawByoipCidrOutput{} + 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_deserializeOpDocumentWithdrawByoipCidrOutput(&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_deserializeOpErrorWithdrawByoipCidr(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)} @@ -118856,6 +119141,264 @@ func awsEc2query_deserializeDocumentResponseLaunchTemplateData(v **types.Respons return nil } +func awsEc2query_deserializeDocumentRevokedSecurityGroupRule(v **types.RevokedSecurityGroupRule, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RevokedSecurityGroupRule + if *v == nil { + sv = &types.RevokedSecurityGroupRule{} + } 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("cidrIpv4", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CidrIpv4 = ptr.String(xtv) + } + + case strings.EqualFold("cidrIpv6", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CidrIpv6 = ptr.String(xtv) + } + + case strings.EqualFold("description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("fromPort", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.FromPort = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("groupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GroupId = ptr.String(xtv) + } + + case strings.EqualFold("ipProtocol", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IpProtocol = ptr.String(xtv) + } + + case strings.EqualFold("isEgress", 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.IsEgress = ptr.Bool(xtv) + } + + case strings.EqualFold("prefixListId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PrefixListId = ptr.String(xtv) + } + + case strings.EqualFold("referencedGroupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReferencedGroupId = ptr.String(xtv) + } + + case strings.EqualFold("securityGroupRuleId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecurityGroupRuleId = ptr.String(xtv) + } + + case strings.EqualFold("toPort", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ToPort = ptr.Int32(int32(i64)) + } + + 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_deserializeDocumentRevokedSecurityGroupRuleList(v *[]types.RevokedSecurityGroupRule, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.RevokedSecurityGroupRule + if *v == nil { + sv = make([]types.RevokedSecurityGroupRule, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.RevokedSecurityGroupRule + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRule(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentRevokedSecurityGroupRuleListUnwrapped(v *[]types.RevokedSecurityGroupRule, decoder smithyxml.NodeDecoder) error { + var sv []types.RevokedSecurityGroupRule + if *v == nil { + sv = make([]types.RevokedSecurityGroupRule, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.RevokedSecurityGroupRule + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRule(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentRootDeviceTypeList(v *[]types.RootDeviceType, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -120990,6 +121533,19 @@ func awsEc2query_deserializeDocumentSecurityGroup(v **types.SecurityGroup, decod sv.OwnerId = ptr.String(xtv) } + case strings.EqualFold("securityGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecurityGroupArn = ptr.String(xtv) + } + case strings.EqualFold("tagSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { @@ -121876,6 +122432,19 @@ func awsEc2query_deserializeDocumentSecurityGroupRule(v **types.SecurityGroupRul return err } + case strings.EqualFold("securityGroupRuleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecurityGroupRuleArn = ptr.String(xtv) + } + case strings.EqualFold("securityGroupRuleId", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -121994,6 +122563,175 @@ func awsEc2query_deserializeDocumentSecurityGroupRuleListUnwrapped(v *[]types.Se *v = sv return nil } +func awsEc2query_deserializeDocumentSecurityGroupVpcAssociation(v **types.SecurityGroupVpcAssociation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SecurityGroupVpcAssociation + if *v == nil { + sv = &types.SecurityGroupVpcAssociation{} + } 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("groupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GroupId = ptr.String(xtv) + } + + case strings.EqualFold("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.SecurityGroupVpcAssociationState(xtv) + } + + case strings.EqualFold("stateReason", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StateReason = ptr.String(xtv) + } + + case strings.EqualFold("vpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + case strings.EqualFold("vpcOwnerId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcOwnerId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentSecurityGroupVpcAssociationList(v *[]types.SecurityGroupVpcAssociation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.SecurityGroupVpcAssociation + if *v == nil { + sv = make([]types.SecurityGroupVpcAssociation, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.SecurityGroupVpcAssociation + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentSecurityGroupVpcAssociation(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentSecurityGroupVpcAssociationListUnwrapped(v *[]types.SecurityGroupVpcAssociation, decoder smithyxml.NodeDecoder) error { + var sv []types.SecurityGroupVpcAssociation + if *v == nil { + sv = make([]types.SecurityGroupVpcAssociation, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.SecurityGroupVpcAssociation + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentSecurityGroupVpcAssociation(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentServiceConfiguration(v **types.ServiceConfiguration, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -146199,6 +146937,55 @@ func awsEc2query_deserializeOpDocumentAssociateRouteTableOutput(v **AssociateRou return nil } +func awsEc2query_deserializeOpDocumentAssociateSecurityGroupVpcOutput(v **AssociateSecurityGroupVpcOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AssociateSecurityGroupVpcOutput + if *v == nil { + sv = &AssociateSecurityGroupVpcOutput{} + } 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("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.SecurityGroupVpcAssociationState(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_deserializeOpDocumentAssociateSubnetCidrBlockOutput(v **AssociateSubnetCidrBlockOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -150104,6 +150891,19 @@ func awsEc2query_deserializeOpDocumentCreateSecurityGroupOutput(v **CreateSecuri sv.GroupId = ptr.String(xtv) } + case strings.EqualFold("securityGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecurityGroupArn = ptr.String(xtv) + } + case strings.EqualFold("tagSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { @@ -158392,13 +159192,123 @@ func awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveriesOutput(v ** return nil } -func awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveryAssociationsOutput(v **DescribeIpamResourceDiscoveryAssociationsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveryAssociationsOutput(v **DescribeIpamResourceDiscoveryAssociationsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeIpamResourceDiscoveryAssociationsOutput + if *v == nil { + sv = &DescribeIpamResourceDiscoveryAssociationsOutput{} + } 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("ipamResourceDiscoveryAssociationSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociationSet(&sv.IpamResourceDiscoveryAssociations, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeOpDocumentDescribeIpamScopesOutput(v **DescribeIpamScopesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeIpamScopesOutput + if *v == nil { + sv = &DescribeIpamScopesOutput{} + } 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("ipamScopeSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamScopeSet(&sv.IpamScopes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeOpDocumentDescribeIpamsOutput(v **DescribeIpamsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeIpamResourceDiscoveryAssociationsOutput + var sv *DescribeIpamsOutput if *v == nil { - sv = &DescribeIpamResourceDiscoveryAssociationsOutput{} + sv = &DescribeIpamsOutput{} } else { sv = *v } @@ -158414,9 +159324,9 @@ func awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveryAssociationsO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ipamResourceDiscoveryAssociationSet", t.Name.Local): + case strings.EqualFold("ipamSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamResourceDiscoveryAssociationSet(&sv.IpamResourceDiscoveryAssociations, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpamSet(&sv.Ipams, nodeDecoder); err != nil { return err } @@ -158447,13 +159357,13 @@ func awsEc2query_deserializeOpDocumentDescribeIpamResourceDiscoveryAssociationsO return nil } -func awsEc2query_deserializeOpDocumentDescribeIpamScopesOutput(v **DescribeIpamScopesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeIpv6PoolsOutput(v **DescribeIpv6PoolsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeIpamScopesOutput + var sv *DescribeIpv6PoolsOutput if *v == nil { - sv = &DescribeIpamScopesOutput{} + sv = &DescribeIpv6PoolsOutput{} } else { sv = *v } @@ -158469,9 +159379,9 @@ func awsEc2query_deserializeOpDocumentDescribeIpamScopesOutput(v **DescribeIpamS originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ipamScopeSet", t.Name.Local): + case strings.EqualFold("ipv6PoolSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamScopeSet(&sv.IpamScopes, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentIpv6PoolSet(&sv.Ipv6Pools, nodeDecoder); err != nil { return err } @@ -158502,13 +159412,13 @@ func awsEc2query_deserializeOpDocumentDescribeIpamScopesOutput(v **DescribeIpamS return nil } -func awsEc2query_deserializeOpDocumentDescribeIpamsOutput(v **DescribeIpamsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeKeyPairsOutput(v **DescribeKeyPairsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeIpamsOutput + var sv *DescribeKeyPairsOutput if *v == nil { - sv = &DescribeIpamsOutput{} + sv = &DescribeKeyPairsOutput{} } else { sv = *v } @@ -158524,9 +159434,51 @@ func awsEc2query_deserializeOpDocumentDescribeIpamsOutput(v **DescribeIpamsOutpu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ipamSet", t.Name.Local): + case strings.EqualFold("keySet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpamSet(&sv.Ipams, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentKeyPairList(&sv.KeyPairs, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeOpDocumentDescribeLaunchTemplatesOutput(v **DescribeLaunchTemplatesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeLaunchTemplatesOutput + if *v == nil { + sv = &DescribeLaunchTemplatesOutput{} + } 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("launchTemplates", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentLaunchTemplateSet(&sv.LaunchTemplates, nodeDecoder); err != nil { return err } @@ -158557,13 +159509,13 @@ func awsEc2query_deserializeOpDocumentDescribeIpamsOutput(v **DescribeIpamsOutpu return nil } -func awsEc2query_deserializeOpDocumentDescribeIpv6PoolsOutput(v **DescribeIpv6PoolsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLaunchTemplateVersionsOutput(v **DescribeLaunchTemplateVersionsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeIpv6PoolsOutput + var sv *DescribeLaunchTemplateVersionsOutput if *v == nil { - sv = &DescribeIpv6PoolsOutput{} + sv = &DescribeLaunchTemplateVersionsOutput{} } else { sv = *v } @@ -158579,9 +159531,9 @@ func awsEc2query_deserializeOpDocumentDescribeIpv6PoolsOutput(v **DescribeIpv6Po originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ipv6PoolSet", t.Name.Local): + case strings.EqualFold("launchTemplateVersionSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentIpv6PoolSet(&sv.Ipv6Pools, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentLaunchTemplateVersionSet(&sv.LaunchTemplateVersions, nodeDecoder); err != nil { return err } @@ -158612,13 +159564,13 @@ func awsEc2query_deserializeOpDocumentDescribeIpv6PoolsOutput(v **DescribeIpv6Po return nil } -func awsEc2query_deserializeOpDocumentDescribeKeyPairsOutput(v **DescribeKeyPairsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTablesOutput(v **DescribeLocalGatewayRouteTablesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeKeyPairsOutput + var sv *DescribeLocalGatewayRouteTablesOutput if *v == nil { - sv = &DescribeKeyPairsOutput{} + sv = &DescribeLocalGatewayRouteTablesOutput{} } else { sv = *v } @@ -158634,11 +159586,24 @@ func awsEc2query_deserializeOpDocumentDescribeKeyPairsOutput(v **DescribeKeyPair originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("keySet", t.Name.Local): + case strings.EqualFold("localGatewayRouteTableSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentKeyPairList(&sv.KeyPairs, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableSet(&sv.LocalGatewayRouteTables, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -158654,13 +159619,13 @@ func awsEc2query_deserializeOpDocumentDescribeKeyPairsOutput(v **DescribeKeyPair return nil } -func awsEc2query_deserializeOpDocumentDescribeLaunchTemplatesOutput(v **DescribeLaunchTemplatesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput(v **DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLaunchTemplatesOutput + var sv *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput if *v == nil { - sv = &DescribeLaunchTemplatesOutput{} + sv = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput{} } else { sv = *v } @@ -158676,9 +159641,9 @@ func awsEc2query_deserializeOpDocumentDescribeLaunchTemplatesOutput(v **Describe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("launchTemplates", t.Name.Local): + case strings.EqualFold("localGatewayRouteTableVirtualInterfaceGroupAssociationSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateSet(&sv.LaunchTemplates, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociationSet(&sv.LocalGatewayRouteTableVirtualInterfaceGroupAssociations, nodeDecoder); err != nil { return err } @@ -158709,13 +159674,13 @@ func awsEc2query_deserializeOpDocumentDescribeLaunchTemplatesOutput(v **Describe return nil } -func awsEc2query_deserializeOpDocumentDescribeLaunchTemplateVersionsOutput(v **DescribeLaunchTemplateVersionsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociationsOutput(v **DescribeLocalGatewayRouteTableVpcAssociationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLaunchTemplateVersionsOutput + var sv *DescribeLocalGatewayRouteTableVpcAssociationsOutput if *v == nil { - sv = &DescribeLaunchTemplateVersionsOutput{} + sv = &DescribeLocalGatewayRouteTableVpcAssociationsOutput{} } else { sv = *v } @@ -158731,9 +159696,9 @@ func awsEc2query_deserializeOpDocumentDescribeLaunchTemplateVersionsOutput(v **D originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("launchTemplateVersionSet", t.Name.Local): + case strings.EqualFold("localGatewayRouteTableVpcAssociationSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLaunchTemplateVersionSet(&sv.LaunchTemplateVersions, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociationSet(&sv.LocalGatewayRouteTableVpcAssociations, nodeDecoder); err != nil { return err } @@ -158764,13 +159729,13 @@ func awsEc2query_deserializeOpDocumentDescribeLaunchTemplateVersionsOutput(v **D return nil } -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTablesOutput(v **DescribeLocalGatewayRouteTablesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLocalGatewaysOutput(v **DescribeLocalGatewaysOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLocalGatewayRouteTablesOutput + var sv *DescribeLocalGatewaysOutput if *v == nil { - sv = &DescribeLocalGatewayRouteTablesOutput{} + sv = &DescribeLocalGatewaysOutput{} } else { sv = *v } @@ -158786,9 +159751,9 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTablesOutput(v ** originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("localGatewayRouteTableSet", t.Name.Local): + case strings.EqualFold("localGatewaySet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableSet(&sv.LocalGatewayRouteTables, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentLocalGatewaySet(&sv.LocalGateways, nodeDecoder); err != nil { return err } @@ -158819,13 +159784,13 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTablesOutput(v ** return nil } -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput(v **DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroupsOutput(v **DescribeLocalGatewayVirtualInterfaceGroupsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput + var sv *DescribeLocalGatewayVirtualInterfaceGroupsOutput if *v == nil { - sv = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput{} + sv = &DescribeLocalGatewayVirtualInterfaceGroupsOutput{} } else { sv = *v } @@ -158841,9 +159806,9 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVirtualInter originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("localGatewayRouteTableVirtualInterfaceGroupAssociationSet", t.Name.Local): + case strings.EqualFold("localGatewayVirtualInterfaceGroupSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVirtualInterfaceGroupAssociationSet(&sv.LocalGatewayRouteTableVirtualInterfaceGroupAssociations, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroupSet(&sv.LocalGatewayVirtualInterfaceGroups, nodeDecoder); err != nil { return err } @@ -158874,13 +159839,13 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVirtualInter return nil } -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociationsOutput(v **DescribeLocalGatewayRouteTableVpcAssociationsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfacesOutput(v **DescribeLocalGatewayVirtualInterfacesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLocalGatewayRouteTableVpcAssociationsOutput + var sv *DescribeLocalGatewayVirtualInterfacesOutput if *v == nil { - sv = &DescribeLocalGatewayRouteTableVpcAssociationsOutput{} + sv = &DescribeLocalGatewayVirtualInterfacesOutput{} } else { sv = *v } @@ -158896,9 +159861,9 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociati originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("localGatewayRouteTableVpcAssociationSet", t.Name.Local): + case strings.EqualFold("localGatewayVirtualInterfaceSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayRouteTableVpcAssociationSet(&sv.LocalGatewayRouteTableVpcAssociations, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceSet(&sv.LocalGatewayVirtualInterfaces, nodeDecoder); err != nil { return err } @@ -158929,13 +159894,13 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayRouteTableVpcAssociati return nil } -func awsEc2query_deserializeOpDocumentDescribeLocalGatewaysOutput(v **DescribeLocalGatewaysOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeLockedSnapshotsOutput(v **DescribeLockedSnapshotsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLocalGatewaysOutput + var sv *DescribeLockedSnapshotsOutput if *v == nil { - sv = &DescribeLocalGatewaysOutput{} + sv = &DescribeLockedSnapshotsOutput{} } else { sv = *v } @@ -158951,12 +159916,6 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewaysOutput(v **DescribeLo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("localGatewaySet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewaySet(&sv.LocalGateways, nodeDecoder); err != nil { - return err - } - case strings.EqualFold("nextToken", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -158970,6 +159929,12 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewaysOutput(v **DescribeLo sv.NextToken = ptr.String(xtv) } + case strings.EqualFold("snapshotSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentLockedSnapshotsInfoList(&sv.Snapshots, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -158984,13 +159949,13 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewaysOutput(v **DescribeLo return nil } -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroupsOutput(v **DescribeLocalGatewayVirtualInterfaceGroupsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeMacHostsOutput(v **DescribeMacHostsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLocalGatewayVirtualInterfaceGroupsOutput + var sv *DescribeMacHostsOutput if *v == nil { - sv = &DescribeLocalGatewayVirtualInterfaceGroupsOutput{} + sv = &DescribeMacHostsOutput{} } else { sv = *v } @@ -159006,9 +159971,9 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroups originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("localGatewayVirtualInterfaceGroupSet", t.Name.Local): + case strings.EqualFold("macHostSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceGroupSet(&sv.LocalGatewayVirtualInterfaceGroups, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentMacHostList(&sv.MacHosts, nodeDecoder); err != nil { return err } @@ -159039,13 +160004,13 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfaceGroups return nil } -func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfacesOutput(v **DescribeLocalGatewayVirtualInterfacesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeManagedPrefixListsOutput(v **DescribeManagedPrefixListsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLocalGatewayVirtualInterfacesOutput + var sv *DescribeManagedPrefixListsOutput if *v == nil { - sv = &DescribeLocalGatewayVirtualInterfacesOutput{} + sv = &DescribeManagedPrefixListsOutput{} } else { sv = *v } @@ -159061,12 +160026,6 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfacesOutpu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("localGatewayVirtualInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLocalGatewayVirtualInterfaceSet(&sv.LocalGatewayVirtualInterfaces, nodeDecoder); err != nil { - return err - } - case strings.EqualFold("nextToken", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -159080,6 +160039,12 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfacesOutpu sv.NextToken = ptr.String(xtv) } + case strings.EqualFold("prefixListSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentManagedPrefixListSet(&sv.PrefixLists, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -159094,13 +160059,13 @@ func awsEc2query_deserializeOpDocumentDescribeLocalGatewayVirtualInterfacesOutpu return nil } -func awsEc2query_deserializeOpDocumentDescribeLockedSnapshotsOutput(v **DescribeLockedSnapshotsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeMovingAddressesOutput(v **DescribeMovingAddressesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeLockedSnapshotsOutput + var sv *DescribeMovingAddressesOutput if *v == nil { - sv = &DescribeLockedSnapshotsOutput{} + sv = &DescribeMovingAddressesOutput{} } else { sv = *v } @@ -159116,6 +160081,12 @@ func awsEc2query_deserializeOpDocumentDescribeLockedSnapshotsOutput(v **Describe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("movingAddressStatusSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentMovingAddressStatusSet(&sv.MovingAddressStatuses, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("nextToken", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -159129,12 +160100,6 @@ func awsEc2query_deserializeOpDocumentDescribeLockedSnapshotsOutput(v **Describe sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("snapshotSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentLockedSnapshotsInfoList(&sv.Snapshots, nodeDecoder); err != nil { - return err - } - default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -159149,13 +160114,13 @@ func awsEc2query_deserializeOpDocumentDescribeLockedSnapshotsOutput(v **Describe return nil } -func awsEc2query_deserializeOpDocumentDescribeMacHostsOutput(v **DescribeMacHostsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNatGatewaysOutput(v **DescribeNatGatewaysOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeMacHostsOutput + var sv *DescribeNatGatewaysOutput if *v == nil { - sv = &DescribeMacHostsOutput{} + sv = &DescribeNatGatewaysOutput{} } else { sv = *v } @@ -159171,9 +160136,9 @@ func awsEc2query_deserializeOpDocumentDescribeMacHostsOutput(v **DescribeMacHost originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("macHostSet", t.Name.Local): + case strings.EqualFold("natGatewaySet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMacHostList(&sv.MacHosts, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNatGatewayList(&sv.NatGateways, nodeDecoder); err != nil { return err } @@ -159204,13 +160169,13 @@ func awsEc2query_deserializeOpDocumentDescribeMacHostsOutput(v **DescribeMacHost return nil } -func awsEc2query_deserializeOpDocumentDescribeManagedPrefixListsOutput(v **DescribeManagedPrefixListsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkAclsOutput(v **DescribeNetworkAclsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeManagedPrefixListsOutput + var sv *DescribeNetworkAclsOutput if *v == nil { - sv = &DescribeManagedPrefixListsOutput{} + sv = &DescribeNetworkAclsOutput{} } else { sv = *v } @@ -159226,6 +160191,12 @@ func awsEc2query_deserializeOpDocumentDescribeManagedPrefixListsOutput(v **Descr originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("networkAclSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentNetworkAclList(&sv.NetworkAcls, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("nextToken", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -159239,12 +160210,6 @@ func awsEc2query_deserializeOpDocumentDescribeManagedPrefixListsOutput(v **Descr sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("prefixListSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentManagedPrefixListSet(&sv.PrefixLists, nodeDecoder); err != nil { - return err - } - default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -159259,13 +160224,13 @@ func awsEc2query_deserializeOpDocumentDescribeManagedPrefixListsOutput(v **Descr return nil } -func awsEc2query_deserializeOpDocumentDescribeMovingAddressesOutput(v **DescribeMovingAddressesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopeAnalysesOutput(v **DescribeNetworkInsightsAccessScopeAnalysesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeMovingAddressesOutput + var sv *DescribeNetworkInsightsAccessScopeAnalysesOutput if *v == nil { - sv = &DescribeMovingAddressesOutput{} + sv = &DescribeNetworkInsightsAccessScopeAnalysesOutput{} } else { sv = *v } @@ -159281,9 +160246,9 @@ func awsEc2query_deserializeOpDocumentDescribeMovingAddressesOutput(v **Describe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("movingAddressStatusSet", t.Name.Local): + case strings.EqualFold("networkInsightsAccessScopeAnalysisSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentMovingAddressStatusSet(&sv.MovingAddressStatuses, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysisList(&sv.NetworkInsightsAccessScopeAnalyses, nodeDecoder); err != nil { return err } @@ -159314,13 +160279,13 @@ func awsEc2query_deserializeOpDocumentDescribeMovingAddressesOutput(v **Describe return nil } -func awsEc2query_deserializeOpDocumentDescribeNatGatewaysOutput(v **DescribeNatGatewaysOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopesOutput(v **DescribeNetworkInsightsAccessScopesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNatGatewaysOutput + var sv *DescribeNetworkInsightsAccessScopesOutput if *v == nil { - sv = &DescribeNatGatewaysOutput{} + sv = &DescribeNetworkInsightsAccessScopesOutput{} } else { sv = *v } @@ -159336,9 +160301,9 @@ func awsEc2query_deserializeOpDocumentDescribeNatGatewaysOutput(v **DescribeNatG originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("natGatewaySet", t.Name.Local): + case strings.EqualFold("networkInsightsAccessScopeSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNatGatewayList(&sv.NatGateways, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeList(&sv.NetworkInsightsAccessScopes, nodeDecoder); err != nil { return err } @@ -159369,13 +160334,13 @@ func awsEc2query_deserializeOpDocumentDescribeNatGatewaysOutput(v **DescribeNatG return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkAclsOutput(v **DescribeNetworkAclsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAnalysesOutput(v **DescribeNetworkInsightsAnalysesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkAclsOutput + var sv *DescribeNetworkInsightsAnalysesOutput if *v == nil { - sv = &DescribeNetworkAclsOutput{} + sv = &DescribeNetworkInsightsAnalysesOutput{} } else { sv = *v } @@ -159391,9 +160356,9 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkAclsOutput(v **DescribeNetw originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("networkAclSet", t.Name.Local): + case strings.EqualFold("networkInsightsAnalysisSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkAclList(&sv.NetworkAcls, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNetworkInsightsAnalysisList(&sv.NetworkInsightsAnalyses, nodeDecoder); err != nil { return err } @@ -159424,13 +160389,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkAclsOutput(v **DescribeNetw return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopeAnalysesOutput(v **DescribeNetworkInsightsAccessScopeAnalysesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsPathsOutput(v **DescribeNetworkInsightsPathsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkInsightsAccessScopeAnalysesOutput + var sv *DescribeNetworkInsightsPathsOutput if *v == nil { - sv = &DescribeNetworkInsightsAccessScopeAnalysesOutput{} + sv = &DescribeNetworkInsightsPathsOutput{} } else { sv = *v } @@ -159446,9 +160411,9 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopeAnalyses originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("networkInsightsAccessScopeAnalysisSet", t.Name.Local): + case strings.EqualFold("networkInsightsPathSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeAnalysisList(&sv.NetworkInsightsAccessScopeAnalyses, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNetworkInsightsPathList(&sv.NetworkInsightsPaths, nodeDecoder); err != nil { return err } @@ -159479,13 +160444,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopeAnalyses return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopesOutput(v **DescribeNetworkInsightsAccessScopesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkInterfaceAttributeOutput(v **DescribeNetworkInterfaceAttributeOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkInsightsAccessScopesOutput + var sv *DescribeNetworkInterfaceAttributeOutput if *v == nil { - sv = &DescribeNetworkInsightsAccessScopesOutput{} + sv = &DescribeNetworkInterfaceAttributeOutput{} } else { sv = *v } @@ -159501,13 +160466,41 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopesOutput( originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("networkInsightsAccessScopeSet", t.Name.Local): + case strings.EqualFold("associatePublicIpAddress", 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.AssociatePublicIpAddress = ptr.Bool(xtv) + } + + case strings.EqualFold("attachment", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAccessScopeList(&sv.NetworkInsightsAccessScopes, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNetworkInterfaceAttachment(&sv.Attachment, nodeDecoder); err != nil { return err } - case strings.EqualFold("nextToken", t.Name.Local): + case strings.EqualFold("description", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentAttributeValue(&sv.Description, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("groupSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("networkInterfaceId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -159517,7 +160510,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopesOutput( } { xtv := string(val) - sv.NextToken = ptr.String(xtv) + sv.NetworkInterfaceId = ptr.String(xtv) + } + + case strings.EqualFold("sourceDestCheck", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.SourceDestCheck, nodeDecoder); err != nil { + return err } default: @@ -159534,13 +160533,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAccessScopesOutput( return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAnalysesOutput(v **DescribeNetworkInsightsAnalysesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacePermissionsOutput(v **DescribeNetworkInterfacePermissionsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkInsightsAnalysesOutput + var sv *DescribeNetworkInterfacePermissionsOutput if *v == nil { - sv = &DescribeNetworkInsightsAnalysesOutput{} + sv = &DescribeNetworkInterfacePermissionsOutput{} } else { sv = *v } @@ -159556,9 +160555,9 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAnalysesOutput(v ** originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("networkInsightsAnalysisSet", t.Name.Local): + case strings.EqualFold("networkInterfacePermissions", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsAnalysisList(&sv.NetworkInsightsAnalyses, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNetworkInterfacePermissionList(&sv.NetworkInterfacePermissions, nodeDecoder); err != nil { return err } @@ -159589,13 +160588,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsAnalysesOutput(v ** return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsPathsOutput(v **DescribeNetworkInsightsPathsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacesOutput(v **DescribeNetworkInterfacesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkInsightsPathsOutput + var sv *DescribeNetworkInterfacesOutput if *v == nil { - sv = &DescribeNetworkInsightsPathsOutput{} + sv = &DescribeNetworkInterfacesOutput{} } else { sv = *v } @@ -159611,9 +160610,9 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsPathsOutput(v **Des originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("networkInsightsPathSet", t.Name.Local): + case strings.EqualFold("networkInterfaceSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInsightsPathList(&sv.NetworkInsightsPaths, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentNetworkInterfaceList(&sv.NetworkInterfaces, nodeDecoder); err != nil { return err } @@ -159644,13 +160643,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInsightsPathsOutput(v **Des return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkInterfaceAttributeOutput(v **DescribeNetworkInterfaceAttributeOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribePlacementGroupsOutput(v **DescribePlacementGroupsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkInterfaceAttributeOutput + var sv *DescribePlacementGroupsOutput if *v == nil { - sv = &DescribeNetworkInterfaceAttributeOutput{} + sv = &DescribePlacementGroupsOutput{} } else { sv = *v } @@ -159666,41 +160665,49 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfaceAttributeOutput(v originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("associatePublicIpAddress", 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.AssociatePublicIpAddress = ptr.Bool(xtv) - } - - case strings.EqualFold("attachment", t.Name.Local): + case strings.EqualFold("placementGroupSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceAttachment(&sv.Attachment, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentPlacementGroupList(&sv.PlacementGroups, nodeDecoder); err != nil { return err } - case strings.EqualFold("description", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeValue(&sv.Description, nodeDecoder); err != nil { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { return err } - case strings.EqualFold("groupSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentGroupIdentifierList(&sv.Groups, nodeDecoder); err != nil { - return err - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("networkInterfaceId", t.Name.Local): +func awsEc2query_deserializeOpDocumentDescribePrefixListsOutput(v **DescribePrefixListsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribePrefixListsOutput + if *v == nil { + sv = &DescribePrefixListsOutput{} + } 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("nextToken", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -159710,12 +160717,12 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfaceAttributeOutput(v } { xtv := string(val) - sv.NetworkInterfaceId = ptr.String(xtv) + sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("sourceDestCheck", t.Name.Local): + case strings.EqualFold("prefixListSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.SourceDestCheck, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentPrefixListSet(&sv.PrefixLists, nodeDecoder); err != nil { return err } @@ -159733,13 +160740,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfaceAttributeOutput(v return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacePermissionsOutput(v **DescribeNetworkInterfacePermissionsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribePrincipalIdFormatOutput(v **DescribePrincipalIdFormatOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkInterfacePermissionsOutput + var sv *DescribePrincipalIdFormatOutput if *v == nil { - sv = &DescribeNetworkInterfacePermissionsOutput{} + sv = &DescribePrincipalIdFormatOutput{} } else { sv = *v } @@ -159755,12 +160762,6 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacePermissionsOutput( originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("networkInterfacePermissions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfacePermissionList(&sv.NetworkInterfacePermissions, nodeDecoder); err != nil { - return err - } - case strings.EqualFold("nextToken", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -159774,6 +160775,12 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacePermissionsOutput( sv.NextToken = ptr.String(xtv) } + case strings.EqualFold("principalSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentPrincipalIdFormatList(&sv.Principals, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -159788,13 +160795,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacePermissionsOutput( return nil } -func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacesOutput(v **DescribeNetworkInterfacesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribePublicIpv4PoolsOutput(v **DescribePublicIpv4PoolsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeNetworkInterfacesOutput + var sv *DescribePublicIpv4PoolsOutput if *v == nil { - sv = &DescribeNetworkInterfacesOutput{} + sv = &DescribePublicIpv4PoolsOutput{} } else { sv = *v } @@ -159810,12 +160817,6 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacesOutput(v **Descri originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("networkInterfaceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentNetworkInterfaceList(&sv.NetworkInterfaces, nodeDecoder); err != nil { - return err - } - case strings.EqualFold("nextToken", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -159829,6 +160830,12 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacesOutput(v **Descri sv.NextToken = ptr.String(xtv) } + case strings.EqualFold("publicIpv4PoolSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentPublicIpv4PoolSet(&sv.PublicIpv4Pools, nodeDecoder); err != nil { + return err + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -159843,13 +160850,13 @@ func awsEc2query_deserializeOpDocumentDescribeNetworkInterfacesOutput(v **Descri return nil } -func awsEc2query_deserializeOpDocumentDescribePlacementGroupsOutput(v **DescribePlacementGroupsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeRegionsOutput(v **DescribeRegionsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribePlacementGroupsOutput + var sv *DescribeRegionsOutput if *v == nil { - sv = &DescribePlacementGroupsOutput{} + sv = &DescribeRegionsOutput{} } else { sv = *v } @@ -159865,9 +160872,9 @@ func awsEc2query_deserializeOpDocumentDescribePlacementGroupsOutput(v **Describe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("placementGroupSet", t.Name.Local): + case strings.EqualFold("regionInfo", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPlacementGroupList(&sv.PlacementGroups, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentRegionList(&sv.Regions, nodeDecoder); err != nil { return err } @@ -159885,13 +160892,13 @@ func awsEc2query_deserializeOpDocumentDescribePlacementGroupsOutput(v **Describe return nil } -func awsEc2query_deserializeOpDocumentDescribePrefixListsOutput(v **DescribePrefixListsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeReplaceRootVolumeTasksOutput(v **DescribeReplaceRootVolumeTasksOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribePrefixListsOutput + var sv *DescribeReplaceRootVolumeTasksOutput if *v == nil { - sv = &DescribePrefixListsOutput{} + sv = &DescribeReplaceRootVolumeTasksOutput{} } else { sv = *v } @@ -159920,9 +160927,9 @@ func awsEc2query_deserializeOpDocumentDescribePrefixListsOutput(v **DescribePref sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("prefixListSet", t.Name.Local): + case strings.EqualFold("replaceRootVolumeTaskSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrefixListSet(&sv.PrefixLists, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentReplaceRootVolumeTasks(&sv.ReplaceRootVolumeTasks, nodeDecoder); err != nil { return err } @@ -159940,13 +160947,13 @@ func awsEc2query_deserializeOpDocumentDescribePrefixListsOutput(v **DescribePref return nil } -func awsEc2query_deserializeOpDocumentDescribePrincipalIdFormatOutput(v **DescribePrincipalIdFormatOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeReservedInstancesListingsOutput(v **DescribeReservedInstancesListingsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribePrincipalIdFormatOutput + var sv *DescribeReservedInstancesListingsOutput if *v == nil { - sv = &DescribePrincipalIdFormatOutput{} + sv = &DescribeReservedInstancesListingsOutput{} } else { sv = *v } @@ -159962,22 +160969,9 @@ func awsEc2query_deserializeOpDocumentDescribePrincipalIdFormatOutput(v **Descri originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("principalSet", t.Name.Local): + case strings.EqualFold("reservedInstancesListingsSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPrincipalIdFormatList(&sv.Principals, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentReservedInstancesListingList(&sv.ReservedInstancesListings, nodeDecoder); err != nil { return err } @@ -159995,13 +160989,13 @@ func awsEc2query_deserializeOpDocumentDescribePrincipalIdFormatOutput(v **Descri return nil } -func awsEc2query_deserializeOpDocumentDescribePublicIpv4PoolsOutput(v **DescribePublicIpv4PoolsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeReservedInstancesModificationsOutput(v **DescribeReservedInstancesModificationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribePublicIpv4PoolsOutput + var sv *DescribeReservedInstancesModificationsOutput if *v == nil { - sv = &DescribePublicIpv4PoolsOutput{} + sv = &DescribeReservedInstancesModificationsOutput{} } else { sv = *v } @@ -160030,51 +161024,9 @@ func awsEc2query_deserializeOpDocumentDescribePublicIpv4PoolsOutput(v **Describe sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("publicIpv4PoolSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentPublicIpv4PoolSet(&sv.PublicIpv4Pools, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeRegionsOutput(v **DescribeRegionsOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeRegionsOutput - if *v == nil { - sv = &DescribeRegionsOutput{} - } 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("regionInfo", t.Name.Local): + case strings.EqualFold("reservedInstancesModificationsSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRegionList(&sv.Regions, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentReservedInstancesModificationList(&sv.ReservedInstancesModifications, nodeDecoder); err != nil { return err } @@ -160092,13 +161044,13 @@ func awsEc2query_deserializeOpDocumentDescribeRegionsOutput(v **DescribeRegionsO return nil } -func awsEc2query_deserializeOpDocumentDescribeReplaceRootVolumeTasksOutput(v **DescribeReplaceRootVolumeTasksOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOfferingsOutput(v **DescribeReservedInstancesOfferingsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeReplaceRootVolumeTasksOutput + var sv *DescribeReservedInstancesOfferingsOutput if *v == nil { - sv = &DescribeReplaceRootVolumeTasksOutput{} + sv = &DescribeReservedInstancesOfferingsOutput{} } else { sv = *v } @@ -160127,9 +161079,9 @@ func awsEc2query_deserializeOpDocumentDescribeReplaceRootVolumeTasksOutput(v **D sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("replaceRootVolumeTaskSet", t.Name.Local): + case strings.EqualFold("reservedInstancesOfferingsSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReplaceRootVolumeTasks(&sv.ReplaceRootVolumeTasks, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentReservedInstancesOfferingList(&sv.ReservedInstancesOfferings, nodeDecoder); err != nil { return err } @@ -160147,13 +161099,13 @@ func awsEc2query_deserializeOpDocumentDescribeReplaceRootVolumeTasksOutput(v **D return nil } -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesListingsOutput(v **DescribeReservedInstancesListingsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOutput(v **DescribeReservedInstancesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeReservedInstancesListingsOutput + var sv *DescribeReservedInstancesOutput if *v == nil { - sv = &DescribeReservedInstancesListingsOutput{} + sv = &DescribeReservedInstancesOutput{} } else { sv = *v } @@ -160169,9 +161121,9 @@ func awsEc2query_deserializeOpDocumentDescribeReservedInstancesListingsOutput(v originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("reservedInstancesListingsSet", t.Name.Local): + case strings.EqualFold("reservedInstancesSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesListingList(&sv.ReservedInstancesListings, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentReservedInstancesList(&sv.ReservedInstances, nodeDecoder); err != nil { return err } @@ -160189,13 +161141,13 @@ func awsEc2query_deserializeOpDocumentDescribeReservedInstancesListingsOutput(v return nil } -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesModificationsOutput(v **DescribeReservedInstancesModificationsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeRouteTablesOutput(v **DescribeRouteTablesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeReservedInstancesModificationsOutput + var sv *DescribeRouteTablesOutput if *v == nil { - sv = &DescribeReservedInstancesModificationsOutput{} + sv = &DescribeRouteTablesOutput{} } else { sv = *v } @@ -160224,9 +161176,9 @@ func awsEc2query_deserializeOpDocumentDescribeReservedInstancesModificationsOutp sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("reservedInstancesModificationsSet", t.Name.Local): + case strings.EqualFold("routeTableSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesModificationList(&sv.ReservedInstancesModifications, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentRouteTableList(&sv.RouteTables, nodeDecoder); err != nil { return err } @@ -160244,13 +161196,13 @@ func awsEc2query_deserializeOpDocumentDescribeReservedInstancesModificationsOutp return nil } -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOfferingsOutput(v **DescribeReservedInstancesOfferingsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeScheduledInstanceAvailabilityOutput(v **DescribeScheduledInstanceAvailabilityOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeReservedInstancesOfferingsOutput + var sv *DescribeScheduledInstanceAvailabilityOutput if *v == nil { - sv = &DescribeReservedInstancesOfferingsOutput{} + sv = &DescribeScheduledInstanceAvailabilityOutput{} } else { sv = *v } @@ -160279,51 +161231,9 @@ func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOfferingsOutput(v sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("reservedInstancesOfferingsSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesOfferingList(&sv.ReservedInstancesOfferings, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOutput(v **DescribeReservedInstancesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeReservedInstancesOutput - if *v == nil { - sv = &DescribeReservedInstancesOutput{} - } 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("reservedInstancesSet", t.Name.Local): + case strings.EqualFold("scheduledInstanceAvailabilitySet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentReservedInstancesList(&sv.ReservedInstances, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentScheduledInstanceAvailabilitySet(&sv.ScheduledInstanceAvailabilitySet, nodeDecoder); err != nil { return err } @@ -160341,13 +161251,13 @@ func awsEc2query_deserializeOpDocumentDescribeReservedInstancesOutput(v **Descri return nil } -func awsEc2query_deserializeOpDocumentDescribeRouteTablesOutput(v **DescribeRouteTablesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeScheduledInstancesOutput(v **DescribeScheduledInstancesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeRouteTablesOutput + var sv *DescribeScheduledInstancesOutput if *v == nil { - sv = &DescribeRouteTablesOutput{} + sv = &DescribeScheduledInstancesOutput{} } else { sv = *v } @@ -160376,9 +161286,9 @@ func awsEc2query_deserializeOpDocumentDescribeRouteTablesOutput(v **DescribeRout sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("routeTableSet", t.Name.Local): + case strings.EqualFold("scheduledInstanceSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentRouteTableList(&sv.RouteTables, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentScheduledInstanceSet(&sv.ScheduledInstanceSet, nodeDecoder); err != nil { return err } @@ -160396,13 +161306,13 @@ func awsEc2query_deserializeOpDocumentDescribeRouteTablesOutput(v **DescribeRout return nil } -func awsEc2query_deserializeOpDocumentDescribeScheduledInstanceAvailabilityOutput(v **DescribeScheduledInstanceAvailabilityOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeSecurityGroupReferencesOutput(v **DescribeSecurityGroupReferencesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeScheduledInstanceAvailabilityOutput + var sv *DescribeSecurityGroupReferencesOutput if *v == nil { - sv = &DescribeScheduledInstanceAvailabilityOutput{} + sv = &DescribeSecurityGroupReferencesOutput{} } else { sv = *v } @@ -160418,22 +161328,9 @@ func awsEc2query_deserializeOpDocumentDescribeScheduledInstanceAvailabilityOutpu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("nextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) - } - - case strings.EqualFold("scheduledInstanceAvailabilitySet", t.Name.Local): + case strings.EqualFold("securityGroupReferenceSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentScheduledInstanceAvailabilitySet(&sv.ScheduledInstanceAvailabilitySet, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentSecurityGroupReferences(&sv.SecurityGroupReferenceSet, nodeDecoder); err != nil { return err } @@ -160451,13 +161348,13 @@ func awsEc2query_deserializeOpDocumentDescribeScheduledInstanceAvailabilityOutpu return nil } -func awsEc2query_deserializeOpDocumentDescribeScheduledInstancesOutput(v **DescribeScheduledInstancesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeSecurityGroupRulesOutput(v **DescribeSecurityGroupRulesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeScheduledInstancesOutput + var sv *DescribeSecurityGroupRulesOutput if *v == nil { - sv = &DescribeScheduledInstancesOutput{} + sv = &DescribeSecurityGroupRulesOutput{} } else { sv = *v } @@ -160486,51 +161383,9 @@ func awsEc2query_deserializeOpDocumentDescribeScheduledInstancesOutput(v **Descr sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("scheduledInstanceSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentScheduledInstanceSet(&sv.ScheduledInstanceSet, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsEc2query_deserializeOpDocumentDescribeSecurityGroupReferencesOutput(v **DescribeSecurityGroupReferencesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *DescribeSecurityGroupReferencesOutput - if *v == nil { - sv = &DescribeSecurityGroupReferencesOutput{} - } 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("securityGroupReferenceSet", t.Name.Local): + case strings.EqualFold("securityGroupRuleSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupReferences(&sv.SecurityGroupReferenceSet, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentSecurityGroupRuleList(&sv.SecurityGroupRules, nodeDecoder); err != nil { return err } @@ -160548,13 +161403,13 @@ func awsEc2query_deserializeOpDocumentDescribeSecurityGroupReferencesOutput(v ** return nil } -func awsEc2query_deserializeOpDocumentDescribeSecurityGroupRulesOutput(v **DescribeSecurityGroupRulesOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeSecurityGroupsOutput(v **DescribeSecurityGroupsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeSecurityGroupRulesOutput + var sv *DescribeSecurityGroupsOutput if *v == nil { - sv = &DescribeSecurityGroupRulesOutput{} + sv = &DescribeSecurityGroupsOutput{} } else { sv = *v } @@ -160583,9 +161438,9 @@ func awsEc2query_deserializeOpDocumentDescribeSecurityGroupRulesOutput(v **Descr sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("securityGroupRuleSet", t.Name.Local): + case strings.EqualFold("securityGroupInfo", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupRuleList(&sv.SecurityGroupRules, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentSecurityGroupList(&sv.SecurityGroups, nodeDecoder); err != nil { return err } @@ -160603,13 +161458,13 @@ func awsEc2query_deserializeOpDocumentDescribeSecurityGroupRulesOutput(v **Descr return nil } -func awsEc2query_deserializeOpDocumentDescribeSecurityGroupsOutput(v **DescribeSecurityGroupsOutput, decoder smithyxml.NodeDecoder) error { +func awsEc2query_deserializeOpDocumentDescribeSecurityGroupVpcAssociationsOutput(v **DescribeSecurityGroupVpcAssociationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DescribeSecurityGroupsOutput + var sv *DescribeSecurityGroupVpcAssociationsOutput if *v == nil { - sv = &DescribeSecurityGroupsOutput{} + sv = &DescribeSecurityGroupVpcAssociationsOutput{} } else { sv = *v } @@ -160638,9 +161493,9 @@ func awsEc2query_deserializeOpDocumentDescribeSecurityGroupsOutput(v **DescribeS sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("securityGroupInfo", t.Name.Local): + case strings.EqualFold("securityGroupVpcAssociationSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsEc2query_deserializeDocumentSecurityGroupList(&sv.SecurityGroups, nodeDecoder); err != nil { + if err := awsEc2query_deserializeDocumentSecurityGroupVpcAssociationList(&sv.SecurityGroupVpcAssociations, nodeDecoder); err != nil { return err } @@ -164917,6 +165772,55 @@ func awsEc2query_deserializeOpDocumentDisassociateNatGatewayAddressOutput(v **Di return nil } +func awsEc2query_deserializeOpDocumentDisassociateSecurityGroupVpcOutput(v **DisassociateSecurityGroupVpcOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DisassociateSecurityGroupVpcOutput + if *v == nil { + sv = &DisassociateSecurityGroupVpcOutput{} + } 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("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.SecurityGroupVpcAssociationState(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_deserializeOpDocumentDisassociateSubnetCidrBlockOutput(v **DisassociateSubnetCidrBlockOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -175149,6 +176053,12 @@ func awsEc2query_deserializeOpDocumentRevokeSecurityGroupEgressOutput(v **Revoke sv.Return = ptr.Bool(xtv) } + case strings.EqualFold("revokedSecurityGroupRuleSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRuleList(&sv.RevokedSecurityGroupRules, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("unknownIpPermissionSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentIpPermissionList(&sv.UnknownIpPermissions, nodeDecoder); err != nil { @@ -175207,6 +176117,12 @@ func awsEc2query_deserializeOpDocumentRevokeSecurityGroupIngressOutput(v **Revok sv.Return = ptr.Bool(xtv) } + case strings.EqualFold("revokedSecurityGroupRuleSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentRevokedSecurityGroupRuleList(&sv.RevokedSecurityGroupRules, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("unknownIpPermissionSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentIpPermissionList(&sv.UnknownIpPermissions, nodeDecoder); err != nil { diff --git a/service/ec2/generated.json b/service/ec2/generated.json index 7426e57d550..7631a3dd7ef 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -37,6 +37,7 @@ "api_op_AssociateIpamResourceDiscovery.go", "api_op_AssociateNatGatewayAddress.go", "api_op_AssociateRouteTable.go", + "api_op_AssociateSecurityGroupVpc.go", "api_op_AssociateSubnetCidrBlock.go", "api_op_AssociateTransitGatewayMulticastDomain.go", "api_op_AssociateTransitGatewayPolicyTable.go", @@ -338,6 +339,7 @@ "api_op_DescribeScheduledInstances.go", "api_op_DescribeSecurityGroupReferences.go", "api_op_DescribeSecurityGroupRules.go", + "api_op_DescribeSecurityGroupVpcAssociations.go", "api_op_DescribeSecurityGroups.go", "api_op_DescribeSnapshotAttribute.go", "api_op_DescribeSnapshotTierStatus.go", @@ -421,6 +423,7 @@ "api_op_DisassociateIpamResourceDiscovery.go", "api_op_DisassociateNatGatewayAddress.go", "api_op_DisassociateRouteTable.go", + "api_op_DisassociateSecurityGroupVpc.go", "api_op_DisassociateSubnetCidrBlock.go", "api_op_DisassociateTransitGatewayMulticastDomain.go", "api_op_DisassociateTransitGatewayPolicyTable.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index d9054698b33..7d889125e17 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -1908,6 +1908,76 @@ func (m *awsEc2query_serializeOpAssociateRouteTable) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpAssociateSecurityGroupVpc struct { +} + +func (*awsEc2query_serializeOpAssociateSecurityGroupVpc) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpAssociateSecurityGroupVpc) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*AssociateSecurityGroupVpcInput) + _ = 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("AssociateSecurityGroupVpc") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentAssociateSecurityGroupVpcInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpAssociateSubnetCidrBlock struct { } @@ -22978,6 +23048,76 @@ func (m *awsEc2query_serializeOpDescribeSecurityGroups) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations struct { +} + +func (*awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDescribeSecurityGroupVpcAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DescribeSecurityGroupVpcAssociationsInput) + _ = 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("DescribeSecurityGroupVpcAssociations") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDescribeSecurityGroupVpcAssociationsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpDescribeSnapshotAttribute struct { } @@ -28718,6 +28858,76 @@ func (m *awsEc2query_serializeOpDisassociateRouteTable) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDisassociateSecurityGroupVpc struct { +} + +func (*awsEc2query_serializeOpDisassociateSecurityGroupVpc) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDisassociateSecurityGroupVpc) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DisassociateSecurityGroupVpcInput) + _ = 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("DisassociateSecurityGroupVpc") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDisassociateSecurityGroupVpcInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpDisassociateSubnetCidrBlock struct { } @@ -55065,6 +55275,28 @@ func awsEc2query_serializeOpDocumentAssociateRouteTableInput(v *AssociateRouteTa return nil } +func awsEc2query_serializeOpDocumentAssociateSecurityGroupVpcInput(v *AssociateSecurityGroupVpcInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.GroupId != nil { + objectKey := object.Key("GroupId") + objectKey.String(*v.GroupId) + } + + if v.VpcId != nil { + objectKey := object.Key("VpcId") + objectKey.String(*v.VpcId) + } + + return nil +} + func awsEc2query_serializeOpDocumentAssociateSubnetCidrBlockInput(v *AssociateSubnetCidrBlockInput, value query.Value) error { object := value.Object() _ = object @@ -64931,6 +65163,35 @@ func awsEc2query_serializeOpDocumentDescribeSecurityGroupsInput(v *DescribeSecur return nil } +func awsEc2query_serializeOpDocumentDescribeSecurityGroupVpcAssociationsInput(v *DescribeSecurityGroupVpcAssociationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.Filters != nil { + objectKey := object.FlatKey("Filter") + if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + func awsEc2query_serializeOpDocumentDescribeSnapshotAttributeInput(v *DescribeSnapshotAttributeInput, value query.Value) error { object := value.Object() _ = object @@ -67277,6 +67538,28 @@ func awsEc2query_serializeOpDocumentDisassociateRouteTableInput(v *DisassociateR return nil } +func awsEc2query_serializeOpDocumentDisassociateSecurityGroupVpcInput(v *DisassociateSecurityGroupVpcInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.GroupId != nil { + objectKey := object.Key("GroupId") + objectKey.String(*v.GroupId) + } + + if v.VpcId != nil { + objectKey := object.Key("VpcId") + objectKey.String(*v.VpcId) + } + + return nil +} + func awsEc2query_serializeOpDocumentDisassociateSubnetCidrBlockInput(v *DisassociateSubnetCidrBlockInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/snapshot/api_op_AssociateSecurityGroupVpc.go.snap b/service/ec2/snapshot/api_op_AssociateSecurityGroupVpc.go.snap new file mode 100644 index 00000000000..c8c851f7ac2 --- /dev/null +++ b/service/ec2/snapshot/api_op_AssociateSecurityGroupVpc.go.snap @@ -0,0 +1,41 @@ +AssociateSecurityGroupVpc + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ec2/snapshot/api_op_DescribeSecurityGroupVpcAssociations.go.snap b/service/ec2/snapshot/api_op_DescribeSecurityGroupVpcAssociations.go.snap new file mode 100644 index 00000000000..e119de0f33c --- /dev/null +++ b/service/ec2/snapshot/api_op_DescribeSecurityGroupVpcAssociations.go.snap @@ -0,0 +1,40 @@ +DescribeSecurityGroupVpcAssociations + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ec2/snapshot/api_op_DisassociateSecurityGroupVpc.go.snap b/service/ec2/snapshot/api_op_DisassociateSecurityGroupVpc.go.snap new file mode 100644 index 00000000000..9d4deb41748 --- /dev/null +++ b/service/ec2/snapshot/api_op_DisassociateSecurityGroupVpc.go.snap @@ -0,0 +1,41 @@ +DisassociateSecurityGroupVpc + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ec2/snapshot_test.go b/service/ec2/snapshot_test.go index 6594d47faa1..db30388b899 100644 --- a/service/ec2/snapshot_test.go +++ b/service/ec2/snapshot_test.go @@ -386,6 +386,18 @@ func TestCheckSnapshot_AssociateRouteTable(t *testing.T) { } } +func TestCheckSnapshot_AssociateSecurityGroupVpc(t *testing.T) { + svc := New(Options{}) + _, err := svc.AssociateSecurityGroupVpc(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "AssociateSecurityGroupVpc") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_AssociateSubnetCidrBlock(t *testing.T) { svc := New(Options{}) _, err := svc.AssociateSubnetCidrBlock(context.Background(), nil, func(o *Options) { @@ -3998,6 +4010,18 @@ func TestCheckSnapshot_DescribeSecurityGroups(t *testing.T) { } } +func TestCheckSnapshot_DescribeSecurityGroupVpcAssociations(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeSecurityGroupVpcAssociations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeSecurityGroupVpcAssociations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeSnapshotAttribute(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeSnapshotAttribute(context.Background(), nil, func(o *Options) { @@ -4982,6 +5006,18 @@ func TestCheckSnapshot_DisassociateRouteTable(t *testing.T) { } } +func TestCheckSnapshot_DisassociateSecurityGroupVpc(t *testing.T) { + svc := New(Options{}) + _, err := svc.DisassociateSecurityGroupVpc(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DisassociateSecurityGroupVpc") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DisassociateSubnetCidrBlock(t *testing.T) { svc := New(Options{}) _, err := svc.DisassociateSubnetCidrBlock(context.Background(), nil, func(o *Options) { @@ -7993,6 +8029,18 @@ func TestUpdateSnapshot_AssociateRouteTable(t *testing.T) { } } +func TestUpdateSnapshot_AssociateSecurityGroupVpc(t *testing.T) { + svc := New(Options{}) + _, err := svc.AssociateSecurityGroupVpc(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "AssociateSecurityGroupVpc") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_AssociateSubnetCidrBlock(t *testing.T) { svc := New(Options{}) _, err := svc.AssociateSubnetCidrBlock(context.Background(), nil, func(o *Options) { @@ -11605,6 +11653,18 @@ func TestUpdateSnapshot_DescribeSecurityGroups(t *testing.T) { } } +func TestUpdateSnapshot_DescribeSecurityGroupVpcAssociations(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeSecurityGroupVpcAssociations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeSecurityGroupVpcAssociations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeSnapshotAttribute(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeSnapshotAttribute(context.Background(), nil, func(o *Options) { @@ -12589,6 +12649,18 @@ func TestUpdateSnapshot_DisassociateRouteTable(t *testing.T) { } } +func TestUpdateSnapshot_DisassociateSecurityGroupVpc(t *testing.T) { + svc := New(Options{}) + _, err := svc.DisassociateSecurityGroupVpc(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DisassociateSecurityGroupVpc") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DisassociateSubnetCidrBlock(t *testing.T) { svc := New(Options{}) _, err := svc.DisassociateSubnetCidrBlock(context.Background(), nil, func(o *Options) { diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 558bf7229af..c267c308b17 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -7519,6 +7519,34 @@ func (SecurityGroupReferencingSupportValue) Values() []SecurityGroupReferencingS } } +type SecurityGroupVpcAssociationState string + +// Enum values for SecurityGroupVpcAssociationState +const ( + SecurityGroupVpcAssociationStateAssociating SecurityGroupVpcAssociationState = "associating" + SecurityGroupVpcAssociationStateAssociated SecurityGroupVpcAssociationState = "associated" + SecurityGroupVpcAssociationStateAssociationFailed SecurityGroupVpcAssociationState = "association-failed" + SecurityGroupVpcAssociationStateDisassociating SecurityGroupVpcAssociationState = "disassociating" + SecurityGroupVpcAssociationStateDisassociated SecurityGroupVpcAssociationState = "disassociated" + SecurityGroupVpcAssociationStateDisassociationFailed SecurityGroupVpcAssociationState = "disassociation-failed" +) + +// Values returns all known values for SecurityGroupVpcAssociationState. 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 (SecurityGroupVpcAssociationState) Values() []SecurityGroupVpcAssociationState { + return []SecurityGroupVpcAssociationState{ + "associating", + "associated", + "association-failed", + "disassociating", + "disassociated", + "disassociation-failed", + } +} + type SelfServicePortal string // Enum values for SelfServicePortal diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index b3af19d8945..d4169cc7168 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -7024,7 +7024,7 @@ type InstanceNetworkInterface struct { // The type of network interface. // - // Valid values: interface | efa | trunk + // Valid values: interface | efa | efa-only | trunk InterfaceType *string // The IPv4 delegated prefixes that are assigned to the network interface. @@ -7177,7 +7177,10 @@ type InstanceNetworkInterfaceSpecification struct { // The type of network interface. // - // Valid values: interface | efa + // If you specify efa-only , do not assign any IP addresses to the network + // interface. EFA-only network interfaces do not support IP addresses. + // + // Valid values: interface | efa | efa-only InterfaceType *string // The number of IPv4 delegated prefixes to be automatically assigned to the @@ -8318,7 +8321,8 @@ type InstanceTypeInfo struct { // The supported root device types. SupportedRootDeviceTypes []RootDeviceType - // Indicates whether the instance type is offered for spot or On-Demand. + // Indicates whether the instance type is offered for spot, On-Demand, or Capacity + // Blocks. SupportedUsageClasses []UsageClassType // The supported virtualization types. @@ -10435,11 +10439,14 @@ type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct { Groups []string // The type of network interface. To create an Elastic Fabric Adapter (EFA), - // specify efa . For more information, see [Elastic Fabric Adapter] in the Amazon EC2 User Guide. + // specify efa or efa . For more information, see [Elastic Fabric Adapter] in the Amazon EC2 User Guide. // // If you are not creating an EFA, specify interface or omit this parameter. // - // Valid values: interface | efa + // If you specify efa-only , do not assign any IP addresses to the network + // interface. EFA-only network interfaces do not support IP addresses. + // + // Valid values: interface | efa | efa-only // // [Elastic Fabric Adapter]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html InterfaceType *string @@ -14699,6 +14706,48 @@ type ResponseLaunchTemplateData struct { noSmithyDocumentSerde } +// A security group rule removed with [RevokeSecurityGroupEgress] or [RevokeSecurityGroupIngress]. +// +// [RevokeSecurityGroupIngress]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RevokeSecurityGroupIngress.html +// [RevokeSecurityGroupEgress]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RevokeSecurityGroupEgress.html +type RevokedSecurityGroupRule struct { + + // The IPv4 CIDR of the traffic source. + CidrIpv4 *string + + // The IPv6 CIDR of the traffic source. + CidrIpv6 *string + + // A description of the revoked security group rule. + Description *string + + // The 'from' port number of the security group rule. + FromPort *int32 + + // A security group ID. + GroupId *string + + // The security group rule's protocol. + IpProtocol *string + + // Defines if a security group rule is an outbound rule. + IsEgress *bool + + // The ID of a prefix list that's the traffic source. + PrefixListId *string + + // The ID of a referenced security group. + ReferencedGroupId *string + + // A security group rule ID. + SecurityGroupRuleId *string + + // The 'to' port number of the security group rule. + ToPort *int32 + + noSmithyDocumentSerde +} + // Describes a route in a route table. type Route struct { @@ -15321,6 +15370,9 @@ type SecurityGroup struct { // The Amazon Web Services account ID of the owner of the security group. OwnerId *string + // The ARN of the security group. + SecurityGroupArn *string + // Any tags assigned to the security group. Tags []Tag @@ -15428,6 +15480,9 @@ type SecurityGroupRule struct { // Describes the security group that is referenced in the rule. ReferencedGroupInfo *ReferencedSecurityGroup + // The ARN of the security group rule. + SecurityGroupRuleArn *string + // The ID of the security group rule. SecurityGroupRuleId *string @@ -15527,6 +15582,29 @@ type SecurityGroupRuleUpdate struct { noSmithyDocumentSerde } +// A security group association with a VPC that you made with [AssociateSecurityGroupVpc]. +// +// [AssociateSecurityGroupVpc]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateSecurityGroupVpc.html +type SecurityGroupVpcAssociation struct { + + // The association's security group ID. + GroupId *string + + // The association's state. + State SecurityGroupVpcAssociationState + + // The association's state reason. + StateReason *string + + // The association's VPC ID. + VpcId *string + + // The Amazon Web Services account ID of the owner of the VPC. + VpcOwnerId *string + + noSmithyDocumentSerde +} + // Describes a service configuration for a VPC endpoint service. type ServiceConfiguration struct { diff --git a/service/ec2/validators.go b/service/ec2/validators.go index f9afd138e8c..30ca8697536 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -490,6 +490,26 @@ func (m *validateOpAssociateRouteTable) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpAssociateSecurityGroupVpc struct { +} + +func (*validateOpAssociateSecurityGroupVpc) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateSecurityGroupVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateSecurityGroupVpcInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateSecurityGroupVpcInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpAssociateSubnetCidrBlock struct { } @@ -4970,6 +4990,26 @@ func (m *validateOpDisassociateRouteTable) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDisassociateSecurityGroupVpc struct { +} + +func (*validateOpDisassociateSecurityGroupVpc) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateSecurityGroupVpc) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateSecurityGroupVpcInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateSecurityGroupVpcInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisassociateSubnetCidrBlock struct { } @@ -9046,6 +9086,10 @@ func addOpAssociateRouteTableValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpAssociateRouteTable{}, middleware.After) } +func addOpAssociateSecurityGroupVpcValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateSecurityGroupVpc{}, middleware.After) +} + func addOpAssociateSubnetCidrBlockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateSubnetCidrBlock{}, middleware.After) } @@ -9942,6 +9986,10 @@ func addOpDisassociateRouteTableValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpDisassociateRouteTable{}, middleware.After) } +func addOpDisassociateSecurityGroupVpcValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateSecurityGroupVpc{}, middleware.After) +} + func addOpDisassociateSubnetCidrBlockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateSubnetCidrBlock{}, middleware.After) } @@ -12028,6 +12076,24 @@ func validateOpAssociateRouteTableInput(v *AssociateRouteTableInput) error { } } +func validateOpAssociateSecurityGroupVpcInput(v *AssociateSecurityGroupVpcInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateSecurityGroupVpcInput"} + if v.GroupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("GroupId")) + } + if v.VpcId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAssociateSubnetCidrBlockInput(v *AssociateSubnetCidrBlockInput) error { if v == nil { return nil @@ -15778,6 +15844,24 @@ func validateOpDisassociateRouteTableInput(v *DisassociateRouteTableInput) error } } +func validateOpDisassociateSecurityGroupVpcInput(v *DisassociateSecurityGroupVpcInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateSecurityGroupVpcInput"} + if v.GroupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("GroupId")) + } + if v.VpcId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisassociateSubnetCidrBlockInput(v *DisassociateSubnetCidrBlockInput) error { if v == nil { return nil diff --git a/service/ecs/api_op_CreateCluster.go b/service/ecs/api_op_CreateCluster.go index f08f5df70a1..36774356637 100644 --- a/service/ecs/api_op_CreateCluster.go +++ b/service/ecs/api_op_CreateCluster.go @@ -15,7 +15,7 @@ import ( // cluster when you launch your first container instance. However, you can create // your own cluster with a unique name. // -// When you call the [CreateCluster] API operation, Amazon ECS attempts to create the Amazon ECS +// When you call the CreateCluster API operation, Amazon ECS attempts to create the Amazon ECS // service-linked role for your account. This is so that it can manage required // resources in other Amazon Web Services services on your behalf. However, if the // user that makes the call doesn't have permissions to create the service-linked @@ -23,7 +23,6 @@ import ( // Container Service Developer Guide. // // [Using service-linked roles for Amazon ECS]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html -// [CreateCluster]: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html func (c *Client) CreateCluster(ctx context.Context, params *CreateClusterInput, optFns ...func(*Options)) (*CreateClusterOutput, error) { if params == nil { params = &CreateClusterInput{} diff --git a/service/ecs/api_op_CreateService.go b/service/ecs/api_op_CreateService.go index d4ca8b37a11..09ea936a4b3 100644 --- a/service/ecs/api_op_CreateService.go +++ b/service/ecs/api_op_CreateService.go @@ -14,7 +14,7 @@ import ( // Runs and maintains your desired number of tasks from a specified task // definition. If the number of tasks running in a service drops below the // desiredCount , Amazon ECS runs another copy of the task in the specified -// cluster. To update an existing service, use [UpdateService]. +// cluster. To update an existing service, see the UpdateServiceaction. // // On March 21, 2024, a change was made to resolve the task definition revision // before authorization. When a task definition revision is not specified, @@ -159,7 +159,7 @@ type CreateServiceInput struct { Cluster *string // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. + // deployment and the failure detection methods. DeploymentConfiguration *types.DeploymentConfiguration // The deployment controller to use for the service. If no deployment controller diff --git a/service/ecs/api_op_DescribeServiceDeployments.go b/service/ecs/api_op_DescribeServiceDeployments.go new file mode 100644 index 00000000000..b59b32ee4a8 --- /dev/null +++ b/service/ecs/api_op_DescribeServiceDeployments.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ecs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes one or more of your service deployments. +// +// A service deployment happens when you release a software update for the +// service. For more information, see [Amazon ECS service deployments]. +// +// [Amazon ECS service deployments]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-deployments.html +func (c *Client) DescribeServiceDeployments(ctx context.Context, params *DescribeServiceDeploymentsInput, optFns ...func(*Options)) (*DescribeServiceDeploymentsOutput, error) { + if params == nil { + params = &DescribeServiceDeploymentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeServiceDeployments", params, optFns, c.addOperationDescribeServiceDeploymentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeServiceDeploymentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeServiceDeploymentsInput struct { + + // The ARN of the service deployment. + // + // You can specify a maximum of 20 ARNs. + // + // This member is required. + ServiceDeploymentArns []string + + noSmithyDocumentSerde +} + +type DescribeServiceDeploymentsOutput struct { + + // Any failures associated with the call. + // + // If you decsribe a deployment with a service revision created before October 25, + // 2024, the call fails. The failure includes the service revision ARN and the + // reason set to MISSING . + Failures []types.Failure + + // The list of service deployments described. + ServiceDeployments []types.ServiceDeployment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeServiceDeploymentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeServiceDeployments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeServiceDeployments{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeServiceDeployments"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeServiceDeploymentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeServiceDeployments(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeServiceDeployments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeServiceDeployments", + } +} diff --git a/service/ecs/api_op_DescribeServiceRevisions.go b/service/ecs/api_op_DescribeServiceRevisions.go new file mode 100644 index 00000000000..7ec557f221b --- /dev/null +++ b/service/ecs/api_op_DescribeServiceRevisions.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ecs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes one or more service revisions. +// +// A service revision is a version of the service that includes the values for the +// Amazon ECS resources (for example, task definition) and the environment +// resources (for example, load balancers, subnets, and security groups). For more +// information, see [Amazon ECS service revisions]. +// +// You can't describe a service revision that was created before October 25, 2024. +// +// [Amazon ECS service revisions]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision.html +func (c *Client) DescribeServiceRevisions(ctx context.Context, params *DescribeServiceRevisionsInput, optFns ...func(*Options)) (*DescribeServiceRevisionsOutput, error) { + if params == nil { + params = &DescribeServiceRevisionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeServiceRevisions", params, optFns, c.addOperationDescribeServiceRevisionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeServiceRevisionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeServiceRevisionsInput struct { + + // The ARN of the service revision. + // + // You can specify a maximum of 20 ARNs. + // + // You can call [ListServiceDeployments] to get the ARNs. + // + // [ListServiceDeployments]: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListServiceDeployments.html + // + // This member is required. + ServiceRevisionArns []string + + noSmithyDocumentSerde +} + +type DescribeServiceRevisionsOutput struct { + + // Any failures associated with the call. + Failures []types.Failure + + // The list of service revisions described. + ServiceRevisions []types.ServiceRevision + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeServiceRevisionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeServiceRevisions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeServiceRevisions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeServiceRevisions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeServiceRevisionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeServiceRevisions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeServiceRevisions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeServiceRevisions", + } +} diff --git a/service/ecs/api_op_ListServiceDeployments.go b/service/ecs/api_op_ListServiceDeployments.go new file mode 100644 index 00000000000..89359832769 --- /dev/null +++ b/service/ecs/api_op_ListServiceDeployments.go @@ -0,0 +1,220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ecs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This operation lists all the service deployments that meet the specified filter +// criteria. +// +// A service deployment happens when you release a softwre update for the service. +// You route traffic from the running service revisions to the new service revison +// and control the number of running tasks. +// +// This API returns the values that you use for the request parameters in [DescribeServiceRevisions]. +// +// [DescribeServiceRevisions]: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServiceRevisions.html +func (c *Client) ListServiceDeployments(ctx context.Context, params *ListServiceDeploymentsInput, optFns ...func(*Options)) (*ListServiceDeploymentsOutput, error) { + if params == nil { + params = &ListServiceDeploymentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListServiceDeployments", params, optFns, c.addOperationListServiceDeploymentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListServiceDeploymentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListServiceDeploymentsInput struct { + + // The ARN or name of the service + // + // This member is required. + Service *string + + // The cluster that hosts the service. This can either be the cluster name or ARN. + // Starting April 15, 2023, Amazon Web Services will not onboard new customers to + // Amazon Elastic Inference (EI), and will help current customers migrate their + // workloads to options that offer better price and performanceIf you don't specify + // a cluster, deault is used. + Cluster *string + + // An optional filter you can use to narrow the results by the service creation + // date. If you do not specify a value, the result includes all services created + // before the current time. The format is yyyy-MM-dd HH:mm:ss.SSSSSS. + CreatedAt *types.CreatedAt + + // The maximum number of service deployment results that ListServiceDeployments + // returned in paginated output. When this parameter is used, + // ListServiceDeployments only returns maxResults results in a single page along + // with a nextToken response element. The remaining results of the initial request + // can be seen by sending another ListServiceDeployments request with the returned + // nextToken value. This value can be between 1 and 100. If this parameter isn't + // used, then ListServiceDeployments returns up to 20 results and a nextToken + // value if applicable. + MaxResults *int32 + + // The nextToken value returned from a ListServiceDeployments request indicating + // that more results are available to fulfill the request and further calls are + // needed. If you provided maxResults , it's possible the number of results is + // fewer than maxResults . + NextToken *string + + // An optional filter you can use to narrow the results. If you do not specify a + // status, then all status values are included in the result. + Status []types.ServiceDeploymentStatus + + noSmithyDocumentSerde +} + +type ListServiceDeploymentsOutput struct { + + // The nextToken value to include in a future ListServiceDeployments request. When + // the results of a ListServiceDeployments request exceed maxResults , this value + // can be used to retrieve the next page of results. This value is null when there + // are no more results to return. + NextToken *string + + // An overview of the service deployment, including the following properties: + // + // - The ARN of the service deployment. + // + // - The ARN of the service being deployed. + // + // - The ARN of the cluster that hosts the service in the service deployment. + // + // - The time that the service deployment started. + // + // - The time that the service deployment completed. + // + // - The service deployment status. + // + // - Information about why the service deployment is in the current state. + // + // - The ARN of the service revision that is being deployed. + ServiceDeployments []types.ServiceDeploymentBrief + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListServiceDeploymentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListServiceDeployments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListServiceDeployments{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListServiceDeployments"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListServiceDeploymentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListServiceDeployments(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListServiceDeployments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListServiceDeployments", + } +} diff --git a/service/ecs/api_op_RegisterTaskDefinition.go b/service/ecs/api_op_RegisterTaskDefinition.go index 8cc12ab8203..cdd7bf2554f 100644 --- a/service/ecs/api_op_RegisterTaskDefinition.go +++ b/service/ecs/api_op_RegisterTaskDefinition.go @@ -141,10 +141,11 @@ type RegisterTaskDefinitionInput struct { // resources. If none is specified, then IPC resources within the containers of a // task are private and not shared with other containers in a task or on the // container instance. If no value is specified, then the IPC resource namespace - // sharing depends on the Docker daemon setting on the container instance. + // sharing depends on the Docker daemon setting on the container instance. For more + // information, see [IPC settings]in the Docker run reference. // // If the host IPC mode is used, be aware that there is a heightened risk of - // undesired IPC namespace expose. + // undesired IPC namespace expose. For more information, see [Docker security]. // // If you are setting namespaced kernel parameters using systemControls for the // containers in the task, the following will apply to your IPC resource namespace. @@ -160,6 +161,8 @@ type RegisterTaskDefinitionInput struct { // This parameter is not supported for Windows containers or tasks run on Fargate. // // [System Controls]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html + // [Docker security]: https://docs.docker.com/engine/security/security/ + // [IPC settings]: https://docs.docker.com/engine/reference/run/#ipc-settings---ipc IpcMode types.IpcMode // The amount of memory (in MiB) used by the task. It can be expressed as an @@ -226,15 +229,17 @@ type RegisterTaskDefinitionInput struct { // user (UID 0). It is considered best practice to use a non-root user. // // If the network mode is awsvpc , the task is allocated an elastic network - // interface, and you must specify a [NetworkConfiguration]value when you create a service or run a task + // interface, and you must specify a NetworkConfigurationvalue when you create a service or run a task // with the task definition. For more information, see [Task Networking]in the Amazon Elastic // Container Service Developer Guide. // // If the network mode is host , you cannot run multiple instantiations of the same // task on a single container instance when port mappings are used. // + // For more information, see [Network settings] in the Docker run reference. + // // [Task Networking]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html - // [NetworkConfiguration]: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_NetworkConfiguration.html + // [Network settings]: https://docs.docker.com/engine/reference/run/#network-settings NetworkMode types.NetworkMode // The process namespace to use for the containers in the task. The valid values @@ -249,16 +254,20 @@ type RegisterTaskDefinitionInput struct { // If task is specified, all containers within the specified task share the same // process namespace. // - // If no value is specified, the default is a private namespace for each container. + // If no value is specified, the default is a private namespace for each + // container. For more information, see [PID settings]in the Docker run reference. // // If the host PID mode is used, there's a heightened risk of undesired process - // namespace exposure. + // namespace exposure. For more information, see [Docker security]. // // This parameter is not supported for Windows containers. // // This parameter is only supported for tasks that are hosted on Fargate if the // tasks are using platform version 1.4.0 or later (Linux). This isn't supported // for Windows containers on Fargate. + // + // [PID settings]: https://docs.docker.com/engine/reference/run/#pid-settings---pid + // [Docker security]: https://docs.docker.com/engine/security/security/ PidMode types.PidMode // An array of placement constraint objects to use for the task. You can specify a diff --git a/service/ecs/api_op_UpdateService.go b/service/ecs/api_op_UpdateService.go index 076ff5c3e26..21afed88811 100644 --- a/service/ecs/api_op_UpdateService.go +++ b/service/ecs/api_op_UpdateService.go @@ -195,7 +195,7 @@ type UpdateServiceInput struct { Cluster *string // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. + // deployment and the failure detection methods. DeploymentConfiguration *types.DeploymentConfiguration // The number of instantiations of the task to place and keep running in your diff --git a/service/ecs/deserializers.go b/service/ecs/deserializers.go index dc72a469cc0..e776c5736a6 100644 --- a/service/ecs/deserializers.go +++ b/service/ecs/deserializers.go @@ -2001,6 +2001,264 @@ func awsAwsjson11_deserializeOpErrorDescribeContainerInstances(response *smithyh } } +type awsAwsjson11_deserializeOpDescribeServiceDeployments struct { +} + +func (*awsAwsjson11_deserializeOpDescribeServiceDeployments) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeServiceDeployments) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDescribeServiceDeployments(response, &metadata) + } + output := &DescribeServiceDeploymentsOutput{} + 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_deserializeOpDocumentDescribeServiceDeploymentsOutput(&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_deserializeOpErrorDescribeServiceDeployments(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsAwsjson11_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ClusterNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorClusterNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("ServiceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorServiceNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedFeatureException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedFeatureException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDescribeServiceRevisions struct { +} + +func (*awsAwsjson11_deserializeOpDescribeServiceRevisions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeServiceRevisions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDescribeServiceRevisions(response, &metadata) + } + output := &DescribeServiceRevisionsOutput{} + 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_deserializeOpDocumentDescribeServiceRevisionsOutput(&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_deserializeOpErrorDescribeServiceRevisions(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsAwsjson11_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ClusterNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorClusterNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("ServiceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorServiceNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedFeatureException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedFeatureException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribeServices struct { } @@ -3327,14 +3585,14 @@ func awsAwsjson11_deserializeOpErrorListContainerInstances(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListServices struct { +type awsAwsjson11_deserializeOpListServiceDeployments struct { } -func (*awsAwsjson11_deserializeOpListServices) ID() string { +func (*awsAwsjson11_deserializeOpListServiceDeployments) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListServices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListServiceDeployments) 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) @@ -3352,9 +3610,9 @@ func (m *awsAwsjson11_deserializeOpListServices) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListServices(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListServiceDeployments(response, &metadata) } - output := &ListServicesOutput{} + output := &ListServiceDeploymentsOutput{} out.Result = output var buff [1024]byte @@ -3374,7 +3632,7 @@ func (m *awsAwsjson11_deserializeOpListServices) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListServicesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListServiceDeploymentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3388,7 +3646,7 @@ func (m *awsAwsjson11_deserializeOpListServices) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListServices(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListServiceDeployments(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)} @@ -3425,11 +3683,137 @@ func awsAwsjson11_deserializeOpErrorListServices(response *smithyhttp.Response, errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): return awsAwsjson11_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ClusterNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorClusterNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsAwsjson11_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("ServiceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorServiceNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedFeatureException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedFeatureException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListServices struct { +} + +func (*awsAwsjson11_deserializeOpListServices) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListServices) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListServices(response, &metadata) + } + output := &ListServicesOutput{} + 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_deserializeOpDocumentListServicesOutput(&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_deserializeOpErrorListServices(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ClientException", errorCode): + return awsAwsjson11_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ClusterNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorClusterNotFoundException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -9733,6 +10117,98 @@ func awsAwsjson11_deserializeDocumentContainerDependency(v **types.ContainerDepe return nil } +func awsAwsjson11_deserializeDocumentContainerImage(v **types.ContainerImage, 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.ContainerImage + if *v == nil { + sv = &types.ContainerImage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "containerName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ContainerName = ptr.String(jtv) + } + + case "image": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Image = ptr.String(jtv) + } + + case "imageDigest": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ImageDigest = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentContainerImages(v *[]types.ContainerImage, 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.ContainerImage + if *v == nil { + cv = []types.ContainerImage{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ContainerImage + destAddr := &col + if err := awsAwsjson11_deserializeDocumentContainerImage(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentContainerInstance(v **types.ContainerInstance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14450,7 +14926,7 @@ func awsAwsjson11_deserializeDocumentResources(v *[]types.Resource, value interf return nil } -func awsAwsjson11_deserializeDocumentRuntimePlatform(v **types.RuntimePlatform, value interface{}) error { +func awsAwsjson11_deserializeDocumentRollback(v **types.Rollback, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14463,31 +14939,47 @@ func awsAwsjson11_deserializeDocumentRuntimePlatform(v **types.RuntimePlatform, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RuntimePlatform + var sv *types.Rollback if *v == nil { - sv = &types.RuntimePlatform{} + sv = &types.Rollback{} } else { sv = *v } for key, value := range shape { switch key { - case "cpuArchitecture": + case "reason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CPUArchitecture to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.CpuArchitecture = types.CPUArchitecture(jtv) + sv.Reason = ptr.String(jtv) } - case "operatingSystemFamily": + case "serviceRevisionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected OSFamily to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceRevisionArn = ptr.String(jtv) + } + + case "startedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.OperatingSystemFamily = types.OSFamily(jtv) } default: @@ -14499,7 +14991,7 @@ func awsAwsjson11_deserializeDocumentRuntimePlatform(v **types.RuntimePlatform, return nil } -func awsAwsjson11_deserializeDocumentScale(v **types.Scale, value interface{}) error { +func awsAwsjson11_deserializeDocumentRuntimePlatform(v **types.RuntimePlatform, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14512,30 +15004,79 @@ func awsAwsjson11_deserializeDocumentScale(v **types.Scale, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Scale + var sv *types.RuntimePlatform if *v == nil { - sv = &types.Scale{} + sv = &types.RuntimePlatform{} } else { sv = *v } for key, value := range shape { switch key { - case "unit": + case "cpuArchitecture": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ScaleUnit to be of type string, got %T instead", value) + return fmt.Errorf("expected CPUArchitecture to be of type string, got %T instead", value) } - sv.Unit = types.ScaleUnit(jtv) + sv.CpuArchitecture = types.CPUArchitecture(jtv) } - case "value": + case "operatingSystemFamily": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OSFamily to be of type string, got %T instead", value) + } + sv.OperatingSystemFamily = types.OSFamily(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentScale(v **types.Scale, 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.Scale + if *v == nil { + sv = &types.Scale{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScaleUnit to be of type string, got %T instead", value) + } + sv.Unit = types.ScaleUnit(jtv) + } + + case "value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { return err } sv.Value = f64 @@ -15415,7 +15956,7 @@ func awsAwsjson11_deserializeDocumentServiceConnectTlsConfiguration(v **types.Se return nil } -func awsAwsjson11_deserializeDocumentServiceEvent(v **types.ServiceEvent, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceDeployment(v **types.ServiceDeployment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15428,15 +15969,29 @@ func awsAwsjson11_deserializeDocumentServiceEvent(v **types.ServiceEvent, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceEvent + var sv *types.ServiceDeployment if *v == nil { - sv = &types.ServiceEvent{} + sv = &types.ServiceDeployment{} } else { sv = *v } for key, value := range shape { switch key { + case "alarms": + if err := awsAwsjson11_deserializeDocumentServiceDeploymentAlarms(&sv.Alarms, value); err != nil { + return err + } + + case "clusterArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ClusterArn = ptr.String(jtv) + } + case "createdAt": if value != nil { switch jtv := value.(type) { @@ -15453,22 +16008,129 @@ func awsAwsjson11_deserializeDocumentServiceEvent(v **types.ServiceEvent, value } } - case "id": + case "deploymentCircuitBreaker": + if err := awsAwsjson11_deserializeDocumentServiceDeploymentCircuitBreaker(&sv.DeploymentCircuitBreaker, value); err != nil { + return err + } + + case "deploymentConfiguration": + if err := awsAwsjson11_deserializeDocumentDeploymentConfiguration(&sv.DeploymentConfiguration, value); err != nil { + return err + } + + case "finishedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "rollback": + if err := awsAwsjson11_deserializeDocumentRollback(&sv.Rollback, value); err != nil { + return err + } + + case "serviceArn": 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) + sv.ServiceArn = ptr.String(jtv) } - case "message": + case "serviceDeploymentArn": 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.ServiceDeploymentArn = ptr.String(jtv) + } + + case "sourceServiceRevisions": + if err := awsAwsjson11_deserializeDocumentServiceRevisionsSummaryList(&sv.SourceServiceRevisions, value); err != nil { + return err + } + + case "startedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceDeploymentStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceDeploymentStatus(jtv) + } + + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + + case "stoppedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StoppedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "targetServiceRevision": + if err := awsAwsjson11_deserializeDocumentServiceRevisionSummary(&sv.TargetServiceRevision, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } default: @@ -15480,7 +16142,7 @@ func awsAwsjson11_deserializeDocumentServiceEvent(v **types.ServiceEvent, value return nil } -func awsAwsjson11_deserializeDocumentServiceEvents(v *[]types.ServiceEvent, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceDeploymentAlarms(v **types.ServiceDeploymentAlarms, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15488,33 +16150,49 @@ func awsAwsjson11_deserializeDocumentServiceEvents(v *[]types.ServiceEvent, valu 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.ServiceEvent + var sv *types.ServiceDeploymentAlarms if *v == nil { - cv = []types.ServiceEvent{} + sv = &types.ServiceDeploymentAlarms{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ServiceEvent - destAddr := &col - if err := awsAwsjson11_deserializeDocumentServiceEvent(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "alarmNames": + if err := awsAwsjson11_deserializeDocumentStringList(&sv.AlarmNames, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceDeploymentRollbackMonitorsStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceDeploymentRollbackMonitorsStatus(jtv) + } + case "triggeredAlarmNames": + if err := awsAwsjson11_deserializeDocumentStringList(&sv.TriggeredAlarmNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentServiceManagedEBSVolumeConfiguration(v **types.ServiceManagedEBSVolumeConfiguration, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceDeploymentBrief(v **types.ServiceDeploymentBrief, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15527,151 +16205,825 @@ func awsAwsjson11_deserializeDocumentServiceManagedEBSVolumeConfiguration(v **ty return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceManagedEBSVolumeConfiguration + var sv *types.ServiceDeploymentBrief if *v == nil { - sv = &types.ServiceManagedEBSVolumeConfiguration{} + sv = &types.ServiceDeploymentBrief{} } else { sv = *v } for key, value := range shape { switch key { - case "encrypted": + case "clusterArn": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.Encrypted = ptr.Bool(jtv) + sv.ClusterArn = ptr.String(jtv) } - case "filesystemType": + case "createdAt": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TaskFilesystemType 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.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.FilesystemType = types.TaskFilesystemType(jtv) } - case "iops": + case "finishedAt": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.Iops = ptr.Int32(int32(i64)) + } + + case "serviceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceArn = ptr.String(jtv) + } + + case "serviceDeploymentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceDeploymentArn = ptr.String(jtv) + } + + case "startedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceDeploymentStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceDeploymentStatus(jtv) + } + + case "statusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusReason = ptr.String(jtv) + } + + case "targetServiceRevisionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TargetServiceRevisionArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceDeploymentCircuitBreaker(v **types.ServiceDeploymentCircuitBreaker, 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.ServiceDeploymentCircuitBreaker + if *v == nil { + sv = &types.ServiceDeploymentCircuitBreaker{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failureCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FailureCount = int32(i64) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceDeploymentRollbackMonitorsStatus to be of type string, got %T instead", value) + } + sv.Status = types.ServiceDeploymentRollbackMonitorsStatus(jtv) + } + + case "threshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Threshold = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceDeployments(v *[]types.ServiceDeployment, 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.ServiceDeployment + if *v == nil { + cv = []types.ServiceDeployment{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceDeployment + destAddr := &col + if err := awsAwsjson11_deserializeDocumentServiceDeployment(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceDeploymentsBrief(v *[]types.ServiceDeploymentBrief, 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.ServiceDeploymentBrief + if *v == nil { + cv = []types.ServiceDeploymentBrief{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceDeploymentBrief + destAddr := &col + if err := awsAwsjson11_deserializeDocumentServiceDeploymentBrief(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceEvent(v **types.ServiceEvent, 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.ServiceEvent + if *v == nil { + sv = &types.ServiceEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = 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_deserializeDocumentServiceEvents(v *[]types.ServiceEvent, 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.ServiceEvent + if *v == nil { + cv = []types.ServiceEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceEvent + destAddr := &col + if err := awsAwsjson11_deserializeDocumentServiceEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceManagedEBSVolumeConfiguration(v **types.ServiceManagedEBSVolumeConfiguration, 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.ServiceManagedEBSVolumeConfiguration + if *v == nil { + sv = &types.ServiceManagedEBSVolumeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "encrypted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + } + sv.Encrypted = ptr.Bool(jtv) + } + + case "filesystemType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskFilesystemType to be of type string, got %T instead", value) + } + sv.FilesystemType = types.TaskFilesystemType(jtv) + } + + case "iops": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EBSKMSKeyId to be of type string, got %T instead", value) + return fmt.Errorf("expected EBSKMSKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "sizeInGiB": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SizeInGiB = ptr.Int32(int32(i64)) + } + + case "snapshotId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EBSSnapshotId to be of type string, got %T instead", value) + } + sv.SnapshotId = ptr.String(jtv) + } + + case "tagSpecifications": + if err := awsAwsjson11_deserializeDocumentEBSTagSpecifications(&sv.TagSpecifications, value); err != nil { + return err + } + + case "throughput": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Throughput = ptr.Int32(int32(i64)) + } + + case "volumeType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EBSVolumeType to be of type string, got %T instead", value) + } + sv.VolumeType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceNotActiveException(v **types.ServiceNotActiveException, 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.ServiceNotActiveException + if *v == nil { + sv = &types.ServiceNotActiveException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.KmsKeyId = ptr.String(jtv) + sv.Message = ptr.String(jtv) } - case "roleArn": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceNotFoundException(v **types.ServiceNotFoundException, 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.ServiceNotFoundException + if *v == nil { + sv = &types.ServiceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceRegistries(v *[]types.ServiceRegistry, 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.ServiceRegistry + if *v == nil { + cv = []types.ServiceRegistry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceRegistry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentServiceRegistry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceRegistry(v **types.ServiceRegistry, 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.ServiceRegistry + if *v == nil { + sv = &types.ServiceRegistry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "containerName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ContainerName = ptr.String(jtv) + } + + case "containerPort": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ContainerPort = ptr.Int32(int32(i64)) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "registryArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RegistryArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentServiceRevision(v **types.ServiceRevision, 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.ServiceRevision + if *v == nil { + sv = &types.ServiceRevision{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "capacityProviderStrategy": + if err := awsAwsjson11_deserializeDocumentCapacityProviderStrategy(&sv.CapacityProviderStrategy, value); err != nil { + return err + } + + case "clusterArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ClusterArn = ptr.String(jtv) + } + + case "containerImages": + if err := awsAwsjson11_deserializeDocumentContainerImages(&sv.ContainerImages, value); err != nil { + return err + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "fargateEphemeralStorage": + if err := awsAwsjson11_deserializeDocumentDeploymentEphemeralStorage(&sv.FargateEphemeralStorage, value); err != nil { + return err + } + + case "guardDutyEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.GuardDutyEnabled = jtv + } + + case "launchType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LaunchType to be of type string, got %T instead", value) + } + sv.LaunchType = types.LaunchType(jtv) + } + + case "loadBalancers": + if err := awsAwsjson11_deserializeDocumentLoadBalancers(&sv.LoadBalancers, value); err != nil { + return err + } + + case "networkConfiguration": + if err := awsAwsjson11_deserializeDocumentNetworkConfiguration(&sv.NetworkConfiguration, value); err != nil { + return err + } + + case "platformFamily": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + sv.PlatformFamily = ptr.String(jtv) } - case "sizeInGiB": + case "platformVersion": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BoxedInteger 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.SizeInGiB = ptr.Int32(int32(i64)) + sv.PlatformVersion = ptr.String(jtv) } - case "snapshotId": + case "serviceArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EBSSnapshotId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.SnapshotId = ptr.String(jtv) + sv.ServiceArn = ptr.String(jtv) } - case "tagSpecifications": - if err := awsAwsjson11_deserializeDocumentEBSTagSpecifications(&sv.TagSpecifications, value); err != nil { + case "serviceConnectConfiguration": + if err := awsAwsjson11_deserializeDocumentServiceConnectConfiguration(&sv.ServiceConnectConfiguration, value); err != nil { return err } - case "throughput": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Throughput = ptr.Int32(int32(i64)) + case "serviceRegistries": + if err := awsAwsjson11_deserializeDocumentServiceRegistries(&sv.ServiceRegistries, value); err != nil { + return err } - case "volumeType": + case "serviceRevisionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EBSVolumeType to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.VolumeType = ptr.String(jtv) + sv.ServiceRevisionArn = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentServiceNotActiveException(v **types.ServiceNotActiveException, 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.ServiceNotActiveException - if *v == nil { - sv = &types.ServiceNotActiveException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": + case "taskDefinition": 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.TaskDefinition = ptr.String(jtv) + } + + case "volumeConfigurations": + if err := awsAwsjson11_deserializeDocumentServiceVolumeConfigurations(&sv.VolumeConfigurations, value); err != nil { + return err } default: @@ -15683,7 +17035,7 @@ func awsAwsjson11_deserializeDocumentServiceNotActiveException(v **types.Service return nil } -func awsAwsjson11_deserializeDocumentServiceNotFoundException(v **types.ServiceNotFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceRevisions(v *[]types.ServiceRevision, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15691,39 +17043,33 @@ func awsAwsjson11_deserializeDocumentServiceNotFoundException(v **types.ServiceN 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.ServiceNotFoundException + var cv []types.ServiceRevision if *v == nil { - sv = &types.ServiceNotFoundException{} + cv = []types.ServiceRevision{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.ServiceRevision + destAddr := &col + if err := awsAwsjson11_deserializeDocumentServiceRevision(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentServiceRegistries(v *[]types.ServiceRegistry, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceRevisionsSummaryList(v *[]types.ServiceRevisionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15736,17 +17082,17 @@ func awsAwsjson11_deserializeDocumentServiceRegistries(v *[]types.ServiceRegistr return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ServiceRegistry + var cv []types.ServiceRevisionSummary if *v == nil { - cv = []types.ServiceRegistry{} + cv = []types.ServiceRevisionSummary{} } else { cv = *v } for _, value := range shape { - var col types.ServiceRegistry + var col types.ServiceRevisionSummary destAddr := &col - if err := awsAwsjson11_deserializeDocumentServiceRegistry(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentServiceRevisionSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -15757,7 +17103,7 @@ func awsAwsjson11_deserializeDocumentServiceRegistries(v *[]types.ServiceRegistr return nil } -func awsAwsjson11_deserializeDocumentServiceRegistry(v **types.ServiceRegistry, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceRevisionSummary(v **types.ServiceRevisionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15770,57 +17116,61 @@ func awsAwsjson11_deserializeDocumentServiceRegistry(v **types.ServiceRegistry, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceRegistry + var sv *types.ServiceRevisionSummary if *v == nil { - sv = &types.ServiceRegistry{} + sv = &types.ServiceRevisionSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "containerName": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ContainerName = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "containerPort": + case "pendingTaskCount": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.ContainerPort = ptr.Int32(int32(i64)) + sv.PendingTaskCount = int32(i64) } - case "port": + case "requestedTaskCount": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.Port = ptr.Int32(int32(i64)) + sv.RequestedTaskCount = int32(i64) } - case "registryArn": + case "runningTaskCount": 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 Integer to be json.Number, got %T instead", value) } - sv.RegistryArn = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RunningTaskCount = int32(i64) } default: @@ -18872,6 +20222,88 @@ func awsAwsjson11_deserializeOpDocumentDescribeContainerInstancesOutput(v **Desc return nil } +func awsAwsjson11_deserializeOpDocumentDescribeServiceDeploymentsOutput(v **DescribeServiceDeploymentsOutput, 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 *DescribeServiceDeploymentsOutput + if *v == nil { + sv = &DescribeServiceDeploymentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failures": + if err := awsAwsjson11_deserializeDocumentFailures(&sv.Failures, value); err != nil { + return err + } + + case "serviceDeployments": + if err := awsAwsjson11_deserializeDocumentServiceDeployments(&sv.ServiceDeployments, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeServiceRevisionsOutput(v **DescribeServiceRevisionsOutput, 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 *DescribeServiceRevisionsOutput + if *v == nil { + sv = &DescribeServiceRevisionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "failures": + if err := awsAwsjson11_deserializeDocumentFailures(&sv.Failures, value); err != nil { + return err + } + + case "serviceRevisions": + if err := awsAwsjson11_deserializeDocumentServiceRevisions(&sv.ServiceRevisions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeServicesOutput(v **DescribeServicesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -19396,6 +20828,51 @@ func awsAwsjson11_deserializeOpDocumentListContainerInstancesOutput(v **ListCont return nil } +func awsAwsjson11_deserializeOpDocumentListServiceDeploymentsOutput(v **ListServiceDeploymentsOutput, 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 *ListServiceDeploymentsOutput + if *v == nil { + sv = &ListServiceDeploymentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "serviceDeployments": + if err := awsAwsjson11_deserializeDocumentServiceDeploymentsBrief(&sv.ServiceDeployments, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListServicesByNamespaceOutput(v **ListServicesByNamespaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ecs/generated.json b/service/ecs/generated.json index bb4c88a1b84..2a0af2dc68d 100644 --- a/service/ecs/generated.json +++ b/service/ecs/generated.json @@ -25,6 +25,8 @@ "api_op_DescribeCapacityProviders.go", "api_op_DescribeClusters.go", "api_op_DescribeContainerInstances.go", + "api_op_DescribeServiceDeployments.go", + "api_op_DescribeServiceRevisions.go", "api_op_DescribeServices.go", "api_op_DescribeTaskDefinition.go", "api_op_DescribeTaskSets.go", @@ -36,6 +38,7 @@ "api_op_ListAttributes.go", "api_op_ListClusters.go", "api_op_ListContainerInstances.go", + "api_op_ListServiceDeployments.go", "api_op_ListServices.go", "api_op_ListServicesByNamespace.go", "api_op_ListTagsForResource.go", diff --git a/service/ecs/serializers.go b/service/ecs/serializers.go index f82fe85547a..864f158fa49 100644 --- a/service/ecs/serializers.go +++ b/service/ecs/serializers.go @@ -994,6 +994,128 @@ func (m *awsAwsjson11_serializeOpDescribeContainerInstances) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeServiceDeployments struct { +} + +func (*awsAwsjson11_serializeOpDescribeServiceDeployments) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeServiceDeployments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DescribeServiceDeploymentsInput) + _ = 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("AmazonEC2ContainerServiceV20141113.DescribeServiceDeployments") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeServiceDeploymentsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpDescribeServiceRevisions struct { +} + +func (*awsAwsjson11_serializeOpDescribeServiceRevisions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeServiceRevisions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DescribeServiceRevisionsInput) + _ = 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("AmazonEC2ContainerServiceV20141113.DescribeServiceRevisions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeServiceRevisionsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribeServices struct { } @@ -1665,6 +1787,67 @@ func (m *awsAwsjson11_serializeOpListContainerInstances) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListServiceDeployments struct { +} + +func (*awsAwsjson11_serializeOpListServiceDeployments) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListServiceDeployments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListServiceDeploymentsInput) + _ = 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("AmazonEC2ContainerServiceV20141113.ListServiceDeployments") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListServiceDeploymentsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListServices struct { } @@ -4178,6 +4361,23 @@ func awsAwsjson11_serializeDocumentContainerStateChanges(v []types.ContainerStat return nil } +func awsAwsjson11_serializeDocumentCreatedAt(v *types.CreatedAt, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.After != nil { + ok := object.Key("after") + ok.Double(smithytime.FormatEpochSeconds(*v.After)) + } + + if v.Before != nil { + ok := object.Key("before") + ok.Double(smithytime.FormatEpochSeconds(*v.Before)) + } + + return nil +} + func awsAwsjson11_serializeDocumentDeploymentAlarms(v *types.DeploymentAlarms, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5639,6 +5839,17 @@ func awsAwsjson11_serializeDocumentServiceConnectTlsConfiguration(v *types.Servi return nil } +func awsAwsjson11_serializeDocumentServiceDeploymentStatusList(v []types.ServiceDeploymentStatus, 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_serializeDocumentServiceFieldList(v []types.ServiceField, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -6842,6 +7053,34 @@ func awsAwsjson11_serializeOpDocumentDescribeContainerInstancesInput(v *Describe return nil } +func awsAwsjson11_serializeOpDocumentDescribeServiceDeploymentsInput(v *DescribeServiceDeploymentsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ServiceDeploymentArns != nil { + ok := object.Key("serviceDeploymentArns") + if err := awsAwsjson11_serializeDocumentStringList(v.ServiceDeploymentArns, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDescribeServiceRevisionsInput(v *DescribeServiceRevisionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ServiceRevisionArns != nil { + ok := object.Key("serviceRevisionArns") + if err := awsAwsjson11_serializeDocumentStringList(v.ServiceRevisionArns, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeServicesInput(v *DescribeServicesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7135,6 +7374,47 @@ func awsAwsjson11_serializeOpDocumentListContainerInstancesInput(v *ListContaine return nil } +func awsAwsjson11_serializeOpDocumentListServiceDeploymentsInput(v *ListServiceDeploymentsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Cluster != nil { + ok := object.Key("cluster") + ok.String(*v.Cluster) + } + + if v.CreatedAt != nil { + ok := object.Key("createdAt") + if err := awsAwsjson11_serializeDocumentCreatedAt(v.CreatedAt, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.Service != nil { + ok := object.Key("service") + ok.String(*v.Service) + } + + if v.Status != nil { + ok := object.Key("status") + if err := awsAwsjson11_serializeDocumentServiceDeploymentStatusList(v.Status, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListServicesByNamespaceInput(v *ListServicesByNamespaceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/ecs/snapshot/api_op_DescribeServiceDeployments.go.snap b/service/ecs/snapshot/api_op_DescribeServiceDeployments.go.snap new file mode 100644 index 00000000000..6a4a6d3f855 --- /dev/null +++ b/service/ecs/snapshot/api_op_DescribeServiceDeployments.go.snap @@ -0,0 +1,41 @@ +DescribeServiceDeployments + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ecs/snapshot/api_op_DescribeServiceRevisions.go.snap b/service/ecs/snapshot/api_op_DescribeServiceRevisions.go.snap new file mode 100644 index 00000000000..8e4ebb7c101 --- /dev/null +++ b/service/ecs/snapshot/api_op_DescribeServiceRevisions.go.snap @@ -0,0 +1,41 @@ +DescribeServiceRevisions + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ecs/snapshot/api_op_ListServiceDeployments.go.snap b/service/ecs/snapshot/api_op_ListServiceDeployments.go.snap new file mode 100644 index 00000000000..5c6312f7944 --- /dev/null +++ b/service/ecs/snapshot/api_op_ListServiceDeployments.go.snap @@ -0,0 +1,41 @@ +ListServiceDeployments + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ecs/snapshot_test.go b/service/ecs/snapshot_test.go index 57681bab17c..450d1ce3938 100644 --- a/service/ecs/snapshot_test.go +++ b/service/ecs/snapshot_test.go @@ -254,6 +254,30 @@ func TestCheckSnapshot_DescribeContainerInstances(t *testing.T) { } } +func TestCheckSnapshot_DescribeServiceDeployments(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeServiceDeployments(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeServiceDeployments") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DescribeServiceRevisions(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeServiceRevisions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeServiceRevisions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeServices(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeServices(context.Background(), nil, func(o *Options) { @@ -386,6 +410,18 @@ func TestCheckSnapshot_ListContainerInstances(t *testing.T) { } } +func TestCheckSnapshot_ListServiceDeployments(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListServiceDeployments(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListServiceDeployments") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListServices(t *testing.T) { svc := New(Options{}) _, err := svc.ListServices(context.Background(), nil, func(o *Options) { @@ -925,6 +961,30 @@ func TestUpdateSnapshot_DescribeContainerInstances(t *testing.T) { } } +func TestUpdateSnapshot_DescribeServiceDeployments(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeServiceDeployments(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeServiceDeployments") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DescribeServiceRevisions(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeServiceRevisions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeServiceRevisions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeServices(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeServices(context.Background(), nil, func(o *Options) { @@ -1057,6 +1117,18 @@ func TestUpdateSnapshot_ListContainerInstances(t *testing.T) { } } +func TestUpdateSnapshot_ListServiceDeployments(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListServiceDeployments(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListServiceDeployments") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListServices(t *testing.T) { svc := New(Options{}) _, err := svc.ListServices(context.Background(), nil, func(o *Options) { diff --git a/service/ecs/types/enums.go b/service/ecs/types/enums.go index 5af99272dc7..e1fdd3858a5 100644 --- a/service/ecs/types/enums.go +++ b/service/ecs/types/enums.go @@ -948,6 +948,61 @@ func (Scope) Values() []Scope { } } +type ServiceDeploymentRollbackMonitorsStatus string + +// Enum values for ServiceDeploymentRollbackMonitorsStatus +const ( + ServiceDeploymentRollbackMonitorsStatusTriggered ServiceDeploymentRollbackMonitorsStatus = "TRIGGERED" + ServiceDeploymentRollbackMonitorsStatusMonitoring ServiceDeploymentRollbackMonitorsStatus = "MONITORING" + ServiceDeploymentRollbackMonitorsStatusMonitoringComplete ServiceDeploymentRollbackMonitorsStatus = "MONITORING_COMPLETE" + ServiceDeploymentRollbackMonitorsStatusDisabled ServiceDeploymentRollbackMonitorsStatus = "DISABLED" +) + +// Values returns all known values for ServiceDeploymentRollbackMonitorsStatus. +// 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 (ServiceDeploymentRollbackMonitorsStatus) Values() []ServiceDeploymentRollbackMonitorsStatus { + return []ServiceDeploymentRollbackMonitorsStatus{ + "TRIGGERED", + "MONITORING", + "MONITORING_COMPLETE", + "DISABLED", + } +} + +type ServiceDeploymentStatus string + +// Enum values for ServiceDeploymentStatus +const ( + ServiceDeploymentStatusPending ServiceDeploymentStatus = "PENDING" + ServiceDeploymentStatusSuccessful ServiceDeploymentStatus = "SUCCESSFUL" + ServiceDeploymentStatusStopped ServiceDeploymentStatus = "STOPPED" + ServiceDeploymentStatusStopRequested ServiceDeploymentStatus = "STOP_REQUESTED" + ServiceDeploymentStatusInProgress ServiceDeploymentStatus = "IN_PROGRESS" + ServiceDeploymentStatusRollbackInProgress ServiceDeploymentStatus = "ROLLBACK_IN_PROGRESS" + ServiceDeploymentStatusRollbackSuccessful ServiceDeploymentStatus = "ROLLBACK_SUCCESSFUL" + ServiceDeploymentStatusRollbackFailed ServiceDeploymentStatus = "ROLLBACK_FAILED" +) + +// Values returns all known values for ServiceDeploymentStatus. 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 (ServiceDeploymentStatus) Values() []ServiceDeploymentStatus { + return []ServiceDeploymentStatus{ + "PENDING", + "SUCCESSFUL", + "STOPPED", + "STOP_REQUESTED", + "IN_PROGRESS", + "ROLLBACK_IN_PROGRESS", + "ROLLBACK_SUCCESSFUL", + "ROLLBACK_FAILED", + } +} + type ServiceField string // Enum values for ServiceField diff --git a/service/ecs/types/types.go b/service/ecs/types/types.go index 0165cef0659..c9c01aaa268 100644 --- a/service/ecs/types/types.go +++ b/service/ecs/types/types.go @@ -1306,6 +1306,33 @@ type ContainerDependency struct { noSmithyDocumentSerde } +// The details about the container image a service revision uses. +// +// To ensure that all tasks in a service use the same container image, Amazon ECS +// resolves container image names and any image tags specified in the task +// definition to container image digests. +// +// After the container image digest has been established, Amazon ECS uses the +// digest to start any other desired tasks, and for any future service and service +// revision updates. This leads to all tasks in a service always running identical +// container images, resulting in version consistency for your software. For more +// information, see [Container image resolution]in the Amazon ECS Developer Guide. +// +// [Container image resolution]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html#deployment-container-image-stability +type ContainerImage struct { + + // The name of the container. + ContainerName *string + + // The container image. + Image *string + + // The container image digest. + ImageDigest *string + + noSmithyDocumentSerde +} + // An Amazon EC2 or External instance that's running the Amazon ECS agent and has // been registered with a cluster. type ContainerInstance struct { @@ -1565,6 +1592,23 @@ type ContainerStateChange struct { noSmithyDocumentSerde } +// The optional filter to narrow the ListServiceDeployment results. +// +// If you do not specify a value, service deployments that were created before the +// current time are included in the result. +type CreatedAt struct { + + // Include service deployments in the result that were created after this time. + // The format is yyyy-MM-dd HH:mm:ss.SSSSSS. + After *time.Time + + // Include service deployments in the result that were created before this time. + // The format is yyyy-MM-dd HH:mm:ss.SSSSSS. + Before *time.Time + + noSmithyDocumentSerde +} + // The details of an Amazon ECS service deployment. This is used only when a // service uses the ECS deployment controller type. type Deployment struct { @@ -1760,8 +1804,8 @@ type DeploymentCircuitBreaker struct { noSmithyDocumentSerde } -// Optional deployment parameters that control how many tasks run during a -// deployment and the ordering of stopping and starting tasks. +// Optional deployment parameters that control how many tasks run during the +// deployment and the failure detection methods. type DeploymentConfiguration struct { // Information about the CloudWatch alarms. @@ -1907,8 +1951,8 @@ type DeploymentController struct { // The amount of ephemeral storage to allocate for the deployment. type DeploymentEphemeralStorage struct { - // Specify an Key Management Service key ID to encrypt the ephemeral storage for - // deployment. + // Specify an Amazon Web Services Key Management Service key ID to encrypt the + // ephemeral storage for deployment. KmsKeyId *string noSmithyDocumentSerde @@ -2705,8 +2749,7 @@ type LoadBalancer struct { // mapping. ContainerPort *int32 - // The name of the load balancer to associate with the Amazon ECS service or task - // set. + // The name of the load balancer to associate with the service or task set. // // If you are using an Application Load Balancer or a Network Load Balancer the // load balancer name parameter should be omitted. @@ -3029,8 +3072,7 @@ type ManagedScaling struct { MaximumScalingStepSize *int32 // The minimum number of Amazon EC2 instances that Amazon ECS will scale out at - // one time. The scale in process is not affected by this parameter If this - // parameter is omitted, the default value of 1 is used. + // one time. If this parameter is omitted, the default value of 1 is used. // // When additional capacity is required, Amazon ECS will scale up the minimum // scaling step size even if the actual demand is less than the minimum scaling @@ -3062,7 +3104,8 @@ type ManagedStorageConfiguration struct { // Specify the Key Management Service key ID for the Fargate ephemeral storage. FargateEphemeralStorageKmsKeyId *string - // Specify a Key Management Service key ID to encrypt the managed storage. + // Specify a Amazon Web Services Key Management Service key ID to encrypt the + // managed storage. KmsKeyId *string noSmithyDocumentSerde @@ -3263,13 +3306,14 @@ type PlatformDevice struct { noSmithyDocumentSerde } -// Port mappings allow containers to access ports on the host container instance -// to send or receive traffic. Port mappings are specified as part of the container -// definition. +// Port mappings expose your container's network ports to the outside world. this +// allows clients to access your application. It's also used for inter-container +// communication within the same task. // -// If you use containers in a task with the awsvpc or host network mode, specify -// the exposed ports using containerPort . The hostPort can be left blank or it -// must be the same value as the containerPort . +// For task definitions (both the Fargate and EC2 launch type) that use the awsvpc +// network mode, only specify the containerPort . The hostPort is always ignored, +// and the container port is automatically mapped to a random high-numbered port on +// the host. // // Most fields of this parameter ( containerPort , hostPort , protocol ) maps to // PortBindings in the docker container create command and the --publish option to @@ -3312,14 +3356,17 @@ type PortMapping struct { // The port number on the container that's bound to the user-specified or // automatically assigned host port. // - // If you use containers in a task with the awsvpc or host network mode, specify - // the exposed ports using containerPort . + // For tasks that use the Fargate launch type or EC2 tasks that use the awsvpc + // network mode, you use containerPort to specify the exposed ports. + // + // For Windows containers on Fargate, you can't use port 3150 for the containerPort + // . This is because it's reserved. // - // If you use containers in a task with the bridge network mode and you specify a - // container port and not a host port, your container automatically receives a host - // port in the ephemeral port range. For more information, see hostPort . Port - // mappings that are automatically assigned in this way do not count toward the 100 - // reserved ports limit of a container instance. + // Suppose that you're using containers in a task with the EC2 launch type and you + // specify a container port and not a host port. Then, your container automatically + // receives a host port in the ephemeral port range. For more information, see + // hostPort . Port mappings that are automatically assigned in this way don't count + // toward the 100 reserved ports quota of a container instance. ContainerPort *int32 // The port number range on the container that's bound to the dynamically mapped @@ -3586,6 +3633,32 @@ type ResourceRequirement struct { noSmithyDocumentSerde } +// Information about the service deployment rollback. +type Rollback struct { + + // The reason the rollback happened. For example, the circuit breaker initiated + // the rollback operation. + Reason *string + + // The ARN of the service revision deployed as part of the rollback. + // + // When the type is GPU , the value is the number of physical GPUs the Amazon ECS + // container agent reserves for the container. The number of GPUs that's reserved + // for all containers in a task can't exceed the number of available GPUs on the + // container instance that the task is launched on. + // + // When the type is InferenceAccelerator , the value matches the deviceName for an [InferenceAccelerator] + // specified in a task definition. + // + // [InferenceAccelerator]: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_InferenceAccelerator.html + ServiceRevisionArn *string + + // Time time that the rollback started. The format is yyyy-MM-dd HH:mm:ss.SSSSSS. + StartedAt *time.Time + + noSmithyDocumentSerde +} + // Information about the platform for the Amazon ECS service or task. // // For more information about RuntimePlatform , see [RuntimePlatform] in the Amazon Elastic @@ -3599,9 +3672,13 @@ type RuntimePlatform struct { // You can run your Linux tasks on an ARM-based platform by setting the value to // ARM64 . This option is available for tasks that run on Linux Amazon EC2 instance // or Linux containers on Fargate. + // + // The default is X86_64 . CpuArchitecture CPUArchitecture // The operating system. + // + // The default is Linux . OperatingSystemFamily OSFamily noSmithyDocumentSerde @@ -3665,9 +3742,8 @@ type Secret struct { // Details on a service within a cluster. type Service struct { - // The capacity provider strategy the service uses. When using the - // DescribeServices API, this field is omitted if the service was created using a - // launch type. + // The capacity provider strategy the service uses. When using DescribeServices , + // this field is omitted if the service was created using a launch type. CapacityProviderStrategy []CapacityProviderStrategyItem // The Amazon Resource Name (ARN) of the cluster that hosts the service. @@ -3809,7 +3885,7 @@ type Service struct { Status *string // The metadata that you apply to the service to help you categorize and organize - // them. Each tag consists of a key and an optional value. You define bot the key + // them. Each tag consists of a key and an optional value. You define both the key // and value. // // The following basic restrictions apply to tags: @@ -4099,6 +4175,176 @@ type ServiceConnectTlsConfiguration struct { noSmithyDocumentSerde } +// Information about the service deployment. +// +// Service deployments provide a comprehensive view of your deployments. For +// information about service deployments, see [View service history using Amazon ECS service deployments]in the Amazon Elastic Container +// Service Developer Guide . +// +// [View service history using Amazon ECS service deployments]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-deployment.html +type ServiceDeployment struct { + + // The CloudWatch alarms that determine when a service deployment fails. + Alarms *ServiceDeploymentAlarms + + // The ARN of the cluster that hosts the service. + ClusterArn *string + + // The time the service deployment was created. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + CreatedAt *time.Time + + // The circuit breaker configuration that determines a service deployment failed. + DeploymentCircuitBreaker *ServiceDeploymentCircuitBreaker + + // Optional deployment parameters that control how many tasks run during the + // deployment and the failure detection methods. + DeploymentConfiguration *DeploymentConfiguration + + // The time the service deployment finished. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + FinishedAt *time.Time + + // The rollback options the service deployment uses when the deployment fails. + Rollback *Rollback + + // The ARN of the service for this service deployment. + ServiceArn *string + + // The ARN of the service deployment. + ServiceDeploymentArn *string + + // The currently deployed workload configuration. + SourceServiceRevisions []ServiceRevisionSummary + + // The time the service deployment statred. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + StartedAt *time.Time + + // The service deployment state. + Status ServiceDeploymentStatus + + // Information about why the service deployment is in the current status. For + // example, the circuit breaker detected a failure. + StatusReason *string + + // The time the service deployment stopped. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + // + // The service deployment stops when any of the following actions happen: + // + // - A user manually stops the deployment + // + // - The rollback option is not in use for the failure detection mechanism (the + // circuit breaker or alarm-based) and the service fails. + StoppedAt *time.Time + + // The workload configuration being deployed. + TargetServiceRevision *ServiceRevisionSummary + + // The time that the service deployment was last updated. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + UpdatedAt *time.Time + + noSmithyDocumentSerde +} + +// The CloudWatch alarms used to determine a service deployment failed. +// +// Amazon ECS considers the service deployment as failed when any of the alarms +// move to the ALARM state. For more information, see [How CloudWatch alarms detect Amazon ECS deployment failures] in the Amazon ECS Developer +// Guide. +// +// [How CloudWatch alarms detect Amazon ECS deployment failures]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-alarm-failure.html +type ServiceDeploymentAlarms struct { + + // The name of the CloudWatch alarms that determine when a service deployment + // failed. A "," separates the alarms. + AlarmNames []string + + // The status of the alarms check. Amazon ECS is not using alarms for service + // deployment failures when the status is DISABLED . + Status ServiceDeploymentRollbackMonitorsStatus + + // One or more CloudWatch alarm names that have been triggered during the service + // deployment. A "," separates the alarm names. + TriggeredAlarmNames []string + + noSmithyDocumentSerde +} + +// The service deployment properties that are retured when you call +// ListServiceDeployments . +// +// This provides a high-level overview of the service deployment. +type ServiceDeploymentBrief struct { + + // The ARN of the cluster that hosts the service. + ClusterArn *string + + // The time that the service deployment was created. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + CreatedAt *time.Time + + // The time that the service deployment completed. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + FinishedAt *time.Time + + // The ARN of the service for this service deployment. + ServiceArn *string + + // The ARN of the service deployment. + ServiceDeploymentArn *string + + // The time that the service deployment statred. The format is yyyy-MM-dd + // HH:mm:ss.SSSSSS. + StartedAt *time.Time + + // The status of the service deployment + Status ServiceDeploymentStatus + + // Information about why the service deployment is in the current status. For + // example, the circuit breaker detected a deployment failure. + StatusReason *string + + // The ARN of the service revision being deplyed. + TargetServiceRevisionArn *string + + noSmithyDocumentSerde +} + +// Information about the circuit breaker used to determine when a service +// deployment has failed. +// +// The deployment circuit breaker is the rolling update mechanism that determines +// if the tasks reach a steady state. The deployment circuit breaker has an option +// that will automatically roll back a failed deployment to the last cpompleted +// service revision. For more information, see [How the Amazon ECS deployment circuit breaker detects failures]in the Amazon ECS Developer Guide. +// +// [How the Amazon ECS deployment circuit breaker detects failures]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-circuit-breaker.html +type ServiceDeploymentCircuitBreaker struct { + + // The number of times the circuit breaker detected a service deploymeny failure. + FailureCount int32 + + // The circuit breaker status. Amazon ECS is not using the circuit breaker for + // service deployment failures when the status is DISABLED . + Status ServiceDeploymentRollbackMonitorsStatus + + // The threshhold which determines that the service deployment failed. + // + // The deployment circuit breaker calculates the threshold value, and then uses + // the value to determine when to move the deployment to a FAILED state. The + // deployment circuit breaker has a minimum threshold of 3 and a maximum threshold + // of 200. and uses the values in the following formula to determine the deployment + // failure. + // + // 0.5 * desired task count + Threshold int32 + + noSmithyDocumentSerde +} + // The details for an event that's associated with a service. type ServiceEvent struct { @@ -4301,6 +4547,102 @@ type ServiceRegistry struct { noSmithyDocumentSerde } +// Information about the service revision. +// +// A service revision contains a record of the workload configuration Amazon ECS +// is attempting to deploy. Whenever you create or deploy a service, Amazon ECS +// automatically creates and captures the configuration that you're trying to +// deploy in the service revision. For information about service revisions, see [Amazon ECS service revisions]in +// the Amazon Elastic Container Service Developer Guide . +// +// [Amazon ECS service revisions]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision.html +type ServiceRevision struct { + + // The capacity provider strategy the service revision uses. + CapacityProviderStrategy []CapacityProviderStrategyItem + + // The ARN of the cluster that hosts the service. + ClusterArn *string + + // The container images the service revision uses. + ContainerImages []ContainerImage + + // The time that the service revision was created. The format is yyyy-mm-dd + // HH:mm:ss.SSSSS. + CreatedAt *time.Time + + // The amount of ephemeral storage to allocate for the deployment. + FargateEphemeralStorage *DeploymentEphemeralStorage + + // Indicates whether Runtime Monitoring is turned on. + GuardDutyEnabled bool + + // The launch type the service revision uses. + LaunchType LaunchType + + // The load balancers the service revision uses. + LoadBalancers []LoadBalancer + + // The network configuration for a task or service. + NetworkConfiguration *NetworkConfiguration + + // The platform family the service revision uses. + PlatformFamily *string + + // For the Fargate launch type, the platform version the service revision uses. + PlatformVersion *string + + // The ARN of the service for the service revision. + ServiceArn *string + + // The Service Connect configuration of your Amazon ECS service. The configuration + // for this service to discover and connect to services, and be discovered by, and + // connected from, other services within a namespace. + // + // Tasks that run in a namespace can use short names to connect to services in the + // namespace. Tasks can connect to services across all of the clusters in the + // namespace. Tasks connect through a managed proxy container that collects logs + // and metrics for increased visibility. Only the tasks that Amazon ECS services + // create are supported with Service Connect. For more information, see [Service Connect]in the + // Amazon Elastic Container Service Developer Guide. + // + // [Service Connect]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html + ServiceConnectConfiguration *ServiceConnectConfiguration + + // The service registries (for Service Discovery) the service revision uses. + ServiceRegistries []ServiceRegistry + + // The ARN of the service revision. + ServiceRevisionArn *string + + // The task definition the service revision uses. + TaskDefinition *string + + // The volumes that are configured at deployment that the service revision uses. + VolumeConfigurations []ServiceVolumeConfiguration + + noSmithyDocumentSerde +} + +// The information about the number of requested, pending, and running tasks for a +// service revision. +type ServiceRevisionSummary struct { + + // The ARN of the service revision. + Arn *string + + // The number of pending tasks for the service revision. + PendingTaskCount int32 + + // The number of requested tasks for the service revision. + RequestedTaskCount int32 + + // The number of running tasks for the service revision. + RunningTaskCount int32 + + noSmithyDocumentSerde +} + // The configuration for a volume specified in the task definition as a volume // that is configured at launch time. Currently, the only supported volume type is // an Amazon EBS volume. @@ -4802,10 +5144,11 @@ type TaskDefinition struct { // resources. If none is specified, then IPC resources within the containers of a // task are private and not shared with other containers in a task or on the // container instance. If no value is specified, then the IPC resource namespace - // sharing depends on the Docker daemon setting on the container instance. + // sharing depends on the Docker daemon setting on the container instance. For more + // information, see [IPC settings]in the Docker run reference. // // If the host IPC mode is used, be aware that there is a heightened risk of - // undesired IPC namespace expose. + // undesired IPC namespace expose. For more information, see [Docker security]. // // If you are setting namespaced kernel parameters using systemControls for the // containers in the task, the following will apply to your IPC resource namespace. @@ -4821,6 +5164,8 @@ type TaskDefinition struct { // This parameter is not supported for Windows containers or tasks run on Fargate. // // [System Controls]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html + // [Docker security]: https://docs.docker.com/engine/security/security/ + // [IPC settings]: https://docs.docker.com/engine/reference/run/#ipc-settings---ipc IpcMode IpcMode // The amount (in MiB) of memory used by the task. @@ -4884,15 +5229,17 @@ type TaskDefinition struct { // user (UID 0). It is considered best practice to use a non-root user. // // If the network mode is awsvpc , the task is allocated an elastic network - // interface, and you must specify a [NetworkConfiguration]value when you create a service or run a task + // interface, and you must specify a NetworkConfigurationvalue when you create a service or run a task // with the task definition. For more information, see [Task Networking]in the Amazon Elastic // Container Service Developer Guide. // // If the network mode is host , you cannot run multiple instantiations of the same // task on a single container instance when port mappings are used. // + // For more information, see [Network settings] in the Docker run reference. + // // [Task Networking]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html - // [NetworkConfiguration]: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_NetworkConfiguration.html + // [Network settings]: https://docs.docker.com/engine/reference/run/#network-settings NetworkMode NetworkMode // The process namespace to use for the containers in the task. The valid values @@ -4907,16 +5254,20 @@ type TaskDefinition struct { // If task is specified, all containers within the specified task share the same // process namespace. // - // If no value is specified, the default is a private namespace for each container. + // If no value is specified, the default is a private namespace for each + // container. For more information, see [PID settings]in the Docker run reference. // // If the host PID mode is used, there's a heightened risk of undesired process - // namespace exposure. + // namespace exposure. For more information, see [Docker security]. // // This parameter is not supported for Windows containers. // // This parameter is only supported for tasks that are hosted on Fargate if the // tasks are using platform version 1.4.0 or later (Linux). This isn't supported // for Windows containers on Fargate. + // + // [PID settings]: https://docs.docker.com/engine/reference/run/#pid-settings---pid + // [Docker security]: https://docs.docker.com/engine/security/security/ PidMode PidMode // An array of placement constraint objects to use for tasks. @@ -5026,8 +5377,8 @@ type TaskDefinitionPlacementConstraint struct { // The amount of ephemeral storage to allocate for the task. type TaskEphemeralStorage struct { - // Specify an Key Management Service key ID to encrypt the ephemeral storage for - // the task. + // Specify an Amazon Web Services Key Management Service key ID to encrypt the + // ephemeral storage for the task. KmsKeyId *string // The total amount, in GiB, of the ephemeral storage to set for the task. The diff --git a/service/ecs/validators.go b/service/ecs/validators.go index dbe5aa2adda..88baf2b55de 100644 --- a/service/ecs/validators.go +++ b/service/ecs/validators.go @@ -290,6 +290,46 @@ func (m *validateOpDescribeContainerInstances) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDescribeServiceDeployments struct { +} + +func (*validateOpDescribeServiceDeployments) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeServiceDeployments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeServiceDeploymentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeServiceDeploymentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeServiceRevisions struct { +} + +func (*validateOpDescribeServiceRevisions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeServiceRevisions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeServiceRevisionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeServiceRevisionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeServices struct { } @@ -430,6 +470,26 @@ func (m *validateOpListAttributes) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpListServiceDeployments struct { +} + +func (*validateOpListServiceDeployments) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListServiceDeployments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListServiceDeploymentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListServiceDeploymentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListServicesByNamespace struct { } @@ -966,6 +1026,14 @@ func addOpDescribeContainerInstancesValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDescribeContainerInstances{}, middleware.After) } +func addOpDescribeServiceDeploymentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeServiceDeployments{}, middleware.After) +} + +func addOpDescribeServiceRevisionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeServiceRevisions{}, middleware.After) +} + func addOpDescribeServicesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeServices{}, middleware.After) } @@ -994,6 +1062,10 @@ func addOpListAttributesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAttributes{}, middleware.After) } +func addOpListServiceDeploymentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListServiceDeployments{}, middleware.After) +} + func addOpListServicesByNamespaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListServicesByNamespace{}, middleware.After) } @@ -2627,6 +2699,36 @@ func validateOpDescribeContainerInstancesInput(v *DescribeContainerInstancesInpu } } +func validateOpDescribeServiceDeploymentsInput(v *DescribeServiceDeploymentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeServiceDeploymentsInput"} + if v.ServiceDeploymentArns == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceDeploymentArns")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeServiceRevisionsInput(v *DescribeServiceRevisionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeServiceRevisionsInput"} + if v.ServiceRevisionArns == nil { + invalidParams.Add(smithy.NewErrParamRequired("ServiceRevisionArns")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeServicesInput(v *DescribeServicesInput) error { if v == nil { return nil @@ -2738,6 +2840,21 @@ func validateOpListAttributesInput(v *ListAttributesInput) error { } } +func validateOpListServiceDeploymentsInput(v *ListServiceDeploymentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListServiceDeploymentsInput"} + if v.Service == nil { + invalidParams.Add(smithy.NewErrParamRequired("Service")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListServicesByNamespaceInput(v *ListServicesByNamespaceInput) error { if v == nil { return nil diff --git a/service/geomaps/LICENSE.txt b/service/geomaps/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/geomaps/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/geomaps/api_client.go b/service/geomaps/api_client.go new file mode 100644 index 00000000000..934633e719d --- /dev/null +++ b/service/geomaps/api_client.go @@ -0,0 +1,913 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "Geo Maps" +const ServiceAPIVersion = "2020-11-19" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/geomaps") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/geomaps") +} + +// Client provides the API client to make operations call for Amazon Location +// Service Maps V2. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/geomaps") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "geomaps", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/geomaps") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/service/geomaps/api_client_test.go b/service/geomaps/api_client_test.go new file mode 100644 index 00000000000..216e73705e2 --- /dev/null +++ b/service/geomaps/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/geomaps/api_op_GetGlyphs.go b/service/geomaps/api_op_GetGlyphs.go new file mode 100644 index 00000000000..36fc9f032e9 --- /dev/null +++ b/service/geomaps/api_op_GetGlyphs.go @@ -0,0 +1,338 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the map's glyphs. +func (c *Client) GetGlyphs(ctx context.Context, params *GetGlyphsInput, optFns ...func(*Options)) (*GetGlyphsOutput, error) { + if params == nil { + params = &GetGlyphsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetGlyphs", params, optFns, c.addOperationGetGlyphsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetGlyphsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetGlyphsInput struct { + + // Name of the FontStack to retrieve. + // + // Example: Amazon Ember Bold,Noto Sans Bold . + // + // The supported font stacks are as follows: + // + // - Amazon Ember Bold + // + // - Amazon Ember Bold Italic + // + // - Amazon Ember Bold,Noto Sans Bold + // + // - Amazon Ember Bold,Noto Sans Bold,Noto Sans Arabic Bold + // + // - Amazon Ember Condensed RC BdItalic + // + // - Amazon Ember Condensed RC Bold + // + // - Amazon Ember Condensed RC Bold Italic + // + // - Amazon Ember Condensed RC Bold,Noto Sans Bold + // + // - Amazon Ember Condensed RC Bold,Noto Sans Bold,Noto Sans Arabic Condensed + // Bold + // + // - Amazon Ember Condensed RC Light + // + // - Amazon Ember Condensed RC Light Italic + // + // - Amazon Ember Condensed RC LtItalic + // + // - Amazon Ember Condensed RC Regular + // + // - Amazon Ember Condensed RC Regular Italic + // + // - Amazon Ember Condensed RC Regular,Noto Sans Regular + // + // - Amazon Ember Condensed RC Regular,Noto Sans Regular,Noto Sans Arabic + // Condensed Regular + // + // - Amazon Ember Condensed RC RgItalic + // + // - Amazon Ember Condensed RC ThItalic + // + // - Amazon Ember Condensed RC Thin + // + // - Amazon Ember Condensed RC Thin Italic + // + // - Amazon Ember Heavy + // + // - Amazon Ember Heavy Italic + // + // - Amazon Ember Light + // + // - Amazon Ember Light Italic + // + // - Amazon Ember Medium + // + // - Amazon Ember Medium Italic + // + // - Amazon Ember Medium,Noto Sans Medium + // + // - Amazon Ember Medium,Noto Sans Medium,Noto Sans Arabic Medium + // + // - Amazon Ember Regular + // + // - Amazon Ember Regular Italic + // + // - Amazon Ember Regular Italic,Noto Sans Italic + // + // - Amazon Ember Regular Italic,Noto Sans Italic,Noto Sans Arabic Regular + // + // - Amazon Ember Regular,Noto Sans Regular + // + // - Amazon Ember Regular,Noto Sans Regular,Noto Sans Arabic Regular + // + // - Amazon Ember Thin + // + // - Amazon Ember Thin Italic + // + // - AmazonEmberCdRC_Bd + // + // - AmazonEmberCdRC_BdIt + // + // - AmazonEmberCdRC_Lt + // + // - AmazonEmberCdRC_LtIt + // + // - AmazonEmberCdRC_Rg + // + // - AmazonEmberCdRC_RgIt + // + // - AmazonEmberCdRC_Th + // + // - AmazonEmberCdRC_ThIt + // + // - AmazonEmber_Bd + // + // - AmazonEmber_BdIt + // + // - AmazonEmber_He + // + // - AmazonEmber_HeIt + // + // - AmazonEmber_Lt + // + // - AmazonEmber_LtIt + // + // - AmazonEmber_Md + // + // - AmazonEmber_MdIt + // + // - AmazonEmber_Rg + // + // - AmazonEmber_RgIt + // + // - AmazonEmber_Th + // + // - AmazonEmber_ThIt + // + // - Noto Sans Black + // + // - Noto Sans Black Italic + // + // - Noto Sans Bold + // + // - Noto Sans Bold Italic + // + // - Noto Sans Extra Bold + // + // - Noto Sans Extra Bold Italic + // + // - Noto Sans Extra Light + // + // - Noto Sans Extra Light Italic + // + // - Noto Sans Italic + // + // - Noto Sans Light + // + // - Noto Sans Light Italic + // + // - Noto Sans Medium + // + // - Noto Sans Medium Italic + // + // - Noto Sans Regular + // + // - Noto Sans Semi Bold + // + // - Noto Sans Semi Bold Italic + // + // - Noto Sans Thin + // + // - Noto Sans Thin Italic + // + // - NotoSans-Bold + // + // - NotoSans-Italic + // + // - NotoSans-Medium + // + // - NotoSans-Regular + // + // - Open Sans Regular,Arial Unicode MS Regular + // + // This member is required. + FontStack *string + + // A Unicode range of characters to download glyphs for. This must be aligned to + // multiples of 256. + // + // Example: 0-255.pdf + // + // This member is required. + FontUnicodeRange *string + + noSmithyDocumentSerde +} + +type GetGlyphsOutput struct { + + // The Glyph, as a binary blob. + Blob []byte + + // Header that instructs caching configuration for the client. + CacheControl *string + + // Header that represents the format of the response. The response returns the + // following as the HTTP body. + ContentType *string + + // The glyph's Etag. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetGlyphsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetGlyphs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetGlyphs{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetGlyphs"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetGlyphsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetGlyphs(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetGlyphs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetGlyphs", + } +} diff --git a/service/geomaps/api_op_GetSprites.go b/service/geomaps/api_op_GetSprites.go new file mode 100644 index 00000000000..b51767da329 --- /dev/null +++ b/service/geomaps/api_op_GetSprites.go @@ -0,0 +1,198 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geomaps/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the map's sprites. +func (c *Client) GetSprites(ctx context.Context, params *GetSpritesInput, optFns ...func(*Options)) (*GetSpritesOutput, error) { + if params == nil { + params = &GetSpritesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSprites", params, optFns, c.addOperationGetSpritesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSpritesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSpritesInput struct { + + // Sets color tone for map such as dark and light for specific map styles. It + // applies to only vector map styles such as Standard and Monochrome. + // + // Example: Light + // + // Default value: Light + // + // Valid values for ColorScheme are case sensitive. + // + // This member is required. + ColorScheme types.ColorScheme + + // Sprites API: The name of the sprite file to retrieve, following pattern + // sprites(@2x)?\.(png|json) . + // + // Example: sprites.png + // + // This member is required. + FileName *string + + // Style specifies the desired map style for the Sprites APIs. + // + // This member is required. + Style types.MapStyle + + // Optimizes map styles for specific use case or industry. You can choose allowed + // variant only with Standard map style. + // + // Example: Default + // + // Valid values for Variant are case sensitive. + // + // This member is required. + Variant types.Variant + + noSmithyDocumentSerde +} + +type GetSpritesOutput struct { + + // The body of the sprite sheet or JSON offset file (image/png or + // application/json, depending on input). + Blob []byte + + // Header that instructs caching configuration for the client. + CacheControl *string + + // Header that represents the format of the response. The response returns the + // following as the HTTP body. + ContentType *string + + // The sprite's Etag. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSpritesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSprites{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSprites{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSprites"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetSpritesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSprites(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSprites(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSprites", + } +} diff --git a/service/geomaps/api_op_GetStaticMap.go b/service/geomaps/api_op_GetStaticMap.go new file mode 100644 index 00000000000..5fb146f138a --- /dev/null +++ b/service/geomaps/api_op_GetStaticMap.go @@ -0,0 +1,271 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geomaps/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides high-quality static map images with customizable options. You can +// modify the map's appearance and overlay additional information. It's an ideal +// solution for applications requiring tailored static map snapshots. +func (c *Client) GetStaticMap(ctx context.Context, params *GetStaticMapInput, optFns ...func(*Options)) (*GetStaticMapOutput, error) { + if params == nil { + params = &GetStaticMapInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetStaticMap", params, optFns, c.addOperationGetStaticMapMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetStaticMapOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetStaticMapInput struct { + + // The map scaling parameter to size the image, icons, and labels. It follows the + // pattern of ^map(@2x)?$ . + // + // Example: map, map@2x + // + // This member is required. + FileName *string + + // Specifies the height of the map image. + // + // This member is required. + Height *int32 + + // Specifies the width of the map image. + // + // This member is required. + Width *int32 + + // Takes in two or more pair of coordinates, [Lon, Lat], with each coordinate + // separated by a comma. The API will generate an image to encompass all of the + // provided coordinates. + // + // Cannot be used with Zoom and or Radius + // + // Example: 97.170451,78.039098,99.045536,27.176178 + BoundedPositions *string + + // Takes in two pairs of coordinates, [Lon, Lat], denoting south-westerly and + // north-easterly edges of the image. The underlying area becomes the view of the + // image. + // + // Example: -123.17075,49.26959,-123.08125,49.31429 + BoundingBox *string + + // Takes in a pair of coordinates, [Lon, Lat], which becomes the center point of + // the image. This parameter requires that either zoom or radius is set. + // + // Cannot be used with Zoom and or Radius + // + // Example: 49.295,-123.108 + Center *string + + // Takes in a string to draw geometries on the image. The input is a comma + // separated format as follows format: [Lon, Lat] + // + // Example: + // line:-122.407653,37.798557,-122.413291,37.802443;color=%23DD0000;width=7;outline-color=#00DD00;outline-width=5yd|point:-122.40572,37.80004;label=Fog + // Hill Market;size=large;text-color=%23DD0000;color=#EE4B2B + // + // Currently it supports the following geometry types: point, line and polygon. It + // does not support multiPoint , multiLine and multiPolgyon. + CompactOverlay *string + + // Takes in a string to draw geometries on the image. The input is a valid GeoJSON + // collection object. + // + // Example: {"type":"FeatureCollection","features": + // [{"type":"Feature","geometry":{"type":"MultiPoint","coordinates": + // [[-90.076345,51.504107],[-0.074451,51.506892]]},"properties": + // {"color":"#00DD00"}}]} + GeoJsonOverlay *string + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // Applies additional space (in pixels) around overlay feature to prevent them + // from being cut or obscured. + // + // Value for max and min is determined by: + // + // Min: 1 + // + // Max: min(height, width)/4 + // + // Example: 100 + Padding *int32 + + // Used with center parameter, it specifies the zoom of the image where you can + // control it on a granular level. Takes in any value >= 1 . + // + // Example: 1500 + // + // Cannot be used with Zoom . + // + // Unit: Meters + Radius *int64 + + // Displays a scale on the bottom right of the map image with the unit specified + // in the input. + // + // Example: KilometersMiles, Miles, Kilometers, MilesKilometers + ScaleBarUnit types.ScaleBarUnit + + // Style specifies the desired map style for the Style APIs. + Style types.StaticMapStyle + + // Specifies the zoom level of the map image. + // + // Cannot be used with Radius . + Zoom *float32 + + noSmithyDocumentSerde +} + +type GetStaticMapOutput struct { + + // The pricing bucket for which the request is charged at. + // + // This member is required. + PricingBucket *string + + // The blob represents a map image as a jpeg for the GetStaticMap API. + Blob []byte + + // Header that instructs caching configuration for the client. + CacheControl *string + + // Header that represents the format of the response. The response returns the + // following as the HTTP body. + ContentType *string + + // The static map's Etag. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetStaticMapMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetStaticMap{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetStaticMap{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetStaticMap"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetStaticMapValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetStaticMap(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetStaticMap(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetStaticMap", + } +} diff --git a/service/geomaps/api_op_GetStyleDescriptor.go b/service/geomaps/api_op_GetStyleDescriptor.go new file mode 100644 index 00000000000..17971ca8557 --- /dev/null +++ b/service/geomaps/api_op_GetStyleDescriptor.go @@ -0,0 +1,218 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geomaps/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about the style. +func (c *Client) GetStyleDescriptor(ctx context.Context, params *GetStyleDescriptorInput, optFns ...func(*Options)) (*GetStyleDescriptorOutput, error) { + if params == nil { + params = &GetStyleDescriptorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetStyleDescriptor", params, optFns, c.addOperationGetStyleDescriptorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetStyleDescriptorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetStyleDescriptorInput struct { + + // Style specifies the desired map style. + // + // This member is required. + Style types.MapStyle + + // Sets color tone for map such as dark and light for specific map styles. It + // applies to only vector map styles such as Standard and Monochrome. + // + // Example: Light + // + // Default value: Light + // + // Valid values for ColorScheme are case sensitive. + ColorScheme types.ColorScheme + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // Specifies the political view using ISO 3166-2 or ISO 3166-3 country code format. + // + // The following political views are currently supported: + // + // - ARG : Argentina's view on the Southern Patagonian Ice Field and Tierra Del + // Fuego, including the Falkland Islands, South Georgia, and South Sandwich Islands + // + // - EGY : Egypt's view on Bir Tawil + // + // - IND : India's view on Gilgit-Baltistan + // + // - KEN : Kenya's view on the Ilemi Triangle + // + // - MAR : Morocco's view on Western Sahara + // + // - PAK : Pakistan's view on Jammu and Kashmir and the Junagadh Area + // + // - RUS : Russia's view on Crimea + // + // - SDN : Sudan's view on the Halaib Triangle + // + // - SRB : Serbia's view on Kosovo, Vukovar, and Sarengrad Islands + // + // - SUR : Suriname's view on the Courantyne Headwaters and Lawa Headwaters + // + // - SYR : Syria's view on the Golan Heights + // + // - TUR : Turkey's view on Cyprus and Northern Cyprus + // + // - TZA : Tanzania's view on Lake Malawi + // + // - URY : Uruguay's view on Rincon de Artigas + // + // - VNM : Vietnam's view on the Paracel Islands and Spratly Islands + PoliticalView *string + + noSmithyDocumentSerde +} + +type GetStyleDescriptorOutput struct { + + // This Blob contains the body of the style descriptor which is in + // application/json format. + Blob []byte + + // Header that instructs caching configuration for the client. + CacheControl *string + + // Header that represents the format of the response. The response returns the + // following as the HTTP body. + ContentType *string + + // The style descriptor's Etag. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetStyleDescriptorMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetStyleDescriptor{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetStyleDescriptor{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetStyleDescriptor"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetStyleDescriptorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetStyleDescriptor(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetStyleDescriptor(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetStyleDescriptor", + } +} diff --git a/service/geomaps/api_op_GetTile.go b/service/geomaps/api_op_GetTile.go new file mode 100644 index 00000000000..6a70d19856d --- /dev/null +++ b/service/geomaps/api_op_GetTile.go @@ -0,0 +1,194 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a tile. Map tiles are used by clients to render a map. they're +// addressed using a grid arrangement with an X coordinate, Y coordinate, and Z +// (zoom) level. +func (c *Client) GetTile(ctx context.Context, params *GetTileInput, optFns ...func(*Options)) (*GetTileOutput, error) { + if params == nil { + params = &GetTileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTile", params, optFns, c.addOperationGetTileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTileInput struct { + + // Specifies the desired tile set. + // + // Valid Values: raster.satellite | vector.basemap + // + // This member is required. + Tileset *string + + // The X axis value for the map tile. Must be between 0 and 19. + // + // This member is required. + X *string + + // The Y axis value for the map tile. + // + // This member is required. + Y *string + + // The zoom value for the map tile. + // + // This member is required. + Z *string + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + noSmithyDocumentSerde +} + +type GetTileOutput struct { + + // The pricing bucket for which the request is charged at. + // + // This member is required. + PricingBucket *string + + // The blob represents a vector tile in mvt format for the GetTile API. + Blob []byte + + // Header that instructs caching configuration for the client. + CacheControl *string + + // Header that represents the format of the response. The response returns the + // following as the HTTP body. + ContentType *string + + // The pricing bucket for which the request is charged at. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTileMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTile{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTile"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetTileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTile(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetTile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTile", + } +} diff --git a/service/geomaps/auth.go b/service/geomaps/auth.go new file mode 100644 index 00000000000..0c459483c64 --- /dev/null +++ b/service/geomaps/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "geo-maps") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/geomaps/deserializers.go b/service/geomaps/deserializers.go new file mode 100644 index 00000000000..91167d15c64 --- /dev/null +++ b/service/geomaps/deserializers.go @@ -0,0 +1,1160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/geomaps/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpGetGlyphs struct { +} + +func (*awsRestjson1_deserializeOpGetGlyphs) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetGlyphs) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetGlyphs(response, &metadata) + } + output := &GetGlyphsOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetGlyphsOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetGlyphsOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetGlyphs(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 { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsGetGlyphsOutput(v *GetGlyphsOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.CacheControl = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetGlyphsOutput(v *GetGlyphsOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Blob = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpGetSprites struct { +} + +func (*awsRestjson1_deserializeOpGetSprites) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSprites) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetSprites(response, &metadata) + } + output := &GetSpritesOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetSpritesOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetSpritesOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSprites(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 { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsGetSpritesOutput(v *GetSpritesOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.CacheControl = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetSpritesOutput(v *GetSpritesOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Blob = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpGetStaticMap struct { +} + +func (*awsRestjson1_deserializeOpGetStaticMap) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetStaticMap) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetStaticMap(response, &metadata) + } + output := &GetStaticMapOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetStaticMapOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetStaticMapOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetStaticMap(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("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_deserializeOpHttpBindingsGetStaticMapOutput(v *GetStaticMapOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.CacheControl = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetStaticMapOutput(v *GetStaticMapOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Blob = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpGetStyleDescriptor struct { +} + +func (*awsRestjson1_deserializeOpGetStyleDescriptor) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetStyleDescriptor) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetStyleDescriptor(response, &metadata) + } + output := &GetStyleDescriptorOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetStyleDescriptorOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetStyleDescriptorOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetStyleDescriptor(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 { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsGetStyleDescriptorOutput(v *GetStyleDescriptorOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.CacheControl = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetStyleDescriptorOutput(v *GetStyleDescriptorOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Blob = buf.Bytes() + } + return nil +} + +type awsRestjson1_deserializeOpGetTile struct { +} + +func (*awsRestjson1_deserializeOpGetTile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTile) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetTile(response, &metadata) + } + output := &GetTileOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetTileOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + err = awsRestjson1_deserializeOpDocumentGetTileOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetTile(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("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_deserializeOpHttpBindingsGetTileOutput(v *GetTileOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.CacheControl = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetTileOutput(v *GetTileOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.Blob = buf.Bytes() + } + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/geomaps/doc.go b/service/geomaps/doc.go new file mode 100644 index 00000000000..87dc5c874f1 --- /dev/null +++ b/service/geomaps/doc.go @@ -0,0 +1,28 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package geomaps provides the API client, operations, and parameter types for +// Amazon Location Service Maps V2. +// +// Integrate high-quality base map data into your applications using [MapLibre]. +// +// Capabilities include: +// +// - Access to comprehensive base map data, allowing you to tailor the map +// display to your specific needs. +// +// - Multiple pre-designed map styles suited for various application types, such +// as navigation, logistics, or data visualization. +// +// - Generation of static map images for scenarios where interactive maps aren't +// suitable, such as: +// +// - Embedding in emails or documents +// +// - Displaying in low-bandwidth environments +// +// - Creating printable maps +// +// - Enhancing application performance by reducing client-side rendering +// +// [MapLibre]: https://maplibre.org +package geomaps diff --git a/service/geomaps/endpoints.go b/service/geomaps/endpoints.go new file mode 100644 index 00000000000..2a186454fda --- /dev/null +++ b/service/geomaps/endpoints.go @@ -0,0 +1,741 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/geomaps/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "geo-maps" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_GEO_MAPS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Geo Maps", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _PartitionResult.Name == "aws" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == false { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == true { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo-fips.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == true { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo-fips.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://maps.geo.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-maps-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _UseDualStack == false { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-maps-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + } + if _UseFIPS == false { + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-maps.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-maps.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + params.Region = bindRegion(options.Region) + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/geomaps/endpoints_config_test.go b/service/geomaps/endpoints_config_test.go new file mode 100644 index 00000000000..02386df0c37 --- /dev/null +++ b/service/geomaps/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-maps.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-geo-maps.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-maps.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-maps.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-maps.dev", + expectURL: aws.String("https://env-geo-maps.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-maps.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-maps.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-geo-maps.dev", + expectURL: aws.String("http://config-geo-maps.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-maps.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-maps.dev", + clientEndpoint: aws.String("https://client-geo-maps.dev"), + expectURL: aws.String("https://client-geo-maps.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_GEO_MAPS", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/geomaps/endpoints_test.go b/service/geomaps/endpoints_test.go new file mode 100644 index 00000000000..fadde15e477 --- /dev/null +++ b/service/geomaps/endpoints_test.go @@ -0,0 +1,1006 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For custom endpoint with region not set and fips disabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo-fips.us-east-1.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo-fips.us-east-1.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo.us-east-1.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo.us-east-1.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack enabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps-fips.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack disabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps-fips.cn-northwest-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack enabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack disabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps.cn-northwest-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo-fips.us-gov-west-1.us-gov.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo-fips.us-gov-west-1.us-gov.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo.us-gov-west-1.us-gov.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://maps.geo.us-gov-west-1.us-gov.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps-fips.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase25(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase26(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack enabled +func TestEndpointCase27(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack disabled +func TestEndpointCase28(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps-fips.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack enabled +func TestEndpointCase29(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack disabled +func TestEndpointCase30(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-maps.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// Missing region +func TestEndpointCase31(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/geomaps/generated.json b/service/geomaps/generated.json new file mode 100644 index 00000000000..09899667530 --- /dev/null +++ b/service/geomaps/generated.json @@ -0,0 +1,37 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_GetGlyphs.go", + "api_op_GetSprites.go", + "api_op_GetStaticMap.go", + "api_op_GetStyleDescriptor.go", + "api_op_GetTile.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/geomaps", + "unstable": false +} diff --git a/service/geomaps/go.mod b/service/geomaps/go.mod new file mode 100644 index 00000000000..e4f7e65b6c1 --- /dev/null +++ b/service/geomaps/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/geomaps + +go 1.21 + +require ( + github.com/aws/aws-sdk-go-v2 v1.32.3 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 + github.com/aws/smithy-go v1.22.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/geomaps/go.sum b/service/geomaps/go.sum new file mode 100644 index 00000000000..70a20636e37 --- /dev/null +++ b/service/geomaps/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/geomaps/go_module_metadata.go b/service/geomaps/go_module_metadata.go new file mode 100644 index 00000000000..e025513811c --- /dev/null +++ b/service/geomaps/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package geomaps + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/geomaps/internal/endpoints/endpoints.go b/service/geomaps/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..c4914bed9fd --- /dev/null +++ b/service/geomaps/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Geo Maps endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-maps.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-maps-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-maps-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-maps.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-maps.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-maps-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-maps-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-maps.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-maps-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-maps.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-maps-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-maps.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-maps-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-maps.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-maps-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-maps.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-maps.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-maps-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-maps-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-maps.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/geomaps/internal/endpoints/endpoints_test.go b/service/geomaps/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/geomaps/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/geomaps/options.go b/service/geomaps/options.go new file mode 100644 index 00000000000..98d42ec9370 --- /dev/null +++ b/service/geomaps/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/service/geomaps/protocol_test.go b/service/geomaps/protocol_test.go new file mode 100644 index 00000000000..d83e617afce --- /dev/null +++ b/service/geomaps/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps diff --git a/service/geomaps/serializers.go b/service/geomaps/serializers.go new file mode 100644 index 00000000000..1a5fc46dd94 --- /dev/null +++ b/service/geomaps/serializers.go @@ -0,0 +1,499 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpGetGlyphs struct { +} + +func (*awsRestjson1_serializeOpGetGlyphs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetGlyphs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetGlyphsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/glyphs/{FontStack}/{FontUnicodeRange}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetGlyphsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetGlyphsInput(v *GetGlyphsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FontStack == nil || len(*v.FontStack) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FontStack must not be empty")} + } + if v.FontStack != nil { + if err := encoder.SetURI("FontStack").String(*v.FontStack); err != nil { + return err + } + } + + if v.FontUnicodeRange == nil || len(*v.FontUnicodeRange) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FontUnicodeRange must not be empty")} + } + if v.FontUnicodeRange != nil { + if err := encoder.SetURI("FontUnicodeRange").String(*v.FontUnicodeRange); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSprites struct { +} + +func (*awsRestjson1_serializeOpGetSprites) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSprites) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetSpritesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/styles/{Style}/{ColorScheme}/{Variant}/sprites/{FileName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSpritesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetSpritesInput(v *GetSpritesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ColorScheme) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ColorScheme must not be empty")} + } + if len(v.ColorScheme) > 0 { + if err := encoder.SetURI("ColorScheme").String(string(v.ColorScheme)); err != nil { + return err + } + } + + if v.FileName == nil || len(*v.FileName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FileName must not be empty")} + } + if v.FileName != nil { + if err := encoder.SetURI("FileName").String(*v.FileName); err != nil { + return err + } + } + + if len(v.Style) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Style must not be empty")} + } + if len(v.Style) > 0 { + if err := encoder.SetURI("Style").String(string(v.Style)); err != nil { + return err + } + } + + if len(v.Variant) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Variant must not be empty")} + } + if len(v.Variant) > 0 { + if err := encoder.SetURI("Variant").String(string(v.Variant)); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetStaticMap struct { +} + +func (*awsRestjson1_serializeOpGetStaticMap) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetStaticMap) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetStaticMapInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/static/{FileName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetStaticMapInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetStaticMapInput(v *GetStaticMapInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BoundedPositions != nil { + encoder.SetQuery("bounded-positions").String(*v.BoundedPositions) + } + + if v.BoundingBox != nil { + encoder.SetQuery("bounding-box").String(*v.BoundingBox) + } + + if v.Center != nil { + encoder.SetQuery("center").String(*v.Center) + } + + if v.CompactOverlay != nil { + encoder.SetQuery("compact-overlay").String(*v.CompactOverlay) + } + + if v.FileName == nil || len(*v.FileName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FileName must not be empty")} + } + if v.FileName != nil { + if err := encoder.SetURI("FileName").String(*v.FileName); err != nil { + return err + } + } + + if v.GeoJsonOverlay != nil { + encoder.SetQuery("geojson-overlay").String(*v.GeoJsonOverlay) + } + + if v.Height != nil { + encoder.SetQuery("height").Integer(*v.Height) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + if v.Padding != nil { + encoder.SetQuery("padding").Integer(*v.Padding) + } + + if v.Radius != nil { + encoder.SetQuery("radius").Long(*v.Radius) + } + + if len(v.ScaleBarUnit) > 0 { + encoder.SetQuery("scale-unit").String(string(v.ScaleBarUnit)) + } + + if len(v.Style) > 0 { + encoder.SetQuery("style").String(string(v.Style)) + } + + if v.Width != nil { + encoder.SetQuery("width").Integer(*v.Width) + } + + if v.Zoom != nil { + encoder.SetQuery("zoom").Float(*v.Zoom) + } + + return nil +} + +type awsRestjson1_serializeOpGetStyleDescriptor struct { +} + +func (*awsRestjson1_serializeOpGetStyleDescriptor) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetStyleDescriptor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetStyleDescriptorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/styles/{Style}/descriptor") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetStyleDescriptorInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetStyleDescriptorInput(v *GetStyleDescriptorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ColorScheme) > 0 { + encoder.SetQuery("color-scheme").String(string(v.ColorScheme)) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + if v.PoliticalView != nil { + encoder.SetQuery("political-view").String(*v.PoliticalView) + } + + if len(v.Style) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Style must not be empty")} + } + if len(v.Style) > 0 { + if err := encoder.SetURI("Style").String(string(v.Style)); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetTile struct { +} + +func (*awsRestjson1_serializeOpGetTile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetTile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetTileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tiles/{Tileset}/{Z}/{X}/{Y}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetTileInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetTileInput(v *GetTileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + if v.Tileset == nil || len(*v.Tileset) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Tileset must not be empty")} + } + if v.Tileset != nil { + if err := encoder.SetURI("Tileset").String(*v.Tileset); err != nil { + return err + } + } + + if v.X == nil || len(*v.X) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member X must not be empty")} + } + if v.X != nil { + if err := encoder.SetURI("X").String(*v.X); err != nil { + return err + } + } + + if v.Y == nil || len(*v.Y) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Y must not be empty")} + } + if v.Y != nil { + if err := encoder.SetURI("Y").String(*v.Y); err != nil { + return err + } + } + + if v.Z == nil || len(*v.Z) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Z must not be empty")} + } + if v.Z != nil { + if err := encoder.SetURI("Z").String(*v.Z); err != nil { + return err + } + } + + return nil +} diff --git a/service/geomaps/snapshot/api_op_GetGlyphs.go.snap b/service/geomaps/snapshot/api_op_GetGlyphs.go.snap new file mode 100644 index 00000000000..8e04b0ae63c --- /dev/null +++ b/service/geomaps/snapshot/api_op_GetGlyphs.go.snap @@ -0,0 +1,41 @@ +GetGlyphs + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geomaps/snapshot/api_op_GetSprites.go.snap b/service/geomaps/snapshot/api_op_GetSprites.go.snap new file mode 100644 index 00000000000..3800127dc18 --- /dev/null +++ b/service/geomaps/snapshot/api_op_GetSprites.go.snap @@ -0,0 +1,41 @@ +GetSprites + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geomaps/snapshot/api_op_GetStaticMap.go.snap b/service/geomaps/snapshot/api_op_GetStaticMap.go.snap new file mode 100644 index 00000000000..86933331436 --- /dev/null +++ b/service/geomaps/snapshot/api_op_GetStaticMap.go.snap @@ -0,0 +1,41 @@ +GetStaticMap + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geomaps/snapshot/api_op_GetStyleDescriptor.go.snap b/service/geomaps/snapshot/api_op_GetStyleDescriptor.go.snap new file mode 100644 index 00000000000..e3664f8b7a5 --- /dev/null +++ b/service/geomaps/snapshot/api_op_GetStyleDescriptor.go.snap @@ -0,0 +1,41 @@ +GetStyleDescriptor + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geomaps/snapshot/api_op_GetTile.go.snap b/service/geomaps/snapshot/api_op_GetTile.go.snap new file mode 100644 index 00000000000..b7ad68930ab --- /dev/null +++ b/service/geomaps/snapshot/api_op_GetTile.go.snap @@ -0,0 +1,41 @@ +GetTile + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geomaps/snapshot_test.go b/service/geomaps/snapshot_test.go new file mode 100644 index 00000000000..51d3df32dc3 --- /dev/null +++ b/service/geomaps/snapshot_test.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package geomaps + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_GetGlyphs(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetGlyphs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetGlyphs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetSprites(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetSprites(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetSprites") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetStaticMap(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetStaticMap(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetStaticMap") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetStyleDescriptor(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetStyleDescriptor(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetStyleDescriptor") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetTile(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTile(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetTile") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_GetGlyphs(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetGlyphs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetGlyphs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetSprites(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetSprites(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetSprites") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetStaticMap(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetStaticMap(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetStaticMap") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetStyleDescriptor(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetStyleDescriptor(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetStyleDescriptor") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetTile(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTile(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetTile") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/geomaps/types/enums.go b/service/geomaps/types/enums.go new file mode 100644 index 00000000000..403f7cf2de5 --- /dev/null +++ b/service/geomaps/types/enums.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ColorScheme string + +// Enum values for ColorScheme +const ( + ColorSchemeLight ColorScheme = "Light" + ColorSchemeDark ColorScheme = "Dark" +) + +// Values returns all known values for ColorScheme. 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 (ColorScheme) Values() []ColorScheme { + return []ColorScheme{ + "Light", + "Dark", + } +} + +type MapStyle string + +// Enum values for MapStyle +const ( + MapStyleStandard MapStyle = "Standard" + MapStyleMonochrome MapStyle = "Monochrome" + MapStyleHybrid MapStyle = "Hybrid" + MapStyleSatellite MapStyle = "Satellite" +) + +// Values returns all known values for MapStyle. 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 (MapStyle) Values() []MapStyle { + return []MapStyle{ + "Standard", + "Monochrome", + "Hybrid", + "Satellite", + } +} + +type ScaleBarUnit string + +// Enum values for ScaleBarUnit +const ( + ScaleBarUnitKilometers ScaleBarUnit = "Kilometers" + ScaleBarUnitKilometersMiles ScaleBarUnit = "KilometersMiles" + ScaleBarUnitMiles ScaleBarUnit = "Miles" + ScaleBarUnitMilesKilometers ScaleBarUnit = "MilesKilometers" +) + +// Values returns all known values for ScaleBarUnit. 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 (ScaleBarUnit) Values() []ScaleBarUnit { + return []ScaleBarUnit{ + "Kilometers", + "KilometersMiles", + "Miles", + "MilesKilometers", + } +} + +type StaticMapStyle string + +// Enum values for StaticMapStyle +const ( + StaticMapStyleSatellite StaticMapStyle = "Satellite" +) + +// Values returns all known values for StaticMapStyle. 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 (StaticMapStyle) Values() []StaticMapStyle { + return []StaticMapStyle{ + "Satellite", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + // No such operation is supported. + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "UnknownOperation" + // The required input is missing. + ValidationExceptionReasonMissing ValidationExceptionReason = "Missing" + // The input cannot be parsed. For example a required JSON document, ARN + // identifier, date value, or numeric field cannot be parsed. + ValidationExceptionReasonCannotParse ValidationExceptionReason = "CannotParse" + // The input is present and parsable, but it is otherwise invalid. For example, a + // required numeric argument is outside the allowed range. + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FieldValidationFailed" + // The input is invalid but no more specific reason is applicable. + ValidationExceptionReasonOther ValidationExceptionReason = "Other" + // No such field is supported. + ValidationExceptionReasonUnknownField ValidationExceptionReason = "UnknownField" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "UnknownOperation", + "Missing", + "CannotParse", + "FieldValidationFailed", + "Other", + "UnknownField", + } +} + +type Variant string + +// Enum values for Variant +const ( + VariantDefault Variant = "Default" +) + +// Values returns all known values for Variant. 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 (Variant) Values() []Variant { + return []Variant{ + "Default", + } +} diff --git a/service/geomaps/types/errors.go b/service/geomaps/types/errors.go new file mode 100644 index 00000000000..710446ff71e --- /dev/null +++ b/service/geomaps/types/errors.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The request was denied because of insufficient access or permissions. Check +// with an administrator to verify your permissions. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request processing has failed because of an unknown error, exception or +// failure. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/geomaps/types/types.go b/service/geomaps/types/types.go new file mode 100644 index 00000000000..495c8653906 --- /dev/null +++ b/service/geomaps/types/types.go @@ -0,0 +1,26 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// The input fails to satisfy the constraints specified by the Amazon Location +// service. +type ValidationExceptionField struct { + + // The error message. + // + // This member is required. + Message *string + + // The name of the resource. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/geomaps/validators.go b/service/geomaps/validators.go new file mode 100644 index 00000000000..9eaec7e0d31 --- /dev/null +++ b/service/geomaps/validators.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpGetGlyphs struct { +} + +func (*validateOpGetGlyphs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetGlyphs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetGlyphsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetGlyphsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSprites struct { +} + +func (*validateOpGetSprites) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSprites) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSpritesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSpritesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetStaticMap struct { +} + +func (*validateOpGetStaticMap) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetStaticMap) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetStaticMapInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetStaticMapInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetStyleDescriptor struct { +} + +func (*validateOpGetStyleDescriptor) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetStyleDescriptor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetStyleDescriptorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetStyleDescriptorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTile struct { +} + +func (*validateOpGetTile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpGetGlyphsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetGlyphs{}, middleware.After) +} + +func addOpGetSpritesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSprites{}, middleware.After) +} + +func addOpGetStaticMapValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetStaticMap{}, middleware.After) +} + +func addOpGetStyleDescriptorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetStyleDescriptor{}, middleware.After) +} + +func addOpGetTileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTile{}, middleware.After) +} + +func validateOpGetGlyphsInput(v *GetGlyphsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetGlyphsInput"} + if v.FontStack == nil { + invalidParams.Add(smithy.NewErrParamRequired("FontStack")) + } + if v.FontUnicodeRange == nil { + invalidParams.Add(smithy.NewErrParamRequired("FontUnicodeRange")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSpritesInput(v *GetSpritesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSpritesInput"} + if v.FileName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FileName")) + } + if len(v.Style) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Style")) + } + if len(v.ColorScheme) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ColorScheme")) + } + if len(v.Variant) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Variant")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetStaticMapInput(v *GetStaticMapInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetStaticMapInput"} + if v.Height == nil { + invalidParams.Add(smithy.NewErrParamRequired("Height")) + } + if v.FileName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FileName")) + } + if v.Width == nil { + invalidParams.Add(smithy.NewErrParamRequired("Width")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetStyleDescriptorInput(v *GetStyleDescriptorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetStyleDescriptorInput"} + if len(v.Style) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Style")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTileInput(v *GetTileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTileInput"} + if v.Tileset == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tileset")) + } + if v.Z == nil { + invalidParams.Add(smithy.NewErrParamRequired("Z")) + } + if v.X == nil { + invalidParams.Add(smithy.NewErrParamRequired("X")) + } + if v.Y == nil { + invalidParams.Add(smithy.NewErrParamRequired("Y")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/geoplaces/LICENSE.txt b/service/geoplaces/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/geoplaces/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/geoplaces/api_client.go b/service/geoplaces/api_client.go new file mode 100644 index 00000000000..688bca1c9ad --- /dev/null +++ b/service/geoplaces/api_client.go @@ -0,0 +1,913 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "Geo Places" +const ServiceAPIVersion = "2020-11-19" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/geoplaces") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/geoplaces") +} + +// Client provides the API client to make operations call for Amazon Location +// Service Places V2. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/geoplaces") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "geoplaces", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/geoplaces") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/service/geoplaces/api_client_test.go b/service/geoplaces/api_client_test.go new file mode 100644 index 00000000000..9023f8b84ab --- /dev/null +++ b/service/geoplaces/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/geoplaces/api_op_Autocomplete.go b/service/geoplaces/api_op_Autocomplete.go new file mode 100644 index 00000000000..26c3faa11c5 --- /dev/null +++ b/service/geoplaces/api_op_Autocomplete.go @@ -0,0 +1,215 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The autocomplete operation speeds up and increases the accuracy of entering +// addresses by providing a list of address candidates matching a partially entered +// address. Results are sorted from most to least matching. Filtering and biasing +// can be used to increase the relevance of the results if additional search +// context is known +func (c *Client) Autocomplete(ctx context.Context, params *AutocompleteInput, optFns ...func(*Options)) (*AutocompleteOutput, error) { + if params == nil { + params = &AutocompleteInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "Autocomplete", params, optFns, c.addOperationAutocompleteMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AutocompleteOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AutocompleteInput struct { + + // The free-form text query to match addresses against. This is usually a + // partially typed address from an end user in an address box or form. + // + // This member is required. + QueryText *string + + // A list of optional additional parameters that can be requested for each result. + AdditionalFeatures []types.AutocompleteAdditionalFeature + + // The position in longitude and latitude that the results should be close to. + // Typically, place results returned are ranked higher the closer they are to this + // position. Stored in [lng, lat] and in the WSG84 format. + // + // The fields BiasPosition , FilterBoundingBox , and FilterCircle are mutually + // exclusive. + BiasPosition []float64 + + // A structure which contains a set of inclusion/exclusion properties that results + // must posses in order to be returned as a result. + Filter *types.AutocompleteFilter + + // Indicates if the results will be stored. Defaults to SingleUse , if left empty. + IntendedUse types.AutocompleteIntendedUse + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // An optional limit for the number of results returned in a single call. + MaxResults *int32 + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The PostalCodeMode affects how postal code results are returned. If a postal + // code spans multiple localities and this value is empty, partial district or + // locality information may be returned under a single postal code result entry. If + // it's populated with the value cityLookup , all cities in that postal code are + // returned. + PostalCodeMode types.PostalCodeMode + + noSmithyDocumentSerde +} + +type AutocompleteOutput struct { + + // The pricing bucket for which the query is charged at. + // + // For more inforamtion on pricing, please visit [Amazon Location Service Pricing]. + // + // [Amazon Location Service Pricing]: https://aws.amazon.com/location/pricing/ + // + // This member is required. + PricingBucket *string + + // List of places or results returned for a query. + ResultItems []types.AutocompleteResultItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAutocompleteMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpAutocomplete{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAutocomplete{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "Autocomplete"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAutocompleteValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAutocomplete(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAutocomplete(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "Autocomplete", + } +} diff --git a/service/geoplaces/api_op_Geocode.go b/service/geoplaces/api_op_Geocode.go new file mode 100644 index 00000000000..1ad06a49aa2 --- /dev/null +++ b/service/geoplaces/api_op_Geocode.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The Geocode action allows you to obtain coordinates, addresses, and other +// information about places. +func (c *Client) Geocode(ctx context.Context, params *GeocodeInput, optFns ...func(*Options)) (*GeocodeOutput, error) { + if params == nil { + params = &GeocodeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "Geocode", params, optFns, c.addOperationGeocodeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GeocodeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GeocodeInput struct { + + // A list of optional additional parameters, such as time zone, that can be + // requested for each result. + AdditionalFeatures []types.GeocodeAdditionalFeature + + // The position, in longitude and latitude, that the results should be close to. + // Typically, place results returned are ranked higher the closer they are to this + // position. Stored in [lng, lat] and in the WSG84 format. + // + // The fields BiasPosition , FilterBoundingBox , and FilterCircle are mutually + // exclusive. + BiasPosition []float64 + + // A structure which contains a set of inclusion/exclusion properties that results + // must posses in order to be returned as a result. + Filter *types.GeocodeFilter + + // Indicates if the results will be stored. Defaults to SingleUse , if left empty. + IntendedUse types.GeocodeIntendedUse + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // An optional limit for the number of results returned in a single call. + MaxResults *int32 + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // A structured free text query allows you to search for places by the name or + // text representation of specific properties of the place. + QueryComponents *types.GeocodeQueryComponents + + // The free-form text query to match addresses against. This is usually a + // partially typed address from an end user in an address box or form. + QueryText *string + + noSmithyDocumentSerde +} + +type GeocodeOutput struct { + + // The pricing bucket for which the query is charged at. + // + // For more inforamtion on pricing, please visit [Amazon Location Service Pricing]. + // + // [Amazon Location Service Pricing]: https://aws.amazon.com/location/pricing/ + // + // This member is required. + PricingBucket *string + + // List of places or results returned for a query. + ResultItems []types.GeocodeResultItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGeocodeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGeocode{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGeocode{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "Geocode"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGeocode(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGeocode(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "Geocode", + } +} diff --git a/service/geoplaces/api_op_GetPlace.go b/service/geoplaces/api_op_GetPlace.go new file mode 100644 index 00000000000..c7bf27bdeb0 --- /dev/null +++ b/service/geoplaces/api_op_GetPlace.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Finds a place by its unique ID. A PlaceId is returned by other place operations. +func (c *Client) GetPlace(ctx context.Context, params *GetPlaceInput, optFns ...func(*Options)) (*GetPlaceOutput, error) { + if params == nil { + params = &GetPlaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPlace", params, optFns, c.addOperationGetPlaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPlaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPlaceInput struct { + + // The PlaceId of the place you wish to receive the information for. + // + // This member is required. + PlaceId *string + + // A list of optional additional parameters such as time zone that can be + // requested for each result. + AdditionalFeatures []types.GetPlaceAdditionalFeature + + // Indicates if the results will be stored. Defaults to SingleUse , if left empty. + IntendedUse types.GetPlaceIntendedUse + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + noSmithyDocumentSerde +} + +type GetPlaceOutput struct { + + // The PlaceId of the place you wish to receive the information for. + // + // This member is required. + PlaceId *string + + // A PlaceType is a category that the result place must belong to. + // + // This member is required. + PlaceType types.PlaceType + + // The pricing bucket for which the query is charged at. + // + // For more inforamtion on pricing, please visit [Amazon Location Service Pricing]. + // + // [Amazon Location Service Pricing]: https://aws.amazon.com/location/pricing/ + // + // This member is required. + PricingBucket *string + + // The localized display name of this result item based on request parameter + // language . + // + // This member is required. + Title *string + + // Position of the access point in (lng,lat) . + AccessPoints []types.AccessPoint + + // Indicates known access restrictions on a vehicle access point. The index + // correlates to an access point and indicates if access through this point has + // some form of restriction. + AccessRestrictions []types.AccessRestriction + + // The place's address. + Address *types.Address + + // Boolean indicating if the address provided has been corrected. + AddressNumberCorrected *bool + + // The Business Chains associated with the place. + BusinessChains []types.BusinessChain + + // Categories of results that results must belong to. + Categories []types.Category + + // List of potential contact methods for the result/place. + Contacts *types.Contacts + + // List of food types offered by this result. + FoodTypes []types.FoodType + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set of four coordinates: [{westward + // lng}, {southern lat}, {eastward lng}, {northern lat}] + MapView []float64 + + // List of opening hours objects. + OpeningHours []types.OpeningHours + + // How the various components of the result's address are pronounced in various + // languages. + Phonemes *types.PhonemeDetails + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The position, in longitude and latitude. + Position []float64 + + // Contains details about the postal code of the place/result. + PostalCodeDetails []types.PostalCodeDetails + + // The time zone in which the place is located. + TimeZone *types.TimeZone + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPlaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPlace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPlace{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPlace"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetPlaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPlace(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetPlace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetPlace", + } +} diff --git a/service/geoplaces/api_op_ReverseGeocode.go b/service/geoplaces/api_op_ReverseGeocode.go new file mode 100644 index 00000000000..f0394fed474 --- /dev/null +++ b/service/geoplaces/api_op_ReverseGeocode.go @@ -0,0 +1,204 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The ReverseGeocode operation allows you to retrieve addresses and place +// +// information from coordinates. +func (c *Client) ReverseGeocode(ctx context.Context, params *ReverseGeocodeInput, optFns ...func(*Options)) (*ReverseGeocodeOutput, error) { + if params == nil { + params = &ReverseGeocodeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ReverseGeocode", params, optFns, c.addOperationReverseGeocodeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ReverseGeocodeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ReverseGeocodeInput struct { + + // The position, in [lng, lat] for which you are querying nearby resultsfor. + // Results closer to the position will be ranked higher then results further away + // from the position + // + // This member is required. + QueryPosition []float64 + + // A list of optional additional parameters, such as time zone that can be + // requested for each result. + AdditionalFeatures []types.ReverseGeocodeAdditionalFeature + + // A structure which contains a set of inclusion/exclusion properties that results + // must posses in order to be returned as a result. + Filter *types.ReverseGeocodeFilter + + // Indicates if the results will be stored. Defaults to SingleUse , if left empty. + IntendedUse types.ReverseGeocodeIntendedUse + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // An optional limit for the number of results returned in a single call. + MaxResults *int32 + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The maximum distance in meters from the QueryPosition from which a result will + // be returned. + QueryRadius *int64 + + noSmithyDocumentSerde +} + +type ReverseGeocodeOutput struct { + + // The pricing bucket for which the query is charged at. + // + // For more inforamtion on pricing, please visit [Amazon Location Service Pricing]. + // + // [Amazon Location Service Pricing]: https://aws.amazon.com/location/pricing/ + // + // This member is required. + PricingBucket *string + + // List of places or results returned for a query. + ResultItems []types.ReverseGeocodeResultItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationReverseGeocodeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpReverseGeocode{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpReverseGeocode{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ReverseGeocode"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpReverseGeocodeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReverseGeocode(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opReverseGeocode(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ReverseGeocode", + } +} diff --git a/service/geoplaces/api_op_SearchNearby.go b/service/geoplaces/api_op_SearchNearby.go new file mode 100644 index 00000000000..fc94c436d04 --- /dev/null +++ b/service/geoplaces/api_op_SearchNearby.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Search nearby a specified location. +func (c *Client) SearchNearby(ctx context.Context, params *SearchNearbyInput, optFns ...func(*Options)) (*SearchNearbyOutput, error) { + if params == nil { + params = &SearchNearbyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchNearby", params, optFns, c.addOperationSearchNearbyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchNearbyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchNearbyInput struct { + + // The position, in [lng, lat] for which you are querying nearby resultsfor. + // Results closer to the position will be ranked higher then results further away + // from the position + // + // This member is required. + QueryPosition []float64 + + // A list of optional additional parameters, such as time zone, that can be + // requested for each result. + AdditionalFeatures []types.SearchNearbyAdditionalFeature + + // A structure which contains a set of inclusion/exclusion properties that results + // must posses in order to be returned as a result. + Filter *types.SearchNearbyFilter + + // Indicates if the results will be stored. Defaults to SingleUse , if left empty. + IntendedUse types.SearchNearbyIntendedUse + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // An optional limit for the number of results returned in a single call. + MaxResults *int32 + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. + NextToken *string + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The maximum distance in meters from the QueryPosition from which a result will + // be returned. + QueryRadius *int64 + + noSmithyDocumentSerde +} + +type SearchNearbyOutput struct { + + // The pricing bucket for which the query is charged at. + // + // For more inforamtion on pricing, please visit [Amazon Location Service Pricing]. + // + // [Amazon Location Service Pricing]: https://aws.amazon.com/location/pricing/ + // + // This member is required. + PricingBucket *string + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. + NextToken *string + + // List of places or results returned for a query. + ResultItems []types.SearchNearbyResultItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchNearbyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchNearby{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchNearby{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SearchNearby"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSearchNearbyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchNearby(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSearchNearby(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SearchNearby", + } +} diff --git a/service/geoplaces/api_op_SearchText.go b/service/geoplaces/api_op_SearchText.go new file mode 100644 index 00000000000..1ed588f5791 --- /dev/null +++ b/service/geoplaces/api_op_SearchText.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use the SearchText operation to search for geocode and place information. You +// can then complete a follow-up query suggested from the Suggest API via a query +// id. +func (c *Client) SearchText(ctx context.Context, params *SearchTextInput, optFns ...func(*Options)) (*SearchTextOutput, error) { + if params == nil { + params = &SearchTextInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchText", params, optFns, c.addOperationSearchTextMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchTextOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchTextInput struct { + + // A list of optional additional parameters, such as time zone, that can be + // requested for each result. + AdditionalFeatures []types.SearchTextAdditionalFeature + + // The position, in longitude and latitude, that the results should be close to. + // Typically, place results returned are ranked higher the closer they are to this + // position. Stored in [lng, lat] and in the WSG84 format. + // + // The fields BiasPosition , FilterBoundingBox , and FilterCircle are mutually + // exclusive. + BiasPosition []float64 + + // A structure which contains a set of inclusion/exclusion properties that results + // must posses in order to be returned as a result. + Filter *types.SearchTextFilter + + // Indicates if the results will be stored. Defaults to SingleUse , if left empty. + IntendedUse types.SearchTextIntendedUse + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // An optional limit for the number of results returned in a single call. + MaxResults *int32 + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. + NextToken *string + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The query Id. + QueryId *string + + // The free-form text query to match addresses against. This is usually a + // partially typed address from an end user in an address box or form. + QueryText *string + + noSmithyDocumentSerde +} + +type SearchTextOutput struct { + + // The pricing bucket for which the query is charged at. + // + // For more inforamtion on pricing, please visit [Amazon Location Service Pricing]. + // + // [Amazon Location Service Pricing]: https://aws.amazon.com/location/pricing/ + // + // This member is required. + PricingBucket *string + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. + NextToken *string + + // List of places or results returned for a query. + ResultItems []types.SearchTextResultItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchTextMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchText{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchText{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SearchText"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSearchTextValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchText(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSearchText(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SearchText", + } +} diff --git a/service/geoplaces/api_op_Suggest.go b/service/geoplaces/api_op_Suggest.go new file mode 100644 index 00000000000..e6aeb01213f --- /dev/null +++ b/service/geoplaces/api_op_Suggest.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The Suggest operation finds addresses or place candidates based on incomplete +// or misspelled queries. You then select the best query to submit based on the +// returned results. +func (c *Client) Suggest(ctx context.Context, params *SuggestInput, optFns ...func(*Options)) (*SuggestOutput, error) { + if params == nil { + params = &SuggestInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "Suggest", params, optFns, c.addOperationSuggestMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SuggestOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SuggestInput struct { + + // The free-form text query to match addresses against. This is usually a + // partially typed address from an end user in an address box or form. + // + // This member is required. + QueryText *string + + // A list of optional additional parameters, such as time zone, that can be + // requested for each result. + AdditionalFeatures []types.SuggestAdditionalFeature + + // The position, in longitude and latitude, that the results should be close to. + // Typically, place results returned are ranked higher the closer they are to this + // position. Stored in [lng, lat] and in the WSG84 format. + // + // The fields BiasPosition , FilterBoundingBox , and FilterCircle are mutually + // exclusive. + BiasPosition []float64 + + // A structure which contains a set of inclusion/exclusion properties that results + // must posses in order to be returned as a result. + Filter *types.SuggestFilter + + // Indicates if the results will be stored. Defaults to SingleUse , if left empty. + IntendedUse types.SuggestIntendedUse + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // Maximum number of query terms to be returned for use with a search text query. + MaxQueryRefinements *int32 + + // An optional limit for the number of results returned in a single call. + MaxResults *int32 + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + noSmithyDocumentSerde +} + +type SuggestOutput struct { + + // The pricing bucket for which the query is charged at. + // + // For more inforamtion on pricing, please visit [Amazon Location Service Pricing]. + // + // [Amazon Location Service Pricing]: https://aws.amazon.com/location/pricing/ + // + // This member is required. + PricingBucket *string + + // Maximum number of query terms to be returned for use with a search text query. + QueryRefinements []types.QueryRefinement + + // List of places or results returned for a query. + ResultItems []types.SuggestResultItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSuggestMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSuggest{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSuggest{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "Suggest"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSuggestValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSuggest(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSuggest(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "Suggest", + } +} diff --git a/service/geoplaces/auth.go b/service/geoplaces/auth.go new file mode 100644 index 00000000000..025caea7bc4 --- /dev/null +++ b/service/geoplaces/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "geo-places") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/geoplaces/deserializers.go b/service/geoplaces/deserializers.go new file mode 100644 index 00000000000..8f90988bed6 --- /dev/null +++ b/service/geoplaces/deserializers.go @@ -0,0 +1,5929 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "math" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpAutocomplete struct { +} + +func (*awsRestjson1_deserializeOpAutocomplete) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAutocomplete) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorAutocomplete(response, &metadata) + } + output := &AutocompleteOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsAutocompleteOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentAutocompleteOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAutocomplete(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("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_deserializeOpHttpBindingsAutocompleteOutput(v *AutocompleteOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentAutocompleteOutput(v **AutocompleteOutput, 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 *AutocompleteOutput + if *v == nil { + sv = &AutocompleteOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResultItems": + if err := awsRestjson1_deserializeDocumentAutocompleteResultItemList(&sv.ResultItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGeocode struct { +} + +func (*awsRestjson1_deserializeOpGeocode) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGeocode) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGeocode(response, &metadata) + } + output := &GeocodeOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGeocodeOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGeocodeOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGeocode(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("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_deserializeOpHttpBindingsGeocodeOutput(v *GeocodeOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGeocodeOutput(v **GeocodeOutput, 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 *GeocodeOutput + if *v == nil { + sv = &GeocodeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResultItems": + if err := awsRestjson1_deserializeDocumentGeocodeResultItemList(&sv.ResultItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetPlace struct { +} + +func (*awsRestjson1_deserializeOpGetPlace) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetPlace) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetPlace(response, &metadata) + } + output := &GetPlaceOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsGetPlaceOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetPlaceOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetPlace(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("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_deserializeOpHttpBindingsGetPlaceOutput(v *GetPlaceOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentGetPlaceOutput(v **GetPlaceOutput, 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 *GetPlaceOutput + if *v == nil { + sv = &GetPlaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccessPoints": + if err := awsRestjson1_deserializeDocumentAccessPointList(&sv.AccessPoints, value); err != nil { + return err + } + + case "AccessRestrictions": + if err := awsRestjson1_deserializeDocumentAccessRestrictionList(&sv.AccessRestrictions, value); err != nil { + return err + } + + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "AddressNumberCorrected": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AddressNumberCorrected = ptr.Bool(jtv) + } + + case "BusinessChains": + if err := awsRestjson1_deserializeDocumentBusinessChainList(&sv.BusinessChains, value); err != nil { + return err + } + + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Contacts": + if err := awsRestjson1_deserializeDocumentContacts(&sv.Contacts, value); err != nil { + return err + } + + case "FoodTypes": + if err := awsRestjson1_deserializeDocumentFoodTypeList(&sv.FoodTypes, value); err != nil { + return err + } + + case "MapView": + if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.MapView, value); err != nil { + return err + } + + case "OpeningHours": + if err := awsRestjson1_deserializeDocumentOpeningHoursList(&sv.OpeningHours, value); err != nil { + return err + } + + case "Phonemes": + if err := awsRestjson1_deserializeDocumentPhonemeDetails(&sv.Phonemes, value); err != nil { + return err + } + + case "PlaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlaceId = ptr.String(jtv) + } + + case "PlaceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlaceType to be of type string, got %T instead", value) + } + sv.PlaceType = types.PlaceType(jtv) + } + + case "PoliticalView": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.PoliticalView = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + case "PostalCodeDetails": + if err := awsRestjson1_deserializeDocumentPostalCodeDetailsList(&sv.PostalCodeDetails, value); err != nil { + return err + } + + case "TimeZone": + if err := awsRestjson1_deserializeDocumentTimeZone(&sv.TimeZone, value); err != nil { + return err + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpReverseGeocode struct { +} + +func (*awsRestjson1_deserializeOpReverseGeocode) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpReverseGeocode) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorReverseGeocode(response, &metadata) + } + output := &ReverseGeocodeOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsReverseGeocodeOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentReverseGeocodeOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorReverseGeocode(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("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_deserializeOpHttpBindingsReverseGeocodeOutput(v *ReverseGeocodeOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentReverseGeocodeOutput(v **ReverseGeocodeOutput, 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 *ReverseGeocodeOutput + if *v == nil { + sv = &ReverseGeocodeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResultItems": + if err := awsRestjson1_deserializeDocumentReverseGeocodeResultItemList(&sv.ResultItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchNearby struct { +} + +func (*awsRestjson1_deserializeOpSearchNearby) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchNearby) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorSearchNearby(response, &metadata) + } + output := &SearchNearbyOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsSearchNearbyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentSearchNearbyOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchNearby(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("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_deserializeOpHttpBindingsSearchNearbyOutput(v *SearchNearbyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentSearchNearbyOutput(v **SearchNearbyOutput, 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 *SearchNearbyOutput + if *v == nil { + sv = &SearchNearbyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ResultItems": + if err := awsRestjson1_deserializeDocumentSearchNearbyResultItemList(&sv.ResultItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchText struct { +} + +func (*awsRestjson1_deserializeOpSearchText) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchText) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorSearchText(response, &metadata) + } + output := &SearchTextOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsSearchTextOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentSearchTextOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchText(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("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_deserializeOpHttpBindingsSearchTextOutput(v *SearchTextOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentSearchTextOutput(v **SearchTextOutput, 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 *SearchTextOutput + if *v == nil { + sv = &SearchTextOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ResultItems": + if err := awsRestjson1_deserializeDocumentSearchTextResultItemList(&sv.ResultItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSuggest struct { +} + +func (*awsRestjson1_deserializeOpSuggest) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSuggest) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorSuggest(response, &metadata) + } + output := &SuggestOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsSuggestOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentSuggestOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSuggest(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("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_deserializeOpHttpBindingsSuggestOutput(v *SuggestOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentSuggestOutput(v **SuggestOutput, 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 *SuggestOutput + if *v == nil { + sv = &SuggestOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "QueryRefinements": + if err := awsRestjson1_deserializeDocumentQueryRefinementList(&sv.QueryRefinements, value); err != nil { + return err + } + + case "ResultItems": + if err := awsRestjson1_deserializeDocumentSuggestResultItemList(&sv.ResultItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccessPoint(v **types.AccessPoint, 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.AccessPoint + if *v == nil { + sv = &types.AccessPoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccessPointList(v *[]types.AccessPoint, 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.AccessPoint + if *v == nil { + cv = []types.AccessPoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccessPoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccessPoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAccessRestriction(v **types.AccessRestriction, 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.AccessRestriction + if *v == nil { + sv = &types.AccessRestriction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Restricted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Restricted = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccessRestrictionList(v *[]types.AccessRestriction, 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.AccessRestriction + if *v == nil { + cv = []types.AccessRestriction{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccessRestriction + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccessRestriction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAddress(v **types.Address, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Address + if *v == nil { + sv = &types.Address{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AddressNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AddressNumber = ptr.String(jtv) + } + + case "Block": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Block = ptr.String(jtv) + } + + case "Building": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Building = ptr.String(jtv) + } + + case "Country": + if err := awsRestjson1_deserializeDocumentCountry(&sv.Country, value); err != nil { + return err + } + + case "District": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.District = ptr.String(jtv) + } + + case "Intersection": + if err := awsRestjson1_deserializeDocumentIntersectionList(&sv.Intersection, value); err != nil { + return err + } + + case "Label": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Label = ptr.String(jtv) + } + + case "Locality": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Locality = ptr.String(jtv) + } + + case "PostalCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PostalCode = ptr.String(jtv) + } + + case "Region": + if err := awsRestjson1_deserializeDocumentRegion(&sv.Region, value); err != nil { + return err + } + + case "Street": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Street = ptr.String(jtv) + } + + case "StreetComponents": + if err := awsRestjson1_deserializeDocumentStreetComponentsList(&sv.StreetComponents, value); err != nil { + return err + } + + case "SubBlock": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubBlock = ptr.String(jtv) + } + + case "SubDistrict": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubDistrict = ptr.String(jtv) + } + + case "SubRegion": + if err := awsRestjson1_deserializeDocumentSubRegion(&sv.SubRegion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAddressComponentMatchScores(v **types.AddressComponentMatchScores, 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.AddressComponentMatchScores + if *v == nil { + sv = &types.AddressComponentMatchScores{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AddressNumber": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.AddressNumber = 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.AddressNumber = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "Block": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Block = 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.Block = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "Building": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Building = 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.Building = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "Country": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Country = 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.Country = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "District": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.District = 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.District = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "Intersection": + if err := awsRestjson1_deserializeDocumentMatchScoreList(&sv.Intersection, value); err != nil { + return err + } + + case "Locality": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Locality = 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.Locality = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "PostalCode": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PostalCode = 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.PostalCode = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "Region": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Region = 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.Region = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "SubBlock": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SubBlock = 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.SubBlock = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "SubDistrict": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SubDistrict = 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.SubDistrict = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + case "SubRegion": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SubRegion = 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.SubRegion = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAddressComponentPhonemes(v **types.AddressComponentPhonemes, 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.AddressComponentPhonemes + if *v == nil { + sv = &types.AddressComponentPhonemes{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Block": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.Block, value); err != nil { + return err + } + + case "Country": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.Country, value); err != nil { + return err + } + + case "District": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.District, value); err != nil { + return err + } + + case "Locality": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.Locality, value); err != nil { + return err + } + + case "Region": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.Region, value); err != nil { + return err + } + + case "Street": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.Street, value); err != nil { + return err + } + + case "SubBlock": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.SubBlock, value); err != nil { + return err + } + + case "SubDistrict": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.SubDistrict, value); err != nil { + return err + } + + case "SubRegion": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.SubRegion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutocompleteAddressHighlights(v **types.AutocompleteAddressHighlights, 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.AutocompleteAddressHighlights + if *v == nil { + sv = &types.AutocompleteAddressHighlights{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AddressNumber": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.AddressNumber, value); err != nil { + return err + } + + case "Block": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Block, value); err != nil { + return err + } + + case "Building": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Building, value); err != nil { + return err + } + + case "Country": + if err := awsRestjson1_deserializeDocumentCountryHighlights(&sv.Country, value); err != nil { + return err + } + + case "District": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.District, value); err != nil { + return err + } + + case "Intersection": + if err := awsRestjson1_deserializeDocumentIntersectionHighlightsList(&sv.Intersection, value); err != nil { + return err + } + + case "Label": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Label, value); err != nil { + return err + } + + case "Locality": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Locality, value); err != nil { + return err + } + + case "PostalCode": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.PostalCode, value); err != nil { + return err + } + + case "Region": + if err := awsRestjson1_deserializeDocumentRegionHighlights(&sv.Region, value); err != nil { + return err + } + + case "Street": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Street, value); err != nil { + return err + } + + case "SubBlock": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.SubBlock, value); err != nil { + return err + } + + case "SubDistrict": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.SubDistrict, value); err != nil { + return err + } + + case "SubRegion": + if err := awsRestjson1_deserializeDocumentSubRegionHighlights(&sv.SubRegion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutocompleteHighlights(v **types.AutocompleteHighlights, 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.AutocompleteHighlights + if *v == nil { + sv = &types.AutocompleteHighlights{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Address": + if err := awsRestjson1_deserializeDocumentAutocompleteAddressHighlights(&sv.Address, value); err != nil { + return err + } + + case "Title": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Title, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutocompleteResultItem(v **types.AutocompleteResultItem, 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.AutocompleteResultItem + if *v == nil { + sv = &types.AutocompleteResultItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Highlights": + if err := awsRestjson1_deserializeDocumentAutocompleteHighlights(&sv.Highlights, value); err != nil { + return err + } + + case "Language": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value) + } + sv.Language = ptr.String(jtv) + } + + case "PlaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlaceId = ptr.String(jtv) + } + + case "PlaceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlaceType to be of type string, got %T instead", value) + } + sv.PlaceType = types.PlaceType(jtv) + } + + case "PoliticalView": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.PoliticalView = ptr.String(jtv) + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAutocompleteResultItemList(v *[]types.AutocompleteResultItem, 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.AutocompleteResultItem + if *v == nil { + cv = []types.AutocompleteResultItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AutocompleteResultItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentAutocompleteResultItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBoundingBox(v *[]float64, 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 []float64 + if *v == nil { + cv = []float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = 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) + + } + col = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBusinessChain(v **types.BusinessChain, 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.BusinessChain + if *v == nil { + sv = &types.BusinessChain{} + } 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 "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBusinessChainList(v *[]types.BusinessChain, 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.BusinessChain + if *v == nil { + cv = []types.BusinessChain{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BusinessChain + destAddr := &col + if err := awsRestjson1_deserializeDocumentBusinessChain(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCategory(v **types.Category, 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.Category + if *v == nil { + sv = &types.Category{} + } 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 "LocalizedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LocalizedName = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Primary": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Primary = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCategoryList(v *[]types.Category, 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.Category + if *v == nil { + cv = []types.Category{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Category + destAddr := &col + if err := awsRestjson1_deserializeDocumentCategory(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentMatchScores(v **types.ComponentMatchScores, 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.ComponentMatchScores + if *v == nil { + sv = &types.ComponentMatchScores{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Address": + if err := awsRestjson1_deserializeDocumentAddressComponentMatchScores(&sv.Address, value); err != nil { + return err + } + + case "Title": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Title = 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.Title = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContactDetails(v **types.ContactDetails, 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.ContactDetails + if *v == nil { + sv = &types.ContactDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Label": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Label = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContactDetailsList(v *[]types.ContactDetails, 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.ContactDetails + if *v == nil { + cv = []types.ContactDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ContactDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentContactDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentContacts(v **types.Contacts, 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.Contacts + if *v == nil { + sv = &types.Contacts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Emails": + if err := awsRestjson1_deserializeDocumentContactDetailsList(&sv.Emails, value); err != nil { + return err + } + + case "Faxes": + if err := awsRestjson1_deserializeDocumentContactDetailsList(&sv.Faxes, value); err != nil { + return err + } + + case "Phones": + if err := awsRestjson1_deserializeDocumentContactDetailsList(&sv.Phones, value); err != nil { + return err + } + + case "Websites": + if err := awsRestjson1_deserializeDocumentContactDetailsList(&sv.Websites, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCountry(v **types.Country, 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.Country + if *v == nil { + sv = &types.Country{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code2": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode2 to be of type string, got %T instead", value) + } + sv.Code2 = ptr.String(jtv) + } + + case "Code3": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.Code3 = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCountryHighlights(v **types.CountryHighlights, 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.CountryHighlights + if *v == nil { + sv = &types.CountryHighlights{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Code, value); err != nil { + return err + } + + case "Name": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Name, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFoodType(v **types.FoodType, 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.FoodType + if *v == nil { + sv = &types.FoodType{} + } 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 "LocalizedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LocalizedName = ptr.String(jtv) + } + + case "Primary": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Primary = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFoodTypeList(v *[]types.FoodType, 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.FoodType + if *v == nil { + cv = []types.FoodType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FoodType + destAddr := &col + if err := awsRestjson1_deserializeDocumentFoodType(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGeocodeResultItem(v **types.GeocodeResultItem, 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.GeocodeResultItem + if *v == nil { + sv = &types.GeocodeResultItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccessPoints": + if err := awsRestjson1_deserializeDocumentAccessPointList(&sv.AccessPoints, value); err != nil { + return err + } + + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "AddressNumberCorrected": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AddressNumberCorrected = ptr.Bool(jtv) + } + + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "FoodTypes": + if err := awsRestjson1_deserializeDocumentFoodTypeList(&sv.FoodTypes, value); err != nil { + return err + } + + case "MapView": + if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.MapView, value); err != nil { + return err + } + + case "MatchScores": + if err := awsRestjson1_deserializeDocumentMatchScoreDetails(&sv.MatchScores, value); err != nil { + return err + } + + case "PlaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlaceId = ptr.String(jtv) + } + + case "PlaceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlaceType to be of type string, got %T instead", value) + } + sv.PlaceType = types.PlaceType(jtv) + } + + case "PoliticalView": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.PoliticalView = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + case "PostalCodeDetails": + if err := awsRestjson1_deserializeDocumentPostalCodeDetailsList(&sv.PostalCodeDetails, value); err != nil { + return err + } + + case "TimeZone": + if err := awsRestjson1_deserializeDocumentTimeZone(&sv.TimeZone, value); err != nil { + return err + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGeocodeResultItemList(v *[]types.GeocodeResultItem, 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.GeocodeResultItem + if *v == nil { + cv = []types.GeocodeResultItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GeocodeResultItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentGeocodeResultItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentHighlight(v **types.Highlight, 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.Highlight + if *v == nil { + sv = &types.Highlight{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EndIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndIndex = ptr.Int32(int32(i64)) + } + + case "StartIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StartIndex = ptr.Int32(int32(i64)) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentHighlightList(v *[]types.Highlight, 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.Highlight + if *v == nil { + cv = []types.Highlight{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Highlight + destAddr := &col + if err := awsRestjson1_deserializeDocumentHighlight(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIntersectionHighlightsList(v *[][]types.Highlight, 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.Highlight + if *v == nil { + cv = [][]types.Highlight{} + } else { + cv = *v + } + + for _, value := range shape { + var col []types.Highlight + if err := awsRestjson1_deserializeDocumentHighlightList(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIntersectionList(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 IntersectionStreet to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMatchScoreDetails(v **types.MatchScoreDetails, 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.MatchScoreDetails + if *v == nil { + sv = &types.MatchScoreDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Components": + if err := awsRestjson1_deserializeDocumentComponentMatchScores(&sv.Components, value); err != nil { + return err + } + + case "Overall": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Overall = 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.Overall = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMatchScoreList(v *[]float64, 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 []float64 + if *v == nil { + cv = []float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = 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) + + } + col = f64 + + default: + return fmt.Errorf("expected MatchScore to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentOpeningHours(v **types.OpeningHours, 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.OpeningHours + if *v == nil { + sv = &types.OpeningHours{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Components": + if err := awsRestjson1_deserializeDocumentOpeningHoursComponentsList(&sv.Components, value); err != nil { + return err + } + + case "Display": + if err := awsRestjson1_deserializeDocumentOpeningHoursDisplayList(&sv.Display, value); err != nil { + return err + } + + case "OpenNow": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.OpenNow = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOpeningHoursComponents(v **types.OpeningHoursComponents, 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.OpeningHoursComponents + if *v == nil { + sv = &types.OpeningHoursComponents{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "OpenDuration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OpenDuration = ptr.String(jtv) + } + + case "OpenTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OpenTime = ptr.String(jtv) + } + + case "Recurrence": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Recurrence = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOpeningHoursComponentsList(v *[]types.OpeningHoursComponents, 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.OpeningHoursComponents + if *v == nil { + cv = []types.OpeningHoursComponents{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OpeningHoursComponents + destAddr := &col + if err := awsRestjson1_deserializeDocumentOpeningHoursComponents(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentOpeningHoursDisplayList(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 OpeningHoursDisplay to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentOpeningHoursList(v *[]types.OpeningHours, 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.OpeningHours + if *v == nil { + cv = []types.OpeningHours{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OpeningHours + destAddr := &col + if err := awsRestjson1_deserializeDocumentOpeningHours(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhonemeDetails(v **types.PhonemeDetails, 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.PhonemeDetails + if *v == nil { + sv = &types.PhonemeDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Address": + if err := awsRestjson1_deserializeDocumentAddressComponentPhonemes(&sv.Address, value); err != nil { + return err + } + + case "Title": + if err := awsRestjson1_deserializeDocumentPhonemeTranscriptionList(&sv.Title, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhonemeTranscription(v **types.PhonemeTranscription, 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.PhonemeTranscription + if *v == nil { + sv = &types.PhonemeTranscription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Language": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value) + } + sv.Language = ptr.String(jtv) + } + + case "Preferred": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Preferred = ptr.Bool(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhonemeTranscriptionList(v *[]types.PhonemeTranscription, 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.PhonemeTranscription + if *v == nil { + cv = []types.PhonemeTranscription{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhonemeTranscription + destAddr := &col + if err := awsRestjson1_deserializeDocumentPhonemeTranscription(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPosition(v *[]float64, 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 []float64 + if *v == nil { + cv = []float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = 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) + + } + col = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPostalCodeDetails(v **types.PostalCodeDetails, 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.PostalCodeDetails + if *v == nil { + sv = &types.PostalCodeDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PostalAuthority": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PostalAuthority to be of type string, got %T instead", value) + } + sv.PostalAuthority = types.PostalAuthority(jtv) + } + + case "PostalCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PostalCode = ptr.String(jtv) + } + + case "PostalCodeType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PostalCodeType to be of type string, got %T instead", value) + } + sv.PostalCodeType = types.PostalCodeType(jtv) + } + + case "UspsZip": + if err := awsRestjson1_deserializeDocumentUspsZip(&sv.UspsZip, value); err != nil { + return err + } + + case "UspsZipPlus4": + if err := awsRestjson1_deserializeDocumentUspsZipPlus4(&sv.UspsZipPlus4, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPostalCodeDetailsList(v *[]types.PostalCodeDetails, 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.PostalCodeDetails + if *v == nil { + cv = []types.PostalCodeDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PostalCodeDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentPostalCodeDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentQueryRefinement(v **types.QueryRefinement, 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.QueryRefinement + if *v == nil { + sv = &types.QueryRefinement{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EndIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndIndex = ptr.Int32(int32(i64)) + } + + case "OriginalTerm": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OriginalTerm = ptr.String(jtv) + } + + case "RefinedTerm": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RefinedTerm = ptr.String(jtv) + } + + case "StartIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StartIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQueryRefinementList(v *[]types.QueryRefinement, 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.QueryRefinement + if *v == nil { + cv = []types.QueryRefinement{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QueryRefinement + destAddr := &col + if err := awsRestjson1_deserializeDocumentQueryRefinement(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 "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 "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRegionHighlights(v **types.RegionHighlights, 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.RegionHighlights + if *v == nil { + sv = &types.RegionHighlights{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Code, value); err != nil { + return err + } + + case "Name": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Name, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentReverseGeocodeResultItem(v **types.ReverseGeocodeResultItem, 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.ReverseGeocodeResultItem + if *v == nil { + sv = &types.ReverseGeocodeResultItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccessPoints": + if err := awsRestjson1_deserializeDocumentAccessPointList(&sv.AccessPoints, value); err != nil { + return err + } + + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "AddressNumberCorrected": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AddressNumberCorrected = ptr.Bool(jtv) + } + + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "FoodTypes": + if err := awsRestjson1_deserializeDocumentFoodTypeList(&sv.FoodTypes, value); err != nil { + return err + } + + case "MapView": + if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.MapView, value); err != nil { + return err + } + + case "PlaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlaceId = ptr.String(jtv) + } + + case "PlaceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlaceType to be of type string, got %T instead", value) + } + sv.PlaceType = types.PlaceType(jtv) + } + + case "PoliticalView": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.PoliticalView = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + case "PostalCodeDetails": + if err := awsRestjson1_deserializeDocumentPostalCodeDetailsList(&sv.PostalCodeDetails, value); err != nil { + return err + } + + case "TimeZone": + if err := awsRestjson1_deserializeDocumentTimeZone(&sv.TimeZone, value); err != nil { + return err + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentReverseGeocodeResultItemList(v *[]types.ReverseGeocodeResultItem, 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.ReverseGeocodeResultItem + if *v == nil { + cv = []types.ReverseGeocodeResultItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ReverseGeocodeResultItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentReverseGeocodeResultItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSearchNearbyResultItem(v **types.SearchNearbyResultItem, 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.SearchNearbyResultItem + if *v == nil { + sv = &types.SearchNearbyResultItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccessPoints": + if err := awsRestjson1_deserializeDocumentAccessPointList(&sv.AccessPoints, value); err != nil { + return err + } + + case "AccessRestrictions": + if err := awsRestjson1_deserializeDocumentAccessRestrictionList(&sv.AccessRestrictions, value); err != nil { + return err + } + + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "AddressNumberCorrected": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AddressNumberCorrected = ptr.Bool(jtv) + } + + case "BusinessChains": + if err := awsRestjson1_deserializeDocumentBusinessChainList(&sv.BusinessChains, value); err != nil { + return err + } + + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Contacts": + if err := awsRestjson1_deserializeDocumentContacts(&sv.Contacts, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "FoodTypes": + if err := awsRestjson1_deserializeDocumentFoodTypeList(&sv.FoodTypes, value); err != nil { + return err + } + + case "MapView": + if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.MapView, value); err != nil { + return err + } + + case "OpeningHours": + if err := awsRestjson1_deserializeDocumentOpeningHoursList(&sv.OpeningHours, value); err != nil { + return err + } + + case "Phonemes": + if err := awsRestjson1_deserializeDocumentPhonemeDetails(&sv.Phonemes, value); err != nil { + return err + } + + case "PlaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlaceId = ptr.String(jtv) + } + + case "PlaceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlaceType to be of type string, got %T instead", value) + } + sv.PlaceType = types.PlaceType(jtv) + } + + case "PoliticalView": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.PoliticalView = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + case "TimeZone": + if err := awsRestjson1_deserializeDocumentTimeZone(&sv.TimeZone, value); err != nil { + return err + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSearchNearbyResultItemList(v *[]types.SearchNearbyResultItem, 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.SearchNearbyResultItem + if *v == nil { + cv = []types.SearchNearbyResultItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SearchNearbyResultItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentSearchNearbyResultItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSearchTextResultItem(v **types.SearchTextResultItem, 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.SearchTextResultItem + if *v == nil { + sv = &types.SearchTextResultItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccessPoints": + if err := awsRestjson1_deserializeDocumentAccessPointList(&sv.AccessPoints, value); err != nil { + return err + } + + case "AccessRestrictions": + if err := awsRestjson1_deserializeDocumentAccessRestrictionList(&sv.AccessRestrictions, value); err != nil { + return err + } + + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "AddressNumberCorrected": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AddressNumberCorrected = ptr.Bool(jtv) + } + + case "BusinessChains": + if err := awsRestjson1_deserializeDocumentBusinessChainList(&sv.BusinessChains, value); err != nil { + return err + } + + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Contacts": + if err := awsRestjson1_deserializeDocumentContacts(&sv.Contacts, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "FoodTypes": + if err := awsRestjson1_deserializeDocumentFoodTypeList(&sv.FoodTypes, value); err != nil { + return err + } + + case "MapView": + if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.MapView, value); err != nil { + return err + } + + case "OpeningHours": + if err := awsRestjson1_deserializeDocumentOpeningHoursList(&sv.OpeningHours, value); err != nil { + return err + } + + case "Phonemes": + if err := awsRestjson1_deserializeDocumentPhonemeDetails(&sv.Phonemes, value); err != nil { + return err + } + + case "PlaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlaceId = ptr.String(jtv) + } + + case "PlaceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlaceType to be of type string, got %T instead", value) + } + sv.PlaceType = types.PlaceType(jtv) + } + + case "PoliticalView": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.PoliticalView = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + case "TimeZone": + if err := awsRestjson1_deserializeDocumentTimeZone(&sv.TimeZone, value); err != nil { + return err + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSearchTextResultItemList(v *[]types.SearchTextResultItem, 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.SearchTextResultItem + if *v == nil { + cv = []types.SearchTextResultItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SearchTextResultItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentSearchTextResultItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentStreetComponents(v **types.StreetComponents, 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.StreetComponents + if *v == nil { + sv = &types.StreetComponents{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BaseName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BaseName = ptr.String(jtv) + } + + case "Direction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Direction = ptr.String(jtv) + } + + case "Language": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value) + } + sv.Language = ptr.String(jtv) + } + + case "Prefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Prefix = ptr.String(jtv) + } + + case "Suffix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Suffix = ptr.String(jtv) + } + + 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 "TypePlacement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypePlacement to be of type string, got %T instead", value) + } + sv.TypePlacement = types.TypePlacement(jtv) + } + + case "TypeSeparator": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeSeparator to be of type string, got %T instead", value) + } + sv.TypeSeparator = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStreetComponentsList(v *[]types.StreetComponents, 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.StreetComponents + if *v == nil { + cv = []types.StreetComponents{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StreetComponents + destAddr := &col + if err := awsRestjson1_deserializeDocumentStreetComponents(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSubRegion(v **types.SubRegion, 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.SubRegion + if *v == nil { + sv = &types.SubRegion{} + } 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 "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSubRegionHighlights(v **types.SubRegionHighlights, 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.SubRegionHighlights + if *v == nil { + sv = &types.SubRegionHighlights{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Code, value); err != nil { + return err + } + + case "Name": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Name, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestAddressHighlights(v **types.SuggestAddressHighlights, 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.SuggestAddressHighlights + if *v == nil { + sv = &types.SuggestAddressHighlights{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Label": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Label, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestHighlights(v **types.SuggestHighlights, 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.SuggestHighlights + if *v == nil { + sv = &types.SuggestHighlights{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Address": + if err := awsRestjson1_deserializeDocumentSuggestAddressHighlights(&sv.Address, value); err != nil { + return err + } + + case "Title": + if err := awsRestjson1_deserializeDocumentHighlightList(&sv.Title, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestPlaceResult(v **types.SuggestPlaceResult, 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.SuggestPlaceResult + if *v == nil { + sv = &types.SuggestPlaceResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccessPoints": + if err := awsRestjson1_deserializeDocumentAccessPointList(&sv.AccessPoints, value); err != nil { + return err + } + + case "AccessRestrictions": + if err := awsRestjson1_deserializeDocumentAccessRestrictionList(&sv.AccessRestrictions, value); err != nil { + return err + } + + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "BusinessChains": + if err := awsRestjson1_deserializeDocumentBusinessChainList(&sv.BusinessChains, value); err != nil { + return err + } + + case "Categories": + if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "FoodTypes": + if err := awsRestjson1_deserializeDocumentFoodTypeList(&sv.FoodTypes, value); err != nil { + return err + } + + case "MapView": + if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.MapView, value); err != nil { + return err + } + + case "Phonemes": + if err := awsRestjson1_deserializeDocumentPhonemeDetails(&sv.Phonemes, value); err != nil { + return err + } + + case "PlaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PlaceId = ptr.String(jtv) + } + + case "PlaceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlaceType to be of type string, got %T instead", value) + } + sv.PlaceType = types.PlaceType(jtv) + } + + case "PoliticalView": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.PoliticalView = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + case "TimeZone": + if err := awsRestjson1_deserializeDocumentTimeZone(&sv.TimeZone, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestQueryResult(v **types.SuggestQueryResult, 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.SuggestQueryResult + if *v == nil { + sv = &types.SuggestQueryResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "QueryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QueryId = ptr.String(jtv) + } + + case "QueryType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryType to be of type string, got %T instead", value) + } + sv.QueryType = types.QueryType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestResultItem(v **types.SuggestResultItem, 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.SuggestResultItem + if *v == nil { + sv = &types.SuggestResultItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Highlights": + if err := awsRestjson1_deserializeDocumentSuggestHighlights(&sv.Highlights, value); err != nil { + return err + } + + case "Place": + if err := awsRestjson1_deserializeDocumentSuggestPlaceResult(&sv.Place, value); err != nil { + return err + } + + case "Query": + if err := awsRestjson1_deserializeDocumentSuggestQueryResult(&sv.Query, value); err != nil { + return err + } + + case "SuggestResultItemType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuggestResultItemType to be of type string, got %T instead", value) + } + sv.SuggestResultItemType = types.SuggestResultItemType(jtv) + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuggestResultItemList(v *[]types.SuggestResultItem, 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.SuggestResultItem + if *v == nil { + cv = []types.SuggestResultItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SuggestResultItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentSuggestResultItem(&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) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTimeZone(v **types.TimeZone, 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.TimeZone + if *v == nil { + sv = &types.TimeZone{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Offset": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Offset = ptr.String(jtv) + } + + case "OffsetSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.OffsetSeconds = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUspsZip(v **types.UspsZip, 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.UspsZip + if *v == nil { + sv = &types.UspsZip{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ZipClassificationCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZipClassificationCode to be of type string, got %T instead", value) + } + sv.ZipClassificationCode = types.ZipClassificationCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUspsZipPlus4(v **types.UspsZipPlus4, 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.UspsZipPlus4 + if *v == nil { + sv = &types.UspsZipPlus4{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RecordTypeCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecordTypeCode to be of type string, got %T instead", value) + } + sv.RecordTypeCode = types.RecordTypeCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/geoplaces/doc.go b/service/geoplaces/doc.go new file mode 100644 index 00000000000..49c30eb2dd4 --- /dev/null +++ b/service/geoplaces/doc.go @@ -0,0 +1,30 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package geoplaces provides the API client, operations, and parameter types for +// Amazon Location Service Places V2. +// +// The Places API enables powerful location search and geocoding capabilities for +// +// your applications, offering global coverage with rich, detailed information. Key +// features include: +// +// - Forward and reverse geocoding for addresses and coordinates +// +// - Comprehensive place searches with detailed information, including: +// +// - Business names and addresses +// +// - Contact information +// +// - Hours of operation +// +// - POI (Points of Interest) categories +// +// - Food types for restaurants +// +// - Chain affiliation for relevant businesses +// +// - Global data coverage with a wide range of POI categories +// +// - Regular data updates to ensure accuracy and relevance +package geoplaces diff --git a/service/geoplaces/endpoints.go b/service/geoplaces/endpoints.go new file mode 100644 index 00000000000..bb39542fad5 --- /dev/null +++ b/service/geoplaces/endpoints.go @@ -0,0 +1,741 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/geoplaces/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "geo-places" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_GEO_PLACES") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Geo Places", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _PartitionResult.Name == "aws" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == false { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == true { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo-fips.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == true { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo-fips.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://places.geo.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-places-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _UseDualStack == false { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-places-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + } + if _UseFIPS == false { + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-places.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-places.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + params.Region = bindRegion(options.Region) + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/geoplaces/endpoints_config_test.go b/service/geoplaces/endpoints_config_test.go new file mode 100644 index 00000000000..4c37fd5c576 --- /dev/null +++ b/service/geoplaces/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-places.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-geo-places.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-places.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-places.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-places.dev", + expectURL: aws.String("https://env-geo-places.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-places.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-places.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-geo-places.dev", + expectURL: aws.String("http://config-geo-places.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-places.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-places.dev", + clientEndpoint: aws.String("https://client-geo-places.dev"), + expectURL: aws.String("https://client-geo-places.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_GEO_PLACES", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/geoplaces/endpoints_test.go b/service/geoplaces/endpoints_test.go new file mode 100644 index 00000000000..df45ab0d448 --- /dev/null +++ b/service/geoplaces/endpoints_test.go @@ -0,0 +1,1006 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For custom endpoint with region not set and fips disabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo-fips.us-east-1.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo-fips.us-east-1.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo.us-east-1.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo.us-east-1.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack enabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places-fips.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack disabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places-fips.cn-northwest-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack enabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack disabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places.cn-northwest-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo-fips.us-gov-west-1.us-gov.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo-fips.us-gov-west-1.us-gov.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo.us-gov-west-1.us-gov.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://places.geo.us-gov-west-1.us-gov.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places-fips.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase25(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase26(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack enabled +func TestEndpointCase27(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack disabled +func TestEndpointCase28(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places-fips.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack enabled +func TestEndpointCase29(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack disabled +func TestEndpointCase30(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-places.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// Missing region +func TestEndpointCase31(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/geoplaces/generated.json b/service/geoplaces/generated.json new file mode 100644 index 00000000000..ab21c38cdd0 --- /dev/null +++ b/service/geoplaces/generated.json @@ -0,0 +1,39 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_Autocomplete.go", + "api_op_Geocode.go", + "api_op_GetPlace.go", + "api_op_ReverseGeocode.go", + "api_op_SearchNearby.go", + "api_op_SearchText.go", + "api_op_Suggest.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/geoplaces", + "unstable": false +} diff --git a/service/geoplaces/go.mod b/service/geoplaces/go.mod new file mode 100644 index 00000000000..611394d2881 --- /dev/null +++ b/service/geoplaces/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/geoplaces + +go 1.21 + +require ( + github.com/aws/aws-sdk-go-v2 v1.32.3 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 + github.com/aws/smithy-go v1.22.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/geoplaces/go.sum b/service/geoplaces/go.sum new file mode 100644 index 00000000000..70a20636e37 --- /dev/null +++ b/service/geoplaces/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/geoplaces/go_module_metadata.go b/service/geoplaces/go_module_metadata.go new file mode 100644 index 00000000000..2c33a86d19d --- /dev/null +++ b/service/geoplaces/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package geoplaces + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/geoplaces/internal/endpoints/endpoints.go b/service/geoplaces/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..48dadd24a0a --- /dev/null +++ b/service/geoplaces/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Geo Places endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-places.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-places-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-places-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-places.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-places.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-places-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-places-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-places.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-places-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-places.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-places-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-places.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-places-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-places.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-places-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-places.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-places.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-places-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-places-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-places.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/geoplaces/internal/endpoints/endpoints_test.go b/service/geoplaces/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/geoplaces/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/geoplaces/options.go b/service/geoplaces/options.go new file mode 100644 index 00000000000..ceed54553b5 --- /dev/null +++ b/service/geoplaces/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/service/geoplaces/protocol_test.go b/service/geoplaces/protocol_test.go new file mode 100644 index 00000000000..445edd869e3 --- /dev/null +++ b/service/geoplaces/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces diff --git a/service/geoplaces/serializers.go b/service/geoplaces/serializers.go new file mode 100644 index 00000000000..23ef6aaadfc --- /dev/null +++ b/service/geoplaces/serializers.go @@ -0,0 +1,1368 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "math" +) + +type awsRestjson1_serializeOpAutocomplete struct { +} + +func (*awsRestjson1_serializeOpAutocomplete) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAutocomplete) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*AutocompleteInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/autocomplete") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAutocompleteInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAutocompleteInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsAutocompleteInput(v *AutocompleteInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAutocompleteInput(v *AutocompleteInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFeatures != nil { + ok := object.Key("AdditionalFeatures") + if err := awsRestjson1_serializeDocumentAutocompleteAdditionalFeatureList(v.AdditionalFeatures, ok); err != nil { + return err + } + } + + if v.BiasPosition != nil { + ok := object.Key("BiasPosition") + if err := awsRestjson1_serializeDocumentPosition(v.BiasPosition, ok); err != nil { + return err + } + } + + if v.Filter != nil { + ok := object.Key("Filter") + if err := awsRestjson1_serializeDocumentAutocompleteFilter(v.Filter, ok); err != nil { + return err + } + } + + if len(v.IntendedUse) > 0 { + ok := object.Key("IntendedUse") + ok.String(string(v.IntendedUse)) + } + + if v.Language != nil { + ok := object.Key("Language") + ok.String(*v.Language) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.PoliticalView != nil { + ok := object.Key("PoliticalView") + ok.String(*v.PoliticalView) + } + + if len(v.PostalCodeMode) > 0 { + ok := object.Key("PostalCodeMode") + ok.String(string(v.PostalCodeMode)) + } + + if v.QueryText != nil { + ok := object.Key("QueryText") + ok.String(*v.QueryText) + } + + return nil +} + +type awsRestjson1_serializeOpGeocode struct { +} + +func (*awsRestjson1_serializeOpGeocode) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGeocode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GeocodeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/geocode") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGeocodeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGeocodeInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGeocodeInput(v *GeocodeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGeocodeInput(v *GeocodeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFeatures != nil { + ok := object.Key("AdditionalFeatures") + if err := awsRestjson1_serializeDocumentGeocodeAdditionalFeatureList(v.AdditionalFeatures, ok); err != nil { + return err + } + } + + if v.BiasPosition != nil { + ok := object.Key("BiasPosition") + if err := awsRestjson1_serializeDocumentPosition(v.BiasPosition, ok); err != nil { + return err + } + } + + if v.Filter != nil { + ok := object.Key("Filter") + if err := awsRestjson1_serializeDocumentGeocodeFilter(v.Filter, ok); err != nil { + return err + } + } + + if len(v.IntendedUse) > 0 { + ok := object.Key("IntendedUse") + ok.String(string(v.IntendedUse)) + } + + if v.Language != nil { + ok := object.Key("Language") + ok.String(*v.Language) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.PoliticalView != nil { + ok := object.Key("PoliticalView") + ok.String(*v.PoliticalView) + } + + if v.QueryComponents != nil { + ok := object.Key("QueryComponents") + if err := awsRestjson1_serializeDocumentGeocodeQueryComponents(v.QueryComponents, ok); err != nil { + return err + } + } + + if v.QueryText != nil { + ok := object.Key("QueryText") + ok.String(*v.QueryText) + } + + return nil +} + +type awsRestjson1_serializeOpGetPlace struct { +} + +func (*awsRestjson1_serializeOpGetPlace) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetPlace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetPlaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/place/{PlaceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetPlaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetPlaceInput(v *GetPlaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AdditionalFeatures != nil { + for i := range v.AdditionalFeatures { + encoder.AddQuery("additional-features").String(string(v.AdditionalFeatures[i])) + } + } + + if len(v.IntendedUse) > 0 { + encoder.SetQuery("intended-use").String(string(v.IntendedUse)) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + if v.Language != nil { + encoder.SetQuery("language").String(*v.Language) + } + + if v.PlaceId == nil || len(*v.PlaceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PlaceId must not be empty")} + } + if v.PlaceId != nil { + if err := encoder.SetURI("PlaceId").String(*v.PlaceId); err != nil { + return err + } + } + + if v.PoliticalView != nil { + encoder.SetQuery("political-view").String(*v.PoliticalView) + } + + return nil +} + +type awsRestjson1_serializeOpReverseGeocode struct { +} + +func (*awsRestjson1_serializeOpReverseGeocode) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpReverseGeocode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ReverseGeocodeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/reverse-geocode") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsReverseGeocodeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentReverseGeocodeInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsReverseGeocodeInput(v *ReverseGeocodeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentReverseGeocodeInput(v *ReverseGeocodeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFeatures != nil { + ok := object.Key("AdditionalFeatures") + if err := awsRestjson1_serializeDocumentReverseGeocodeAdditionalFeatureList(v.AdditionalFeatures, ok); err != nil { + return err + } + } + + if v.Filter != nil { + ok := object.Key("Filter") + if err := awsRestjson1_serializeDocumentReverseGeocodeFilter(v.Filter, ok); err != nil { + return err + } + } + + if len(v.IntendedUse) > 0 { + ok := object.Key("IntendedUse") + ok.String(string(v.IntendedUse)) + } + + if v.Language != nil { + ok := object.Key("Language") + ok.String(*v.Language) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.PoliticalView != nil { + ok := object.Key("PoliticalView") + ok.String(*v.PoliticalView) + } + + if v.QueryPosition != nil { + ok := object.Key("QueryPosition") + if err := awsRestjson1_serializeDocumentPosition(v.QueryPosition, ok); err != nil { + return err + } + } + + if v.QueryRadius != nil { + ok := object.Key("QueryRadius") + ok.Long(*v.QueryRadius) + } + + return nil +} + +type awsRestjson1_serializeOpSearchNearby struct { +} + +func (*awsRestjson1_serializeOpSearchNearby) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchNearby) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*SearchNearbyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/search-nearby") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchNearbyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchNearbyInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchNearbyInput(v *SearchNearbyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchNearbyInput(v *SearchNearbyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFeatures != nil { + ok := object.Key("AdditionalFeatures") + if err := awsRestjson1_serializeDocumentSearchNearbyAdditionalFeatureList(v.AdditionalFeatures, ok); err != nil { + return err + } + } + + if v.Filter != nil { + ok := object.Key("Filter") + if err := awsRestjson1_serializeDocumentSearchNearbyFilter(v.Filter, ok); err != nil { + return err + } + } + + if len(v.IntendedUse) > 0 { + ok := object.Key("IntendedUse") + ok.String(string(v.IntendedUse)) + } + + if v.Language != nil { + ok := object.Key("Language") + ok.String(*v.Language) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.PoliticalView != nil { + ok := object.Key("PoliticalView") + ok.String(*v.PoliticalView) + } + + if v.QueryPosition != nil { + ok := object.Key("QueryPosition") + if err := awsRestjson1_serializeDocumentPosition(v.QueryPosition, ok); err != nil { + return err + } + } + + if v.QueryRadius != nil { + ok := object.Key("QueryRadius") + ok.Long(*v.QueryRadius) + } + + return nil +} + +type awsRestjson1_serializeOpSearchText struct { +} + +func (*awsRestjson1_serializeOpSearchText) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchText) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*SearchTextInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/search-text") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchTextInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchTextInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchTextInput(v *SearchTextInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchTextInput(v *SearchTextInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFeatures != nil { + ok := object.Key("AdditionalFeatures") + if err := awsRestjson1_serializeDocumentSearchTextAdditionalFeatureList(v.AdditionalFeatures, ok); err != nil { + return err + } + } + + if v.BiasPosition != nil { + ok := object.Key("BiasPosition") + if err := awsRestjson1_serializeDocumentPosition(v.BiasPosition, ok); err != nil { + return err + } + } + + if v.Filter != nil { + ok := object.Key("Filter") + if err := awsRestjson1_serializeDocumentSearchTextFilter(v.Filter, ok); err != nil { + return err + } + } + + if len(v.IntendedUse) > 0 { + ok := object.Key("IntendedUse") + ok.String(string(v.IntendedUse)) + } + + if v.Language != nil { + ok := object.Key("Language") + ok.String(*v.Language) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.PoliticalView != nil { + ok := object.Key("PoliticalView") + ok.String(*v.PoliticalView) + } + + if v.QueryId != nil { + ok := object.Key("QueryId") + ok.String(*v.QueryId) + } + + if v.QueryText != nil { + ok := object.Key("QueryText") + ok.String(*v.QueryText) + } + + return nil +} + +type awsRestjson1_serializeOpSuggest struct { +} + +func (*awsRestjson1_serializeOpSuggest) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSuggest) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*SuggestInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suggest") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSuggestInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSuggestInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSuggestInput(v *SuggestInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSuggestInput(v *SuggestInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFeatures != nil { + ok := object.Key("AdditionalFeatures") + if err := awsRestjson1_serializeDocumentSuggestAdditionalFeatureList(v.AdditionalFeatures, ok); err != nil { + return err + } + } + + if v.BiasPosition != nil { + ok := object.Key("BiasPosition") + if err := awsRestjson1_serializeDocumentPosition(v.BiasPosition, ok); err != nil { + return err + } + } + + if v.Filter != nil { + ok := object.Key("Filter") + if err := awsRestjson1_serializeDocumentSuggestFilter(v.Filter, ok); err != nil { + return err + } + } + + if len(v.IntendedUse) > 0 { + ok := object.Key("IntendedUse") + ok.String(string(v.IntendedUse)) + } + + if v.Language != nil { + ok := object.Key("Language") + ok.String(*v.Language) + } + + if v.MaxQueryRefinements != nil { + ok := object.Key("MaxQueryRefinements") + ok.Integer(*v.MaxQueryRefinements) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.PoliticalView != nil { + ok := object.Key("PoliticalView") + ok.String(*v.PoliticalView) + } + + if v.QueryText != nil { + ok := object.Key("QueryText") + ok.String(*v.QueryText) + } + + return nil +} + +func awsRestjson1_serializeDocumentAutocompleteAdditionalFeatureList(v []types.AutocompleteAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentAutocompleteFilter(v *types.AutocompleteFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.Circle != nil { + ok := object.Key("Circle") + if err := awsRestjson1_serializeDocumentFilterCircle(v.Circle, ok); err != nil { + return err + } + } + + if v.IncludeCountries != nil { + ok := object.Key("IncludeCountries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.IncludeCountries, ok); err != nil { + return err + } + } + + if v.IncludePlaceTypes != nil { + ok := object.Key("IncludePlaceTypes") + if err := awsRestjson1_serializeDocumentAutocompleteFilterPlaceTypeList(v.IncludePlaceTypes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAutocompleteFilterPlaceTypeList(v []types.AutocompleteFilterPlaceType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentBoundingBox(v []float64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + switch { + case math.IsNaN(v[i]): + av.String("NaN") + + case math.IsInf(v[i], 1): + av.String("Infinity") + + case math.IsInf(v[i], -1): + av.String("-Infinity") + + default: + av.Double(v[i]) + + } + } + return nil +} + +func awsRestjson1_serializeDocumentCountryCodeList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentFilterBusinessChainList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentFilterCategoryList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentFilterCircle(v *types.FilterCircle, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Center != nil { + ok := object.Key("Center") + if err := awsRestjson1_serializeDocumentPosition(v.Center, ok); err != nil { + return err + } + } + + if v.Radius != nil { + ok := object.Key("Radius") + ok.Long(*v.Radius) + } + + return nil +} + +func awsRestjson1_serializeDocumentFilterFoodTypeList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentGeocodeAdditionalFeatureList(v []types.GeocodeAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentGeocodeFilter(v *types.GeocodeFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IncludeCountries != nil { + ok := object.Key("IncludeCountries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.IncludeCountries, ok); err != nil { + return err + } + } + + if v.IncludePlaceTypes != nil { + ok := object.Key("IncludePlaceTypes") + if err := awsRestjson1_serializeDocumentGeocodeFilterPlaceTypeList(v.IncludePlaceTypes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentGeocodeFilterPlaceTypeList(v []types.GeocodeFilterPlaceType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentGeocodeQueryComponents(v *types.GeocodeQueryComponents, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddressNumber != nil { + ok := object.Key("AddressNumber") + ok.String(*v.AddressNumber) + } + + if v.Country != nil { + ok := object.Key("Country") + ok.String(*v.Country) + } + + if v.District != nil { + ok := object.Key("District") + ok.String(*v.District) + } + + if v.Locality != nil { + ok := object.Key("Locality") + ok.String(*v.Locality) + } + + if v.PostalCode != nil { + ok := object.Key("PostalCode") + ok.String(*v.PostalCode) + } + + if v.Region != nil { + ok := object.Key("Region") + ok.String(*v.Region) + } + + if v.Street != nil { + ok := object.Key("Street") + ok.String(*v.Street) + } + + if v.SubRegion != nil { + ok := object.Key("SubRegion") + ok.String(*v.SubRegion) + } + + return nil +} + +func awsRestjson1_serializeDocumentPosition(v []float64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + switch { + case math.IsNaN(v[i]): + av.String("NaN") + + case math.IsInf(v[i], 1): + av.String("Infinity") + + case math.IsInf(v[i], -1): + av.String("-Infinity") + + default: + av.Double(v[i]) + + } + } + return nil +} + +func awsRestjson1_serializeDocumentReverseGeocodeAdditionalFeatureList(v []types.ReverseGeocodeAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentReverseGeocodeFilter(v *types.ReverseGeocodeFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IncludePlaceTypes != nil { + ok := object.Key("IncludePlaceTypes") + if err := awsRestjson1_serializeDocumentReverseGeocodeFilterPlaceTypeList(v.IncludePlaceTypes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentReverseGeocodeFilterPlaceTypeList(v []types.ReverseGeocodeFilterPlaceType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentSearchNearbyAdditionalFeatureList(v []types.SearchNearbyAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentSearchNearbyFilter(v *types.SearchNearbyFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.ExcludeBusinessChains != nil { + ok := object.Key("ExcludeBusinessChains") + if err := awsRestjson1_serializeDocumentFilterBusinessChainList(v.ExcludeBusinessChains, ok); err != nil { + return err + } + } + + if v.ExcludeCategories != nil { + ok := object.Key("ExcludeCategories") + if err := awsRestjson1_serializeDocumentFilterCategoryList(v.ExcludeCategories, ok); err != nil { + return err + } + } + + if v.ExcludeFoodTypes != nil { + ok := object.Key("ExcludeFoodTypes") + if err := awsRestjson1_serializeDocumentFilterFoodTypeList(v.ExcludeFoodTypes, ok); err != nil { + return err + } + } + + if v.IncludeBusinessChains != nil { + ok := object.Key("IncludeBusinessChains") + if err := awsRestjson1_serializeDocumentFilterBusinessChainList(v.IncludeBusinessChains, ok); err != nil { + return err + } + } + + if v.IncludeCategories != nil { + ok := object.Key("IncludeCategories") + if err := awsRestjson1_serializeDocumentFilterCategoryList(v.IncludeCategories, ok); err != nil { + return err + } + } + + if v.IncludeCountries != nil { + ok := object.Key("IncludeCountries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.IncludeCountries, ok); err != nil { + return err + } + } + + if v.IncludeFoodTypes != nil { + ok := object.Key("IncludeFoodTypes") + if err := awsRestjson1_serializeDocumentFilterFoodTypeList(v.IncludeFoodTypes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSearchTextAdditionalFeatureList(v []types.SearchTextAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentSearchTextFilter(v *types.SearchTextFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.Circle != nil { + ok := object.Key("Circle") + if err := awsRestjson1_serializeDocumentFilterCircle(v.Circle, ok); err != nil { + return err + } + } + + if v.IncludeCountries != nil { + ok := object.Key("IncludeCountries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.IncludeCountries, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentSuggestAdditionalFeatureList(v []types.SuggestAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentSuggestFilter(v *types.SuggestFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.Circle != nil { + ok := object.Key("Circle") + if err := awsRestjson1_serializeDocumentFilterCircle(v.Circle, ok); err != nil { + return err + } + } + + if v.IncludeCountries != nil { + ok := object.Key("IncludeCountries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.IncludeCountries, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/geoplaces/snapshot/api_op_Autocomplete.go.snap b/service/geoplaces/snapshot/api_op_Autocomplete.go.snap new file mode 100644 index 00000000000..b5bd6a871ad --- /dev/null +++ b/service/geoplaces/snapshot/api_op_Autocomplete.go.snap @@ -0,0 +1,41 @@ +Autocomplete + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geoplaces/snapshot/api_op_Geocode.go.snap b/service/geoplaces/snapshot/api_op_Geocode.go.snap new file mode 100644 index 00000000000..c7852a4d5e8 --- /dev/null +++ b/service/geoplaces/snapshot/api_op_Geocode.go.snap @@ -0,0 +1,40 @@ +Geocode + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geoplaces/snapshot/api_op_GetPlace.go.snap b/service/geoplaces/snapshot/api_op_GetPlace.go.snap new file mode 100644 index 00000000000..ce0d9955171 --- /dev/null +++ b/service/geoplaces/snapshot/api_op_GetPlace.go.snap @@ -0,0 +1,41 @@ +GetPlace + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geoplaces/snapshot/api_op_ReverseGeocode.go.snap b/service/geoplaces/snapshot/api_op_ReverseGeocode.go.snap new file mode 100644 index 00000000000..c362e022273 --- /dev/null +++ b/service/geoplaces/snapshot/api_op_ReverseGeocode.go.snap @@ -0,0 +1,41 @@ +ReverseGeocode + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geoplaces/snapshot/api_op_SearchNearby.go.snap b/service/geoplaces/snapshot/api_op_SearchNearby.go.snap new file mode 100644 index 00000000000..ee244254e3d --- /dev/null +++ b/service/geoplaces/snapshot/api_op_SearchNearby.go.snap @@ -0,0 +1,41 @@ +SearchNearby + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geoplaces/snapshot/api_op_SearchText.go.snap b/service/geoplaces/snapshot/api_op_SearchText.go.snap new file mode 100644 index 00000000000..4486d150167 --- /dev/null +++ b/service/geoplaces/snapshot/api_op_SearchText.go.snap @@ -0,0 +1,41 @@ +SearchText + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geoplaces/snapshot/api_op_Suggest.go.snap b/service/geoplaces/snapshot/api_op_Suggest.go.snap new file mode 100644 index 00000000000..d88b1a2be00 --- /dev/null +++ b/service/geoplaces/snapshot/api_op_Suggest.go.snap @@ -0,0 +1,41 @@ +Suggest + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/geoplaces/snapshot_test.go b/service/geoplaces/snapshot_test.go new file mode 100644 index 00000000000..d6be61e3207 --- /dev/null +++ b/service/geoplaces/snapshot_test.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package geoplaces + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_Autocomplete(t *testing.T) { + svc := New(Options{}) + _, err := svc.Autocomplete(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "Autocomplete") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_Geocode(t *testing.T) { + svc := New(Options{}) + _, err := svc.Geocode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "Geocode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetPlace(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPlace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetPlace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ReverseGeocode(t *testing.T) { + svc := New(Options{}) + _, err := svc.ReverseGeocode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ReverseGeocode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_SearchNearby(t *testing.T) { + svc := New(Options{}) + _, err := svc.SearchNearby(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "SearchNearby") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_SearchText(t *testing.T) { + svc := New(Options{}) + _, err := svc.SearchText(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "SearchText") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_Suggest(t *testing.T) { + svc := New(Options{}) + _, err := svc.Suggest(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "Suggest") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_Autocomplete(t *testing.T) { + svc := New(Options{}) + _, err := svc.Autocomplete(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "Autocomplete") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_Geocode(t *testing.T) { + svc := New(Options{}) + _, err := svc.Geocode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "Geocode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetPlace(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPlace(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetPlace") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ReverseGeocode(t *testing.T) { + svc := New(Options{}) + _, err := svc.ReverseGeocode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ReverseGeocode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_SearchNearby(t *testing.T) { + svc := New(Options{}) + _, err := svc.SearchNearby(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "SearchNearby") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_SearchText(t *testing.T) { + svc := New(Options{}) + _, err := svc.SearchText(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "SearchText") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_Suggest(t *testing.T) { + svc := New(Options{}) + _, err := svc.Suggest(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "Suggest") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/geoplaces/types/enums.go b/service/geoplaces/types/enums.go new file mode 100644 index 00000000000..b3618b2ad15 --- /dev/null +++ b/service/geoplaces/types/enums.go @@ -0,0 +1,611 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AutocompleteAdditionalFeature string + +// Enum values for AutocompleteAdditionalFeature +const ( + AutocompleteAdditionalFeatureCore AutocompleteAdditionalFeature = "Core" +) + +// Values returns all known values for AutocompleteAdditionalFeature. 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 (AutocompleteAdditionalFeature) Values() []AutocompleteAdditionalFeature { + return []AutocompleteAdditionalFeature{ + "Core", + } +} + +type AutocompleteFilterPlaceType string + +// Enum values for AutocompleteFilterPlaceType +const ( + AutocompleteFilterPlaceTypeLocality AutocompleteFilterPlaceType = "Locality" + AutocompleteFilterPlaceTypePostalCode AutocompleteFilterPlaceType = "PostalCode" +) + +// Values returns all known values for AutocompleteFilterPlaceType. 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 (AutocompleteFilterPlaceType) Values() []AutocompleteFilterPlaceType { + return []AutocompleteFilterPlaceType{ + "Locality", + "PostalCode", + } +} + +type AutocompleteIntendedUse string + +// Enum values for AutocompleteIntendedUse +const ( + // Indicates that results of the operation are for single use, e.g., displaying + // results on a map or presenting options to users. + AutocompleteIntendedUseSingleUse AutocompleteIntendedUse = "SingleUse" +) + +// Values returns all known values for AutocompleteIntendedUse. 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 (AutocompleteIntendedUse) Values() []AutocompleteIntendedUse { + return []AutocompleteIntendedUse{ + "SingleUse", + } +} + +type GeocodeAdditionalFeature string + +// Enum values for GeocodeAdditionalFeature +const ( + GeocodeAdditionalFeatureTimeZone GeocodeAdditionalFeature = "TimeZone" + GeocodeAdditionalFeatureAccess GeocodeAdditionalFeature = "Access" +) + +// Values returns all known values for GeocodeAdditionalFeature. 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 (GeocodeAdditionalFeature) Values() []GeocodeAdditionalFeature { + return []GeocodeAdditionalFeature{ + "TimeZone", + "Access", + } +} + +type GeocodeFilterPlaceType string + +// Enum values for GeocodeFilterPlaceType +const ( + GeocodeFilterPlaceTypeLocality GeocodeFilterPlaceType = "Locality" + GeocodeFilterPlaceTypePostalCode GeocodeFilterPlaceType = "PostalCode" + GeocodeFilterPlaceTypeIntersection GeocodeFilterPlaceType = "Intersection" + GeocodeFilterPlaceTypeStreet GeocodeFilterPlaceType = "Street" + GeocodeFilterPlaceTypePointAddress GeocodeFilterPlaceType = "PointAddress" + GeocodeFilterPlaceTypeInterpolatedAddress GeocodeFilterPlaceType = "InterpolatedAddress" +) + +// Values returns all known values for GeocodeFilterPlaceType. 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 (GeocodeFilterPlaceType) Values() []GeocodeFilterPlaceType { + return []GeocodeFilterPlaceType{ + "Locality", + "PostalCode", + "Intersection", + "Street", + "PointAddress", + "InterpolatedAddress", + } +} + +type GeocodeIntendedUse string + +// Enum values for GeocodeIntendedUse +const ( + // Indicates that results of the operation are for single use, e.g., displaying + // results on a map or presenting options to users. + GeocodeIntendedUseSingleUse GeocodeIntendedUse = "SingleUse" + // Indicates that results of the operation may be stored locally. + GeocodeIntendedUseStorage GeocodeIntendedUse = "Storage" +) + +// Values returns all known values for GeocodeIntendedUse. 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 (GeocodeIntendedUse) Values() []GeocodeIntendedUse { + return []GeocodeIntendedUse{ + "SingleUse", + "Storage", + } +} + +type GetPlaceAdditionalFeature string + +// Enum values for GetPlaceAdditionalFeature +const ( + GetPlaceAdditionalFeatureTimeZone GetPlaceAdditionalFeature = "TimeZone" + GetPlaceAdditionalFeaturePhonemes GetPlaceAdditionalFeature = "Phonemes" + GetPlaceAdditionalFeatureAccess GetPlaceAdditionalFeature = "Access" + GetPlaceAdditionalFeatureContact GetPlaceAdditionalFeature = "Contact" +) + +// Values returns all known values for GetPlaceAdditionalFeature. 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 (GetPlaceAdditionalFeature) Values() []GetPlaceAdditionalFeature { + return []GetPlaceAdditionalFeature{ + "TimeZone", + "Phonemes", + "Access", + "Contact", + } +} + +type GetPlaceIntendedUse string + +// Enum values for GetPlaceIntendedUse +const ( + // Indicates that results of the operation are for single use, e.g., displaying + // results on a map or presenting options to users. + GetPlaceIntendedUseSingleUse GetPlaceIntendedUse = "SingleUse" + // Indicates that results of the operation may be stored locally. + GetPlaceIntendedUseStorage GetPlaceIntendedUse = "Storage" +) + +// Values returns all known values for GetPlaceIntendedUse. 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 (GetPlaceIntendedUse) Values() []GetPlaceIntendedUse { + return []GetPlaceIntendedUse{ + "SingleUse", + "Storage", + } +} + +type PlaceType string + +// Enum values for PlaceType +const ( + PlaceTypeCountry PlaceType = "Country" + PlaceTypeRegion PlaceType = "Region" + PlaceTypeSubRegion PlaceType = "SubRegion" + PlaceTypeLocality PlaceType = "Locality" + PlaceTypeDistrict PlaceType = "District" + PlaceTypeSubDistrict PlaceType = "SubDistrict" + PlaceTypePostalCode PlaceType = "PostalCode" + PlaceTypeBlock PlaceType = "Block" + PlaceTypeSubBlock PlaceType = "SubBlock" + PlaceTypeIntersection PlaceType = "Intersection" + PlaceTypeStreet PlaceType = "Street" + PlaceTypePointOfInterest PlaceType = "PointOfInterest" + PlaceTypePointAddress PlaceType = "PointAddress" + PlaceTypeInterpolatedAddress PlaceType = "InterpolatedAddress" +) + +// Values returns all known values for PlaceType. 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 (PlaceType) Values() []PlaceType { + return []PlaceType{ + "Country", + "Region", + "SubRegion", + "Locality", + "District", + "SubDistrict", + "PostalCode", + "Block", + "SubBlock", + "Intersection", + "Street", + "PointOfInterest", + "PointAddress", + "InterpolatedAddress", + } +} + +type PostalAuthority string + +// Enum values for PostalAuthority +const ( + PostalAuthorityUsps PostalAuthority = "Usps" +) + +// Values returns all known values for PostalAuthority. 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 (PostalAuthority) Values() []PostalAuthority { + return []PostalAuthority{ + "Usps", + } +} + +type PostalCodeMode string + +// Enum values for PostalCodeMode +const ( + PostalCodeModeMergeAllSpannedLocalities PostalCodeMode = "MergeAllSpannedLocalities" + PostalCodeModeEnumerateSpannedLocalities PostalCodeMode = "EnumerateSpannedLocalities" +) + +// Values returns all known values for PostalCodeMode. 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 (PostalCodeMode) Values() []PostalCodeMode { + return []PostalCodeMode{ + "MergeAllSpannedLocalities", + "EnumerateSpannedLocalities", + } +} + +type PostalCodeType string + +// Enum values for PostalCodeType +const ( + PostalCodeTypeUspsZip PostalCodeType = "UspsZip" + PostalCodeTypeUspsZipPlus4 PostalCodeType = "UspsZipPlus4" +) + +// Values returns all known values for PostalCodeType. 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 (PostalCodeType) Values() []PostalCodeType { + return []PostalCodeType{ + "UspsZip", + "UspsZipPlus4", + } +} + +type QueryType string + +// Enum values for QueryType +const ( + QueryTypeCategory QueryType = "Category" + QueryTypeBusinessChain QueryType = "BusinessChain" +) + +// Values returns all known values for QueryType. 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 (QueryType) Values() []QueryType { + return []QueryType{ + "Category", + "BusinessChain", + } +} + +type RecordTypeCode string + +// Enum values for RecordTypeCode +const ( + RecordTypeCodeFirm RecordTypeCode = "Firm" + RecordTypeCodeGeneral RecordTypeCode = "General" + RecordTypeCodeHighRise RecordTypeCode = "HighRise" + RecordTypeCodePostOfficeBox RecordTypeCode = "PostOfficeBox" + RecordTypeCodeRural RecordTypeCode = "Rural" + RecordTypeCodeStreet RecordTypeCode = "Street" +) + +// Values returns all known values for RecordTypeCode. 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 (RecordTypeCode) Values() []RecordTypeCode { + return []RecordTypeCode{ + "Firm", + "General", + "HighRise", + "PostOfficeBox", + "Rural", + "Street", + } +} + +type ReverseGeocodeAdditionalFeature string + +// Enum values for ReverseGeocodeAdditionalFeature +const ( + ReverseGeocodeAdditionalFeatureTimeZone ReverseGeocodeAdditionalFeature = "TimeZone" + ReverseGeocodeAdditionalFeatureAccess ReverseGeocodeAdditionalFeature = "Access" +) + +// Values returns all known values for ReverseGeocodeAdditionalFeature. 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 (ReverseGeocodeAdditionalFeature) Values() []ReverseGeocodeAdditionalFeature { + return []ReverseGeocodeAdditionalFeature{ + "TimeZone", + "Access", + } +} + +type ReverseGeocodeFilterPlaceType string + +// Enum values for ReverseGeocodeFilterPlaceType +const ( + ReverseGeocodeFilterPlaceTypeLocality ReverseGeocodeFilterPlaceType = "Locality" + ReverseGeocodeFilterPlaceTypeIntersection ReverseGeocodeFilterPlaceType = "Intersection" + ReverseGeocodeFilterPlaceTypeStreet ReverseGeocodeFilterPlaceType = "Street" + ReverseGeocodeFilterPlaceTypePointAddress ReverseGeocodeFilterPlaceType = "PointAddress" + ReverseGeocodeFilterPlaceTypeInterpolatedAddress ReverseGeocodeFilterPlaceType = "InterpolatedAddress" +) + +// Values returns all known values for ReverseGeocodeFilterPlaceType. 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 (ReverseGeocodeFilterPlaceType) Values() []ReverseGeocodeFilterPlaceType { + return []ReverseGeocodeFilterPlaceType{ + "Locality", + "Intersection", + "Street", + "PointAddress", + "InterpolatedAddress", + } +} + +type ReverseGeocodeIntendedUse string + +// Enum values for ReverseGeocodeIntendedUse +const ( + // Indicates that results of the operation are for single use, e.g., displaying + // results on a map or presenting options to users. + ReverseGeocodeIntendedUseSingleUse ReverseGeocodeIntendedUse = "SingleUse" + // Indicates that results of the operation may be stored locally. + ReverseGeocodeIntendedUseStorage ReverseGeocodeIntendedUse = "Storage" +) + +// Values returns all known values for ReverseGeocodeIntendedUse. 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 (ReverseGeocodeIntendedUse) Values() []ReverseGeocodeIntendedUse { + return []ReverseGeocodeIntendedUse{ + "SingleUse", + "Storage", + } +} + +type SearchNearbyAdditionalFeature string + +// Enum values for SearchNearbyAdditionalFeature +const ( + SearchNearbyAdditionalFeatureTimeZone SearchNearbyAdditionalFeature = "TimeZone" + SearchNearbyAdditionalFeaturePhonemes SearchNearbyAdditionalFeature = "Phonemes" + SearchNearbyAdditionalFeatureAccess SearchNearbyAdditionalFeature = "Access" + SearchNearbyAdditionalFeatureContact SearchNearbyAdditionalFeature = "Contact" +) + +// Values returns all known values for SearchNearbyAdditionalFeature. 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 (SearchNearbyAdditionalFeature) Values() []SearchNearbyAdditionalFeature { + return []SearchNearbyAdditionalFeature{ + "TimeZone", + "Phonemes", + "Access", + "Contact", + } +} + +type SearchNearbyIntendedUse string + +// Enum values for SearchNearbyIntendedUse +const ( + // Indicates that results of the operation are for single use, e.g., displaying + // results on a map or presenting options to users. + SearchNearbyIntendedUseSingleUse SearchNearbyIntendedUse = "SingleUse" + // Indicates that results of the operation may be stored locally. + SearchNearbyIntendedUseStorage SearchNearbyIntendedUse = "Storage" +) + +// Values returns all known values for SearchNearbyIntendedUse. 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 (SearchNearbyIntendedUse) Values() []SearchNearbyIntendedUse { + return []SearchNearbyIntendedUse{ + "SingleUse", + "Storage", + } +} + +type SearchTextAdditionalFeature string + +// Enum values for SearchTextAdditionalFeature +const ( + SearchTextAdditionalFeatureTimeZone SearchTextAdditionalFeature = "TimeZone" + SearchTextAdditionalFeaturePhonemes SearchTextAdditionalFeature = "Phonemes" + SearchTextAdditionalFeatureAccess SearchTextAdditionalFeature = "Access" + SearchTextAdditionalFeatureContact SearchTextAdditionalFeature = "Contact" +) + +// Values returns all known values for SearchTextAdditionalFeature. 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 (SearchTextAdditionalFeature) Values() []SearchTextAdditionalFeature { + return []SearchTextAdditionalFeature{ + "TimeZone", + "Phonemes", + "Access", + "Contact", + } +} + +type SearchTextIntendedUse string + +// Enum values for SearchTextIntendedUse +const ( + // Indicates that results of the operation are for single use, e.g., displaying + // results on a map or presenting options to users. + SearchTextIntendedUseSingleUse SearchTextIntendedUse = "SingleUse" + // Indicates that results of the operation may be stored locally. + SearchTextIntendedUseStorage SearchTextIntendedUse = "Storage" +) + +// Values returns all known values for SearchTextIntendedUse. 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 (SearchTextIntendedUse) Values() []SearchTextIntendedUse { + return []SearchTextIntendedUse{ + "SingleUse", + "Storage", + } +} + +type SuggestAdditionalFeature string + +// Enum values for SuggestAdditionalFeature +const ( + SuggestAdditionalFeatureCore SuggestAdditionalFeature = "Core" + SuggestAdditionalFeatureTimeZone SuggestAdditionalFeature = "TimeZone" + SuggestAdditionalFeaturePhonemes SuggestAdditionalFeature = "Phonemes" + SuggestAdditionalFeatureAccess SuggestAdditionalFeature = "Access" +) + +// Values returns all known values for SuggestAdditionalFeature. 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 (SuggestAdditionalFeature) Values() []SuggestAdditionalFeature { + return []SuggestAdditionalFeature{ + "Core", + "TimeZone", + "Phonemes", + "Access", + } +} + +type SuggestIntendedUse string + +// Enum values for SuggestIntendedUse +const ( + // Indicates that results of the operation are for single use, e.g., displaying + // results on a map or presenting options to users. + SuggestIntendedUseSingleUse SuggestIntendedUse = "SingleUse" +) + +// Values returns all known values for SuggestIntendedUse. 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 (SuggestIntendedUse) Values() []SuggestIntendedUse { + return []SuggestIntendedUse{ + "SingleUse", + } +} + +type SuggestResultItemType string + +// Enum values for SuggestResultItemType +const ( + SuggestResultItemTypePlace SuggestResultItemType = "Place" + SuggestResultItemTypeQuery SuggestResultItemType = "Query" +) + +// Values returns all known values for SuggestResultItemType. 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 (SuggestResultItemType) Values() []SuggestResultItemType { + return []SuggestResultItemType{ + "Place", + "Query", + } +} + +type TypePlacement string + +// Enum values for TypePlacement +const ( + TypePlacementBeforeBaseName TypePlacement = "BeforeBaseName" + TypePlacementAfterBaseName TypePlacement = "AfterBaseName" +) + +// Values returns all known values for TypePlacement. 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 (TypePlacement) Values() []TypePlacement { + return []TypePlacement{ + "BeforeBaseName", + "AfterBaseName", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + // No such operation is supported. + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "UnknownOperation" + // The required input is missing. + ValidationExceptionReasonMissing ValidationExceptionReason = "Missing" + // The input cannot be parsed. For example a required JSON document, ARN + // identifier, date value, or numeric field cannot be parsed. + ValidationExceptionReasonCannotParse ValidationExceptionReason = "CannotParse" + // The input is present and parsable, but it is otherwise invalid. For example, a + // required numeric argument is outside the allowed range. + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FieldValidationFailed" + // The input is invalid but no more specific reason is applicable. + ValidationExceptionReasonOther ValidationExceptionReason = "Other" + // No such field is supported. + ValidationExceptionReasonUnknownField ValidationExceptionReason = "UnknownField" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "UnknownOperation", + "Missing", + "CannotParse", + "FieldValidationFailed", + "Other", + "UnknownField", + } +} + +type ZipClassificationCode string + +// Enum values for ZipClassificationCode +const ( + ZipClassificationCodeMilitary ZipClassificationCode = "Military" + ZipClassificationCodePostOfficeBoxes ZipClassificationCode = "PostOfficeBoxes" + ZipClassificationCodeUnique ZipClassificationCode = "Unique" +) + +// Values returns all known values for ZipClassificationCode. 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 (ZipClassificationCode) Values() []ZipClassificationCode { + return []ZipClassificationCode{ + "Military", + "PostOfficeBoxes", + "Unique", + } +} diff --git a/service/geoplaces/types/errors.go b/service/geoplaces/types/errors.go new file mode 100644 index 00000000000..35d3dedb70d --- /dev/null +++ b/service/geoplaces/types/errors.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You don't have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request processing has failed because of an unknown error, exception or +// failure. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/geoplaces/types/types.go b/service/geoplaces/types/types.go new file mode 100644 index 00000000000..940c2d502fb --- /dev/null +++ b/service/geoplaces/types/types.go @@ -0,0 +1,1335 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// Position of the access point represented by longitude and latitude for a +// vehicle. +type AccessPoint struct { + + // The position, in longitude and latitude. + Position []float64 + + noSmithyDocumentSerde +} + +// Indicates if the access location is restricted. Index correlates to that of an +// access point and indicates if access through this point has some form of +// restriction. +type AccessRestriction struct { + + // Categories of results that results must belong too. + Categories []Category + + // The restriction. + Restricted *bool + + noSmithyDocumentSerde +} + +// The place address. +type Address struct { + + // The number that identifies an address within a street. + AddressNumber *string + + // Name of the block. + // + // Example: Sunny Mansion 203 block: 2 Chome + Block *string + + // The name of the building at the address. + Building *string + + // The country component of the address. + Country *Country + + // The district or division of a locality associated with this address. + District *string + + // Name of the streets in the intersection. + // + // Example: ["Friedrichstraße","Unter den Linden"] + Intersection []string + + // Assembled address value built out of the address components, according to the + // regional postal rules. This is the correctly formatted address. + Label *string + + // The locality or city of the address. + // + // Example: Vancouver . + Locality *string + + // An alphanumeric string included in a postal address to facilitate mail sorting, + // such as post code, postcode, or ZIP code, for which the result should posses. + PostalCode *string + + // The region or state results should be present in. + // + // Example: North Rhine-Westphalia . + Region *Region + + // The name of the street results should be present in. + Street *string + + // Components of the street. + // + // Example: Younge from the "Younge street". + StreetComponents []StreetComponents + + // Name of sub-block. + // + // Example: Sunny Mansion 203 sub-block: 4 + SubBlock *string + + // A subdivision of a district. + // + // Example: Minden-Lübbecke . + SubDistrict *string + + // The sub-region or county for which results should be present in. + SubRegion *SubRegion + + noSmithyDocumentSerde +} + +// Indicates how well the entire input matches the returned. It is equal to 1 if +// all input tokens are recognized and matched. +type AddressComponentMatchScores struct { + + // The house number or address results should have. + AddressNumber float64 + + // Name of the block. + // + // Example: Sunny Mansion 203 block: 2 Chome + Block float64 + + // The name of the building at the address. + Building float64 + + // The alpha-2 or alpha-3 character code for the country that the results will be + // present in. + Country float64 + + // The district or division of a city the results should be present in. + District float64 + + // Name of the streets in the intersection. + // + // Example: ["Friedrichstraße","Unter den Linden"] + Intersection []float64 + + // The city or locality results should be present in. + // + // Example: Vancouver . + Locality float64 + + // An alphanumeric string included in a postal address to facilitate mail sorting, + // such as post code, postcode, or ZIP code, for which the result should posses. + PostalCode float64 + + // The region or state results should be to be present in. + // + // Example: North Rhine-Westphalia . + Region float64 + + // Name of sub-block. + // + // Example: Sunny Mansion 203 sub-block: 4 + SubBlock float64 + + // A subdivision of a district. + // + // Example: Minden-Lübbecke + SubDistrict float64 + + // The sub-region or county for which results should be present in. + SubRegion float64 + + noSmithyDocumentSerde +} + +// How to pronounce the various components of the address or place. +type AddressComponentPhonemes struct { + + // How to pronounce the name of the block. + Block []PhonemeTranscription + + // The alpha-2 or alpha-3 character code for the country that the results will be + // present in. + Country []PhonemeTranscription + + // How to pronounce the district or division of a city results should be present + // in. + District []PhonemeTranscription + + // How to pronounce the city or locality results should be present in. + // + // Example: Vancouver . + Locality []PhonemeTranscription + + // How to pronounce the region or state results should be to be present in. + Region []PhonemeTranscription + + // How to pronounce the name of the street results should be present in. + Street []PhonemeTranscription + + // How to pronounce the name of the sub-block. + SubBlock []PhonemeTranscription + + // How to pronounce the sub-district or division of a city results should be + // present in. + SubDistrict []PhonemeTranscription + + // How to pronounce the sub-region or county for which results should be present + // in. + SubRegion []PhonemeTranscription + + noSmithyDocumentSerde +} + +// Describes how the parts of the response element matched the input query by +// returning the sections of the response which matched to input query terms. +type AutocompleteAddressHighlights struct { + + // The house number or address results should have. + AddressNumber []Highlight + + // Name of the block. Example: Sunny Mansion 203 block: 2 Chome + Block []Highlight + + // The name of the building at the address. + Building []Highlight + + // The alpha-2 or alpha-3 character code for the country that the results will be + // present in. + Country *CountryHighlights + + // The district or division of a city the results should be present in. + District []Highlight + + // Name of the streets in the intersection. For example: e.g. + // ["Friedrichstraße","Unter den Linden"] + Intersection [][]Highlight + + // Indicates the starting and ending indexes for result items where they are + // identified to match the input query. This should be used to provide emphasis to + // output display to make selecting the correct result from a list easier for end + // users. + Label []Highlight + + // The city or locality results should be present in. + // + // Example: Vancouver . + Locality []Highlight + + // An alphanumeric string included in a postal address to facilitate mail sorting, + // such as post code, postcode, or ZIP code for which the result should posses. + PostalCode []Highlight + + // The region or state results should be to be present in. + // + // Example: North Rhine-Westphalia . + Region *RegionHighlights + + // The name of the street results should be present in. + Street []Highlight + + // Name of sub-block. Example Sunny Mansion 203 sub-block: 4 + SubBlock []Highlight + + // Indicates the starting and ending index of the title in the text query that + // match the found title. + SubDistrict []Highlight + + // The sub-region or county for which results should be present in. + SubRegion *SubRegionHighlights + + noSmithyDocumentSerde +} + +// Autocomplete structure which contains a set of inclusion/exclusion properties +// that results must posses in order to be returned as a result. +type AutocompleteFilter struct { + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + BoundingBox []float64 + + // The Circle that all results must be in. + Circle *FilterCircle + + // A list of countries that all results must be in. Countries are represented by + // either their alpha-2 or alpha-3 character codes. + IncludeCountries []string + + // The included place types. + IncludePlaceTypes []AutocompleteFilterPlaceType + + noSmithyDocumentSerde +} + +// Describes how the parts of the response element matched the input query by +// returning the sections of the response which matched to input query terms. +type AutocompleteHighlights struct { + + // Describes how part of the result address match the input query. + Address *AutocompleteAddressHighlights + + // Indicates where the title field in the result matches the input query. + Title []Highlight + + noSmithyDocumentSerde +} + +// A result matching the input query text. +type AutocompleteResultItem struct { + + // The PlaceId of the place associated with this result. This can be used to look + // up additional details about the result via GetPlace. + // + // This member is required. + PlaceId *string + + // PlaceType describes the type of result entry returned. + // + // This member is required. + PlaceType PlaceType + + // A formatted string for display when presenting this result to an end user. + // + // This member is required. + Title *string + + // The address associated with this result. + Address *Address + + // The distance in meters between the center of the search area and this result. + // Useful to evaluate how far away from the original bias position the result is. + Distance int64 + + // Indicates the starting and ending index of the place in the text query that + // match the found title. + Highlights *AutocompleteHighlights + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + noSmithyDocumentSerde +} + +// A businesschain is a chain of businesses that belong to the same brand. For +// example 7-11 . +type BusinessChain struct { + + // The Business Chain Id. + Id *string + + // The business chain name. + Name *string + + noSmithyDocumentSerde +} + +// Category of the Place returned. +type Category struct { + + // The category ID. + // + // This member is required. + Id *string + + // The category name. + // + // This member is required. + Name *string + + // Localized name of the category type. + LocalizedName *string + + // Boolean which indicates if this category is the primary offered by the place. + Primary *bool + + noSmithyDocumentSerde +} + +// Indicates how well the input matches the returned element. It is equal to 1 if +// all input tokens are recognized and matched to the title in the result. +type ComponentMatchScores struct { + + // The place's address. + Address *AddressComponentMatchScores + + // Indicates the starting and ending index of the title in the text query that + // match the found title. + Title float64 + + noSmithyDocumentSerde +} + +// Details related to contacts. +type ContactDetails struct { + + // Categories of results that results must belong too. + Categories []Category + + // The contact's label. + Label *string + + // The contact's value. + Value *string + + noSmithyDocumentSerde +} + +// A list of potential contact methods for the result/place. +type Contacts struct { + + // List of emails for contacts of the result. + Emails []ContactDetails + + // List of fax addresses for the result contact. + Faxes []ContactDetails + + // List of phone numbers for the results contact. + Phones []ContactDetails + + // List of website URLs that belong to the result. + Websites []ContactDetails + + noSmithyDocumentSerde +} + +// The alpha-2 or alpha-3 character code for the country that the results will be +// present in. +type Country struct { + + // Country, represented by its alpha 2-character code. + Code2 *string + + // Country, represented by its alpha t-character code. + Code3 *string + + // Name of the country. + Name *string + + noSmithyDocumentSerde +} + +// Indicates the starting and ending index of the country in the text query that +// match the found title. +type CountryHighlights struct { + + // Indicates the starting and ending index of the country code in the text query + // that match the found title. + Code []Highlight + + // Indicates the starting and ending index of the country code in the text query + // that match the found title. + Name []Highlight + + noSmithyDocumentSerde +} + +// The Circle that all results must be in. +type FilterCircle struct { + + // The center position, in longitude and latitude, of the FilterCircle . + // + // This member is required. + Center []float64 + + // The radius, in meters, of the FilterCircle . + // + // This member is required. + Radius *int64 + + noSmithyDocumentSerde +} + +// List of Food types offered by this result. +type FoodType struct { + + // Localized name of the food type. + // + // This member is required. + LocalizedName *string + + // The Food Type Id. + Id *string + + // Boolean which indicates if this food type is the primary offered by the place. + // For example, if a location serves fast food, but also dessert, he primary would + // likely be fast food. + Primary *bool + + noSmithyDocumentSerde +} + +// Geocode structure which contains a set of inclusion/exclusion properties that +// results must posses in order to be returned as a result. +type GeocodeFilter struct { + + // A list of countries that all results must be in. Countries are represented by + // either their alpha-2 or alpha-3 character codes. + IncludeCountries []string + + // The included place types. + IncludePlaceTypes []GeocodeFilterPlaceType + + noSmithyDocumentSerde +} + +// A structured free text query allows you to search for places by the name or +// text representation of specific properties of the place. +type GeocodeQueryComponents struct { + + // The house number or address results should have. + AddressNumber *string + + // The alpha-2 or alpha-3 character code for the country that the results will be + // present in. + Country *string + + // The district or division of a city the results should be present in. + District *string + + // City or locality results should be present in. + // + // Example: Vancouver . + Locality *string + + // An alphanumeric string included in a postal address to facilitate mail sorting, + // such as post code, postcode, or ZIP code for which the result should posses. + PostalCode *string + + // The region or state results should be to be present in. + // + // Example: North Rhine-Westphalia . + Region *string + + // The name of the street results should be present in. + Street *string + + // The sub-region or county for which results should be present in. + SubRegion *string + + noSmithyDocumentSerde +} + +// The Geocoded result. +type GeocodeResultItem struct { + + // The PlaceId of the place you wish to receive the information for. + // + // This member is required. + PlaceId *string + + // A PlaceType is a category that the result place must belong to. + // + // This member is required. + PlaceType PlaceType + + // The localized display name of this result item based on request parameter + // language . + // + // This member is required. + Title *string + + // Position of the access point represent by longitude and latitude. + AccessPoints []AccessPoint + + // The place's address. + Address *Address + + // Boolean indicating if the address provided has been corrected. + AddressNumberCorrected *bool + + // Categories of results that results must belong to. + Categories []Category + + // The distance in meters from the QueryPosition. + Distance int64 + + // List of food types offered by this result. + FoodTypes []FoodType + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + MapView []float64 + + // Indicates how well the entire input matches the returned. It is equal to 1 if + // all input tokens are recognized and matched. + MatchScores *MatchScoreDetails + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The position in longitude and latitude. + Position []float64 + + // Contains details about the postal code of the place/result. + PostalCodeDetails []PostalCodeDetails + + // The time zone in which the place is located. + TimeZone *TimeZone + + noSmithyDocumentSerde +} + +// Describes how parts of the result response match the input query. +type Highlight struct { + + // End index of the highlight. + EndIndex *int32 + + // Start index of the highlight. + StartIndex *int32 + + // The highlight's value. + Value *string + + noSmithyDocumentSerde +} + +// Details related to the match score. +type MatchScoreDetails struct { + + // Indicates how well the component input matches the returned. It is equal to 1 + // if all input tokens are recognized and matched. + Components *ComponentMatchScores + + // Indicates how well the entire input matches the returned. It is equal to 1 if + // all input tokens are recognized and matched. + Overall float64 + + noSmithyDocumentSerde +} + +// List of opening hours objects. +type OpeningHours struct { + + // Categories of results that results must belong too. + Categories []Category + + // Components of the opening hours object. + Components []OpeningHoursComponents + + // List of opening hours in the format they are displayed in. This can vary by + // result and in most cases represents how the result uniquely formats their + // opening hours. + Display []string + + // Boolean which indicates if the result/place is currently open. + OpenNow *bool + + noSmithyDocumentSerde +} + +// Components of the opening hours object. +type OpeningHoursComponents struct { + + // String which represents the duration of the opening period, such as "PT12H00M" . + OpenDuration *string + + // String which represents the opening hours, such as "T070000" . + OpenTime *string + + // Days or periods when the provided opening hours are in affect. + // + // Example: FREQ:DAILY;BYDAY:MO,TU,WE,TH,SU + Recurrence *string + + noSmithyDocumentSerde +} + +// The phoneme details. +type PhonemeDetails struct { + + // How to pronounce the address. + Address *AddressComponentPhonemes + + // List of PhonemeTranscription . See PhonemeTranscription for fields. + Title []PhonemeTranscription + + noSmithyDocumentSerde +} + +// How to pronounce the various components of the address or place. +type PhonemeTranscription struct { + + // A list of [BCP 47] compliant language codes for the results to be rendered in. If there + // is no data for the result in the requested language, data will be returned in + // the default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // Boolean which indicates if it the preferred pronunciation. + Preferred *bool + + // Value which indicates how to pronounce the value. + Value *string + + noSmithyDocumentSerde +} + +// Contains details about the postal code of the place or result. +type PostalCodeDetails struct { + + // The postal authority or entity. This could be a governmental authority, a + // regulatory authority, or a designated postal operator. + PostalAuthority PostalAuthority + + // An alphanumeric string included in a postal address to facilitate mail sorting, + // such as post code, postcode, or ZIP code for which the result should posses. + PostalCode *string + + // The postal code type. + PostalCodeType PostalCodeType + + // The ZIP Classification Code, or in other words what type of postal code is it. + UspsZip *UspsZip + + // The USPS ZIP+4 Record Type Code. + UspsZipPlus4 *UspsZipPlus4 + + noSmithyDocumentSerde +} + +// Suggestions for refining individual query terms. Suggestions are returned as +// objects which note the term, suggested replacement, and its index in the query. +type QueryRefinement struct { + + // End index of the parsed query. + // + // This member is required. + EndIndex *int32 + + // The sub-string of the original query that is replaced by this query term. + // + // This member is required. + OriginalTerm *string + + // The term that will be suggested to the user. + // + // This member is required. + RefinedTerm *string + + // Start index of the parsed component. + // + // This member is required. + StartIndex *int32 + + noSmithyDocumentSerde +} + +// The region or state results should be to be present in. +// +// Example: North Rhine-Westphalia . +type Region struct { + + // Abbreviated code for a the state, province or region of the country. + // + // Example: BC . + Code *string + + // Name for a the state, province, or region of the country. + // + // Example: British Columbia . + Name *string + + noSmithyDocumentSerde +} + +// Indicates the starting and ending index of the region in the text query that +// match the found title. +type RegionHighlights struct { + + // Indicates the starting and ending index of the region in the text query that + // match the found title. + Code []Highlight + + // Indicates the starting and ending index of the region name in the text query + // that match the found title. + Name []Highlight + + noSmithyDocumentSerde +} + +// The included place types. +type ReverseGeocodeFilter struct { + + // The included place types. + IncludePlaceTypes []ReverseGeocodeFilterPlaceType + + noSmithyDocumentSerde +} + +// The returned location from the Reverse Geocode action. +type ReverseGeocodeResultItem struct { + + // The PlaceId of the place you wish to receive the information for. + // + // This member is required. + PlaceId *string + + // A PlaceType is a category that the result place must belong to. + // + // This member is required. + PlaceType PlaceType + + // The localized display name of this result item based on request parameter + // language . + // + // This member is required. + Title *string + + // Position of the access point represent by longitude and latitude. + AccessPoints []AccessPoint + + // The place's address. + Address *Address + + // Boolean indicating if the address provided has been corrected. + AddressNumberCorrected *bool + + // Categories of results that results must belong to. + Categories []Category + + // The distance in meters from the QueryPosition. + Distance int64 + + // List of food types offered by this result. + FoodTypes []FoodType + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + MapView []float64 + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The position in longitude and latitude. + Position []float64 + + // Contains details about the postal code of the place/result. + PostalCodeDetails []PostalCodeDetails + + // The time zone in which the place is located. + TimeZone *TimeZone + + noSmithyDocumentSerde +} + +// SearchNearby structure which contains a set of inclusion/exclusion properties +// that results must posses in order to be returned as a result. +type SearchNearbyFilter struct { + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + BoundingBox []float64 + + // The Business Chains associated with the place. + ExcludeBusinessChains []string + + // Categories of results that results are excluded from. + ExcludeCategories []string + + // Food types that results are excluded from. + ExcludeFoodTypes []string + + // The Business Chains associated with the place. + IncludeBusinessChains []string + + // Categories of results that results must belong too. + IncludeCategories []string + + // A list of countries that all results must be in. Countries are represented by + // either their alpha-2 or alpha-3 character codes. + IncludeCountries []string + + // Food types that results are included from. + IncludeFoodTypes []string + + noSmithyDocumentSerde +} + +// The search results of nearby places. +type SearchNearbyResultItem struct { + + // The PlaceId of the place you wish to receive the information for. + // + // This member is required. + PlaceId *string + + // A PlaceType is a category that the result place must belong to. + // + // This member is required. + PlaceType PlaceType + + // The item's title. + // + // This member is required. + Title *string + + // Position of the access point represent by longitude and latitude. + AccessPoints []AccessPoint + + // Indicates known access restrictions on a vehicle access point. The index + // correlates to an access point and indicates if access through this point has + // some form of restriction. + AccessRestrictions []AccessRestriction + + // The place's address. + Address *Address + + // Boolean indicating if the address provided has been corrected. + AddressNumberCorrected *bool + + // The Business Chains associated with the place. + BusinessChains []BusinessChain + + // Categories of results that results must belong to. + Categories []Category + + // List of potential contact methods for the result/place. + Contacts *Contacts + + // The distance in meters from the QueryPosition. + Distance int64 + + // List of food types offered by this result. + FoodTypes []FoodType + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + MapView []float64 + + // List of opening hours objects. + OpeningHours []OpeningHours + + // How the various components of the result's address are pronounced in various + // languages. + Phonemes *PhonemeDetails + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The position in longitude and latitude. + Position []float64 + + // The time zone in which the place is located. + TimeZone *TimeZone + + noSmithyDocumentSerde +} + +// SearchText structure which contains a set of inclusion/exclusion properties +// that results must posses in order to be returned as a result. +type SearchTextFilter struct { + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + BoundingBox []float64 + + // The Circle that all results must be in. + Circle *FilterCircle + + // A list of countries that all results must be in. Countries are represented by + // either their alpha-2 or alpha-3 character codes. + IncludeCountries []string + + noSmithyDocumentSerde +} + +// The text search result. +type SearchTextResultItem struct { + + // The PlaceId of the place you wish to receive the information for. + // + // This member is required. + PlaceId *string + + // A PlaceType is a category that the result place must belong to. + // + // This member is required. + PlaceType PlaceType + + // The item's title. + // + // This member is required. + Title *string + + // Position of the access point represent by longitude and latitude. + AccessPoints []AccessPoint + + // Indicates known access restrictions on a vehicle access point. The index + // correlates to an access point and indicates if access through this point has + // some form of restriction. + AccessRestrictions []AccessRestriction + + // The place's address. + Address *Address + + // Boolean indicating if the address provided has been corrected. + AddressNumberCorrected *bool + + // The Business Chains associated with the place. + BusinessChains []BusinessChain + + // Categories of results that results must belong to. + Categories []Category + + // List of potential contact methods for the result/place. + Contacts *Contacts + + // The distance in meters from the QueryPosition. + Distance int64 + + // List of food types offered by this result. + FoodTypes []FoodType + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + MapView []float64 + + // List of opening hours objects. + OpeningHours []OpeningHours + + // How the various components of the result's address are pronounced in various + // languages. + Phonemes *PhonemeDetails + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The position, in longitude and latitude. + Position []float64 + + // The time zone in which the place is located. + TimeZone *TimeZone + + noSmithyDocumentSerde +} + +// Components of a street. +type StreetComponents struct { + + // Base name part of the street name. + // + // Example: Younge from the “Younge street". + BaseName *string + + // Indicates the official directional identifiers assigned to highways. + Direction *string + + // A [BCP 47] compliant language codes for the results to be rendered in. If there is no + // data for the result in the requested language, data will be returned in the + // default language for the entry. + // + // [BCP 47]: https://en.wikipedia.org/wiki/IETF_language_tag + Language *string + + // A prefix is a directional identifier that precedes, but is not included in, the + // base name of a road. + // + // Example: E for East. + Prefix *string + + // A suffix is a directional identifier that follows, but is not included in, the + // base name of a road. + // + // Example W for West. + Suffix *string + + // Street type part of the street name. + // + // Example: “avenue" . + Type *string + + // Defines if the street type is before or after the base name. + TypePlacement TypePlacement + + // What character(s) separates the string from its type. + TypeSeparator *string + + noSmithyDocumentSerde +} + +// The sub-region. +type SubRegion struct { + + // Abbreviated code for the county or sub-region. + Code *string + + // Name for the county or sub-region. + Name *string + + noSmithyDocumentSerde +} + +// Indicates the starting and ending index of the sub-region in the text query +// that match the found title. +type SubRegionHighlights struct { + + // Indicates the starting and ending index of the sub-region in the text query + // that match the found title. + Code []Highlight + + // Indicates the starting and ending index of the name in the text query that + // match the found title. + Name []Highlight + + noSmithyDocumentSerde +} + +// Describes how the parts of the textQuery matched the input query by returning +// the sections of the response which matched to textQuery terms. +type SuggestAddressHighlights struct { + + // Indicates the starting and ending indexes of the places in the result which + // were identified to match the textQuery. This result is useful for providing + // emphasis to results where the user query directly matched to make selecting the + // correct result from a list easier for an end user. + Label []Highlight + + noSmithyDocumentSerde +} + +// SuggestFilter structure which contains a set of inclusion/exclusion properties +// that results must posses in order to be returned as a result. +type SuggestFilter struct { + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + BoundingBox []float64 + + // The Circle that all results must be in. + Circle *FilterCircle + + // A list of countries that all results must be in. Countries are represented by + // either their alpha-2 or alpha-3 character codes. + IncludeCountries []string + + noSmithyDocumentSerde +} + +// Describes how the parts of the textQuery matched the input query by returning +// the sections of the response which matched to textQuery terms. +type SuggestHighlights struct { + + // The place's address. + Address *SuggestAddressHighlights + + // Indicates the starting and ending index of the title in the text query that + // match the found title. + Title []Highlight + + noSmithyDocumentSerde +} + +// The suggested place results. +type SuggestPlaceResult struct { + + // Position of the access point represent by longitude and latitude. + AccessPoints []AccessPoint + + // Indicates known access restrictions on a vehicle access point. The index + // correlates to an access point and indicates if access through this point has + // some form of restriction. + AccessRestrictions []AccessRestriction + + // The place's address. + Address *Address + + // The Business Chains associated with the place. + BusinessChains []BusinessChain + + // Categories of results that results must belong to. + Categories []Category + + // The distance in meters from the QueryPosition. + Distance int64 + + // List of food types offered by this result. + FoodTypes []FoodType + + // The bounding box enclosing the geometric shape (area or line) that an + // individual result covers. + // + // The bounding box formed is defined as a set 4 coordinates: [{westward lng}, + // {southern lat}, {eastward lng}, {northern lat}] + MapView []float64 + + // How the various components of the result's address are pronounced in various + // languages. + Phonemes *PhonemeDetails + + // The PlaceId of the place you wish to receive the information for. + PlaceId *string + + // A PlaceType is a category that the result place must belong to. + PlaceType PlaceType + + // The alpha-2 or alpha-3 character code for the political view of a country. The + // political view applies to the results of the request to represent unresolved + // territorial claims through the point of view of the specified country. + PoliticalView *string + + // The position, in longitude and latitude. + Position []float64 + + // The time zone in which the place is located. + TimeZone *TimeZone + + noSmithyDocumentSerde +} + +// The suggested query results. +type SuggestQueryResult struct { + + // QueryId can be used to complete a follow up query through the SearchText API. + // The QueryId retains context from the original Suggest request such as filters, + // political view and language. See the SearchText API documentation for more + // details [SearchText API docs]. + // + // [SearchText API docs]: https://docs.aws.amazon.com/latest/APIReference/API_geoplaces_SearchText.html + QueryId *string + + // The query type. Category qeuries will search for places which have an entry + // matching the given category, for example "doctor office". BusinessChain queries + // will search for instances of a given business. + QueryType QueryType + + noSmithyDocumentSerde +} + +// The resulting item from the suggested query. +type SuggestResultItem struct { + + // The result type. Place results represent the final result for a point of + // interest, Query results represent a follow up query which can be completed + // through the SearchText operation. + // + // This member is required. + SuggestResultItemType SuggestResultItemType + + // The display title that should be used when presenting this option to the end + // user. + // + // This member is required. + Title *string + + // Describes how the parts of the response element matched the input query by + // returning the sections of the response which matched to input query terms. + Highlights *SuggestHighlights + + // The suggested place by its unique ID. + Place *SuggestPlaceResult + + // The suggested query results. + Query *SuggestQueryResult + + noSmithyDocumentSerde +} + +// The time zone in which the place is located. +type TimeZone struct { + + // The time zone name. + // + // This member is required. + Name *string + + // Time zone offset of the timezone from UTC. + Offset *string + + // The offset of the time zone from UTC, in seconds. + OffsetSeconds int64 + + noSmithyDocumentSerde +} + +// The USPS zip code. +type UspsZip struct { + + // The ZIP Classification Code, or in other words what type of postal code is it. + ZipClassificationCode ZipClassificationCode + + noSmithyDocumentSerde +} + +// The USPS zip+4 code. +type UspsZipPlus4 struct { + + // The USPS ZIP+4 Record Type Code. + RecordTypeCode RecordTypeCode + + noSmithyDocumentSerde +} + +// The input fails to satisfy the constraints specified by the Amazon Location +// service. +type ValidationExceptionField struct { + + // The error message. + // + // This member is required. + Message *string + + // The name of the resource. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/geoplaces/validators.go b/service/geoplaces/validators.go new file mode 100644 index 00000000000..e415186fc09 --- /dev/null +++ b/service/geoplaces/validators.go @@ -0,0 +1,326 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/geoplaces/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAutocomplete struct { +} + +func (*validateOpAutocomplete) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAutocomplete) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AutocompleteInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAutocompleteInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetPlace struct { +} + +func (*validateOpGetPlace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPlace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPlaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPlaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpReverseGeocode struct { +} + +func (*validateOpReverseGeocode) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpReverseGeocode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ReverseGeocodeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpReverseGeocodeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchNearby struct { +} + +func (*validateOpSearchNearby) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchNearby) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchNearbyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchNearbyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchText struct { +} + +func (*validateOpSearchText) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchText) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchTextInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchTextInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSuggest struct { +} + +func (*validateOpSuggest) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSuggest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SuggestInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSuggestInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAutocompleteValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAutocomplete{}, middleware.After) +} + +func addOpGetPlaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPlace{}, middleware.After) +} + +func addOpReverseGeocodeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpReverseGeocode{}, middleware.After) +} + +func addOpSearchNearbyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchNearby{}, middleware.After) +} + +func addOpSearchTextValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchText{}, middleware.After) +} + +func addOpSuggestValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSuggest{}, middleware.After) +} + +func validateAutocompleteFilter(v *types.AutocompleteFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AutocompleteFilter"} + if v.Circle != nil { + if err := validateFilterCircle(v.Circle); err != nil { + invalidParams.AddNested("Circle", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilterCircle(v *types.FilterCircle) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FilterCircle"} + if v.Center == nil { + invalidParams.Add(smithy.NewErrParamRequired("Center")) + } + if v.Radius == nil { + invalidParams.Add(smithy.NewErrParamRequired("Radius")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSearchTextFilter(v *types.SearchTextFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchTextFilter"} + if v.Circle != nil { + if err := validateFilterCircle(v.Circle); err != nil { + invalidParams.AddNested("Circle", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSuggestFilter(v *types.SuggestFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SuggestFilter"} + if v.Circle != nil { + if err := validateFilterCircle(v.Circle); err != nil { + invalidParams.AddNested("Circle", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAutocompleteInput(v *AutocompleteInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AutocompleteInput"} + if v.QueryText == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryText")) + } + if v.Filter != nil { + if err := validateAutocompleteFilter(v.Filter); err != nil { + invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetPlaceInput(v *GetPlaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPlaceInput"} + if v.PlaceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PlaceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpReverseGeocodeInput(v *ReverseGeocodeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReverseGeocodeInput"} + if v.QueryPosition == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryPosition")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchNearbyInput(v *SearchNearbyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchNearbyInput"} + if v.QueryPosition == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryPosition")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchTextInput(v *SearchTextInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchTextInput"} + if v.Filter != nil { + if err := validateSearchTextFilter(v.Filter); err != nil { + invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSuggestInput(v *SuggestInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SuggestInput"} + if v.QueryText == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryText")) + } + if v.Filter != nil { + if err := validateSuggestFilter(v.Filter); err != nil { + invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/georoutes/LICENSE.txt b/service/georoutes/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/georoutes/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/georoutes/api_client.go b/service/georoutes/api_client.go new file mode 100644 index 00000000000..21b72c7af83 --- /dev/null +++ b/service/georoutes/api_client.go @@ -0,0 +1,913 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "Geo Routes" +const ServiceAPIVersion = "2020-11-19" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/georoutes") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/georoutes") +} + +// Client provides the API client to make operations call for Amazon Location +// Service Routes V2. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/georoutes") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "georoutes", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/georoutes") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/service/georoutes/api_client_test.go b/service/georoutes/api_client_test.go new file mode 100644 index 00000000000..c6aef286718 --- /dev/null +++ b/service/georoutes/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/georoutes/api_op_CalculateIsolines.go b/service/georoutes/api_op_CalculateIsolines.go new file mode 100644 index 00000000000..5f116601816 --- /dev/null +++ b/service/georoutes/api_op_CalculateIsolines.go @@ -0,0 +1,290 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use the CalculateIsolines action to find service areas that can be reached in a +// given threshold of time, distance. +func (c *Client) CalculateIsolines(ctx context.Context, params *CalculateIsolinesInput, optFns ...func(*Options)) (*CalculateIsolinesOutput, error) { + if params == nil { + params = &CalculateIsolinesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CalculateIsolines", params, optFns, c.addOperationCalculateIsolinesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CalculateIsolinesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CalculateIsolinesInput struct { + + // Threshold to be used for the isoline calculation. Up to 3 thresholds per + // provided type can be requested. + // + // This member is required. + Thresholds *types.IsolineThresholds + + // Features that are allowed while calculating. a route + Allow *types.IsolineAllowOptions + + // Time of arrival at the destination. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + ArrivalTime *string + + // Features that are avoided while calculating a route. Avoidance is on a + // best-case basis. If an avoidance can't be satisfied for a particular case, it + // violates the avoidance and the returned response produces a notice for the + // violation. + Avoid *types.IsolineAvoidanceOptions + + // Uses the current time as the time of departure. + DepartNow *bool + + // Time of departure from thr origin. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + DepartureTime *string + + // The final position for the route. In the World Geodetic System (WGS 84) format: + // [longitude, latitude] . + Destination []float64 + + // Destination related options. + DestinationOptions *types.IsolineDestinationOptions + + // The format of the returned IsolineGeometry. + // + // Default Value: FlexiblePolyline + IsolineGeometryFormat types.GeometryFormat + + // Defines the granularity of the returned Isoline + IsolineGranularity *types.IsolineGranularityOptions + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // Specifies the optimization criteria for when calculating an isoline. + // AccurateCalculation generates an isoline of higher granularity that is more + // precise. FastCalculation generates an isoline faster by reducing the + // granularity, and in turn the quality of the isoline. BalancedCalculation + // generates an isoline by balancing between quality and performance. + // + // Default Value: BalancedCalculation + OptimizeIsolineFor types.IsolineOptimizationObjective + + // Specifies the optimization criteria for calculating a route. + // + // Default Value: FastestRoute + OptimizeRoutingFor types.RoutingObjective + + // The start position for the route. + Origin []float64 + + // Origin related options. + OriginOptions *types.IsolineOriginOptions + + // Traffic related options. + Traffic *types.IsolineTrafficOptions + + // Specifies the mode of transport when calculating a route. Used in estimating + // the speed of travel and road compatibility. + // + // The mode Scooter also applies to motorcycles, set to Scooter when wanted to + // calculate options for motorcycles. + // + // Default Value: Car + TravelMode types.IsolineTravelMode + + // Travel mode related options for the provided travel mode. + TravelModeOptions *types.IsolineTravelModeOptions + + noSmithyDocumentSerde +} + +type CalculateIsolinesOutput struct { + + // The format of the returned IsolineGeometry. + // + // Default Value: FlexiblePolyline + // + // This member is required. + IsolineGeometryFormat types.GeometryFormat + + // Calculated isolines and associated properties. + // + // This member is required. + Isolines []types.Isoline + + // The pricing bucket for which the query is charged at. + // + // This member is required. + PricingBucket *string + + // Time of arrival at the destination. This parameter is returned only if the + // Destination parameters was provided in the request. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + ArrivalTime *string + + // Time of departure from thr origin. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + DepartureTime *string + + // Snapped destination that was used for the Isoline calculation. + SnappedDestination []float64 + + // Snapped origin that was used for the Isoline calculation. + SnappedOrigin []float64 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCalculateIsolinesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCalculateIsolines{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCalculateIsolines{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CalculateIsolines"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCalculateIsolinesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCalculateIsolines(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCalculateIsolines(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CalculateIsolines", + } +} diff --git a/service/georoutes/api_op_CalculateRouteMatrix.go b/service/georoutes/api_op_CalculateRouteMatrix.go new file mode 100644 index 00000000000..a693c65c92e --- /dev/null +++ b/service/georoutes/api_op_CalculateRouteMatrix.go @@ -0,0 +1,246 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Calculates route matrix containing the results for all pairs of Origins to +// Destinations. Each row corresponds to one entry in Origins. Each entry in the +// row corresponds to the route from that entry in Origins to an entry in +// Destinations positions. +func (c *Client) CalculateRouteMatrix(ctx context.Context, params *CalculateRouteMatrixInput, optFns ...func(*Options)) (*CalculateRouteMatrixOutput, error) { + if params == nil { + params = &CalculateRouteMatrixInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CalculateRouteMatrix", params, optFns, c.addOperationCalculateRouteMatrixMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CalculateRouteMatrixOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CalculateRouteMatrixInput struct { + + // List of destinations for the route. + // + // This member is required. + Destinations []types.RouteMatrixDestination + + // The position in longitude and latitude for the origin. + // + // This member is required. + Origins []types.RouteMatrixOrigin + + // Boundary within which the matrix is to be calculated. All data, origins and + // destinations outside the boundary are considered invalid. + // + // When request routing boundary was set as AutoCircle, the response routing + // boundary will return Circle derived from the AutoCircle settings. + // + // This member is required. + RoutingBoundary *types.RouteMatrixBoundary + + // Features that are allowed while calculating. a route + Allow *types.RouteMatrixAllowOptions + + // Features that are avoided while calculating a route. Avoidance is on a + // best-case basis. If an avoidance can't be satisfied for a particular case, it + // violates the avoidance and the returned response produces a notice for the + // violation. + Avoid *types.RouteMatrixAvoidanceOptions + + // Uses the current time as the time of departure. + DepartNow *bool + + // Time of departure from thr origin. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + DepartureTime *string + + // Features to be strictly excluded while calculating the route. + Exclude *types.RouteMatrixExclusionOptions + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // Specifies the optimization criteria for calculating a route. + // + // Default Value: FastestRoute + OptimizeRoutingFor types.RoutingObjective + + // Traffic related options. + Traffic *types.RouteMatrixTrafficOptions + + // Specifies the mode of transport when calculating a route. Used in estimating + // the speed of travel and road compatibility. + // + // Default Value: Car + TravelMode types.RouteMatrixTravelMode + + // Travel mode related options for the provided travel mode. + TravelModeOptions *types.RouteMatrixTravelModeOptions + + noSmithyDocumentSerde +} + +type CalculateRouteMatrixOutput struct { + + // The count of error results in the route matrix. If this number is 0, all routes + // were calculated successfully. + // + // This member is required. + ErrorCount *int32 + + // The pricing bucket for which the query is charged at. + // + // This member is required. + PricingBucket *string + + // The calculated route matrix containing the results for all pairs of Origins to + // Destination positions. Each row corresponds to one entry in Origins. Each entry + // in the row corresponds to the route from that entry in Origins to an entry in + // Destination positions. + // + // This member is required. + RouteMatrix [][]types.RouteMatrixEntry + + // Boundary within which the matrix is to be calculated. All data, origins and + // destinations outside the boundary are considered invalid. + // + // When request routing boundary was set as AutoCircle, the response routing + // boundary will return Circle derived from the AutoCircle settings. + // + // This member is required. + RoutingBoundary *types.RouteMatrixBoundary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCalculateRouteMatrixMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCalculateRouteMatrix{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCalculateRouteMatrix{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CalculateRouteMatrix"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCalculateRouteMatrixValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCalculateRouteMatrix(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCalculateRouteMatrix(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CalculateRouteMatrix", + } +} diff --git a/service/georoutes/api_op_CalculateRoutes.go b/service/georoutes/api_op_CalculateRoutes.go new file mode 100644 index 00000000000..0a13dd2120c --- /dev/null +++ b/service/georoutes/api_op_CalculateRoutes.go @@ -0,0 +1,314 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Calculates a route given the following required parameters: Origin and +// Destination . +func (c *Client) CalculateRoutes(ctx context.Context, params *CalculateRoutesInput, optFns ...func(*Options)) (*CalculateRoutesOutput, error) { + if params == nil { + params = &CalculateRoutesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CalculateRoutes", params, optFns, c.addOperationCalculateRoutesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CalculateRoutesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CalculateRoutesInput struct { + + // The final position for the route. In the World Geodetic System (WGS 84) format: + // [longitude, latitude] . + // + // This member is required. + Destination []float64 + + // The start position for the route. + // + // This member is required. + Origin []float64 + + // Features that are allowed while calculating. a route + Allow *types.RouteAllowOptions + + // Time of arrival at the destination. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + ArrivalTime *string + + // Features that are avoided while calculating a route. Avoidance is on a + // best-case basis. If an avoidance can't be satisfied for a particular case, it + // violates the avoidance and the returned response produces a notice for the + // violation. + Avoid *types.RouteAvoidanceOptions + + // Uses the current time as the time of departure. + DepartNow *bool + + // Time of departure from thr origin. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + DepartureTime *string + + // Destination related options. + DestinationOptions *types.RouteDestinationOptions + + // Driver related options. + Driver *types.RouteDriverOptions + + // Features to be strictly excluded while calculating the route. + Exclude *types.RouteExclusionOptions + + // Measurement system to be used for instructions within steps in the response. + InstructionsMeasurementSystem types.MeasurementSystem + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // List of languages for instructions within steps in the response. + // + // Instructions in the requested language are returned only if they are available. + Languages []string + + // A list of optional additional parameters such as timezone that can be requested + // for each result. + // + // - Elevation : Retrieves the elevation information for each location. + // + // - Incidents : Provides information on traffic incidents along the route. + // + // - PassThroughWaypoints : Indicates waypoints that are passed through without + // stopping. + // + // - Summary : Returns a summary of the route, including distance and duration. + // + // - Tolls : Supplies toll cost information along the route. + // + // - TravelStepInstructions : Provides step-by-step instructions for travel along + // the route. + // + // - TruckRoadTypes : Returns information about road types suitable for trucks. + // + // - TypicalDuration : Gives typical travel duration based on historical data. + // + // - Zones : Specifies the time zone information for each waypoint. + LegAdditionalFeatures []types.RouteLegAdditionalFeature + + // Specifies the format of the geometry returned for each leg of the route. You + // can choose between two different geometry encoding formats. + // + // FlexiblePolyline : A compact and precise encoding format for the leg geometry. + // For more information on the format, see the GitHub repository for [FlexiblePolyline] + // FlexiblePolyline . + // + // Simple : A less compact encoding, which is easier to decode but may be less + // precise and result in larger payloads. + // + // [FlexiblePolyline]: https://github.com/heremaps/flexible-polyline + LegGeometryFormat types.GeometryFormat + + // Maximum number of alternative routes to be provided in the response, if + // available. + MaxAlternatives *int32 + + // Specifies the optimization criteria for calculating a route. + // + // Default Value: FastestRoute + OptimizeRoutingFor types.RoutingObjective + + // Origin related options. + OriginOptions *types.RouteOriginOptions + + // A list of optional features such as SpeedLimit that can be requested for a + // Span. A span is a section of a Leg for which the requested features have the + // same values. + SpanAdditionalFeatures []types.RouteSpanAdditionalFeature + + // Toll related options. + Tolls *types.RouteTollOptions + + // Traffic related options. + Traffic *types.RouteTrafficOptions + + // Specifies the mode of transport when calculating a route. Used in estimating + // the speed of travel and road compatibility. + // + // Default Value: Car + TravelMode types.RouteTravelMode + + // Travel mode related options for the provided travel mode. + TravelModeOptions *types.RouteTravelModeOptions + + // Type of step returned by the response. Default provides basic steps intended + // for web based applications. TurnByTurn provides detailed instructions with more + // granularity intended for a turn based naviagtion system. + TravelStepType types.RouteTravelStepType + + // List of waypoints between the Origin and Destination. + Waypoints []types.RouteWaypoint + + noSmithyDocumentSerde +} + +type CalculateRoutesOutput struct { + + // Specifies the format of the geometry returned for each leg of the route. + // + // This member is required. + LegGeometryFormat types.GeometryFormat + + // Notices are additional information returned that indicate issues that occurred + // during route calculation. + // + // This member is required. + Notices []types.RouteResponseNotice + + // The pricing bucket for which the query is charged at. + // + // This member is required. + PricingBucket *string + + // The path from the origin to the destination. + // + // This member is required. + Routes []types.Route + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCalculateRoutesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCalculateRoutes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCalculateRoutes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CalculateRoutes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCalculateRoutesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCalculateRoutes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCalculateRoutes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CalculateRoutes", + } +} diff --git a/service/georoutes/api_op_OptimizeWaypoints.go b/service/georoutes/api_op_OptimizeWaypoints.go new file mode 100644 index 00000000000..68cd9bc8fc0 --- /dev/null +++ b/service/georoutes/api_op_OptimizeWaypoints.go @@ -0,0 +1,251 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Calculates the optimal order to travel between a set of waypoints to minimize +// either the travel time or the distance travelled during the journey, based on +// road network restrictions and the traffic pattern data. +func (c *Client) OptimizeWaypoints(ctx context.Context, params *OptimizeWaypointsInput, optFns ...func(*Options)) (*OptimizeWaypointsOutput, error) { + if params == nil { + params = &OptimizeWaypointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "OptimizeWaypoints", params, optFns, c.addOperationOptimizeWaypointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*OptimizeWaypointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type OptimizeWaypointsInput struct { + + // The start position for the route. + // + // This member is required. + Origin []float64 + + // Features that are avoided while calculating a route. Avoidance is on a + // best-case basis. If an avoidance can't be satisfied for a particular case, this + // setting is ignored. + Avoid *types.WaypointOptimizationAvoidanceOptions + + // Departure time from the waypoint. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + DepartureTime *string + + // The final position for the route in the World Geodetic System (WGS 84) format: + // [longitude, latitude] . + Destination []float64 + + // Destination related options. + DestinationOptions *types.WaypointOptimizationDestinationOptions + + // Driver related options. + Driver *types.WaypointOptimizationDriverOptions + + // Features to be strictly excluded while calculating the route. + Exclude *types.WaypointOptimizationExclusionOptions + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // Specifies the optimization criteria for the calculated sequence. + // + // Default Value: FastestRoute . + OptimizeSequencingFor types.WaypointOptimizationSequencingObjective + + // Origin related options. + OriginOptions *types.WaypointOptimizationOriginOptions + + // Traffic-related options. + Traffic *types.WaypointOptimizationTrafficOptions + + // Specifies the mode of transport when calculating a route. Used in estimating + // the speed of travel and road compatibility. + // + // Default Value: Car + TravelMode types.WaypointOptimizationTravelMode + + // Travel mode related options for the provided travel mode. + TravelModeOptions *types.WaypointOptimizationTravelModeOptions + + // List of waypoints between the Origin and Destination . + Waypoints []types.WaypointOptimizationWaypoint + + noSmithyDocumentSerde +} + +type OptimizeWaypointsOutput struct { + + // Details about the connection from one waypoint to the next, within the + // optimized sequence. + // + // This member is required. + Connections []types.WaypointOptimizationConnection + + // Overall distance to travel the whole sequence. + // + // This member is required. + Distance int64 + + // Overall duration to travel the whole sequence. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Returns waypoints that caused the optimization problem to fail, and the + // constraints that were unsatisfied leading to the failure. + // + // This member is required. + ImpedingWaypoints []types.WaypointOptimizationImpedingWaypoint + + // Waypoints in the order of the optimized sequence. + // + // This member is required. + OptimizedWaypoints []types.WaypointOptimizationOptimizedWaypoint + + // The pricing bucket for which the query is charged at. + // + // This member is required. + PricingBucket *string + + // Time breakdown for the sequence. + // + // This member is required. + TimeBreakdown *types.WaypointOptimizationTimeBreakdown + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationOptimizeWaypointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpOptimizeWaypoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpOptimizeWaypoints{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "OptimizeWaypoints"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpOptimizeWaypointsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opOptimizeWaypoints(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opOptimizeWaypoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "OptimizeWaypoints", + } +} diff --git a/service/georoutes/api_op_SnapToRoads.go b/service/georoutes/api_op_SnapToRoads.go new file mode 100644 index 00000000000..3c281d024cf --- /dev/null +++ b/service/georoutes/api_op_SnapToRoads.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The SnapToRoads action matches GPS trace to roads most likely traveled on. +func (c *Client) SnapToRoads(ctx context.Context, params *SnapToRoadsInput, optFns ...func(*Options)) (*SnapToRoadsOutput, error) { + if params == nil { + params = &SnapToRoadsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SnapToRoads", params, optFns, c.addOperationSnapToRoadsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SnapToRoadsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SnapToRoadsInput struct { + + // List of trace points to be snapped onto the road network. + // + // This member is required. + TracePoints []types.RoadSnapTracePoint + + // Optional: The API key to be used for authorization. Either an API key or valid + // SigV4 signature must be provided when making a request. + Key *string + + // The radius around the provided tracepoint that is considered for snapping. + // + // Unit: meters + // + // Default value: 300 + SnapRadius int64 + + // Chooses what the returned SnappedGeometry format should be. + // + // Default Value: FlexiblePolyline + SnappedGeometryFormat types.GeometryFormat + + // Specifies the mode of transport when calculating a route. Used in estimating + // the speed of travel and road compatibility. + // + // Default Value: Car + TravelMode types.RoadSnapTravelMode + + // Travel mode related options for the provided travel mode. + TravelModeOptions *types.RoadSnapTravelModeOptions + + noSmithyDocumentSerde +} + +type SnapToRoadsOutput struct { + + // Notices are additional information returned that indicate issues that occurred + // during route calculation. + // + // This member is required. + Notices []types.RoadSnapNotice + + // The pricing bucket for which the query is charged at. + // + // This member is required. + PricingBucket *string + + // Specifies the format of the geometry returned for each leg of the route. + // + // This member is required. + SnappedGeometryFormat types.GeometryFormat + + // The trace points snapped onto the road network. + // + // This member is required. + SnappedTracePoints []types.RoadSnapSnappedTracePoint + + // The interpolated geometry for the snapped route onto the road network. + SnappedGeometry *types.RoadSnapSnappedGeometry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSnapToRoadsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSnapToRoads{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSnapToRoads{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SnapToRoads"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSnapToRoadsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSnapToRoads(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSnapToRoads(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SnapToRoads", + } +} diff --git a/service/georoutes/auth.go b/service/georoutes/auth.go new file mode 100644 index 00000000000..84aefcd09cf --- /dev/null +++ b/service/georoutes/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "geo-routes") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/georoutes/deserializers.go b/service/georoutes/deserializers.go new file mode 100644 index 00000000000..e569dc75333 --- /dev/null +++ b/service/georoutes/deserializers.go @@ -0,0 +1,9873 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "math" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpCalculateIsolines struct { +} + +func (*awsRestjson1_deserializeOpCalculateIsolines) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCalculateIsolines) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCalculateIsolines(response, &metadata) + } + output := &CalculateIsolinesOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsCalculateIsolinesOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCalculateIsolinesOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCalculateIsolines(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("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_deserializeOpHttpBindingsCalculateIsolinesOutput(v *CalculateIsolinesOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentCalculateIsolinesOutput(v **CalculateIsolinesOutput, 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 *CalculateIsolinesOutput + if *v == nil { + sv = &CalculateIsolinesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ArrivalTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.ArrivalTime = ptr.String(jtv) + } + + case "DepartureTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.DepartureTime = ptr.String(jtv) + } + + case "IsolineGeometryFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeometryFormat to be of type string, got %T instead", value) + } + sv.IsolineGeometryFormat = types.GeometryFormat(jtv) + } + + case "Isolines": + if err := awsRestjson1_deserializeDocumentIsolineList(&sv.Isolines, value); err != nil { + return err + } + + case "SnappedDestination": + if err := awsRestjson1_deserializeDocumentPosition(&sv.SnappedDestination, value); err != nil { + return err + } + + case "SnappedOrigin": + if err := awsRestjson1_deserializeDocumentPosition(&sv.SnappedOrigin, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCalculateRouteMatrix struct { +} + +func (*awsRestjson1_deserializeOpCalculateRouteMatrix) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCalculateRouteMatrix) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCalculateRouteMatrix(response, &metadata) + } + output := &CalculateRouteMatrixOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsCalculateRouteMatrixOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCalculateRouteMatrixOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCalculateRouteMatrix(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("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_deserializeOpHttpBindingsCalculateRouteMatrixOutput(v *CalculateRouteMatrixOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentCalculateRouteMatrixOutput(v **CalculateRouteMatrixOutput, 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 *CalculateRouteMatrixOutput + if *v == nil { + sv = &CalculateRouteMatrixOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ErrorCount = ptr.Int32(int32(i64)) + } + + case "RouteMatrix": + if err := awsRestjson1_deserializeDocumentRouteMatrix(&sv.RouteMatrix, value); err != nil { + return err + } + + case "RoutingBoundary": + if err := awsRestjson1_deserializeDocumentRouteMatrixBoundary(&sv.RoutingBoundary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCalculateRoutes struct { +} + +func (*awsRestjson1_deserializeOpCalculateRoutes) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCalculateRoutes) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCalculateRoutes(response, &metadata) + } + output := &CalculateRoutesOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsCalculateRoutesOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCalculateRoutesOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCalculateRoutes(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("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_deserializeOpHttpBindingsCalculateRoutesOutput(v *CalculateRoutesOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentCalculateRoutesOutput(v **CalculateRoutesOutput, 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 *CalculateRoutesOutput + if *v == nil { + sv = &CalculateRoutesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LegGeometryFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeometryFormat to be of type string, got %T instead", value) + } + sv.LegGeometryFormat = types.GeometryFormat(jtv) + } + + case "Notices": + if err := awsRestjson1_deserializeDocumentRouteResponseNoticeList(&sv.Notices, value); err != nil { + return err + } + + case "Routes": + if err := awsRestjson1_deserializeDocumentRouteList(&sv.Routes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpOptimizeWaypoints struct { +} + +func (*awsRestjson1_deserializeOpOptimizeWaypoints) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpOptimizeWaypoints) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorOptimizeWaypoints(response, &metadata) + } + output := &OptimizeWaypointsOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsOptimizeWaypointsOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentOptimizeWaypointsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorOptimizeWaypoints(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("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_deserializeOpHttpBindingsOptimizeWaypointsOutput(v *OptimizeWaypointsOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentOptimizeWaypointsOutput(v **OptimizeWaypointsOutput, 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 *OptimizeWaypointsOutput + if *v == nil { + sv = &OptimizeWaypointsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Connections": + if err := awsRestjson1_deserializeDocumentWaypointOptimizationConnectionList(&sv.Connections, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "ImpedingWaypoints": + if err := awsRestjson1_deserializeDocumentWaypointOptimizationImpedingWaypointList(&sv.ImpedingWaypoints, value); err != nil { + return err + } + + case "OptimizedWaypoints": + if err := awsRestjson1_deserializeDocumentWaypointOptimizationOptimizedWaypointList(&sv.OptimizedWaypoints, value); err != nil { + return err + } + + case "TimeBreakdown": + if err := awsRestjson1_deserializeDocumentWaypointOptimizationTimeBreakdown(&sv.TimeBreakdown, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSnapToRoads struct { +} + +func (*awsRestjson1_deserializeOpSnapToRoads) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSnapToRoads) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorSnapToRoads(response, &metadata) + } + output := &SnapToRoadsOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsSnapToRoadsOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentSnapToRoadsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSnapToRoads(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("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_deserializeOpHttpBindingsSnapToRoadsOutput(v *SnapToRoadsOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-geo-pricing-bucket"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.PricingBucket = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestjson1_deserializeOpDocumentSnapToRoadsOutput(v **SnapToRoadsOutput, 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 *SnapToRoadsOutput + if *v == nil { + sv = &SnapToRoadsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Notices": + if err := awsRestjson1_deserializeDocumentRoadSnapNoticeList(&sv.Notices, value); err != nil { + return err + } + + case "SnappedGeometry": + if err := awsRestjson1_deserializeDocumentRoadSnapSnappedGeometry(&sv.SnappedGeometry, value); err != nil { + return err + } + + case "SnappedGeometryFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeometryFormat to be of type string, got %T instead", value) + } + sv.SnappedGeometryFormat = types.GeometryFormat(jtv) + } + + case "SnappedTracePoints": + if err := awsRestjson1_deserializeDocumentRoadSnapSnappedTracePointList(&sv.SnappedTracePoints, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBoundingBox(v *[]float64, 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 []float64 + if *v == nil { + cv = []float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = 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) + + } + col = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCircle(v **types.Circle, 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.Circle + if *v == nil { + sv = &types.Circle{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Center": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Center, value); err != nil { + return err + } + + case "Radius": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Radius = ptr.Float64(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.Radius = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIndexList(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 Integer 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 awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIsoline(v **types.Isoline, 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.Isoline + if *v == nil { + sv = &types.Isoline{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Connections": + if err := awsRestjson1_deserializeDocumentIsolineConnectionList(&sv.Connections, value); err != nil { + return err + } + + case "DistanceThreshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DistanceThreshold = i64 + } + + case "Geometries": + if err := awsRestjson1_deserializeDocumentIsolineShapeGeometryList(&sv.Geometries, value); err != nil { + return err + } + + case "TimeThreshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimeThreshold = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIsolineConnection(v **types.IsolineConnection, 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.IsolineConnection + if *v == nil { + sv = &types.IsolineConnection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FromPolygonIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FromPolygonIndex = ptr.Int32(int32(i64)) + } + + case "Geometry": + if err := awsRestjson1_deserializeDocumentIsolineConnectionGeometry(&sv.Geometry, value); err != nil { + return err + } + + case "ToPolygonIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ToPolygonIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIsolineConnectionGeometry(v **types.IsolineConnectionGeometry, 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.IsolineConnectionGeometry + if *v == nil { + sv = &types.IsolineConnectionGeometry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LineString": + if err := awsRestjson1_deserializeDocumentLineString(&sv.LineString, value); err != nil { + return err + } + + case "Polyline": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Polyline to be of type string, got %T instead", value) + } + sv.Polyline = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIsolineConnectionList(v *[]types.IsolineConnection, 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.IsolineConnection + if *v == nil { + cv = []types.IsolineConnection{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IsolineConnection + destAddr := &col + if err := awsRestjson1_deserializeDocumentIsolineConnection(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIsolineList(v *[]types.Isoline, 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.Isoline + if *v == nil { + cv = []types.Isoline{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Isoline + destAddr := &col + if err := awsRestjson1_deserializeDocumentIsoline(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIsolineShapeGeometry(v **types.IsolineShapeGeometry, 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.IsolineShapeGeometry + if *v == nil { + sv = &types.IsolineShapeGeometry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Polygon": + if err := awsRestjson1_deserializeDocumentLinearRings(&sv.Polygon, value); err != nil { + return err + } + + case "PolylinePolygon": + if err := awsRestjson1_deserializeDocumentPolylineRingList(&sv.PolylinePolygon, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIsolineShapeGeometryList(v *[]types.IsolineShapeGeometry, 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.IsolineShapeGeometry + if *v == nil { + cv = []types.IsolineShapeGeometry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IsolineShapeGeometry + destAddr := &col + if err := awsRestjson1_deserializeDocumentIsolineShapeGeometry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLinearRing(v *[][]float64, 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 [][]float64 + if *v == nil { + cv = [][]float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col []float64 + if err := awsRestjson1_deserializeDocumentPosition(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLinearRings(v *[][][]float64, 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 [][][]float64 + if *v == nil { + cv = [][][]float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col [][]float64 + if err := awsRestjson1_deserializeDocumentLinearRing(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLineString(v *[][]float64, 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 [][]float64 + if *v == nil { + cv = [][]float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col []float64 + if err := awsRestjson1_deserializeDocumentPosition(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLocalizedString(v **types.LocalizedString, 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.LocalizedString + if *v == nil { + sv = &types.LocalizedString{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Language": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value) + } + sv.Language = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLocalizedStringList(v *[]types.LocalizedString, 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.LocalizedString + if *v == nil { + cv = []types.LocalizedString{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LocalizedString + destAddr := &col + if err := awsRestjson1_deserializeDocumentLocalizedString(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPolylineRingList(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 PolylineRing to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPosition(v *[]float64, 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 []float64 + if *v == nil { + cv = []float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = 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) + + } + col = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPosition23(v *[]float64, 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 []float64 + if *v == nil { + cv = []float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = 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) + + } + col = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRoadSnapNotice(v **types.RoadSnapNotice, 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.RoadSnapNotice + if *v == nil { + sv = &types.RoadSnapNotice{} + } 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 RoadSnapNoticeCode to be of type string, got %T instead", value) + } + sv.Code = types.RoadSnapNoticeCode(jtv) + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + case "TracePointIndexes": + if err := awsRestjson1_deserializeDocumentRoadSnapTracePointIndexList(&sv.TracePointIndexes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoadSnapNoticeList(v *[]types.RoadSnapNotice, 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.RoadSnapNotice + if *v == nil { + cv = []types.RoadSnapNotice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RoadSnapNotice + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoadSnapNotice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRoadSnapSnappedGeometry(v **types.RoadSnapSnappedGeometry, 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.RoadSnapSnappedGeometry + if *v == nil { + sv = &types.RoadSnapSnappedGeometry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LineString": + if err := awsRestjson1_deserializeDocumentLineString(&sv.LineString, value); err != nil { + return err + } + + case "Polyline": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Polyline to be of type string, got %T instead", value) + } + sv.Polyline = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoadSnapSnappedTracePoint(v **types.RoadSnapSnappedTracePoint, 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.RoadSnapSnappedTracePoint + if *v == nil { + sv = &types.RoadSnapSnappedTracePoint{} + } 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.Float64(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.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "OriginalPosition": + if err := awsRestjson1_deserializeDocumentPosition(&sv.OriginalPosition, value); err != nil { + return err + } + + case "SnappedPosition": + if err := awsRestjson1_deserializeDocumentPosition(&sv.SnappedPosition, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoadSnapSnappedTracePointList(v *[]types.RoadSnapSnappedTracePoint, 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.RoadSnapSnappedTracePoint + if *v == nil { + cv = []types.RoadSnapSnappedTracePoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RoadSnapSnappedTracePoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoadSnapSnappedTracePoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRoadSnapTracePointIndexList(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 Integer 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 awsRestjson1_deserializeDocumentRoute(v **types.Route, 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.Route + if *v == nil { + sv = &types.Route{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Legs": + if err := awsRestjson1_deserializeDocumentRouteLegList(&sv.Legs, value); err != nil { + return err + } + + case "MajorRoadLabels": + if err := awsRestjson1_deserializeDocumentRouteMajorRoadLabelList(&sv.MajorRoadLabels, value); err != nil { + return err + } + + case "Summary": + if err := awsRestjson1_deserializeDocumentRouteSummary(&sv.Summary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteContinueHighwayStepDetails(v **types.RouteContinueHighwayStepDetails, 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.RouteContinueHighwayStepDetails + if *v == nil { + sv = &types.RouteContinueHighwayStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteContinueStepDetails(v **types.RouteContinueStepDetails, 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.RouteContinueStepDetails + if *v == nil { + sv = &types.RouteContinueStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteEnterHighwayStepDetails(v **types.RouteEnterHighwayStepDetails, 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.RouteEnterHighwayStepDetails + if *v == nil { + sv = &types.RouteEnterHighwayStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteExitStepDetails(v **types.RouteExitStepDetails, 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.RouteExitStepDetails + if *v == nil { + sv = &types.RouteExitStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "RelativeExit": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RelativeExit = ptr.Int32(int32(i64)) + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryAfterTravelStep(v **types.RouteFerryAfterTravelStep, 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.RouteFerryAfterTravelStep + if *v == nil { + sv = &types.RouteFerryAfterTravelStep{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "Instruction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Instruction = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteFerryAfterTravelStepType to be of type string, got %T instead", value) + } + sv.Type = types.RouteFerryAfterTravelStepType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryAfterTravelStepList(v *[]types.RouteFerryAfterTravelStep, 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.RouteFerryAfterTravelStep + if *v == nil { + cv = []types.RouteFerryAfterTravelStep{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteFerryAfterTravelStep + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteFerryAfterTravelStep(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryArrival(v **types.RouteFerryArrival, 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.RouteFerryArrival + if *v == nil { + sv = &types.RouteFerryArrival{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Place": + if err := awsRestjson1_deserializeDocumentRouteFerryPlace(&sv.Place, value); err != nil { + return err + } + + case "Time": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.Time = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryBeforeTravelStep(v **types.RouteFerryBeforeTravelStep, 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.RouteFerryBeforeTravelStep + if *v == nil { + sv = &types.RouteFerryBeforeTravelStep{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "Instruction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Instruction = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteFerryBeforeTravelStepType to be of type string, got %T instead", value) + } + sv.Type = types.RouteFerryBeforeTravelStepType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryBeforeTravelStepList(v *[]types.RouteFerryBeforeTravelStep, 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.RouteFerryBeforeTravelStep + if *v == nil { + cv = []types.RouteFerryBeforeTravelStep{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteFerryBeforeTravelStep + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteFerryBeforeTravelStep(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryDeparture(v **types.RouteFerryDeparture, 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.RouteFerryDeparture + if *v == nil { + sv = &types.RouteFerryDeparture{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Place": + if err := awsRestjson1_deserializeDocumentRouteFerryPlace(&sv.Place, value); err != nil { + return err + } + + case "Time": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.Time = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryLegDetails(v **types.RouteFerryLegDetails, 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.RouteFerryLegDetails + if *v == nil { + sv = &types.RouteFerryLegDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AfterTravelSteps": + if err := awsRestjson1_deserializeDocumentRouteFerryAfterTravelStepList(&sv.AfterTravelSteps, value); err != nil { + return err + } + + case "Arrival": + if err := awsRestjson1_deserializeDocumentRouteFerryArrival(&sv.Arrival, value); err != nil { + return err + } + + case "BeforeTravelSteps": + if err := awsRestjson1_deserializeDocumentRouteFerryBeforeTravelStepList(&sv.BeforeTravelSteps, value); err != nil { + return err + } + + case "Departure": + if err := awsRestjson1_deserializeDocumentRouteFerryDeparture(&sv.Departure, value); err != nil { + return err + } + + case "Notices": + if err := awsRestjson1_deserializeDocumentRouteFerryNoticeList(&sv.Notices, value); err != nil { + return err + } + + case "PassThroughWaypoints": + if err := awsRestjson1_deserializeDocumentRoutePassThroughWaypointList(&sv.PassThroughWaypoints, value); err != nil { + return err + } + + case "RouteName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RouteName = ptr.String(jtv) + } + + case "Spans": + if err := awsRestjson1_deserializeDocumentRouteFerrySpanList(&sv.Spans, value); err != nil { + return err + } + + case "Summary": + if err := awsRestjson1_deserializeDocumentRouteFerrySummary(&sv.Summary, value); err != nil { + return err + } + + case "TravelSteps": + if err := awsRestjson1_deserializeDocumentRouteFerryTravelStepList(&sv.TravelSteps, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryNotice(v **types.RouteFerryNotice, 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.RouteFerryNotice + if *v == nil { + sv = &types.RouteFerryNotice{} + } 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 RouteFerryNoticeCode to be of type string, got %T instead", value) + } + sv.Code = types.RouteFerryNoticeCode(jtv) + } + + case "Impact": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteNoticeImpact to be of type string, got %T instead", value) + } + sv.Impact = types.RouteNoticeImpact(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryNoticeList(v *[]types.RouteFerryNotice, 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.RouteFerryNotice + if *v == nil { + cv = []types.RouteFerryNotice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteFerryNotice + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteFerryNotice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryOverviewSummary(v **types.RouteFerryOverviewSummary, 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.RouteFerryOverviewSummary + if *v == nil { + sv = &types.RouteFerryOverviewSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryPlace(v **types.RouteFerryPlace, 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.RouteFerryPlace + if *v == nil { + sv = &types.RouteFerryPlace{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "OriginalPosition": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.OriginalPosition, value); err != nil { + return err + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.Position, value); err != nil { + return err + } + + case "WaypointIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WaypointIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerrySpan(v **types.RouteFerrySpan, 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.RouteFerrySpan + if *v == nil { + sv = &types.RouteFerrySpan{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "GeometryOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.GeometryOffset = ptr.Int32(int32(i64)) + } + + case "Names": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Names, value); err != nil { + return err + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerrySpanList(v *[]types.RouteFerrySpan, 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.RouteFerrySpan + if *v == nil { + cv = []types.RouteFerrySpan{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteFerrySpan + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteFerrySpan(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerrySummary(v **types.RouteFerrySummary, 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.RouteFerrySummary + if *v == nil { + sv = &types.RouteFerrySummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Overview": + if err := awsRestjson1_deserializeDocumentRouteFerryOverviewSummary(&sv.Overview, value); err != nil { + return err + } + + case "TravelOnly": + if err := awsRestjson1_deserializeDocumentRouteFerryTravelOnlySummary(&sv.TravelOnly, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryTravelOnlySummary(v **types.RouteFerryTravelOnlySummary, 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.RouteFerryTravelOnlySummary + if *v == nil { + sv = &types.RouteFerryTravelOnlySummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryTravelStep(v **types.RouteFerryTravelStep, 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.RouteFerryTravelStep + if *v == nil { + sv = &types.RouteFerryTravelStep{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "GeometryOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.GeometryOffset = ptr.Int32(int32(i64)) + } + + case "Instruction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Instruction = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteFerryTravelStepType to be of type string, got %T instead", value) + } + sv.Type = types.RouteFerryTravelStepType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteFerryTravelStepList(v *[]types.RouteFerryTravelStep, 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.RouteFerryTravelStep + if *v == nil { + cv = []types.RouteFerryTravelStep{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteFerryTravelStep + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteFerryTravelStep(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteHazardousCargoTypeList(v *[]types.RouteHazardousCargoType, 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.RouteHazardousCargoType + if *v == nil { + cv = []types.RouteHazardousCargoType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteHazardousCargoType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteHazardousCargoType to be of type string, got %T instead", value) + } + col = types.RouteHazardousCargoType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteKeepStepDetails(v **types.RouteKeepStepDetails, 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.RouteKeepStepDetails + if *v == nil { + sv = &types.RouteKeepStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteLeg(v **types.RouteLeg, 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.RouteLeg + if *v == nil { + sv = &types.RouteLeg{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FerryLegDetails": + if err := awsRestjson1_deserializeDocumentRouteFerryLegDetails(&sv.FerryLegDetails, value); err != nil { + return err + } + + case "Geometry": + if err := awsRestjson1_deserializeDocumentRouteLegGeometry(&sv.Geometry, value); err != nil { + return err + } + + case "Language": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value) + } + sv.Language = ptr.String(jtv) + } + + case "PedestrianLegDetails": + if err := awsRestjson1_deserializeDocumentRoutePedestrianLegDetails(&sv.PedestrianLegDetails, value); err != nil { + return err + } + + case "TravelMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteLegTravelMode to be of type string, got %T instead", value) + } + sv.TravelMode = types.RouteLegTravelMode(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteLegType to be of type string, got %T instead", value) + } + sv.Type = types.RouteLegType(jtv) + } + + case "VehicleLegDetails": + if err := awsRestjson1_deserializeDocumentRouteVehicleLegDetails(&sv.VehicleLegDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteLegGeometry(v **types.RouteLegGeometry, 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.RouteLegGeometry + if *v == nil { + sv = &types.RouteLegGeometry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LineString": + if err := awsRestjson1_deserializeDocumentLineString(&sv.LineString, value); err != nil { + return err + } + + case "Polyline": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Polyline to be of type string, got %T instead", value) + } + sv.Polyline = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteLegList(v *[]types.RouteLeg, 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.RouteLeg + if *v == nil { + cv = []types.RouteLeg{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteLeg + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteLeg(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteList(v *[]types.Route, 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.Route + if *v == nil { + cv = []types.Route{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Route + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoute(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMajorRoadLabel(v **types.RouteMajorRoadLabel, 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.RouteMajorRoadLabel + if *v == nil { + sv = &types.RouteMajorRoadLabel{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RoadName": + if err := awsRestjson1_deserializeDocumentLocalizedString(&sv.RoadName, value); err != nil { + return err + } + + case "RouteNumber": + if err := awsRestjson1_deserializeDocumentRouteNumber(&sv.RouteNumber, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMajorRoadLabelList(v *[]types.RouteMajorRoadLabel, 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.RouteMajorRoadLabel + if *v == nil { + cv = []types.RouteMajorRoadLabel{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteMajorRoadLabel + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteMajorRoadLabel(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMatrix(v *[][]types.RouteMatrixEntry, 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.RouteMatrixEntry + if *v == nil { + cv = [][]types.RouteMatrixEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col []types.RouteMatrixEntry + if err := awsRestjson1_deserializeDocumentRouteMatrixRow(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMatrixAutoCircle(v **types.RouteMatrixAutoCircle, 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.RouteMatrixAutoCircle + if *v == nil { + sv = &types.RouteMatrixAutoCircle{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Margin": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Margin = i64 + } + + case "MaxRadius": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxRadius = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMatrixBoundary(v **types.RouteMatrixBoundary, 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.RouteMatrixBoundary + if *v == nil { + sv = &types.RouteMatrixBoundary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Geometry": + if err := awsRestjson1_deserializeDocumentRouteMatrixBoundaryGeometry(&sv.Geometry, value); err != nil { + return err + } + + case "Unbounded": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Unbounded = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMatrixBoundaryGeometry(v **types.RouteMatrixBoundaryGeometry, 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.RouteMatrixBoundaryGeometry + if *v == nil { + sv = &types.RouteMatrixBoundaryGeometry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AutoCircle": + if err := awsRestjson1_deserializeDocumentRouteMatrixAutoCircle(&sv.AutoCircle, value); err != nil { + return err + } + + case "BoundingBox": + if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.BoundingBox, value); err != nil { + return err + } + + case "Circle": + if err := awsRestjson1_deserializeDocumentCircle(&sv.Circle, value); err != nil { + return err + } + + case "Polygon": + if err := awsRestjson1_deserializeDocumentLinearRings(&sv.Polygon, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMatrixEntry(v **types.RouteMatrixEntry, 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.RouteMatrixEntry + if *v == nil { + sv = &types.RouteMatrixEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "Error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteMatrixErrorCode to be of type string, got %T instead", value) + } + sv.Error = types.RouteMatrixErrorCode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteMatrixRow(v *[]types.RouteMatrixEntry, 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.RouteMatrixEntry + if *v == nil { + cv = []types.RouteMatrixEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteMatrixEntry + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteMatrixEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteNoticeDetailRange(v **types.RouteNoticeDetailRange, 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.RouteNoticeDetailRange + if *v == nil { + sv = &types.RouteNoticeDetailRange{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Max": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Max = ptr.Int32(int32(i64)) + } + + case "Min": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Min = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteNumber(v **types.RouteNumber, 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.RouteNumber + if *v == nil { + sv = &types.RouteNumber{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Direction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteDirection to be of type string, got %T instead", value) + } + sv.Direction = types.RouteDirection(jtv) + } + + case "Language": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value) + } + sv.Language = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteNumberList(v *[]types.RouteNumber, 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.RouteNumber + if *v == nil { + cv = []types.RouteNumber{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteNumber + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteNumber(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePassThroughPlace(v **types.RoutePassThroughPlace, 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.RoutePassThroughPlace + if *v == nil { + sv = &types.RoutePassThroughPlace{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "OriginalPosition": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.OriginalPosition, value); err != nil { + return err + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.Position, value); err != nil { + return err + } + + case "WaypointIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WaypointIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePassThroughWaypoint(v **types.RoutePassThroughWaypoint, 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.RoutePassThroughWaypoint + if *v == nil { + sv = &types.RoutePassThroughWaypoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GeometryOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.GeometryOffset = ptr.Int32(int32(i64)) + } + + case "Place": + if err := awsRestjson1_deserializeDocumentRoutePassThroughPlace(&sv.Place, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePassThroughWaypointList(v *[]types.RoutePassThroughWaypoint, 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.RoutePassThroughWaypoint + if *v == nil { + cv = []types.RoutePassThroughWaypoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RoutePassThroughWaypoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoutePassThroughWaypoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianArrival(v **types.RoutePedestrianArrival, 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.RoutePedestrianArrival + if *v == nil { + sv = &types.RoutePedestrianArrival{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Place": + if err := awsRestjson1_deserializeDocumentRoutePedestrianPlace(&sv.Place, value); err != nil { + return err + } + + case "Time": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.Time = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianDeparture(v **types.RoutePedestrianDeparture, 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.RoutePedestrianDeparture + if *v == nil { + sv = &types.RoutePedestrianDeparture{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Place": + if err := awsRestjson1_deserializeDocumentRoutePedestrianPlace(&sv.Place, value); err != nil { + return err + } + + case "Time": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.Time = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianLegDetails(v **types.RoutePedestrianLegDetails, 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.RoutePedestrianLegDetails + if *v == nil { + sv = &types.RoutePedestrianLegDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arrival": + if err := awsRestjson1_deserializeDocumentRoutePedestrianArrival(&sv.Arrival, value); err != nil { + return err + } + + case "Departure": + if err := awsRestjson1_deserializeDocumentRoutePedestrianDeparture(&sv.Departure, value); err != nil { + return err + } + + case "Notices": + if err := awsRestjson1_deserializeDocumentRoutePedestrianNoticeList(&sv.Notices, value); err != nil { + return err + } + + case "PassThroughWaypoints": + if err := awsRestjson1_deserializeDocumentRoutePassThroughWaypointList(&sv.PassThroughWaypoints, value); err != nil { + return err + } + + case "Spans": + if err := awsRestjson1_deserializeDocumentRoutePedestrianSpanList(&sv.Spans, value); err != nil { + return err + } + + case "Summary": + if err := awsRestjson1_deserializeDocumentRoutePedestrianSummary(&sv.Summary, value); err != nil { + return err + } + + case "TravelSteps": + if err := awsRestjson1_deserializeDocumentRoutePedestrianTravelStepList(&sv.TravelSteps, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianNotice(v **types.RoutePedestrianNotice, 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.RoutePedestrianNotice + if *v == nil { + sv = &types.RoutePedestrianNotice{} + } 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 RoutePedestrianNoticeCode to be of type string, got %T instead", value) + } + sv.Code = types.RoutePedestrianNoticeCode(jtv) + } + + case "Impact": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteNoticeImpact to be of type string, got %T instead", value) + } + sv.Impact = types.RouteNoticeImpact(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianNoticeList(v *[]types.RoutePedestrianNotice, 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.RoutePedestrianNotice + if *v == nil { + cv = []types.RoutePedestrianNotice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RoutePedestrianNotice + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoutePedestrianNotice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianOverviewSummary(v **types.RoutePedestrianOverviewSummary, 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.RoutePedestrianOverviewSummary + if *v == nil { + sv = &types.RoutePedestrianOverviewSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianPlace(v **types.RoutePedestrianPlace, 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.RoutePedestrianPlace + if *v == nil { + sv = &types.RoutePedestrianPlace{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "OriginalPosition": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.OriginalPosition, value); err != nil { + return err + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.Position, value); err != nil { + return err + } + + case "SideOfStreet": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSideOfStreet to be of type string, got %T instead", value) + } + sv.SideOfStreet = types.RouteSideOfStreet(jtv) + } + + case "WaypointIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WaypointIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianSpan(v **types.RoutePedestrianSpan, 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.RoutePedestrianSpan + if *v == nil { + sv = &types.RoutePedestrianSpan{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BestCaseDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BestCaseDuration = i64 + } + + case "Country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "DynamicSpeed": + if err := awsRestjson1_deserializeDocumentRouteSpanDynamicSpeedDetails(&sv.DynamicSpeed, value); err != nil { + return err + } + + case "FunctionalClassification": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FunctionalClassification = ptr.Int32(int32(i64)) + } + + case "GeometryOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.GeometryOffset = ptr.Int32(int32(i64)) + } + + case "Incidents": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.Incidents, value); err != nil { + return err + } + + case "Names": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Names, value); err != nil { + return err + } + + case "PedestrianAccess": + if err := awsRestjson1_deserializeDocumentRouteSpanPedestrianAccessAttributeList(&sv.PedestrianAccess, value); err != nil { + return err + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "RoadAttributes": + if err := awsRestjson1_deserializeDocumentRouteSpanRoadAttributeList(&sv.RoadAttributes, value); err != nil { + return err + } + + case "RouteNumbers": + if err := awsRestjson1_deserializeDocumentRouteNumberList(&sv.RouteNumbers, value); err != nil { + return err + } + + case "SpeedLimit": + if err := awsRestjson1_deserializeDocumentRouteSpanSpeedLimitDetails(&sv.SpeedLimit, value); err != nil { + return err + } + + case "TypicalDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TypicalDuration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianSpanList(v *[]types.RoutePedestrianSpan, 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.RoutePedestrianSpan + if *v == nil { + cv = []types.RoutePedestrianSpan{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RoutePedestrianSpan + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoutePedestrianSpan(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianSummary(v **types.RoutePedestrianSummary, 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.RoutePedestrianSummary + if *v == nil { + sv = &types.RoutePedestrianSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Overview": + if err := awsRestjson1_deserializeDocumentRoutePedestrianOverviewSummary(&sv.Overview, value); err != nil { + return err + } + + case "TravelOnly": + if err := awsRestjson1_deserializeDocumentRoutePedestrianTravelOnlySummary(&sv.TravelOnly, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianTravelOnlySummary(v **types.RoutePedestrianTravelOnlySummary, 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.RoutePedestrianTravelOnlySummary + if *v == nil { + sv = &types.RoutePedestrianTravelOnlySummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianTravelStep(v **types.RoutePedestrianTravelStep, 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.RoutePedestrianTravelStep + if *v == nil { + sv = &types.RoutePedestrianTravelStep{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContinueStepDetails": + if err := awsRestjson1_deserializeDocumentRouteContinueStepDetails(&sv.ContinueStepDetails, value); err != nil { + return err + } + + case "CurrentRoad": + if err := awsRestjson1_deserializeDocumentRouteRoad(&sv.CurrentRoad, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "ExitNumber": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.ExitNumber, value); err != nil { + return err + } + + case "GeometryOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.GeometryOffset = ptr.Int32(int32(i64)) + } + + case "Instruction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Instruction = ptr.String(jtv) + } + + case "KeepStepDetails": + if err := awsRestjson1_deserializeDocumentRouteKeepStepDetails(&sv.KeepStepDetails, value); err != nil { + return err + } + + case "NextRoad": + if err := awsRestjson1_deserializeDocumentRouteRoad(&sv.NextRoad, value); err != nil { + return err + } + + case "RoundaboutEnterStepDetails": + if err := awsRestjson1_deserializeDocumentRouteRoundaboutEnterStepDetails(&sv.RoundaboutEnterStepDetails, value); err != nil { + return err + } + + case "RoundaboutExitStepDetails": + if err := awsRestjson1_deserializeDocumentRouteRoundaboutExitStepDetails(&sv.RoundaboutExitStepDetails, value); err != nil { + return err + } + + case "RoundaboutPassStepDetails": + if err := awsRestjson1_deserializeDocumentRouteRoundaboutPassStepDetails(&sv.RoundaboutPassStepDetails, value); err != nil { + return err + } + + case "Signpost": + if err := awsRestjson1_deserializeDocumentRouteSignpost(&sv.Signpost, value); err != nil { + return err + } + + case "TurnStepDetails": + if err := awsRestjson1_deserializeDocumentRouteTurnStepDetails(&sv.TurnStepDetails, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoutePedestrianTravelStepType to be of type string, got %T instead", value) + } + sv.Type = types.RoutePedestrianTravelStepType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoutePedestrianTravelStepList(v *[]types.RoutePedestrianTravelStep, 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.RoutePedestrianTravelStep + if *v == nil { + cv = []types.RoutePedestrianTravelStep{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RoutePedestrianTravelStep + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoutePedestrianTravelStep(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteRampStepDetails(v **types.RouteRampStepDetails, 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.RouteRampStepDetails + if *v == nil { + sv = &types.RouteRampStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteResponseNotice(v **types.RouteResponseNotice, 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.RouteResponseNotice + if *v == nil { + sv = &types.RouteResponseNotice{} + } 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 RouteResponseNoticeCode to be of type string, got %T instead", value) + } + sv.Code = types.RouteResponseNoticeCode(jtv) + } + + case "Impact": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteNoticeImpact to be of type string, got %T instead", value) + } + sv.Impact = types.RouteNoticeImpact(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteResponseNoticeList(v *[]types.RouteResponseNotice, 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.RouteResponseNotice + if *v == nil { + cv = []types.RouteResponseNotice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteResponseNotice + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteResponseNotice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteRoad(v **types.RouteRoad, 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.RouteRoad + if *v == nil { + sv = &types.RouteRoad{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RoadName": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.RoadName, value); err != nil { + return err + } + + case "RouteNumber": + if err := awsRestjson1_deserializeDocumentRouteNumberList(&sv.RouteNumber, value); err != nil { + return err + } + + case "Towards": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Towards, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteRoadType to be of type string, got %T instead", value) + } + sv.Type = types.RouteRoadType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteRoundaboutEnterStepDetails(v **types.RouteRoundaboutEnterStepDetails, 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.RouteRoundaboutEnterStepDetails + if *v == nil { + sv = &types.RouteRoundaboutEnterStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteRoundaboutExitStepDetails(v **types.RouteRoundaboutExitStepDetails, 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.RouteRoundaboutExitStepDetails + if *v == nil { + sv = &types.RouteRoundaboutExitStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "RelativeExit": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RelativeExit = ptr.Int32(int32(i64)) + } + + case "RoundaboutAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RoundaboutAngle = 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.RoundaboutAngle = f64 + + default: + return fmt.Errorf("expected RoundaboutAngle to be a JSON Number, got %T instead", value) + + } + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteRoundaboutPassStepDetails(v **types.RouteRoundaboutPassStepDetails, 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.RouteRoundaboutPassStepDetails + if *v == nil { + sv = &types.RouteRoundaboutPassStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSignpost(v **types.RouteSignpost, 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.RouteSignpost + if *v == nil { + sv = &types.RouteSignpost{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Labels": + if err := awsRestjson1_deserializeDocumentRouteSignpostLabelList(&sv.Labels, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSignpostLabel(v **types.RouteSignpostLabel, 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.RouteSignpostLabel + if *v == nil { + sv = &types.RouteSignpostLabel{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RouteNumber": + if err := awsRestjson1_deserializeDocumentRouteNumber(&sv.RouteNumber, value); err != nil { + return err + } + + case "Text": + if err := awsRestjson1_deserializeDocumentLocalizedString(&sv.Text, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSignpostLabelList(v *[]types.RouteSignpostLabel, 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.RouteSignpostLabel + if *v == nil { + cv = []types.RouteSignpostLabel{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteSignpostLabel + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteSignpostLabel(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSpanCarAccessAttributeList(v *[]types.RouteSpanCarAccessAttribute, 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.RouteSpanCarAccessAttribute + if *v == nil { + cv = []types.RouteSpanCarAccessAttribute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteSpanCarAccessAttribute + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSpanCarAccessAttribute to be of type string, got %T instead", value) + } + col = types.RouteSpanCarAccessAttribute(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSpanDynamicSpeedDetails(v **types.RouteSpanDynamicSpeedDetails, 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.RouteSpanDynamicSpeedDetails + if *v == nil { + sv = &types.RouteSpanDynamicSpeedDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BestCaseSpeed": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.BestCaseSpeed = 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.BestCaseSpeed = f64 + + default: + return fmt.Errorf("expected SpeedKilometersPerHour to be a JSON Number, got %T instead", value) + + } + } + + case "TurnDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TurnDuration = i64 + } + + case "TypicalSpeed": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TypicalSpeed = 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.TypicalSpeed = f64 + + default: + return fmt.Errorf("expected SpeedKilometersPerHour to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSpanPedestrianAccessAttributeList(v *[]types.RouteSpanPedestrianAccessAttribute, 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.RouteSpanPedestrianAccessAttribute + if *v == nil { + cv = []types.RouteSpanPedestrianAccessAttribute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteSpanPedestrianAccessAttribute + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSpanPedestrianAccessAttribute to be of type string, got %T instead", value) + } + col = types.RouteSpanPedestrianAccessAttribute(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSpanRoadAttributeList(v *[]types.RouteSpanRoadAttribute, 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.RouteSpanRoadAttribute + if *v == nil { + cv = []types.RouteSpanRoadAttribute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteSpanRoadAttribute + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSpanRoadAttribute to be of type string, got %T instead", value) + } + col = types.RouteSpanRoadAttribute(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSpanScooterAccessAttributeList(v *[]types.RouteSpanScooterAccessAttribute, 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.RouteSpanScooterAccessAttribute + if *v == nil { + cv = []types.RouteSpanScooterAccessAttribute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteSpanScooterAccessAttribute + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSpanScooterAccessAttribute to be of type string, got %T instead", value) + } + col = types.RouteSpanScooterAccessAttribute(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSpanSpeedLimitDetails(v **types.RouteSpanSpeedLimitDetails, 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.RouteSpanSpeedLimitDetails + if *v == nil { + sv = &types.RouteSpanSpeedLimitDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MaxSpeed": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.MaxSpeed = 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.MaxSpeed = f64 + + default: + return fmt.Errorf("expected SpeedKilometersPerHour to be a JSON Number, got %T instead", value) + + } + } + + case "Unlimited": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Unlimited = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSpanTruckAccessAttributeList(v *[]types.RouteSpanTruckAccessAttribute, 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.RouteSpanTruckAccessAttribute + if *v == nil { + cv = []types.RouteSpanTruckAccessAttribute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteSpanTruckAccessAttribute + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSpanTruckAccessAttribute to be of type string, got %T instead", value) + } + col = types.RouteSpanTruckAccessAttribute(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteSummary(v **types.RouteSummary, 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.RouteSummary + if *v == nil { + sv = &types.RouteSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "Tolls": + if err := awsRestjson1_deserializeDocumentRouteTollSummary(&sv.Tolls, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteToll(v **types.RouteToll, 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.RouteToll + if *v == nil { + sv = &types.RouteToll{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "PaymentSites": + if err := awsRestjson1_deserializeDocumentRouteTollPaymentSiteList(&sv.PaymentSites, value); err != nil { + return err + } + + case "Rates": + if err := awsRestjson1_deserializeDocumentRouteTollRateList(&sv.Rates, value); err != nil { + return err + } + + case "Systems": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.Systems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollList(v *[]types.RouteToll, 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.RouteToll + if *v == nil { + cv = []types.RouteToll{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteToll + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteToll(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPass(v **types.RouteTollPass, 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.RouteTollPass + if *v == nil { + sv = &types.RouteTollPass{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IncludesReturnTrip": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IncludesReturnTrip = ptr.Bool(jtv) + } + + case "SeniorPass": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.SeniorPass = ptr.Bool(jtv) + } + + case "TransferCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TransferCount = ptr.Int32(int32(i64)) + } + + case "TripCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TripCount = ptr.Int32(int32(i64)) + } + + case "ValidityPeriod": + if err := awsRestjson1_deserializeDocumentRouteTollPassValidityPeriod(&sv.ValidityPeriod, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPassValidityPeriod(v **types.RouteTollPassValidityPeriod, 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.RouteTollPassValidityPeriod + if *v == nil { + sv = &types.RouteTollPassValidityPeriod{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Period": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTollPassValidityPeriodType to be of type string, got %T instead", value) + } + sv.Period = types.RouteTollPassValidityPeriodType(jtv) + } + + case "PeriodCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.PeriodCount = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPaymentMethodList(v *[]types.RouteTollPaymentMethod, 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.RouteTollPaymentMethod + if *v == nil { + cv = []types.RouteTollPaymentMethod{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteTollPaymentMethod + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTollPaymentMethod to be of type string, got %T instead", value) + } + col = types.RouteTollPaymentMethod(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPaymentSite(v **types.RouteTollPaymentSite, 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.RouteTollPaymentSite + if *v == nil { + sv = &types.RouteTollPaymentSite{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.Position, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPaymentSiteList(v *[]types.RouteTollPaymentSite, 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.RouteTollPaymentSite + if *v == nil { + cv = []types.RouteTollPaymentSite{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteTollPaymentSite + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteTollPaymentSite(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPrice(v **types.RouteTollPrice, 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.RouteTollPrice + if *v == nil { + sv = &types.RouteTollPrice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Currency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CurrencyCode to be of type string, got %T instead", value) + } + sv.Currency = ptr.String(jtv) + } + + case "Estimate": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Estimate = ptr.Bool(jtv) + } + + case "PerDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.PerDuration = i64 + } + + case "Range": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Range = ptr.Bool(jtv) + } + + case "RangeValue": + if err := awsRestjson1_deserializeDocumentRouteTollPriceValueRange(&sv.RangeValue, value); err != nil { + return err + } + + case "Value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Value = ptr.Float64(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.Value = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPriceSummary(v **types.RouteTollPriceSummary, 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.RouteTollPriceSummary + if *v == nil { + sv = &types.RouteTollPriceSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Currency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CurrencyCode to be of type string, got %T instead", value) + } + sv.Currency = ptr.String(jtv) + } + + case "Estimate": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Estimate = ptr.Bool(jtv) + } + + case "Range": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Range = ptr.Bool(jtv) + } + + case "RangeValue": + if err := awsRestjson1_deserializeDocumentRouteTollPriceValueRange(&sv.RangeValue, value); err != nil { + return err + } + + case "Value": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Value = ptr.Float64(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.Value = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollPriceValueRange(v **types.RouteTollPriceValueRange, 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.RouteTollPriceValueRange + if *v == nil { + sv = &types.RouteTollPriceValueRange{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Max": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Max = ptr.Float64(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.Max = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "Min": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Min = ptr.Float64(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.Min = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollRate(v **types.RouteTollRate, 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.RouteTollRate + if *v == nil { + sv = &types.RouteTollRate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicableTimes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ApplicableTimes = ptr.String(jtv) + } + + case "ConvertedPrice": + if err := awsRestjson1_deserializeDocumentRouteTollPrice(&sv.ConvertedPrice, value); err != nil { + return err + } + + 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 "LocalPrice": + if err := awsRestjson1_deserializeDocumentRouteTollPrice(&sv.LocalPrice, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Pass": + if err := awsRestjson1_deserializeDocumentRouteTollPass(&sv.Pass, value); err != nil { + return err + } + + case "PaymentMethods": + if err := awsRestjson1_deserializeDocumentRouteTollPaymentMethodList(&sv.PaymentMethods, value); err != nil { + return err + } + + case "Transponders": + if err := awsRestjson1_deserializeDocumentRouteTransponderList(&sv.Transponders, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollRateList(v *[]types.RouteTollRate, 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.RouteTollRate + if *v == nil { + cv = []types.RouteTollRate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteTollRate + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteTollRate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollSummary(v **types.RouteTollSummary, 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.RouteTollSummary + if *v == nil { + sv = &types.RouteTollSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Total": + if err := awsRestjson1_deserializeDocumentRouteTollPriceSummary(&sv.Total, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollSystem(v **types.RouteTollSystem, 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.RouteTollSystem + if *v == nil { + sv = &types.RouteTollSystem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTollSystemList(v *[]types.RouteTollSystem, 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.RouteTollSystem + if *v == nil { + cv = []types.RouteTollSystem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteTollSystem + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteTollSystem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTransponder(v **types.RouteTransponder, 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.RouteTransponder + if *v == nil { + sv = &types.RouteTransponder{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SystemName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SystemName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTransponderList(v *[]types.RouteTransponder, 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.RouteTransponder + if *v == nil { + cv = []types.RouteTransponder{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteTransponder + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteTransponder(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteTurnStepDetails(v **types.RouteTurnStepDetails, 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.RouteTurnStepDetails + if *v == nil { + sv = &types.RouteTurnStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteUTurnStepDetails(v **types.RouteUTurnStepDetails, 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.RouteUTurnStepDetails + if *v == nil { + sv = &types.RouteUTurnStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Intersection": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Intersection, value); err != nil { + return err + } + + case "SteeringDirection": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSteeringDirection to be of type string, got %T instead", value) + } + sv.SteeringDirection = types.RouteSteeringDirection(jtv) + } + + case "TurnAngle": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TurnAngle = 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.TurnAngle = f64 + + default: + return fmt.Errorf("expected TurnAngle to be a JSON Number, got %T instead", value) + + } + } + + case "TurnIntensity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTurnIntensity to be of type string, got %T instead", value) + } + sv.TurnIntensity = types.RouteTurnIntensity(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleArrival(v **types.RouteVehicleArrival, 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.RouteVehicleArrival + if *v == nil { + sv = &types.RouteVehicleArrival{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Place": + if err := awsRestjson1_deserializeDocumentRouteVehiclePlace(&sv.Place, value); err != nil { + return err + } + + case "Time": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.Time = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleDeparture(v **types.RouteVehicleDeparture, 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.RouteVehicleDeparture + if *v == nil { + sv = &types.RouteVehicleDeparture{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Place": + if err := awsRestjson1_deserializeDocumentRouteVehiclePlace(&sv.Place, value); err != nil { + return err + } + + case "Time": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.Time = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleIncident(v **types.RouteVehicleIncident, 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.RouteVehicleIncident + if *v == nil { + sv = &types.RouteVehicleIncident{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EndTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.EndTime = ptr.String(jtv) + } + + case "Severity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteVehicleIncidentSeverity to be of type string, got %T instead", value) + } + sv.Severity = types.RouteVehicleIncidentSeverity(jtv) + } + + case "StartTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.StartTime = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteVehicleIncidentType to be of type string, got %T instead", value) + } + sv.Type = types.RouteVehicleIncidentType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleIncidentList(v *[]types.RouteVehicleIncident, 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.RouteVehicleIncident + if *v == nil { + cv = []types.RouteVehicleIncident{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteVehicleIncident + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteVehicleIncident(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleLegDetails(v **types.RouteVehicleLegDetails, 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.RouteVehicleLegDetails + if *v == nil { + sv = &types.RouteVehicleLegDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arrival": + if err := awsRestjson1_deserializeDocumentRouteVehicleArrival(&sv.Arrival, value); err != nil { + return err + } + + case "Departure": + if err := awsRestjson1_deserializeDocumentRouteVehicleDeparture(&sv.Departure, value); err != nil { + return err + } + + case "Incidents": + if err := awsRestjson1_deserializeDocumentRouteVehicleIncidentList(&sv.Incidents, value); err != nil { + return err + } + + case "Notices": + if err := awsRestjson1_deserializeDocumentRouteVehicleNoticeList(&sv.Notices, value); err != nil { + return err + } + + case "PassThroughWaypoints": + if err := awsRestjson1_deserializeDocumentRoutePassThroughWaypointList(&sv.PassThroughWaypoints, value); err != nil { + return err + } + + case "Spans": + if err := awsRestjson1_deserializeDocumentRouteVehicleSpanList(&sv.Spans, value); err != nil { + return err + } + + case "Summary": + if err := awsRestjson1_deserializeDocumentRouteVehicleSummary(&sv.Summary, value); err != nil { + return err + } + + case "Tolls": + if err := awsRestjson1_deserializeDocumentRouteTollList(&sv.Tolls, value); err != nil { + return err + } + + case "TollSystems": + if err := awsRestjson1_deserializeDocumentRouteTollSystemList(&sv.TollSystems, value); err != nil { + return err + } + + case "TravelSteps": + if err := awsRestjson1_deserializeDocumentRouteVehicleTravelStepList(&sv.TravelSteps, value); err != nil { + return err + } + + case "TruckRoadTypes": + if err := awsRestjson1_deserializeDocumentTruckRoadTypeList(&sv.TruckRoadTypes, value); err != nil { + return err + } + + case "Zones": + if err := awsRestjson1_deserializeDocumentRouteZoneList(&sv.Zones, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleNotice(v **types.RouteVehicleNotice, 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.RouteVehicleNotice + if *v == nil { + sv = &types.RouteVehicleNotice{} + } 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 RouteVehicleNoticeCode to be of type string, got %T instead", value) + } + sv.Code = types.RouteVehicleNoticeCode(jtv) + } + + case "Details": + if err := awsRestjson1_deserializeDocumentRouteVehicleNoticeDetailList(&sv.Details, value); err != nil { + return err + } + + case "Impact": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteNoticeImpact to be of type string, got %T instead", value) + } + sv.Impact = types.RouteNoticeImpact(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleNoticeDetail(v **types.RouteVehicleNoticeDetail, 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.RouteVehicleNoticeDetail + if *v == nil { + sv = &types.RouteVehicleNoticeDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + case "ViolatedConstraints": + if err := awsRestjson1_deserializeDocumentRouteViolatedConstraints(&sv.ViolatedConstraints, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleNoticeDetailList(v *[]types.RouteVehicleNoticeDetail, 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.RouteVehicleNoticeDetail + if *v == nil { + cv = []types.RouteVehicleNoticeDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteVehicleNoticeDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteVehicleNoticeDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleNoticeList(v *[]types.RouteVehicleNotice, 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.RouteVehicleNotice + if *v == nil { + cv = []types.RouteVehicleNotice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteVehicleNotice + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteVehicleNotice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleOverviewSummary(v **types.RouteVehicleOverviewSummary, 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.RouteVehicleOverviewSummary + if *v == nil { + sv = &types.RouteVehicleOverviewSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BestCaseDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BestCaseDuration = i64 + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "TypicalDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TypicalDuration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehiclePlace(v **types.RouteVehiclePlace, 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.RouteVehiclePlace + if *v == nil { + sv = &types.RouteVehiclePlace{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "OriginalPosition": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.OriginalPosition, value); err != nil { + return err + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition23(&sv.Position, value); err != nil { + return err + } + + case "SideOfStreet": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSideOfStreet to be of type string, got %T instead", value) + } + sv.SideOfStreet = types.RouteSideOfStreet(jtv) + } + + case "WaypointIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WaypointIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleSpan(v **types.RouteVehicleSpan, 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.RouteVehicleSpan + if *v == nil { + sv = &types.RouteVehicleSpan{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BestCaseDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BestCaseDuration = i64 + } + + case "CarAccess": + if err := awsRestjson1_deserializeDocumentRouteSpanCarAccessAttributeList(&sv.CarAccess, value); err != nil { + return err + } + + case "Country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "DynamicSpeed": + if err := awsRestjson1_deserializeDocumentRouteSpanDynamicSpeedDetails(&sv.DynamicSpeed, value); err != nil { + return err + } + + case "FunctionalClassification": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FunctionalClassification = ptr.Int32(int32(i64)) + } + + case "Gate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSpanGateAttribute to be of type string, got %T instead", value) + } + sv.Gate = types.RouteSpanGateAttribute(jtv) + } + + case "GeometryOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.GeometryOffset = ptr.Int32(int32(i64)) + } + + case "Incidents": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.Incidents, value); err != nil { + return err + } + + case "Names": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.Names, value); err != nil { + return err + } + + case "Notices": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.Notices, value); err != nil { + return err + } + + case "RailwayCrossing": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteSpanRailwayCrossingAttribute to be of type string, got %T instead", value) + } + sv.RailwayCrossing = types.RouteSpanRailwayCrossingAttribute(jtv) + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "RoadAttributes": + if err := awsRestjson1_deserializeDocumentRouteSpanRoadAttributeList(&sv.RoadAttributes, value); err != nil { + return err + } + + case "RouteNumbers": + if err := awsRestjson1_deserializeDocumentRouteNumberList(&sv.RouteNumbers, value); err != nil { + return err + } + + case "ScooterAccess": + if err := awsRestjson1_deserializeDocumentRouteSpanScooterAccessAttributeList(&sv.ScooterAccess, value); err != nil { + return err + } + + case "SpeedLimit": + if err := awsRestjson1_deserializeDocumentRouteSpanSpeedLimitDetails(&sv.SpeedLimit, value); err != nil { + return err + } + + case "TollSystems": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.TollSystems, value); err != nil { + return err + } + + case "TruckAccess": + if err := awsRestjson1_deserializeDocumentRouteSpanTruckAccessAttributeList(&sv.TruckAccess, value); err != nil { + return err + } + + case "TruckRoadTypes": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.TruckRoadTypes, value); err != nil { + return err + } + + case "TypicalDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TypicalDuration = i64 + } + + case "Zones": + if err := awsRestjson1_deserializeDocumentIndexList(&sv.Zones, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleSpanList(v *[]types.RouteVehicleSpan, 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.RouteVehicleSpan + if *v == nil { + cv = []types.RouteVehicleSpan{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteVehicleSpan + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteVehicleSpan(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleSummary(v **types.RouteVehicleSummary, 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.RouteVehicleSummary + if *v == nil { + sv = &types.RouteVehicleSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Overview": + if err := awsRestjson1_deserializeDocumentRouteVehicleOverviewSummary(&sv.Overview, value); err != nil { + return err + } + + case "TravelOnly": + if err := awsRestjson1_deserializeDocumentRouteVehicleTravelOnlySummary(&sv.TravelOnly, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleTravelOnlySummary(v **types.RouteVehicleTravelOnlySummary, 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.RouteVehicleTravelOnlySummary + if *v == nil { + sv = &types.RouteVehicleTravelOnlySummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BestCaseDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BestCaseDuration = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "TypicalDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TypicalDuration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleTravelStep(v **types.RouteVehicleTravelStep, 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.RouteVehicleTravelStep + if *v == nil { + sv = &types.RouteVehicleTravelStep{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContinueHighwayStepDetails": + if err := awsRestjson1_deserializeDocumentRouteContinueHighwayStepDetails(&sv.ContinueHighwayStepDetails, value); err != nil { + return err + } + + case "ContinueStepDetails": + if err := awsRestjson1_deserializeDocumentRouteContinueStepDetails(&sv.ContinueStepDetails, value); err != nil { + return err + } + + case "CurrentRoad": + if err := awsRestjson1_deserializeDocumentRouteRoad(&sv.CurrentRoad, value); err != nil { + return err + } + + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "Duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = i64 + } + + case "EnterHighwayStepDetails": + if err := awsRestjson1_deserializeDocumentRouteEnterHighwayStepDetails(&sv.EnterHighwayStepDetails, value); err != nil { + return err + } + + case "ExitNumber": + if err := awsRestjson1_deserializeDocumentLocalizedStringList(&sv.ExitNumber, value); err != nil { + return err + } + + case "ExitStepDetails": + if err := awsRestjson1_deserializeDocumentRouteExitStepDetails(&sv.ExitStepDetails, value); err != nil { + return err + } + + case "GeometryOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.GeometryOffset = ptr.Int32(int32(i64)) + } + + case "Instruction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Instruction = ptr.String(jtv) + } + + case "KeepStepDetails": + if err := awsRestjson1_deserializeDocumentRouteKeepStepDetails(&sv.KeepStepDetails, value); err != nil { + return err + } + + case "NextRoad": + if err := awsRestjson1_deserializeDocumentRouteRoad(&sv.NextRoad, value); err != nil { + return err + } + + case "RampStepDetails": + if err := awsRestjson1_deserializeDocumentRouteRampStepDetails(&sv.RampStepDetails, value); err != nil { + return err + } + + case "RoundaboutEnterStepDetails": + if err := awsRestjson1_deserializeDocumentRouteRoundaboutEnterStepDetails(&sv.RoundaboutEnterStepDetails, value); err != nil { + return err + } + + case "RoundaboutExitStepDetails": + if err := awsRestjson1_deserializeDocumentRouteRoundaboutExitStepDetails(&sv.RoundaboutExitStepDetails, value); err != nil { + return err + } + + case "RoundaboutPassStepDetails": + if err := awsRestjson1_deserializeDocumentRouteRoundaboutPassStepDetails(&sv.RoundaboutPassStepDetails, value); err != nil { + return err + } + + case "Signpost": + if err := awsRestjson1_deserializeDocumentRouteSignpost(&sv.Signpost, value); err != nil { + return err + } + + case "TurnStepDetails": + if err := awsRestjson1_deserializeDocumentRouteTurnStepDetails(&sv.TurnStepDetails, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteVehicleTravelStepType to be of type string, got %T instead", value) + } + sv.Type = types.RouteVehicleTravelStepType(jtv) + } + + case "UTurnStepDetails": + if err := awsRestjson1_deserializeDocumentRouteUTurnStepDetails(&sv.UTurnStepDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteVehicleTravelStepList(v *[]types.RouteVehicleTravelStep, 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.RouteVehicleTravelStep + if *v == nil { + cv = []types.RouteVehicleTravelStep{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteVehicleTravelStep + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteVehicleTravelStep(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRouteViolatedConstraints(v **types.RouteViolatedConstraints, 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.RouteViolatedConstraints + if *v == nil { + sv = &types.RouteViolatedConstraints{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllHazardsRestricted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AllHazardsRestricted = ptr.Bool(jtv) + } + + case "AxleCount": + if err := awsRestjson1_deserializeDocumentRouteNoticeDetailRange(&sv.AxleCount, value); err != nil { + return err + } + + case "HazardousCargos": + if err := awsRestjson1_deserializeDocumentRouteHazardousCargoTypeList(&sv.HazardousCargos, value); err != nil { + return err + } + + case "MaxHeight": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DimensionCentimeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxHeight = i64 + } + + case "MaxKpraLength": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DimensionCentimeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxKpraLength = i64 + } + + case "MaxLength": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DimensionCentimeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxLength = i64 + } + + case "MaxPayloadCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxPayloadCapacity = i64 + } + + case "MaxWeight": + if err := awsRestjson1_deserializeDocumentRouteWeightConstraint(&sv.MaxWeight, value); err != nil { + return err + } + + case "MaxWeightPerAxle": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxWeightPerAxle = i64 + } + + case "MaxWeightPerAxleGroup": + if err := awsRestjson1_deserializeDocumentWeightPerAxleGroup(&sv.MaxWeightPerAxleGroup, value); err != nil { + return err + } + + case "MaxWidth": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DimensionCentimeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxWidth = i64 + } + + case "Occupancy": + if err := awsRestjson1_deserializeDocumentRouteNoticeDetailRange(&sv.Occupancy, value); err != nil { + return err + } + + case "RestrictedTimes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RestrictedTimes = ptr.String(jtv) + } + + case "TimeDependent": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.TimeDependent = ptr.Bool(jtv) + } + + case "TrailerCount": + if err := awsRestjson1_deserializeDocumentRouteNoticeDetailRange(&sv.TrailerCount, value); err != nil { + return err + } + + case "TravelMode": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.TravelMode = ptr.Bool(jtv) + } + + case "TruckRoadType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TruckRoadType = ptr.String(jtv) + } + + case "TruckType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteTruckType to be of type string, got %T instead", value) + } + sv.TruckType = types.RouteTruckType(jtv) + } + + case "TunnelRestrictionCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TunnelRestrictionCode to be of type string, got %T instead", value) + } + sv.TunnelRestrictionCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteWeightConstraint(v **types.RouteWeightConstraint, 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.RouteWeightConstraint + if *v == nil { + sv = &types.RouteWeightConstraint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteWeightConstraintType to be of type string, got %T instead", value) + } + sv.Type = types.RouteWeightConstraintType(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Value = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteZone(v **types.RouteZone, 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.RouteZone + if *v == nil { + sv = &types.RouteZone{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Category": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RouteZoneCategory to be of type string, got %T instead", value) + } + sv.Category = types.RouteZoneCategory(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRouteZoneList(v *[]types.RouteZone, 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.RouteZone + if *v == nil { + cv = []types.RouteZone{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RouteZone + destAddr := &col + if err := awsRestjson1_deserializeDocumentRouteZone(&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) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTruckRoadTypeList(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 TruckRoadType to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationConnection(v **types.WaypointOptimizationConnection, 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.WaypointOptimizationConnection + if *v == nil { + sv = &types.WaypointOptimizationConnection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Distance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DistanceMeters to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Distance = i64 + } + + case "From": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WaypointId to be of type string, got %T instead", value) + } + sv.From = ptr.String(jtv) + } + + case "RestDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RestDuration = i64 + } + + case "To": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WaypointId to be of type string, got %T instead", value) + } + sv.To = ptr.String(jtv) + } + + case "TravelDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TravelDuration = i64 + } + + case "WaitDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WaitDuration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationConnectionList(v *[]types.WaypointOptimizationConnection, 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.WaypointOptimizationConnection + if *v == nil { + cv = []types.WaypointOptimizationConnection{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WaypointOptimizationConnection + destAddr := &col + if err := awsRestjson1_deserializeDocumentWaypointOptimizationConnection(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationFailedConstraint(v **types.WaypointOptimizationFailedConstraint, 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.WaypointOptimizationFailedConstraint + if *v == nil { + sv = &types.WaypointOptimizationFailedConstraint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Constraint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WaypointOptimizationConstraint to be of type string, got %T instead", value) + } + sv.Constraint = types.WaypointOptimizationConstraint(jtv) + } + + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Reason = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationFailedConstraintList(v *[]types.WaypointOptimizationFailedConstraint, 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.WaypointOptimizationFailedConstraint + if *v == nil { + cv = []types.WaypointOptimizationFailedConstraint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WaypointOptimizationFailedConstraint + destAddr := &col + if err := awsRestjson1_deserializeDocumentWaypointOptimizationFailedConstraint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationImpedingWaypoint(v **types.WaypointOptimizationImpedingWaypoint, 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.WaypointOptimizationImpedingWaypoint + if *v == nil { + sv = &types.WaypointOptimizationImpedingWaypoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FailedConstraints": + if err := awsRestjson1_deserializeDocumentWaypointOptimizationFailedConstraintList(&sv.FailedConstraints, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WaypointId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationImpedingWaypointList(v *[]types.WaypointOptimizationImpedingWaypoint, 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.WaypointOptimizationImpedingWaypoint + if *v == nil { + cv = []types.WaypointOptimizationImpedingWaypoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WaypointOptimizationImpedingWaypoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentWaypointOptimizationImpedingWaypoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationOptimizedWaypoint(v **types.WaypointOptimizationOptimizedWaypoint, 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.WaypointOptimizationOptimizedWaypoint + if *v == nil { + sv = &types.WaypointOptimizationOptimizedWaypoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ArrivalTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.ArrivalTime = ptr.String(jtv) + } + + case "DepartureTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampWithTimezoneOffset to be of type string, got %T instead", value) + } + sv.DepartureTime = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WaypointId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Position": + if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationOptimizedWaypointList(v *[]types.WaypointOptimizationOptimizedWaypoint, 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.WaypointOptimizationOptimizedWaypoint + if *v == nil { + cv = []types.WaypointOptimizationOptimizedWaypoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WaypointOptimizationOptimizedWaypoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentWaypointOptimizationOptimizedWaypoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWaypointOptimizationTimeBreakdown(v **types.WaypointOptimizationTimeBreakdown, 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.WaypointOptimizationTimeBreakdown + if *v == nil { + sv = &types.WaypointOptimizationTimeBreakdown{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RestDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RestDuration = i64 + } + + case "ServiceDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ServiceDuration = i64 + } + + case "TravelDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TravelDuration = i64 + } + + case "WaitDuration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WaitDuration = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWeightPerAxleGroup(v **types.WeightPerAxleGroup, 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.WeightPerAxleGroup + if *v == nil { + sv = &types.WeightPerAxleGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Quad": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Quad = i64 + } + + case "Quint": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Quint = i64 + } + + case "Single": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Single = i64 + } + + case "Tandem": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Tandem = i64 + } + + case "Triple": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WeightKilograms to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Triple = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/georoutes/doc.go b/service/georoutes/doc.go new file mode 100644 index 00000000000..83a39df64d5 --- /dev/null +++ b/service/georoutes/doc.go @@ -0,0 +1,23 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package georoutes provides the API client, operations, and parameter types for +// Amazon Location Service Routes V2. +// +// With the Amazon Location Routes API you can calculate routes and estimate +// travel time based on up-to-date road network and live traffic information. +// +// Calculate optimal travel routes and estimate travel times using up-to-date road +// network and traffic data. Key features include: +// +// - Point-to-point routing with estimated travel time, distance, and +// turn-by-turn directions +// +// - Multi-point route optimization to minimize travel time or distance +// +// - Route matrices for efficient multi-destination planning +// +// - Isoline calculations to determine reachable areas within specified time or +// distance thresholds +// +// - Map-matching to align GPS traces with the road network +package georoutes diff --git a/service/georoutes/endpoints.go b/service/georoutes/endpoints.go new file mode 100644 index 00000000000..92df51e8e9b --- /dev/null +++ b/service/georoutes/endpoints.go @@ -0,0 +1,741 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/georoutes/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "geo-routes" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_GEO_ROUTES") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Geo Routes", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _PartitionResult.Name == "aws" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == true { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws" { + if _UseFIPS == false { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == true { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo-fips.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == true { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo-fips.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://routes.geo.") + out.WriteString(_Region) + out.WriteString(".us-gov.") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + out.WriteString("/v2") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-routes-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _UseDualStack == false { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-routes-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + } + if _UseFIPS == false { + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-routes.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://geo-routes.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + params.Region = bindRegion(options.Region) + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/georoutes/endpoints_config_test.go b/service/georoutes/endpoints_config_test.go new file mode 100644 index 00000000000..92ce305280e --- /dev/null +++ b/service/georoutes/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-routes.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-geo-routes.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-routes.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-routes.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-routes.dev", + expectURL: aws.String("https://env-geo-routes.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-routes.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-routes.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-geo-routes.dev", + expectURL: aws.String("http://config-geo-routes.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-geo-routes.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-geo-routes.dev", + clientEndpoint: aws.String("https://client-geo-routes.dev"), + expectURL: aws.String("https://client-geo-routes.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_GEO_ROUTES", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/georoutes/endpoints_test.go b/service/georoutes/endpoints_test.go new file mode 100644 index 00000000000..5943a7745d0 --- /dev/null +++ b/service/georoutes/endpoints_test.go @@ -0,0 +1,1006 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For custom endpoint with region not set and fips disabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For custom endpoint with fips disabled and dualstack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo-fips.us-east-1.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo-fips.us-east-1.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo.us-east-1.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo.us-east-1.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack enabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes-fips.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack disabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes-fips.cn-northwest-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack enabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack disabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes.cn-northwest-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo-fips.us-gov-west-1.us-gov.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo-fips.us-gov-west-1.us-gov.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo.us-gov-west-1.us-gov.api.aws/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://routes.geo.us-gov-west-1.us-gov.amazonaws.com/v2") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase17(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase18(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase19(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase20(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase22(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase23(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes-fips.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase25(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase26(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack enabled +func TestEndpointCase27(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack disabled +func TestEndpointCase28(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes-fips.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack enabled +func TestEndpointCase29(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack disabled +func TestEndpointCase30(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://geo-routes.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// Missing region +func TestEndpointCase31(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/georoutes/generated.json b/service/georoutes/generated.json new file mode 100644 index 00000000000..447c43abae0 --- /dev/null +++ b/service/georoutes/generated.json @@ -0,0 +1,37 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CalculateIsolines.go", + "api_op_CalculateRouteMatrix.go", + "api_op_CalculateRoutes.go", + "api_op_OptimizeWaypoints.go", + "api_op_SnapToRoads.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/georoutes", + "unstable": false +} diff --git a/service/georoutes/go.mod b/service/georoutes/go.mod new file mode 100644 index 00000000000..e9d2dc3fcdb --- /dev/null +++ b/service/georoutes/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/georoutes + +go 1.21 + +require ( + github.com/aws/aws-sdk-go-v2 v1.32.3 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 + github.com/aws/smithy-go v1.22.0 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/georoutes/go.sum b/service/georoutes/go.sum new file mode 100644 index 00000000000..70a20636e37 --- /dev/null +++ b/service/georoutes/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/georoutes/go_module_metadata.go b/service/georoutes/go_module_metadata.go new file mode 100644 index 00000000000..301cd59a6c3 --- /dev/null +++ b/service/georoutes/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package georoutes + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/georoutes/internal/endpoints/endpoints.go b/service/georoutes/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..cf7fc0a157c --- /dev/null +++ b/service/georoutes/internal/endpoints/endpoints.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Geo Routes endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-routes.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-routes-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-routes-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-routes.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-routes.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-routes-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-routes-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-routes.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-routes-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-routes.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-routes-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-routes.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-routes-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-routes.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-routes-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-routes.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "geo-routes.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "geo-routes-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "geo-routes-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "geo-routes.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/georoutes/internal/endpoints/endpoints_test.go b/service/georoutes/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/georoutes/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/georoutes/options.go b/service/georoutes/options.go new file mode 100644 index 00000000000..53c1b306080 --- /dev/null +++ b/service/georoutes/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/service/georoutes/protocol_test.go b/service/georoutes/protocol_test.go new file mode 100644 index 00000000000..15e45a9420a --- /dev/null +++ b/service/georoutes/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes diff --git a/service/georoutes/serializers.go b/service/georoutes/serializers.go new file mode 100644 index 00000000000..af23940db9c --- /dev/null +++ b/service/georoutes/serializers.go @@ -0,0 +1,4096 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "math" +) + +type awsRestjson1_serializeOpCalculateIsolines struct { +} + +func (*awsRestjson1_serializeOpCalculateIsolines) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCalculateIsolines) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CalculateIsolinesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/isolines") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCalculateIsolinesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCalculateIsolinesInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCalculateIsolinesInput(v *CalculateIsolinesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCalculateIsolinesInput(v *CalculateIsolinesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Allow != nil { + ok := object.Key("Allow") + if err := awsRestjson1_serializeDocumentIsolineAllowOptions(v.Allow, ok); err != nil { + return err + } + } + + if v.ArrivalTime != nil { + ok := object.Key("ArrivalTime") + ok.String(*v.ArrivalTime) + } + + if v.Avoid != nil { + ok := object.Key("Avoid") + if err := awsRestjson1_serializeDocumentIsolineAvoidanceOptions(v.Avoid, ok); err != nil { + return err + } + } + + if v.DepartNow != nil { + ok := object.Key("DepartNow") + ok.Boolean(*v.DepartNow) + } + + if v.DepartureTime != nil { + ok := object.Key("DepartureTime") + ok.String(*v.DepartureTime) + } + + if v.Destination != nil { + ok := object.Key("Destination") + if err := awsRestjson1_serializeDocumentPosition(v.Destination, ok); err != nil { + return err + } + } + + if v.DestinationOptions != nil { + ok := object.Key("DestinationOptions") + if err := awsRestjson1_serializeDocumentIsolineDestinationOptions(v.DestinationOptions, ok); err != nil { + return err + } + } + + if len(v.IsolineGeometryFormat) > 0 { + ok := object.Key("IsolineGeometryFormat") + ok.String(string(v.IsolineGeometryFormat)) + } + + if v.IsolineGranularity != nil { + ok := object.Key("IsolineGranularity") + if err := awsRestjson1_serializeDocumentIsolineGranularityOptions(v.IsolineGranularity, ok); err != nil { + return err + } + } + + if len(v.OptimizeIsolineFor) > 0 { + ok := object.Key("OptimizeIsolineFor") + ok.String(string(v.OptimizeIsolineFor)) + } + + if len(v.OptimizeRoutingFor) > 0 { + ok := object.Key("OptimizeRoutingFor") + ok.String(string(v.OptimizeRoutingFor)) + } + + if v.Origin != nil { + ok := object.Key("Origin") + if err := awsRestjson1_serializeDocumentPosition(v.Origin, ok); err != nil { + return err + } + } + + if v.OriginOptions != nil { + ok := object.Key("OriginOptions") + if err := awsRestjson1_serializeDocumentIsolineOriginOptions(v.OriginOptions, ok); err != nil { + return err + } + } + + if v.Thresholds != nil { + ok := object.Key("Thresholds") + if err := awsRestjson1_serializeDocumentIsolineThresholds(v.Thresholds, ok); err != nil { + return err + } + } + + if v.Traffic != nil { + ok := object.Key("Traffic") + if err := awsRestjson1_serializeDocumentIsolineTrafficOptions(v.Traffic, ok); err != nil { + return err + } + } + + if len(v.TravelMode) > 0 { + ok := object.Key("TravelMode") + ok.String(string(v.TravelMode)) + } + + if v.TravelModeOptions != nil { + ok := object.Key("TravelModeOptions") + if err := awsRestjson1_serializeDocumentIsolineTravelModeOptions(v.TravelModeOptions, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCalculateRouteMatrix struct { +} + +func (*awsRestjson1_serializeOpCalculateRouteMatrix) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCalculateRouteMatrix) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CalculateRouteMatrixInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/route-matrix") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCalculateRouteMatrixInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCalculateRouteMatrixInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCalculateRouteMatrixInput(v *CalculateRouteMatrixInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCalculateRouteMatrixInput(v *CalculateRouteMatrixInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Allow != nil { + ok := object.Key("Allow") + if err := awsRestjson1_serializeDocumentRouteMatrixAllowOptions(v.Allow, ok); err != nil { + return err + } + } + + if v.Avoid != nil { + ok := object.Key("Avoid") + if err := awsRestjson1_serializeDocumentRouteMatrixAvoidanceOptions(v.Avoid, ok); err != nil { + return err + } + } + + if v.DepartNow != nil { + ok := object.Key("DepartNow") + ok.Boolean(*v.DepartNow) + } + + if v.DepartureTime != nil { + ok := object.Key("DepartureTime") + ok.String(*v.DepartureTime) + } + + if v.Destinations != nil { + ok := object.Key("Destinations") + if err := awsRestjson1_serializeDocumentRouteMatrixDestinationList(v.Destinations, ok); err != nil { + return err + } + } + + if v.Exclude != nil { + ok := object.Key("Exclude") + if err := awsRestjson1_serializeDocumentRouteMatrixExclusionOptions(v.Exclude, ok); err != nil { + return err + } + } + + if len(v.OptimizeRoutingFor) > 0 { + ok := object.Key("OptimizeRoutingFor") + ok.String(string(v.OptimizeRoutingFor)) + } + + if v.Origins != nil { + ok := object.Key("Origins") + if err := awsRestjson1_serializeDocumentRouteMatrixOriginList(v.Origins, ok); err != nil { + return err + } + } + + if v.RoutingBoundary != nil { + ok := object.Key("RoutingBoundary") + if err := awsRestjson1_serializeDocumentRouteMatrixBoundary(v.RoutingBoundary, ok); err != nil { + return err + } + } + + if v.Traffic != nil { + ok := object.Key("Traffic") + if err := awsRestjson1_serializeDocumentRouteMatrixTrafficOptions(v.Traffic, ok); err != nil { + return err + } + } + + if len(v.TravelMode) > 0 { + ok := object.Key("TravelMode") + ok.String(string(v.TravelMode)) + } + + if v.TravelModeOptions != nil { + ok := object.Key("TravelModeOptions") + if err := awsRestjson1_serializeDocumentRouteMatrixTravelModeOptions(v.TravelModeOptions, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCalculateRoutes struct { +} + +func (*awsRestjson1_serializeOpCalculateRoutes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCalculateRoutes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CalculateRoutesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/routes") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCalculateRoutesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCalculateRoutesInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCalculateRoutesInput(v *CalculateRoutesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCalculateRoutesInput(v *CalculateRoutesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Allow != nil { + ok := object.Key("Allow") + if err := awsRestjson1_serializeDocumentRouteAllowOptions(v.Allow, ok); err != nil { + return err + } + } + + if v.ArrivalTime != nil { + ok := object.Key("ArrivalTime") + ok.String(*v.ArrivalTime) + } + + if v.Avoid != nil { + ok := object.Key("Avoid") + if err := awsRestjson1_serializeDocumentRouteAvoidanceOptions(v.Avoid, ok); err != nil { + return err + } + } + + if v.DepartNow != nil { + ok := object.Key("DepartNow") + ok.Boolean(*v.DepartNow) + } + + if v.DepartureTime != nil { + ok := object.Key("DepartureTime") + ok.String(*v.DepartureTime) + } + + if v.Destination != nil { + ok := object.Key("Destination") + if err := awsRestjson1_serializeDocumentPosition(v.Destination, ok); err != nil { + return err + } + } + + if v.DestinationOptions != nil { + ok := object.Key("DestinationOptions") + if err := awsRestjson1_serializeDocumentRouteDestinationOptions(v.DestinationOptions, ok); err != nil { + return err + } + } + + if v.Driver != nil { + ok := object.Key("Driver") + if err := awsRestjson1_serializeDocumentRouteDriverOptions(v.Driver, ok); err != nil { + return err + } + } + + if v.Exclude != nil { + ok := object.Key("Exclude") + if err := awsRestjson1_serializeDocumentRouteExclusionOptions(v.Exclude, ok); err != nil { + return err + } + } + + if len(v.InstructionsMeasurementSystem) > 0 { + ok := object.Key("InstructionsMeasurementSystem") + ok.String(string(v.InstructionsMeasurementSystem)) + } + + if v.Languages != nil { + ok := object.Key("Languages") + if err := awsRestjson1_serializeDocumentLanguageTagList(v.Languages, ok); err != nil { + return err + } + } + + if v.LegAdditionalFeatures != nil { + ok := object.Key("LegAdditionalFeatures") + if err := awsRestjson1_serializeDocumentRouteLegAdditionalFeatureList(v.LegAdditionalFeatures, ok); err != nil { + return err + } + } + + if len(v.LegGeometryFormat) > 0 { + ok := object.Key("LegGeometryFormat") + ok.String(string(v.LegGeometryFormat)) + } + + if v.MaxAlternatives != nil { + ok := object.Key("MaxAlternatives") + ok.Integer(*v.MaxAlternatives) + } + + if len(v.OptimizeRoutingFor) > 0 { + ok := object.Key("OptimizeRoutingFor") + ok.String(string(v.OptimizeRoutingFor)) + } + + if v.Origin != nil { + ok := object.Key("Origin") + if err := awsRestjson1_serializeDocumentPosition(v.Origin, ok); err != nil { + return err + } + } + + if v.OriginOptions != nil { + ok := object.Key("OriginOptions") + if err := awsRestjson1_serializeDocumentRouteOriginOptions(v.OriginOptions, ok); err != nil { + return err + } + } + + if v.SpanAdditionalFeatures != nil { + ok := object.Key("SpanAdditionalFeatures") + if err := awsRestjson1_serializeDocumentRouteSpanAdditionalFeatureList(v.SpanAdditionalFeatures, ok); err != nil { + return err + } + } + + if v.Tolls != nil { + ok := object.Key("Tolls") + if err := awsRestjson1_serializeDocumentRouteTollOptions(v.Tolls, ok); err != nil { + return err + } + } + + if v.Traffic != nil { + ok := object.Key("Traffic") + if err := awsRestjson1_serializeDocumentRouteTrafficOptions(v.Traffic, ok); err != nil { + return err + } + } + + if len(v.TravelMode) > 0 { + ok := object.Key("TravelMode") + ok.String(string(v.TravelMode)) + } + + if v.TravelModeOptions != nil { + ok := object.Key("TravelModeOptions") + if err := awsRestjson1_serializeDocumentRouteTravelModeOptions(v.TravelModeOptions, ok); err != nil { + return err + } + } + + if len(v.TravelStepType) > 0 { + ok := object.Key("TravelStepType") + ok.String(string(v.TravelStepType)) + } + + if v.Waypoints != nil { + ok := object.Key("Waypoints") + if err := awsRestjson1_serializeDocumentRouteWaypointList(v.Waypoints, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpOptimizeWaypoints struct { +} + +func (*awsRestjson1_serializeOpOptimizeWaypoints) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpOptimizeWaypoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*OptimizeWaypointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/optimize-waypoints") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsOptimizeWaypointsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentOptimizeWaypointsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsOptimizeWaypointsInput(v *OptimizeWaypointsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentOptimizeWaypointsInput(v *OptimizeWaypointsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Avoid != nil { + ok := object.Key("Avoid") + if err := awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceOptions(v.Avoid, ok); err != nil { + return err + } + } + + if v.DepartureTime != nil { + ok := object.Key("DepartureTime") + ok.String(*v.DepartureTime) + } + + if v.Destination != nil { + ok := object.Key("Destination") + if err := awsRestjson1_serializeDocumentPosition(v.Destination, ok); err != nil { + return err + } + } + + if v.DestinationOptions != nil { + ok := object.Key("DestinationOptions") + if err := awsRestjson1_serializeDocumentWaypointOptimizationDestinationOptions(v.DestinationOptions, ok); err != nil { + return err + } + } + + if v.Driver != nil { + ok := object.Key("Driver") + if err := awsRestjson1_serializeDocumentWaypointOptimizationDriverOptions(v.Driver, ok); err != nil { + return err + } + } + + if v.Exclude != nil { + ok := object.Key("Exclude") + if err := awsRestjson1_serializeDocumentWaypointOptimizationExclusionOptions(v.Exclude, ok); err != nil { + return err + } + } + + if len(v.OptimizeSequencingFor) > 0 { + ok := object.Key("OptimizeSequencingFor") + ok.String(string(v.OptimizeSequencingFor)) + } + + if v.Origin != nil { + ok := object.Key("Origin") + if err := awsRestjson1_serializeDocumentPosition(v.Origin, ok); err != nil { + return err + } + } + + if v.OriginOptions != nil { + ok := object.Key("OriginOptions") + if err := awsRestjson1_serializeDocumentWaypointOptimizationOriginOptions(v.OriginOptions, ok); err != nil { + return err + } + } + + if v.Traffic != nil { + ok := object.Key("Traffic") + if err := awsRestjson1_serializeDocumentWaypointOptimizationTrafficOptions(v.Traffic, ok); err != nil { + return err + } + } + + if len(v.TravelMode) > 0 { + ok := object.Key("TravelMode") + ok.String(string(v.TravelMode)) + } + + if v.TravelModeOptions != nil { + ok := object.Key("TravelModeOptions") + if err := awsRestjson1_serializeDocumentWaypointOptimizationTravelModeOptions(v.TravelModeOptions, ok); err != nil { + return err + } + } + + if v.Waypoints != nil { + ok := object.Key("Waypoints") + if err := awsRestjson1_serializeDocumentWaypointOptimizationWaypointList(v.Waypoints, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSnapToRoads struct { +} + +func (*awsRestjson1_serializeOpSnapToRoads) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSnapToRoads) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*SnapToRoadsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/snap-to-roads") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSnapToRoadsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSnapToRoadsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSnapToRoadsInput(v *SnapToRoadsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Key != nil { + encoder.SetQuery("key").String(*v.Key) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSnapToRoadsInput(v *SnapToRoadsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.SnappedGeometryFormat) > 0 { + ok := object.Key("SnappedGeometryFormat") + ok.String(string(v.SnappedGeometryFormat)) + } + + if v.SnapRadius != 0 { + ok := object.Key("SnapRadius") + ok.Long(v.SnapRadius) + } + + if v.TracePoints != nil { + ok := object.Key("TracePoints") + if err := awsRestjson1_serializeDocumentRoadSnapTracePointList(v.TracePoints, ok); err != nil { + return err + } + } + + if len(v.TravelMode) > 0 { + ok := object.Key("TravelMode") + ok.String(string(v.TravelMode)) + } + + if v.TravelModeOptions != nil { + ok := object.Key("TravelModeOptions") + if err := awsRestjson1_serializeDocumentRoadSnapTravelModeOptions(v.TravelModeOptions, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentBeforeWaypointsList(v []int32, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.Integer(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentBoundingBox(v []float64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + switch { + case math.IsNaN(v[i]): + av.String("NaN") + + case math.IsInf(v[i], 1): + av.String("Infinity") + + case math.IsInf(v[i], -1): + av.String("-Infinity") + + default: + av.Double(v[i]) + + } + } + return nil +} + +func awsRestjson1_serializeDocumentCircle(v *types.Circle, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Center != nil { + ok := object.Key("Center") + if err := awsRestjson1_serializeDocumentPosition(v.Center, ok); err != nil { + return err + } + } + + if v.Radius != nil { + ok := object.Key("Radius") + switch { + case math.IsNaN(*v.Radius): + ok.String("NaN") + + case math.IsInf(*v.Radius, 1): + ok.String("Infinity") + + case math.IsInf(*v.Radius, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Radius) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCorridor(v *types.Corridor, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LineString != nil { + ok := object.Key("LineString") + if err := awsRestjson1_serializeDocumentLineString(v.LineString, ok); err != nil { + return err + } + } + + if v.Radius != nil { + ok := object.Key("Radius") + ok.Integer(*v.Radius) + } + + return nil +} + +func awsRestjson1_serializeDocumentCountryCodeList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentDistanceThresholdList(v []int64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.Long(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentIsolineAllowOptions(v *types.IsolineAllowOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Hot != nil { + ok := object.Key("Hot") + ok.Boolean(*v.Hot) + } + + if v.Hov != nil { + ok := object.Key("Hov") + ok.Boolean(*v.Hov) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineAvoidanceArea(v *types.IsolineAvoidanceArea, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Except != nil { + ok := object.Key("Except") + if err := awsRestjson1_serializeDocumentIsolineAvoidanceAreaGeometryList(v.Except, ok); err != nil { + return err + } + } + + if v.Geometry != nil { + ok := object.Key("Geometry") + if err := awsRestjson1_serializeDocumentIsolineAvoidanceAreaGeometry(v.Geometry, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineAvoidanceAreaGeometry(v *types.IsolineAvoidanceAreaGeometry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.Corridor != nil { + ok := object.Key("Corridor") + if err := awsRestjson1_serializeDocumentCorridor(v.Corridor, ok); err != nil { + return err + } + } + + if v.Polygon != nil { + ok := object.Key("Polygon") + if err := awsRestjson1_serializeDocumentLinearRings(v.Polygon, ok); err != nil { + return err + } + } + + if v.PolylineCorridor != nil { + ok := object.Key("PolylineCorridor") + if err := awsRestjson1_serializeDocumentPolylineCorridor(v.PolylineCorridor, ok); err != nil { + return err + } + } + + if v.PolylinePolygon != nil { + ok := object.Key("PolylinePolygon") + if err := awsRestjson1_serializeDocumentPolylineRingList(v.PolylinePolygon, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineAvoidanceAreaGeometryList(v []types.IsolineAvoidanceAreaGeometry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentIsolineAvoidanceAreaGeometry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentIsolineAvoidanceAreaList(v []types.IsolineAvoidanceArea, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentIsolineAvoidanceArea(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentIsolineAvoidanceOptions(v *types.IsolineAvoidanceOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Areas != nil { + ok := object.Key("Areas") + if err := awsRestjson1_serializeDocumentIsolineAvoidanceAreaList(v.Areas, ok); err != nil { + return err + } + } + + if v.CarShuttleTrains != nil { + ok := object.Key("CarShuttleTrains") + ok.Boolean(*v.CarShuttleTrains) + } + + if v.ControlledAccessHighways != nil { + ok := object.Key("ControlledAccessHighways") + ok.Boolean(*v.ControlledAccessHighways) + } + + if v.DirtRoads != nil { + ok := object.Key("DirtRoads") + ok.Boolean(*v.DirtRoads) + } + + if v.Ferries != nil { + ok := object.Key("Ferries") + ok.Boolean(*v.Ferries) + } + + if v.SeasonalClosure != nil { + ok := object.Key("SeasonalClosure") + ok.Boolean(*v.SeasonalClosure) + } + + if v.TollRoads != nil { + ok := object.Key("TollRoads") + ok.Boolean(*v.TollRoads) + } + + if v.TollTransponders != nil { + ok := object.Key("TollTransponders") + ok.Boolean(*v.TollTransponders) + } + + if v.TruckRoadTypes != nil { + ok := object.Key("TruckRoadTypes") + if err := awsRestjson1_serializeDocumentTruckRoadTypeList(v.TruckRoadTypes, ok); err != nil { + return err + } + } + + if v.Tunnels != nil { + ok := object.Key("Tunnels") + ok.Boolean(*v.Tunnels) + } + + if v.UTurns != nil { + ok := object.Key("UTurns") + ok.Boolean(*v.UTurns) + } + + if v.ZoneCategories != nil { + ok := object.Key("ZoneCategories") + if err := awsRestjson1_serializeDocumentIsolineAvoidanceZoneCategoryList(v.ZoneCategories, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineAvoidanceZoneCategory(v *types.IsolineAvoidanceZoneCategory, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Category) > 0 { + ok := object.Key("Category") + ok.String(string(v.Category)) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineAvoidanceZoneCategoryList(v []types.IsolineAvoidanceZoneCategory, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentIsolineAvoidanceZoneCategory(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentIsolineCarOptions(v *types.IsolineCarOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.EngineType) > 0 { + ok := object.Key("EngineType") + ok.String(string(v.EngineType)) + } + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentIsolineVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineDestinationOptions(v *types.IsolineDestinationOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AvoidActionsForDistance != 0 { + ok := object.Key("AvoidActionsForDistance") + ok.Long(v.AvoidActionsForDistance) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Matching != nil { + ok := object.Key("Matching") + if err := awsRestjson1_serializeDocumentIsolineMatchingOptions(v.Matching, ok); err != nil { + return err + } + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentIsolineSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineGranularityOptions(v *types.IsolineGranularityOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxPoints != nil { + ok := object.Key("MaxPoints") + ok.Integer(*v.MaxPoints) + } + + if v.MaxResolution != 0 { + ok := object.Key("MaxResolution") + ok.Long(v.MaxResolution) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineHazardousCargoTypeList(v []types.IsolineHazardousCargoType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentIsolineMatchingOptions(v *types.IsolineMatchingOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NameHint != nil { + ok := object.Key("NameHint") + ok.String(*v.NameHint) + } + + if v.OnRoadThreshold != 0 { + ok := object.Key("OnRoadThreshold") + ok.Long(v.OnRoadThreshold) + } + + if v.Radius != 0 { + ok := object.Key("Radius") + ok.Long(v.Radius) + } + + if len(v.Strategy) > 0 { + ok := object.Key("Strategy") + ok.String(string(v.Strategy)) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineOriginOptions(v *types.IsolineOriginOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AvoidActionsForDistance != 0 { + ok := object.Key("AvoidActionsForDistance") + ok.Long(v.AvoidActionsForDistance) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Matching != nil { + ok := object.Key("Matching") + if err := awsRestjson1_serializeDocumentIsolineMatchingOptions(v.Matching, ok); err != nil { + return err + } + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentIsolineSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineScooterOptions(v *types.IsolineScooterOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.EngineType) > 0 { + ok := object.Key("EngineType") + ok.String(string(v.EngineType)) + } + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentIsolineVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineSideOfStreetOptions(v *types.IsolineSideOfStreetOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + if len(v.UseWith) > 0 { + ok := object.Key("UseWith") + ok.String(string(v.UseWith)) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineThresholds(v *types.IsolineThresholds, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Distance != nil { + ok := object.Key("Distance") + if err := awsRestjson1_serializeDocumentDistanceThresholdList(v.Distance, ok); err != nil { + return err + } + } + + if v.Time != nil { + ok := object.Key("Time") + if err := awsRestjson1_serializeDocumentTimeThresholdList(v.Time, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineTrafficOptions(v *types.IsolineTrafficOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FlowEventThresholdOverride != 0 { + ok := object.Key("FlowEventThresholdOverride") + ok.Long(v.FlowEventThresholdOverride) + } + + if len(v.Usage) > 0 { + ok := object.Key("Usage") + ok.String(string(v.Usage)) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineTrailerOptions(v *types.IsolineTrailerOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AxleCount != nil { + ok := object.Key("AxleCount") + ok.Integer(*v.AxleCount) + } + + if v.TrailerCount != nil { + ok := object.Key("TrailerCount") + ok.Integer(*v.TrailerCount) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineTravelModeOptions(v *types.IsolineTravelModeOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Car != nil { + ok := object.Key("Car") + if err := awsRestjson1_serializeDocumentIsolineCarOptions(v.Car, ok); err != nil { + return err + } + } + + if v.Scooter != nil { + ok := object.Key("Scooter") + if err := awsRestjson1_serializeDocumentIsolineScooterOptions(v.Scooter, ok); err != nil { + return err + } + } + + if v.Truck != nil { + ok := object.Key("Truck") + if err := awsRestjson1_serializeDocumentIsolineTruckOptions(v.Truck, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineTruckOptions(v *types.IsolineTruckOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AxleCount != nil { + ok := object.Key("AxleCount") + ok.Integer(*v.AxleCount) + } + + if len(v.EngineType) > 0 { + ok := object.Key("EngineType") + ok.String(string(v.EngineType)) + } + + if v.GrossWeight != 0 { + ok := object.Key("GrossWeight") + ok.Long(v.GrossWeight) + } + + if v.HazardousCargos != nil { + ok := object.Key("HazardousCargos") + if err := awsRestjson1_serializeDocumentIsolineHazardousCargoTypeList(v.HazardousCargos, ok); err != nil { + return err + } + } + + if v.Height != 0 { + ok := object.Key("Height") + ok.Long(v.Height) + } + + if v.HeightAboveFirstAxle != 0 { + ok := object.Key("HeightAboveFirstAxle") + ok.Long(v.HeightAboveFirstAxle) + } + + if v.KpraLength != 0 { + ok := object.Key("KpraLength") + ok.Long(v.KpraLength) + } + + if v.Length != 0 { + ok := object.Key("Length") + ok.Long(v.Length) + } + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentIsolineVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + if v.PayloadCapacity != 0 { + ok := object.Key("PayloadCapacity") + ok.Long(v.PayloadCapacity) + } + + if v.TireCount != nil { + ok := object.Key("TireCount") + ok.Integer(*v.TireCount) + } + + if v.Trailer != nil { + ok := object.Key("Trailer") + if err := awsRestjson1_serializeDocumentIsolineTrailerOptions(v.Trailer, ok); err != nil { + return err + } + } + + if len(v.TruckType) > 0 { + ok := object.Key("TruckType") + ok.String(string(v.TruckType)) + } + + if v.TunnelRestrictionCode != nil { + ok := object.Key("TunnelRestrictionCode") + ok.String(*v.TunnelRestrictionCode) + } + + if v.WeightPerAxle != 0 { + ok := object.Key("WeightPerAxle") + ok.Long(v.WeightPerAxle) + } + + if v.WeightPerAxleGroup != nil { + ok := object.Key("WeightPerAxleGroup") + if err := awsRestjson1_serializeDocumentWeightPerAxleGroup(v.WeightPerAxleGroup, ok); err != nil { + return err + } + } + + if v.Width != 0 { + ok := object.Key("Width") + ok.Long(v.Width) + } + + return nil +} + +func awsRestjson1_serializeDocumentIsolineVehicleLicensePlate(v *types.IsolineVehicleLicensePlate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LastCharacter != nil { + ok := object.Key("LastCharacter") + ok.String(*v.LastCharacter) + } + + return nil +} + +func awsRestjson1_serializeDocumentLanguageTagList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentLinearRing(v [][]float64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentPosition(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentLinearRings(v [][][]float64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentLinearRing(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentLineString(v [][]float64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentPosition(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentPolylineCorridor(v *types.PolylineCorridor, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Polyline != nil { + ok := object.Key("Polyline") + ok.String(*v.Polyline) + } + + if v.Radius != nil { + ok := object.Key("Radius") + ok.Integer(*v.Radius) + } + + return nil +} + +func awsRestjson1_serializeDocumentPolylineRingList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentPosition(v []float64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + switch { + case math.IsNaN(v[i]): + av.String("NaN") + + case math.IsInf(v[i], 1): + av.String("Infinity") + + case math.IsInf(v[i], -1): + av.String("-Infinity") + + default: + av.Double(v[i]) + + } + } + return nil +} + +func awsRestjson1_serializeDocumentRoadSnapHazardousCargoTypeList(v []types.RoadSnapHazardousCargoType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentRoadSnapTracePoint(v *types.RoadSnapTracePoint, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + if v.Speed != 0 { + ok := object.Key("Speed") + switch { + case math.IsNaN(v.Speed): + ok.String("NaN") + + case math.IsInf(v.Speed, 1): + ok.String("Infinity") + + case math.IsInf(v.Speed, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Speed) + + } + } + + if v.Timestamp != nil { + ok := object.Key("Timestamp") + ok.String(*v.Timestamp) + } + + return nil +} + +func awsRestjson1_serializeDocumentRoadSnapTracePointList(v []types.RoadSnapTracePoint, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRoadSnapTracePoint(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRoadSnapTrailerOptions(v *types.RoadSnapTrailerOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TrailerCount != nil { + ok := object.Key("TrailerCount") + ok.Integer(*v.TrailerCount) + } + + return nil +} + +func awsRestjson1_serializeDocumentRoadSnapTravelModeOptions(v *types.RoadSnapTravelModeOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Truck != nil { + ok := object.Key("Truck") + if err := awsRestjson1_serializeDocumentRoadSnapTruckOptions(v.Truck, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRoadSnapTruckOptions(v *types.RoadSnapTruckOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GrossWeight != 0 { + ok := object.Key("GrossWeight") + ok.Long(v.GrossWeight) + } + + if v.HazardousCargos != nil { + ok := object.Key("HazardousCargos") + if err := awsRestjson1_serializeDocumentRoadSnapHazardousCargoTypeList(v.HazardousCargos, ok); err != nil { + return err + } + } + + if v.Height != 0 { + ok := object.Key("Height") + ok.Long(v.Height) + } + + if v.Length != 0 { + ok := object.Key("Length") + ok.Long(v.Length) + } + + if v.Trailer != nil { + ok := object.Key("Trailer") + if err := awsRestjson1_serializeDocumentRoadSnapTrailerOptions(v.Trailer, ok); err != nil { + return err + } + } + + if v.TunnelRestrictionCode != nil { + ok := object.Key("TunnelRestrictionCode") + ok.String(*v.TunnelRestrictionCode) + } + + if v.Width != 0 { + ok := object.Key("Width") + ok.Long(v.Width) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteAllowOptions(v *types.RouteAllowOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Hot != nil { + ok := object.Key("Hot") + ok.Boolean(*v.Hot) + } + + if v.Hov != nil { + ok := object.Key("Hov") + ok.Boolean(*v.Hov) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteAvoidanceArea(v *types.RouteAvoidanceArea, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Except != nil { + ok := object.Key("Except") + if err := awsRestjson1_serializeDocumentRouteAvoidanceAreaGeometryList(v.Except, ok); err != nil { + return err + } + } + + if v.Geometry != nil { + ok := object.Key("Geometry") + if err := awsRestjson1_serializeDocumentRouteAvoidanceAreaGeometry(v.Geometry, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteAvoidanceAreaGeometry(v *types.RouteAvoidanceAreaGeometry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.Corridor != nil { + ok := object.Key("Corridor") + if err := awsRestjson1_serializeDocumentCorridor(v.Corridor, ok); err != nil { + return err + } + } + + if v.Polygon != nil { + ok := object.Key("Polygon") + if err := awsRestjson1_serializeDocumentLinearRings(v.Polygon, ok); err != nil { + return err + } + } + + if v.PolylineCorridor != nil { + ok := object.Key("PolylineCorridor") + if err := awsRestjson1_serializeDocumentPolylineCorridor(v.PolylineCorridor, ok); err != nil { + return err + } + } + + if v.PolylinePolygon != nil { + ok := object.Key("PolylinePolygon") + if err := awsRestjson1_serializeDocumentPolylineRingList(v.PolylinePolygon, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteAvoidanceAreaGeometryList(v []types.RouteAvoidanceAreaGeometry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteAvoidanceAreaGeometry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteAvoidanceAreaList(v []types.RouteAvoidanceArea, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteAvoidanceArea(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteAvoidanceOptions(v *types.RouteAvoidanceOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Areas != nil { + ok := object.Key("Areas") + if err := awsRestjson1_serializeDocumentRouteAvoidanceAreaList(v.Areas, ok); err != nil { + return err + } + } + + if v.CarShuttleTrains != nil { + ok := object.Key("CarShuttleTrains") + ok.Boolean(*v.CarShuttleTrains) + } + + if v.ControlledAccessHighways != nil { + ok := object.Key("ControlledAccessHighways") + ok.Boolean(*v.ControlledAccessHighways) + } + + if v.DirtRoads != nil { + ok := object.Key("DirtRoads") + ok.Boolean(*v.DirtRoads) + } + + if v.Ferries != nil { + ok := object.Key("Ferries") + ok.Boolean(*v.Ferries) + } + + if v.SeasonalClosure != nil { + ok := object.Key("SeasonalClosure") + ok.Boolean(*v.SeasonalClosure) + } + + if v.TollRoads != nil { + ok := object.Key("TollRoads") + ok.Boolean(*v.TollRoads) + } + + if v.TollTransponders != nil { + ok := object.Key("TollTransponders") + ok.Boolean(*v.TollTransponders) + } + + if v.TruckRoadTypes != nil { + ok := object.Key("TruckRoadTypes") + if err := awsRestjson1_serializeDocumentTruckRoadTypeList(v.TruckRoadTypes, ok); err != nil { + return err + } + } + + if v.Tunnels != nil { + ok := object.Key("Tunnels") + ok.Boolean(*v.Tunnels) + } + + if v.UTurns != nil { + ok := object.Key("UTurns") + ok.Boolean(*v.UTurns) + } + + if v.ZoneCategories != nil { + ok := object.Key("ZoneCategories") + if err := awsRestjson1_serializeDocumentRouteAvoidanceZoneCategoryList(v.ZoneCategories, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteAvoidanceZoneCategory(v *types.RouteAvoidanceZoneCategory, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Category) > 0 { + ok := object.Key("Category") + ok.String(string(v.Category)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteAvoidanceZoneCategoryList(v []types.RouteAvoidanceZoneCategory, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteAvoidanceZoneCategory(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteCarOptions(v *types.RouteCarOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.EngineType) > 0 { + ok := object.Key("EngineType") + ok.String(string(v.EngineType)) + } + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentRouteVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteDestinationOptions(v *types.RouteDestinationOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AvoidActionsForDistance != 0 { + ok := object.Key("AvoidActionsForDistance") + ok.Long(v.AvoidActionsForDistance) + } + + if v.AvoidUTurns != nil { + ok := object.Key("AvoidUTurns") + ok.Boolean(*v.AvoidUTurns) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Matching != nil { + ok := object.Key("Matching") + if err := awsRestjson1_serializeDocumentRouteMatchingOptions(v.Matching, ok); err != nil { + return err + } + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentRouteSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + if v.StopDuration != 0 { + ok := object.Key("StopDuration") + ok.Long(v.StopDuration) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteDriverOptions(v *types.RouteDriverOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Schedule != nil { + ok := object.Key("Schedule") + if err := awsRestjson1_serializeDocumentRouteDriverScheduleIntervalList(v.Schedule, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteDriverScheduleInterval(v *types.RouteDriverScheduleInterval, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + { + ok := object.Key("DriveDuration") + ok.Long(v.DriveDuration) + } + + { + ok := object.Key("RestDuration") + ok.Long(v.RestDuration) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteDriverScheduleIntervalList(v []types.RouteDriverScheduleInterval, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteDriverScheduleInterval(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteEmissionType(v *types.RouteEmissionType, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Co2EmissionClass != nil { + ok := object.Key("Co2EmissionClass") + ok.String(*v.Co2EmissionClass) + } + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteExclusionOptions(v *types.RouteExclusionOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Countries != nil { + ok := object.Key("Countries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.Countries, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteHazardousCargoTypeList(v []types.RouteHazardousCargoType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentRouteLegAdditionalFeatureList(v []types.RouteLegAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentRouteMatchingOptions(v *types.RouteMatchingOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NameHint != nil { + ok := object.Key("NameHint") + ok.String(*v.NameHint) + } + + if v.OnRoadThreshold != 0 { + ok := object.Key("OnRoadThreshold") + ok.Long(v.OnRoadThreshold) + } + + if v.Radius != 0 { + ok := object.Key("Radius") + ok.Long(v.Radius) + } + + if len(v.Strategy) > 0 { + ok := object.Key("Strategy") + ok.String(string(v.Strategy)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAllowOptions(v *types.RouteMatrixAllowOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Hot != nil { + ok := object.Key("Hot") + ok.Boolean(*v.Hot) + } + + if v.Hov != nil { + ok := object.Key("Hov") + ok.Boolean(*v.Hov) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAutoCircle(v *types.RouteMatrixAutoCircle, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Margin != 0 { + ok := object.Key("Margin") + ok.Long(v.Margin) + } + + if v.MaxRadius != 0 { + ok := object.Key("MaxRadius") + ok.Long(v.MaxRadius) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAvoidanceArea(v *types.RouteMatrixAvoidanceArea, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Geometry != nil { + ok := object.Key("Geometry") + if err := awsRestjson1_serializeDocumentRouteMatrixAvoidanceAreaGeometry(v.Geometry, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAvoidanceAreaGeometry(v *types.RouteMatrixAvoidanceAreaGeometry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.Polygon != nil { + ok := object.Key("Polygon") + if err := awsRestjson1_serializeDocumentLinearRings(v.Polygon, ok); err != nil { + return err + } + } + + if v.PolylinePolygon != nil { + ok := object.Key("PolylinePolygon") + if err := awsRestjson1_serializeDocumentPolylineRingList(v.PolylinePolygon, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAvoidanceAreaList(v []types.RouteMatrixAvoidanceArea, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteMatrixAvoidanceArea(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAvoidanceOptions(v *types.RouteMatrixAvoidanceOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Areas != nil { + ok := object.Key("Areas") + if err := awsRestjson1_serializeDocumentRouteMatrixAvoidanceAreaList(v.Areas, ok); err != nil { + return err + } + } + + if v.CarShuttleTrains != nil { + ok := object.Key("CarShuttleTrains") + ok.Boolean(*v.CarShuttleTrains) + } + + if v.ControlledAccessHighways != nil { + ok := object.Key("ControlledAccessHighways") + ok.Boolean(*v.ControlledAccessHighways) + } + + if v.DirtRoads != nil { + ok := object.Key("DirtRoads") + ok.Boolean(*v.DirtRoads) + } + + if v.Ferries != nil { + ok := object.Key("Ferries") + ok.Boolean(*v.Ferries) + } + + if v.TollRoads != nil { + ok := object.Key("TollRoads") + ok.Boolean(*v.TollRoads) + } + + if v.TollTransponders != nil { + ok := object.Key("TollTransponders") + ok.Boolean(*v.TollTransponders) + } + + if v.TruckRoadTypes != nil { + ok := object.Key("TruckRoadTypes") + if err := awsRestjson1_serializeDocumentTruckRoadTypeList(v.TruckRoadTypes, ok); err != nil { + return err + } + } + + if v.Tunnels != nil { + ok := object.Key("Tunnels") + ok.Boolean(*v.Tunnels) + } + + if v.UTurns != nil { + ok := object.Key("UTurns") + ok.Boolean(*v.UTurns) + } + + if v.ZoneCategories != nil { + ok := object.Key("ZoneCategories") + if err := awsRestjson1_serializeDocumentRouteMatrixAvoidanceZoneCategoryList(v.ZoneCategories, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAvoidanceZoneCategory(v *types.RouteMatrixAvoidanceZoneCategory, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Category) > 0 { + ok := object.Key("Category") + ok.String(string(v.Category)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixAvoidanceZoneCategoryList(v []types.RouteMatrixAvoidanceZoneCategory, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteMatrixAvoidanceZoneCategory(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixBoundary(v *types.RouteMatrixBoundary, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Geometry != nil { + ok := object.Key("Geometry") + if err := awsRestjson1_serializeDocumentRouteMatrixBoundaryGeometry(v.Geometry, ok); err != nil { + return err + } + } + + if v.Unbounded != nil { + ok := object.Key("Unbounded") + ok.Boolean(*v.Unbounded) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixBoundaryGeometry(v *types.RouteMatrixBoundaryGeometry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutoCircle != nil { + ok := object.Key("AutoCircle") + if err := awsRestjson1_serializeDocumentRouteMatrixAutoCircle(v.AutoCircle, ok); err != nil { + return err + } + } + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + if v.Circle != nil { + ok := object.Key("Circle") + if err := awsRestjson1_serializeDocumentCircle(v.Circle, ok); err != nil { + return err + } + } + + if v.Polygon != nil { + ok := object.Key("Polygon") + if err := awsRestjson1_serializeDocumentLinearRings(v.Polygon, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixCarOptions(v *types.RouteMatrixCarOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentRouteMatrixVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixDestination(v *types.RouteMatrixDestination, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Options != nil { + ok := object.Key("Options") + if err := awsRestjson1_serializeDocumentRouteMatrixDestinationOptions(v.Options, ok); err != nil { + return err + } + } + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixDestinationList(v []types.RouteMatrixDestination, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteMatrixDestination(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixDestinationOptions(v *types.RouteMatrixDestinationOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AvoidActionsForDistance != 0 { + ok := object.Key("AvoidActionsForDistance") + ok.Long(v.AvoidActionsForDistance) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Matching != nil { + ok := object.Key("Matching") + if err := awsRestjson1_serializeDocumentRouteMatrixMatchingOptions(v.Matching, ok); err != nil { + return err + } + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentRouteMatrixSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixExclusionOptions(v *types.RouteMatrixExclusionOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Countries != nil { + ok := object.Key("Countries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.Countries, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixHazardousCargoTypeList(v []types.RouteMatrixHazardousCargoType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixMatchingOptions(v *types.RouteMatrixMatchingOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NameHint != nil { + ok := object.Key("NameHint") + ok.String(*v.NameHint) + } + + if v.OnRoadThreshold != 0 { + ok := object.Key("OnRoadThreshold") + ok.Long(v.OnRoadThreshold) + } + + if v.Radius != 0 { + ok := object.Key("Radius") + ok.Long(v.Radius) + } + + if len(v.Strategy) > 0 { + ok := object.Key("Strategy") + ok.String(string(v.Strategy)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixOrigin(v *types.RouteMatrixOrigin, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Options != nil { + ok := object.Key("Options") + if err := awsRestjson1_serializeDocumentRouteMatrixOriginOptions(v.Options, ok); err != nil { + return err + } + } + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixOriginList(v []types.RouteMatrixOrigin, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteMatrixOrigin(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixOriginOptions(v *types.RouteMatrixOriginOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AvoidActionsForDistance != 0 { + ok := object.Key("AvoidActionsForDistance") + ok.Long(v.AvoidActionsForDistance) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Matching != nil { + ok := object.Key("Matching") + if err := awsRestjson1_serializeDocumentRouteMatrixMatchingOptions(v.Matching, ok); err != nil { + return err + } + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentRouteMatrixSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixScooterOptions(v *types.RouteMatrixScooterOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentRouteMatrixVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixSideOfStreetOptions(v *types.RouteMatrixSideOfStreetOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + if len(v.UseWith) > 0 { + ok := object.Key("UseWith") + ok.String(string(v.UseWith)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixTrafficOptions(v *types.RouteMatrixTrafficOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FlowEventThresholdOverride != 0 { + ok := object.Key("FlowEventThresholdOverride") + ok.Long(v.FlowEventThresholdOverride) + } + + if len(v.Usage) > 0 { + ok := object.Key("Usage") + ok.String(string(v.Usage)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixTrailerOptions(v *types.RouteMatrixTrailerOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TrailerCount != nil { + ok := object.Key("TrailerCount") + ok.Integer(*v.TrailerCount) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixTravelModeOptions(v *types.RouteMatrixTravelModeOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Car != nil { + ok := object.Key("Car") + if err := awsRestjson1_serializeDocumentRouteMatrixCarOptions(v.Car, ok); err != nil { + return err + } + } + + if v.Scooter != nil { + ok := object.Key("Scooter") + if err := awsRestjson1_serializeDocumentRouteMatrixScooterOptions(v.Scooter, ok); err != nil { + return err + } + } + + if v.Truck != nil { + ok := object.Key("Truck") + if err := awsRestjson1_serializeDocumentRouteMatrixTruckOptions(v.Truck, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixTruckOptions(v *types.RouteMatrixTruckOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AxleCount != nil { + ok := object.Key("AxleCount") + ok.Integer(*v.AxleCount) + } + + if v.GrossWeight != 0 { + ok := object.Key("GrossWeight") + ok.Long(v.GrossWeight) + } + + if v.HazardousCargos != nil { + ok := object.Key("HazardousCargos") + if err := awsRestjson1_serializeDocumentRouteMatrixHazardousCargoTypeList(v.HazardousCargos, ok); err != nil { + return err + } + } + + if v.Height != 0 { + ok := object.Key("Height") + ok.Long(v.Height) + } + + if v.KpraLength != 0 { + ok := object.Key("KpraLength") + ok.Long(v.KpraLength) + } + + if v.Length != 0 { + ok := object.Key("Length") + ok.Long(v.Length) + } + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentRouteMatrixVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + if v.PayloadCapacity != 0 { + ok := object.Key("PayloadCapacity") + ok.Long(v.PayloadCapacity) + } + + if v.Trailer != nil { + ok := object.Key("Trailer") + if err := awsRestjson1_serializeDocumentRouteMatrixTrailerOptions(v.Trailer, ok); err != nil { + return err + } + } + + if len(v.TruckType) > 0 { + ok := object.Key("TruckType") + ok.String(string(v.TruckType)) + } + + if v.TunnelRestrictionCode != nil { + ok := object.Key("TunnelRestrictionCode") + ok.String(*v.TunnelRestrictionCode) + } + + if v.WeightPerAxle != 0 { + ok := object.Key("WeightPerAxle") + ok.Long(v.WeightPerAxle) + } + + if v.WeightPerAxleGroup != nil { + ok := object.Key("WeightPerAxleGroup") + if err := awsRestjson1_serializeDocumentWeightPerAxleGroup(v.WeightPerAxleGroup, ok); err != nil { + return err + } + } + + if v.Width != 0 { + ok := object.Key("Width") + ok.Long(v.Width) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteMatrixVehicleLicensePlate(v *types.RouteMatrixVehicleLicensePlate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LastCharacter != nil { + ok := object.Key("LastCharacter") + ok.String(*v.LastCharacter) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteOriginOptions(v *types.RouteOriginOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AvoidActionsForDistance != 0 { + ok := object.Key("AvoidActionsForDistance") + ok.Long(v.AvoidActionsForDistance) + } + + if v.AvoidUTurns != nil { + ok := object.Key("AvoidUTurns") + ok.Boolean(*v.AvoidUTurns) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Matching != nil { + ok := object.Key("Matching") + if err := awsRestjson1_serializeDocumentRouteMatchingOptions(v.Matching, ok); err != nil { + return err + } + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentRouteSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRoutePedestrianOptions(v *types.RoutePedestrianOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Speed != nil { + ok := object.Key("Speed") + switch { + case math.IsNaN(*v.Speed): + ok.String("NaN") + + case math.IsInf(*v.Speed, 1): + ok.String("Infinity") + + case math.IsInf(*v.Speed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Speed) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteScooterOptions(v *types.RouteScooterOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.EngineType) > 0 { + ok := object.Key("EngineType") + ok.String(string(v.EngineType)) + } + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentRouteVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteSideOfStreetOptions(v *types.RouteSideOfStreetOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + if len(v.UseWith) > 0 { + ok := object.Key("UseWith") + ok.String(string(v.UseWith)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteSpanAdditionalFeatureList(v []types.RouteSpanAdditionalFeature, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentRouteTollOptions(v *types.RouteTollOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AllTransponders != nil { + ok := object.Key("AllTransponders") + ok.Boolean(*v.AllTransponders) + } + + if v.AllVignettes != nil { + ok := object.Key("AllVignettes") + ok.Boolean(*v.AllVignettes) + } + + if v.Currency != nil { + ok := object.Key("Currency") + ok.String(*v.Currency) + } + + if v.EmissionType != nil { + ok := object.Key("EmissionType") + if err := awsRestjson1_serializeDocumentRouteEmissionType(v.EmissionType, ok); err != nil { + return err + } + } + + if len(v.VehicleCategory) > 0 { + ok := object.Key("VehicleCategory") + ok.String(string(v.VehicleCategory)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteTrafficOptions(v *types.RouteTrafficOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FlowEventThresholdOverride != 0 { + ok := object.Key("FlowEventThresholdOverride") + ok.Long(v.FlowEventThresholdOverride) + } + + if len(v.Usage) > 0 { + ok := object.Key("Usage") + ok.String(string(v.Usage)) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteTrailerOptions(v *types.RouteTrailerOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AxleCount != nil { + ok := object.Key("AxleCount") + ok.Integer(*v.AxleCount) + } + + if v.TrailerCount != nil { + ok := object.Key("TrailerCount") + ok.Integer(*v.TrailerCount) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteTravelModeOptions(v *types.RouteTravelModeOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Car != nil { + ok := object.Key("Car") + if err := awsRestjson1_serializeDocumentRouteCarOptions(v.Car, ok); err != nil { + return err + } + } + + if v.Pedestrian != nil { + ok := object.Key("Pedestrian") + if err := awsRestjson1_serializeDocumentRoutePedestrianOptions(v.Pedestrian, ok); err != nil { + return err + } + } + + if v.Scooter != nil { + ok := object.Key("Scooter") + if err := awsRestjson1_serializeDocumentRouteScooterOptions(v.Scooter, ok); err != nil { + return err + } + } + + if v.Truck != nil { + ok := object.Key("Truck") + if err := awsRestjson1_serializeDocumentRouteTruckOptions(v.Truck, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteTruckOptions(v *types.RouteTruckOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AxleCount != nil { + ok := object.Key("AxleCount") + ok.Integer(*v.AxleCount) + } + + if len(v.EngineType) > 0 { + ok := object.Key("EngineType") + ok.String(string(v.EngineType)) + } + + if v.GrossWeight != 0 { + ok := object.Key("GrossWeight") + ok.Long(v.GrossWeight) + } + + if v.HazardousCargos != nil { + ok := object.Key("HazardousCargos") + if err := awsRestjson1_serializeDocumentRouteHazardousCargoTypeList(v.HazardousCargos, ok); err != nil { + return err + } + } + + if v.Height != 0 { + ok := object.Key("Height") + ok.Long(v.Height) + } + + if v.HeightAboveFirstAxle != 0 { + ok := object.Key("HeightAboveFirstAxle") + ok.Long(v.HeightAboveFirstAxle) + } + + if v.KpraLength != 0 { + ok := object.Key("KpraLength") + ok.Long(v.KpraLength) + } + + if v.Length != 0 { + ok := object.Key("Length") + ok.Long(v.Length) + } + + if v.LicensePlate != nil { + ok := object.Key("LicensePlate") + if err := awsRestjson1_serializeDocumentRouteVehicleLicensePlate(v.LicensePlate, ok); err != nil { + return err + } + } + + if v.MaxSpeed != nil { + ok := object.Key("MaxSpeed") + switch { + case math.IsNaN(*v.MaxSpeed): + ok.String("NaN") + + case math.IsInf(*v.MaxSpeed, 1): + ok.String("Infinity") + + case math.IsInf(*v.MaxSpeed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.MaxSpeed) + + } + } + + if v.Occupancy != nil { + ok := object.Key("Occupancy") + ok.Integer(*v.Occupancy) + } + + if v.PayloadCapacity != 0 { + ok := object.Key("PayloadCapacity") + ok.Long(v.PayloadCapacity) + } + + if v.TireCount != nil { + ok := object.Key("TireCount") + ok.Integer(*v.TireCount) + } + + if v.Trailer != nil { + ok := object.Key("Trailer") + if err := awsRestjson1_serializeDocumentRouteTrailerOptions(v.Trailer, ok); err != nil { + return err + } + } + + if len(v.TruckType) > 0 { + ok := object.Key("TruckType") + ok.String(string(v.TruckType)) + } + + if v.TunnelRestrictionCode != nil { + ok := object.Key("TunnelRestrictionCode") + ok.String(*v.TunnelRestrictionCode) + } + + if v.WeightPerAxle != 0 { + ok := object.Key("WeightPerAxle") + ok.Long(v.WeightPerAxle) + } + + if v.WeightPerAxleGroup != nil { + ok := object.Key("WeightPerAxleGroup") + if err := awsRestjson1_serializeDocumentWeightPerAxleGroup(v.WeightPerAxleGroup, ok); err != nil { + return err + } + } + + if v.Width != 0 { + ok := object.Key("Width") + ok.Long(v.Width) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteVehicleLicensePlate(v *types.RouteVehicleLicensePlate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LastCharacter != nil { + ok := object.Key("LastCharacter") + ok.String(*v.LastCharacter) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteWaypoint(v *types.RouteWaypoint, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AvoidActionsForDistance != 0 { + ok := object.Key("AvoidActionsForDistance") + ok.Long(v.AvoidActionsForDistance) + } + + if v.AvoidUTurns != nil { + ok := object.Key("AvoidUTurns") + ok.Boolean(*v.AvoidUTurns) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Matching != nil { + ok := object.Key("Matching") + if err := awsRestjson1_serializeDocumentRouteMatchingOptions(v.Matching, ok); err != nil { + return err + } + } + + if v.PassThrough != nil { + ok := object.Key("PassThrough") + ok.Boolean(*v.PassThrough) + } + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentRouteSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + if v.StopDuration != 0 { + ok := object.Key("StopDuration") + ok.Long(v.StopDuration) + } + + return nil +} + +func awsRestjson1_serializeDocumentRouteWaypointList(v []types.RouteWaypoint, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRouteWaypoint(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTimeThresholdList(v []int64, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.Long(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentTruckRoadTypeList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationAccessHours(v *types.WaypointOptimizationAccessHours, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.From != nil { + ok := object.Key("From") + if err := awsRestjson1_serializeDocumentWaypointOptimizationAccessHoursEntry(v.From, ok); err != nil { + return err + } + } + + if v.To != nil { + ok := object.Key("To") + if err := awsRestjson1_serializeDocumentWaypointOptimizationAccessHoursEntry(v.To, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationAccessHoursEntry(v *types.WaypointOptimizationAccessHoursEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.DayOfWeek) > 0 { + ok := object.Key("DayOfWeek") + ok.String(string(v.DayOfWeek)) + } + + if v.TimeOfDay != nil { + ok := object.Key("TimeOfDay") + ok.String(*v.TimeOfDay) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceArea(v *types.WaypointOptimizationAvoidanceArea, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Geometry != nil { + ok := object.Key("Geometry") + if err := awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceAreaGeometry(v.Geometry, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceAreaGeometry(v *types.WaypointOptimizationAvoidanceAreaGeometry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BoundingBox != nil { + ok := object.Key("BoundingBox") + if err := awsRestjson1_serializeDocumentBoundingBox(v.BoundingBox, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceAreaList(v []types.WaypointOptimizationAvoidanceArea, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceArea(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceOptions(v *types.WaypointOptimizationAvoidanceOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Areas != nil { + ok := object.Key("Areas") + if err := awsRestjson1_serializeDocumentWaypointOptimizationAvoidanceAreaList(v.Areas, ok); err != nil { + return err + } + } + + if v.CarShuttleTrains != nil { + ok := object.Key("CarShuttleTrains") + ok.Boolean(*v.CarShuttleTrains) + } + + if v.ControlledAccessHighways != nil { + ok := object.Key("ControlledAccessHighways") + ok.Boolean(*v.ControlledAccessHighways) + } + + if v.DirtRoads != nil { + ok := object.Key("DirtRoads") + ok.Boolean(*v.DirtRoads) + } + + if v.Ferries != nil { + ok := object.Key("Ferries") + ok.Boolean(*v.Ferries) + } + + if v.TollRoads != nil { + ok := object.Key("TollRoads") + ok.Boolean(*v.TollRoads) + } + + if v.Tunnels != nil { + ok := object.Key("Tunnels") + ok.Boolean(*v.Tunnels) + } + + if v.UTurns != nil { + ok := object.Key("UTurns") + ok.Boolean(*v.UTurns) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationDestinationOptions(v *types.WaypointOptimizationDestinationOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccessHours != nil { + ok := object.Key("AccessHours") + if err := awsRestjson1_serializeDocumentWaypointOptimizationAccessHours(v.AccessHours, ok); err != nil { + return err + } + } + + if v.AppointmentTime != nil { + ok := object.Key("AppointmentTime") + ok.String(*v.AppointmentTime) + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.ServiceDuration != 0 { + ok := object.Key("ServiceDuration") + ok.Long(v.ServiceDuration) + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentWaypointOptimizationSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationDriverOptions(v *types.WaypointOptimizationDriverOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RestCycles != nil { + ok := object.Key("RestCycles") + if err := awsRestjson1_serializeDocumentWaypointOptimizationRestCycles(v.RestCycles, ok); err != nil { + return err + } + } + + if v.RestProfile != nil { + ok := object.Key("RestProfile") + if err := awsRestjson1_serializeDocumentWaypointOptimizationRestProfile(v.RestProfile, ok); err != nil { + return err + } + } + + if len(v.TreatServiceTimeAs) > 0 { + ok := object.Key("TreatServiceTimeAs") + ok.String(string(v.TreatServiceTimeAs)) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationExclusionOptions(v *types.WaypointOptimizationExclusionOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Countries != nil { + ok := object.Key("Countries") + if err := awsRestjson1_serializeDocumentCountryCodeList(v.Countries, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationHazardousCargoTypeList(v []types.WaypointOptimizationHazardousCargoType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationOriginOptions(v *types.WaypointOptimizationOriginOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationPedestrianOptions(v *types.WaypointOptimizationPedestrianOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Speed != nil { + ok := object.Key("Speed") + switch { + case math.IsNaN(*v.Speed): + ok.String("NaN") + + case math.IsInf(*v.Speed, 1): + ok.String("Infinity") + + case math.IsInf(*v.Speed, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Speed) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationRestCycleDurations(v *types.WaypointOptimizationRestCycleDurations, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + { + ok := object.Key("RestDuration") + ok.Long(v.RestDuration) + } + + { + ok := object.Key("WorkDuration") + ok.Long(v.WorkDuration) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationRestCycles(v *types.WaypointOptimizationRestCycles, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LongCycle != nil { + ok := object.Key("LongCycle") + if err := awsRestjson1_serializeDocumentWaypointOptimizationRestCycleDurations(v.LongCycle, ok); err != nil { + return err + } + } + + if v.ShortCycle != nil { + ok := object.Key("ShortCycle") + if err := awsRestjson1_serializeDocumentWaypointOptimizationRestCycleDurations(v.ShortCycle, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationRestProfile(v *types.WaypointOptimizationRestProfile, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Profile != nil { + ok := object.Key("Profile") + ok.String(*v.Profile) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationSideOfStreetOptions(v *types.WaypointOptimizationSideOfStreetOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + if len(v.UseWith) > 0 { + ok := object.Key("UseWith") + ok.String(string(v.UseWith)) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationTrafficOptions(v *types.WaypointOptimizationTrafficOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Usage) > 0 { + ok := object.Key("Usage") + ok.String(string(v.Usage)) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationTrailerOptions(v *types.WaypointOptimizationTrailerOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TrailerCount != nil { + ok := object.Key("TrailerCount") + ok.Integer(*v.TrailerCount) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationTravelModeOptions(v *types.WaypointOptimizationTravelModeOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Pedestrian != nil { + ok := object.Key("Pedestrian") + if err := awsRestjson1_serializeDocumentWaypointOptimizationPedestrianOptions(v.Pedestrian, ok); err != nil { + return err + } + } + + if v.Truck != nil { + ok := object.Key("Truck") + if err := awsRestjson1_serializeDocumentWaypointOptimizationTruckOptions(v.Truck, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationTruckOptions(v *types.WaypointOptimizationTruckOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GrossWeight != 0 { + ok := object.Key("GrossWeight") + ok.Long(v.GrossWeight) + } + + if v.HazardousCargos != nil { + ok := object.Key("HazardousCargos") + if err := awsRestjson1_serializeDocumentWaypointOptimizationHazardousCargoTypeList(v.HazardousCargos, ok); err != nil { + return err + } + } + + if v.Height != 0 { + ok := object.Key("Height") + ok.Long(v.Height) + } + + if v.Length != 0 { + ok := object.Key("Length") + ok.Long(v.Length) + } + + if v.Trailer != nil { + ok := object.Key("Trailer") + if err := awsRestjson1_serializeDocumentWaypointOptimizationTrailerOptions(v.Trailer, ok); err != nil { + return err + } + } + + if len(v.TruckType) > 0 { + ok := object.Key("TruckType") + ok.String(string(v.TruckType)) + } + + if v.TunnelRestrictionCode != nil { + ok := object.Key("TunnelRestrictionCode") + ok.String(*v.TunnelRestrictionCode) + } + + if v.WeightPerAxle != 0 { + ok := object.Key("WeightPerAxle") + ok.Long(v.WeightPerAxle) + } + + if v.Width != 0 { + ok := object.Key("Width") + ok.Long(v.Width) + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationWaypoint(v *types.WaypointOptimizationWaypoint, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccessHours != nil { + ok := object.Key("AccessHours") + if err := awsRestjson1_serializeDocumentWaypointOptimizationAccessHours(v.AccessHours, ok); err != nil { + return err + } + } + + if v.AppointmentTime != nil { + ok := object.Key("AppointmentTime") + ok.String(*v.AppointmentTime) + } + + if v.Before != nil { + ok := object.Key("Before") + if err := awsRestjson1_serializeDocumentBeforeWaypointsList(v.Before, ok); err != nil { + return err + } + } + + if v.Heading != 0 { + ok := object.Key("Heading") + switch { + case math.IsNaN(v.Heading): + ok.String("NaN") + + case math.IsInf(v.Heading, 1): + ok.String("Infinity") + + case math.IsInf(v.Heading, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Heading) + + } + } + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.Position != nil { + ok := object.Key("Position") + if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil { + return err + } + } + + if v.ServiceDuration != 0 { + ok := object.Key("ServiceDuration") + ok.Long(v.ServiceDuration) + } + + if v.SideOfStreet != nil { + ok := object.Key("SideOfStreet") + if err := awsRestjson1_serializeDocumentWaypointOptimizationSideOfStreetOptions(v.SideOfStreet, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentWaypointOptimizationWaypointList(v []types.WaypointOptimizationWaypoint, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentWaypointOptimizationWaypoint(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentWeightPerAxleGroup(v *types.WeightPerAxleGroup, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Quad != 0 { + ok := object.Key("Quad") + ok.Long(v.Quad) + } + + if v.Quint != 0 { + ok := object.Key("Quint") + ok.Long(v.Quint) + } + + if v.Single != 0 { + ok := object.Key("Single") + ok.Long(v.Single) + } + + if v.Tandem != 0 { + ok := object.Key("Tandem") + ok.Long(v.Tandem) + } + + if v.Triple != 0 { + ok := object.Key("Triple") + ok.Long(v.Triple) + } + + return nil +} diff --git a/service/georoutes/snapshot/api_op_CalculateIsolines.go.snap b/service/georoutes/snapshot/api_op_CalculateIsolines.go.snap new file mode 100644 index 00000000000..729526dac35 --- /dev/null +++ b/service/georoutes/snapshot/api_op_CalculateIsolines.go.snap @@ -0,0 +1,41 @@ +CalculateIsolines + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/georoutes/snapshot/api_op_CalculateRouteMatrix.go.snap b/service/georoutes/snapshot/api_op_CalculateRouteMatrix.go.snap new file mode 100644 index 00000000000..9a0d7aff98d --- /dev/null +++ b/service/georoutes/snapshot/api_op_CalculateRouteMatrix.go.snap @@ -0,0 +1,41 @@ +CalculateRouteMatrix + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/georoutes/snapshot/api_op_CalculateRoutes.go.snap b/service/georoutes/snapshot/api_op_CalculateRoutes.go.snap new file mode 100644 index 00000000000..8836bdcb66f --- /dev/null +++ b/service/georoutes/snapshot/api_op_CalculateRoutes.go.snap @@ -0,0 +1,41 @@ +CalculateRoutes + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/georoutes/snapshot/api_op_OptimizeWaypoints.go.snap b/service/georoutes/snapshot/api_op_OptimizeWaypoints.go.snap new file mode 100644 index 00000000000..b8b6e0be54e --- /dev/null +++ b/service/georoutes/snapshot/api_op_OptimizeWaypoints.go.snap @@ -0,0 +1,41 @@ +OptimizeWaypoints + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/georoutes/snapshot/api_op_SnapToRoads.go.snap b/service/georoutes/snapshot/api_op_SnapToRoads.go.snap new file mode 100644 index 00000000000..f03af71469f --- /dev/null +++ b/service/georoutes/snapshot/api_op_SnapToRoads.go.snap @@ -0,0 +1,41 @@ +SnapToRoads + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/georoutes/snapshot_test.go b/service/georoutes/snapshot_test.go new file mode 100644 index 00000000000..897ba9b217d --- /dev/null +++ b/service/georoutes/snapshot_test.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package georoutes + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_CalculateIsolines(t *testing.T) { + svc := New(Options{}) + _, err := svc.CalculateIsolines(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CalculateIsolines") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CalculateRouteMatrix(t *testing.T) { + svc := New(Options{}) + _, err := svc.CalculateRouteMatrix(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CalculateRouteMatrix") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CalculateRoutes(t *testing.T) { + svc := New(Options{}) + _, err := svc.CalculateRoutes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CalculateRoutes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_OptimizeWaypoints(t *testing.T) { + svc := New(Options{}) + _, err := svc.OptimizeWaypoints(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "OptimizeWaypoints") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_SnapToRoads(t *testing.T) { + svc := New(Options{}) + _, err := svc.SnapToRoads(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "SnapToRoads") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_CalculateIsolines(t *testing.T) { + svc := New(Options{}) + _, err := svc.CalculateIsolines(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CalculateIsolines") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CalculateRouteMatrix(t *testing.T) { + svc := New(Options{}) + _, err := svc.CalculateRouteMatrix(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CalculateRouteMatrix") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CalculateRoutes(t *testing.T) { + svc := New(Options{}) + _, err := svc.CalculateRoutes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CalculateRoutes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_OptimizeWaypoints(t *testing.T) { + svc := New(Options{}) + _, err := svc.OptimizeWaypoints(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "OptimizeWaypoints") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_SnapToRoads(t *testing.T) { + svc := New(Options{}) + _, err := svc.SnapToRoads(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "SnapToRoads") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/georoutes/types/enums.go b/service/georoutes/types/enums.go new file mode 100644 index 00000000000..db5c36be218 --- /dev/null +++ b/service/georoutes/types/enums.go @@ -0,0 +1,1715 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type DayOfWeek string + +// Enum values for DayOfWeek +const ( + DayOfWeekMonday DayOfWeek = "Monday" + DayOfWeekTuesday DayOfWeek = "Tuesday" + DayOfWeekWednesday DayOfWeek = "Wednesday" + DayOfWeekThursday DayOfWeek = "Thursday" + DayOfWeekFriday DayOfWeek = "Friday" + DayOfWeekSaturday DayOfWeek = "Saturday" + DayOfWeekSunday DayOfWeek = "Sunday" +) + +// Values returns all known values for DayOfWeek. 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 (DayOfWeek) Values() []DayOfWeek { + return []DayOfWeek{ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", + } +} + +type GeometryFormat string + +// Enum values for GeometryFormat +const ( + GeometryFormatFlexiblePolyline GeometryFormat = "FlexiblePolyline" + GeometryFormatSimple GeometryFormat = "Simple" +) + +// Values returns all known values for GeometryFormat. 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 (GeometryFormat) Values() []GeometryFormat { + return []GeometryFormat{ + "FlexiblePolyline", + "Simple", + } +} + +type IsolineEngineType string + +// Enum values for IsolineEngineType +const ( + IsolineEngineTypeElectric IsolineEngineType = "Electric" + IsolineEngineTypeInternalCombustion IsolineEngineType = "InternalCombustion" + IsolineEngineTypePluginHybrid IsolineEngineType = "PluginHybrid" +) + +// Values returns all known values for IsolineEngineType. 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 (IsolineEngineType) Values() []IsolineEngineType { + return []IsolineEngineType{ + "Electric", + "InternalCombustion", + "PluginHybrid", + } +} + +type IsolineHazardousCargoType string + +// Enum values for IsolineHazardousCargoType +const ( + IsolineHazardousCargoTypeCombustible IsolineHazardousCargoType = "Combustible" + IsolineHazardousCargoTypeCorrosive IsolineHazardousCargoType = "Corrosive" + IsolineHazardousCargoTypeExplosive IsolineHazardousCargoType = "Explosive" + IsolineHazardousCargoTypeFlammable IsolineHazardousCargoType = "Flammable" + IsolineHazardousCargoTypeGas IsolineHazardousCargoType = "Gas" + IsolineHazardousCargoTypeHarmfulToWater IsolineHazardousCargoType = "HarmfulToWater" + IsolineHazardousCargoTypeOrganic IsolineHazardousCargoType = "Organic" + IsolineHazardousCargoTypeOther IsolineHazardousCargoType = "Other" + IsolineHazardousCargoTypePoison IsolineHazardousCargoType = "Poison" + IsolineHazardousCargoTypePoisonousInhalation IsolineHazardousCargoType = "PoisonousInhalation" + IsolineHazardousCargoTypeRadioactive IsolineHazardousCargoType = "Radioactive" +) + +// Values returns all known values for IsolineHazardousCargoType. 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 (IsolineHazardousCargoType) Values() []IsolineHazardousCargoType { + return []IsolineHazardousCargoType{ + "Combustible", + "Corrosive", + "Explosive", + "Flammable", + "Gas", + "HarmfulToWater", + "Organic", + "Other", + "Poison", + "PoisonousInhalation", + "Radioactive", + } +} + +type IsolineOptimizationObjective string + +// Enum values for IsolineOptimizationObjective +const ( + IsolineOptimizationObjectiveAccurateCalculation IsolineOptimizationObjective = "AccurateCalculation" + IsolineOptimizationObjectiveBalancedCalculation IsolineOptimizationObjective = "BalancedCalculation" + IsolineOptimizationObjectiveFastCalculation IsolineOptimizationObjective = "FastCalculation" +) + +// Values returns all known values for IsolineOptimizationObjective. 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 (IsolineOptimizationObjective) Values() []IsolineOptimizationObjective { + return []IsolineOptimizationObjective{ + "AccurateCalculation", + "BalancedCalculation", + "FastCalculation", + } +} + +type IsolineTravelMode string + +// Enum values for IsolineTravelMode +const ( + IsolineTravelModeCar IsolineTravelMode = "Car" + IsolineTravelModePedestrian IsolineTravelMode = "Pedestrian" + IsolineTravelModeScooter IsolineTravelMode = "Scooter" + IsolineTravelModeTruck IsolineTravelMode = "Truck" +) + +// Values returns all known values for IsolineTravelMode. 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 (IsolineTravelMode) Values() []IsolineTravelMode { + return []IsolineTravelMode{ + "Car", + "Pedestrian", + "Scooter", + "Truck", + } +} + +type IsolineTruckType string + +// Enum values for IsolineTruckType +const ( + IsolineTruckTypeLightTruck IsolineTruckType = "LightTruck" + IsolineTruckTypeStraightTruck IsolineTruckType = "StraightTruck" + IsolineTruckTypeTractor IsolineTruckType = "Tractor" +) + +// Values returns all known values for IsolineTruckType. 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 (IsolineTruckType) Values() []IsolineTruckType { + return []IsolineTruckType{ + "LightTruck", + "StraightTruck", + "Tractor", + } +} + +type IsolineZoneCategory string + +// Enum values for IsolineZoneCategory +const ( + IsolineZoneCategoryCongestionPricing IsolineZoneCategory = "CongestionPricing" + IsolineZoneCategoryEnvironmental IsolineZoneCategory = "Environmental" + IsolineZoneCategoryVignette IsolineZoneCategory = "Vignette" +) + +// Values returns all known values for IsolineZoneCategory. 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 (IsolineZoneCategory) Values() []IsolineZoneCategory { + return []IsolineZoneCategory{ + "CongestionPricing", + "Environmental", + "Vignette", + } +} + +type MatchingStrategy string + +// Enum values for MatchingStrategy +const ( + MatchingStrategyMatchAny MatchingStrategy = "MatchAny" + MatchingStrategyMatchMostSignificantRoad MatchingStrategy = "MatchMostSignificantRoad" +) + +// Values returns all known values for MatchingStrategy. 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 (MatchingStrategy) Values() []MatchingStrategy { + return []MatchingStrategy{ + "MatchAny", + "MatchMostSignificantRoad", + } +} + +type MeasurementSystem string + +// Enum values for MeasurementSystem +const ( + MeasurementSystemMetric MeasurementSystem = "Metric" + MeasurementSystemImperial MeasurementSystem = "Imperial" +) + +// Values returns all known values for MeasurementSystem. 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 (MeasurementSystem) Values() []MeasurementSystem { + return []MeasurementSystem{ + "Metric", + "Imperial", + } +} + +type RoadSnapHazardousCargoType string + +// Enum values for RoadSnapHazardousCargoType +const ( + RoadSnapHazardousCargoTypeCombustible RoadSnapHazardousCargoType = "Combustible" + RoadSnapHazardousCargoTypeCorrosive RoadSnapHazardousCargoType = "Corrosive" + RoadSnapHazardousCargoTypeExplosive RoadSnapHazardousCargoType = "Explosive" + RoadSnapHazardousCargoTypeFlammable RoadSnapHazardousCargoType = "Flammable" + RoadSnapHazardousCargoTypeGas RoadSnapHazardousCargoType = "Gas" + RoadSnapHazardousCargoTypeHarmfulToWater RoadSnapHazardousCargoType = "HarmfulToWater" + RoadSnapHazardousCargoTypeOrganic RoadSnapHazardousCargoType = "Organic" + RoadSnapHazardousCargoTypeOther RoadSnapHazardousCargoType = "Other" + RoadSnapHazardousCargoTypePoison RoadSnapHazardousCargoType = "Poison" + RoadSnapHazardousCargoTypePoisonousInhalation RoadSnapHazardousCargoType = "PoisonousInhalation" + RoadSnapHazardousCargoTypeRadioactive RoadSnapHazardousCargoType = "Radioactive" +) + +// Values returns all known values for RoadSnapHazardousCargoType. 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 (RoadSnapHazardousCargoType) Values() []RoadSnapHazardousCargoType { + return []RoadSnapHazardousCargoType{ + "Combustible", + "Corrosive", + "Explosive", + "Flammable", + "Gas", + "HarmfulToWater", + "Organic", + "Other", + "Poison", + "PoisonousInhalation", + "Radioactive", + } +} + +type RoadSnapNoticeCode string + +// Enum values for RoadSnapNoticeCode +const ( + RoadSnapNoticeCodeTracePointsHeadingIgnored RoadSnapNoticeCode = "TracePointsHeadingIgnored" + RoadSnapNoticeCodeTracePointsIgnored RoadSnapNoticeCode = "TracePointsIgnored" + RoadSnapNoticeCodeTracePointsMovedByLargeDistance RoadSnapNoticeCode = "TracePointsMovedByLargeDistance" + RoadSnapNoticeCodeTracePointsNotMatched RoadSnapNoticeCode = "TracePointsNotMatched" + RoadSnapNoticeCodeTracePointsOutOfSequence RoadSnapNoticeCode = "TracePointsOutOfSequence" + RoadSnapNoticeCodeTracePointsSpeedEstimated RoadSnapNoticeCode = "TracePointsSpeedEstimated" + RoadSnapNoticeCodeTracePointsSpeedIgnored RoadSnapNoticeCode = "TracePointsSpeedIgnored" +) + +// Values returns all known values for RoadSnapNoticeCode. 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 (RoadSnapNoticeCode) Values() []RoadSnapNoticeCode { + return []RoadSnapNoticeCode{ + "TracePointsHeadingIgnored", + "TracePointsIgnored", + "TracePointsMovedByLargeDistance", + "TracePointsNotMatched", + "TracePointsOutOfSequence", + "TracePointsSpeedEstimated", + "TracePointsSpeedIgnored", + } +} + +type RoadSnapTravelMode string + +// Enum values for RoadSnapTravelMode +const ( + RoadSnapTravelModeCar RoadSnapTravelMode = "Car" + RoadSnapTravelModePedestrian RoadSnapTravelMode = "Pedestrian" + RoadSnapTravelModeScooter RoadSnapTravelMode = "Scooter" + RoadSnapTravelModeTruck RoadSnapTravelMode = "Truck" +) + +// Values returns all known values for RoadSnapTravelMode. 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 (RoadSnapTravelMode) Values() []RoadSnapTravelMode { + return []RoadSnapTravelMode{ + "Car", + "Pedestrian", + "Scooter", + "Truck", + } +} + +type RouteDirection string + +// Enum values for RouteDirection +const ( + RouteDirectionEast RouteDirection = "East" + RouteDirectionNorth RouteDirection = "North" + RouteDirectionSouth RouteDirection = "South" + RouteDirectionWest RouteDirection = "West" +) + +// Values returns all known values for RouteDirection. 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 (RouteDirection) Values() []RouteDirection { + return []RouteDirection{ + "East", + "North", + "South", + "West", + } +} + +type RouteEngineType string + +// Enum values for RouteEngineType +const ( + RouteEngineTypeElectric RouteEngineType = "Electric" + RouteEngineTypeInternalCombustion RouteEngineType = "InternalCombustion" + RouteEngineTypePluginHybrid RouteEngineType = "PluginHybrid" +) + +// Values returns all known values for RouteEngineType. 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 (RouteEngineType) Values() []RouteEngineType { + return []RouteEngineType{ + "Electric", + "InternalCombustion", + "PluginHybrid", + } +} + +type RouteFerryAfterTravelStepType string + +// Enum values for RouteFerryAfterTravelStepType +const ( + RouteFerryAfterTravelStepTypeDeboard RouteFerryAfterTravelStepType = "Deboard" +) + +// Values returns all known values for RouteFerryAfterTravelStepType. 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 (RouteFerryAfterTravelStepType) Values() []RouteFerryAfterTravelStepType { + return []RouteFerryAfterTravelStepType{ + "Deboard", + } +} + +type RouteFerryBeforeTravelStepType string + +// Enum values for RouteFerryBeforeTravelStepType +const ( + RouteFerryBeforeTravelStepTypeBoard RouteFerryBeforeTravelStepType = "Board" +) + +// Values returns all known values for RouteFerryBeforeTravelStepType. 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 (RouteFerryBeforeTravelStepType) Values() []RouteFerryBeforeTravelStepType { + return []RouteFerryBeforeTravelStepType{ + "Board", + } +} + +type RouteFerryNoticeCode string + +// Enum values for RouteFerryNoticeCode +const ( + RouteFerryNoticeCodeAccuratePolylineUnavailable RouteFerryNoticeCode = "AccuratePolylineUnavailable" + RouteFerryNoticeCodeNoSchedule RouteFerryNoticeCode = "NoSchedule" + RouteFerryNoticeCodeOther RouteFerryNoticeCode = "Other" + RouteFerryNoticeCodeViolatedAvoidFerry RouteFerryNoticeCode = "ViolatedAvoidFerry" + RouteFerryNoticeCodeViolatedAvoidRailFerry RouteFerryNoticeCode = "ViolatedAvoidRailFerry" +) + +// Values returns all known values for RouteFerryNoticeCode. 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 (RouteFerryNoticeCode) Values() []RouteFerryNoticeCode { + return []RouteFerryNoticeCode{ + "AccuratePolylineUnavailable", + "NoSchedule", + "Other", + "ViolatedAvoidFerry", + "ViolatedAvoidRailFerry", + } +} + +type RouteFerryTravelStepType string + +// Enum values for RouteFerryTravelStepType +const ( + RouteFerryTravelStepTypeDepart RouteFerryTravelStepType = "Depart" + RouteFerryTravelStepTypeContinue RouteFerryTravelStepType = "Continue" + RouteFerryTravelStepTypeArrive RouteFerryTravelStepType = "Arrive" +) + +// Values returns all known values for RouteFerryTravelStepType. 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 (RouteFerryTravelStepType) Values() []RouteFerryTravelStepType { + return []RouteFerryTravelStepType{ + "Depart", + "Continue", + "Arrive", + } +} + +type RouteHazardousCargoType string + +// Enum values for RouteHazardousCargoType +const ( + RouteHazardousCargoTypeCombustible RouteHazardousCargoType = "Combustible" + RouteHazardousCargoTypeCorrosive RouteHazardousCargoType = "Corrosive" + RouteHazardousCargoTypeExplosive RouteHazardousCargoType = "Explosive" + RouteHazardousCargoTypeFlammable RouteHazardousCargoType = "Flammable" + RouteHazardousCargoTypeGas RouteHazardousCargoType = "Gas" + RouteHazardousCargoTypeHarmfulToWater RouteHazardousCargoType = "HarmfulToWater" + RouteHazardousCargoTypeOrganic RouteHazardousCargoType = "Organic" + RouteHazardousCargoTypeOther RouteHazardousCargoType = "Other" + RouteHazardousCargoTypePoison RouteHazardousCargoType = "Poison" + RouteHazardousCargoTypePoisonousInhalation RouteHazardousCargoType = "PoisonousInhalation" + RouteHazardousCargoTypeRadioactive RouteHazardousCargoType = "Radioactive" +) + +// Values returns all known values for RouteHazardousCargoType. 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 (RouteHazardousCargoType) Values() []RouteHazardousCargoType { + return []RouteHazardousCargoType{ + "Combustible", + "Corrosive", + "Explosive", + "Flammable", + "Gas", + "HarmfulToWater", + "Organic", + "Other", + "Poison", + "PoisonousInhalation", + "Radioactive", + } +} + +type RouteLegAdditionalFeature string + +// Enum values for RouteLegAdditionalFeature +const ( + RouteLegAdditionalFeatureElevation RouteLegAdditionalFeature = "Elevation" + RouteLegAdditionalFeatureIncidents RouteLegAdditionalFeature = "Incidents" + RouteLegAdditionalFeaturePassThroughWaypoints RouteLegAdditionalFeature = "PassThroughWaypoints" + RouteLegAdditionalFeatureSummary RouteLegAdditionalFeature = "Summary" + RouteLegAdditionalFeatureTolls RouteLegAdditionalFeature = "Tolls" + RouteLegAdditionalFeatureTravelStepInstructions RouteLegAdditionalFeature = "TravelStepInstructions" + RouteLegAdditionalFeatureTruckRoadTypes RouteLegAdditionalFeature = "TruckRoadTypes" + RouteLegAdditionalFeatureTypicalDuration RouteLegAdditionalFeature = "TypicalDuration" + RouteLegAdditionalFeatureZones RouteLegAdditionalFeature = "Zones" +) + +// Values returns all known values for RouteLegAdditionalFeature. 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 (RouteLegAdditionalFeature) Values() []RouteLegAdditionalFeature { + return []RouteLegAdditionalFeature{ + "Elevation", + "Incidents", + "PassThroughWaypoints", + "Summary", + "Tolls", + "TravelStepInstructions", + "TruckRoadTypes", + "TypicalDuration", + "Zones", + } +} + +type RouteLegTravelMode string + +// Enum values for RouteLegTravelMode +const ( + RouteLegTravelModeCar RouteLegTravelMode = "Car" + RouteLegTravelModeFerry RouteLegTravelMode = "Ferry" + RouteLegTravelModePedestrian RouteLegTravelMode = "Pedestrian" + RouteLegTravelModeScooter RouteLegTravelMode = "Scooter" + RouteLegTravelModeTruck RouteLegTravelMode = "Truck" +) + +// Values returns all known values for RouteLegTravelMode. 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 (RouteLegTravelMode) Values() []RouteLegTravelMode { + return []RouteLegTravelMode{ + "Car", + "Ferry", + "Pedestrian", + "Scooter", + "Truck", + } +} + +type RouteLegType string + +// Enum values for RouteLegType +const ( + RouteLegTypeFerry RouteLegType = "Ferry" + RouteLegTypePedestrian RouteLegType = "Pedestrian" + RouteLegTypeVehicle RouteLegType = "Vehicle" +) + +// Values returns all known values for RouteLegType. 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 (RouteLegType) Values() []RouteLegType { + return []RouteLegType{ + "Ferry", + "Pedestrian", + "Vehicle", + } +} + +type RouteMatrixErrorCode string + +// Enum values for RouteMatrixErrorCode +const ( + RouteMatrixErrorCodeNoMatch RouteMatrixErrorCode = "NoMatch" + RouteMatrixErrorCodeNoMatchDestination RouteMatrixErrorCode = "NoMatchDestination" + RouteMatrixErrorCodeNoMatchOrigin RouteMatrixErrorCode = "NoMatchOrigin" + RouteMatrixErrorCodeNoRoute RouteMatrixErrorCode = "NoRoute" + RouteMatrixErrorCodeOutOfBounds RouteMatrixErrorCode = "OutOfBounds" + RouteMatrixErrorCodeOutOfBoundsDestination RouteMatrixErrorCode = "OutOfBoundsDestination" + RouteMatrixErrorCodeOutOfBoundsOrigin RouteMatrixErrorCode = "OutOfBoundsOrigin" + RouteMatrixErrorCodeOther RouteMatrixErrorCode = "Other" + RouteMatrixErrorCodeViolation RouteMatrixErrorCode = "Violation" +) + +// Values returns all known values for RouteMatrixErrorCode. 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 (RouteMatrixErrorCode) Values() []RouteMatrixErrorCode { + return []RouteMatrixErrorCode{ + "NoMatch", + "NoMatchDestination", + "NoMatchOrigin", + "NoRoute", + "OutOfBounds", + "OutOfBoundsDestination", + "OutOfBoundsOrigin", + "Other", + "Violation", + } +} + +type RouteMatrixHazardousCargoType string + +// Enum values for RouteMatrixHazardousCargoType +const ( + RouteMatrixHazardousCargoTypeCombustible RouteMatrixHazardousCargoType = "Combustible" + RouteMatrixHazardousCargoTypeCorrosive RouteMatrixHazardousCargoType = "Corrosive" + RouteMatrixHazardousCargoTypeExplosive RouteMatrixHazardousCargoType = "Explosive" + RouteMatrixHazardousCargoTypeFlammable RouteMatrixHazardousCargoType = "Flammable" + RouteMatrixHazardousCargoTypeGas RouteMatrixHazardousCargoType = "Gas" + RouteMatrixHazardousCargoTypeHarmfulToWater RouteMatrixHazardousCargoType = "HarmfulToWater" + RouteMatrixHazardousCargoTypeOrganic RouteMatrixHazardousCargoType = "Organic" + RouteMatrixHazardousCargoTypeOther RouteMatrixHazardousCargoType = "Other" + RouteMatrixHazardousCargoTypePoison RouteMatrixHazardousCargoType = "Poison" + RouteMatrixHazardousCargoTypePoisonousInhalation RouteMatrixHazardousCargoType = "PoisonousInhalation" + RouteMatrixHazardousCargoTypeRadioactive RouteMatrixHazardousCargoType = "Radioactive" +) + +// Values returns all known values for RouteMatrixHazardousCargoType. 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 (RouteMatrixHazardousCargoType) Values() []RouteMatrixHazardousCargoType { + return []RouteMatrixHazardousCargoType{ + "Combustible", + "Corrosive", + "Explosive", + "Flammable", + "Gas", + "HarmfulToWater", + "Organic", + "Other", + "Poison", + "PoisonousInhalation", + "Radioactive", + } +} + +type RouteMatrixTravelMode string + +// Enum values for RouteMatrixTravelMode +const ( + RouteMatrixTravelModeCar RouteMatrixTravelMode = "Car" + RouteMatrixTravelModePedestrian RouteMatrixTravelMode = "Pedestrian" + RouteMatrixTravelModeScooter RouteMatrixTravelMode = "Scooter" + RouteMatrixTravelModeTruck RouteMatrixTravelMode = "Truck" +) + +// Values returns all known values for RouteMatrixTravelMode. 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 (RouteMatrixTravelMode) Values() []RouteMatrixTravelMode { + return []RouteMatrixTravelMode{ + "Car", + "Pedestrian", + "Scooter", + "Truck", + } +} + +type RouteMatrixTruckType string + +// Enum values for RouteMatrixTruckType +const ( + RouteMatrixTruckTypeLightTruck RouteMatrixTruckType = "LightTruck" + RouteMatrixTruckTypeStraightTruck RouteMatrixTruckType = "StraightTruck" + RouteMatrixTruckTypeTractor RouteMatrixTruckType = "Tractor" +) + +// Values returns all known values for RouteMatrixTruckType. 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 (RouteMatrixTruckType) Values() []RouteMatrixTruckType { + return []RouteMatrixTruckType{ + "LightTruck", + "StraightTruck", + "Tractor", + } +} + +type RouteMatrixZoneCategory string + +// Enum values for RouteMatrixZoneCategory +const ( + RouteMatrixZoneCategoryCongestionPricing RouteMatrixZoneCategory = "CongestionPricing" + RouteMatrixZoneCategoryEnvironmental RouteMatrixZoneCategory = "Environmental" + RouteMatrixZoneCategoryVignette RouteMatrixZoneCategory = "Vignette" +) + +// Values returns all known values for RouteMatrixZoneCategory. 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 (RouteMatrixZoneCategory) Values() []RouteMatrixZoneCategory { + return []RouteMatrixZoneCategory{ + "CongestionPricing", + "Environmental", + "Vignette", + } +} + +type RouteNoticeImpact string + +// Enum values for RouteNoticeImpact +const ( + RouteNoticeImpactHigh RouteNoticeImpact = "High" + RouteNoticeImpactLow RouteNoticeImpact = "Low" +) + +// Values returns all known values for RouteNoticeImpact. 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 (RouteNoticeImpact) Values() []RouteNoticeImpact { + return []RouteNoticeImpact{ + "High", + "Low", + } +} + +type RoutePedestrianNoticeCode string + +// Enum values for RoutePedestrianNoticeCode +const ( + RoutePedestrianNoticeCodeAccuratePolylineUnavailable RoutePedestrianNoticeCode = "AccuratePolylineUnavailable" + RoutePedestrianNoticeCodeOther RoutePedestrianNoticeCode = "Other" + RoutePedestrianNoticeCodeViolatedAvoidDirtRoad RoutePedestrianNoticeCode = "ViolatedAvoidDirtRoad" + RoutePedestrianNoticeCodeViolatedAvoidTunnel RoutePedestrianNoticeCode = "ViolatedAvoidTunnel" + RoutePedestrianNoticeCodeViolatedPedestrianOption RoutePedestrianNoticeCode = "ViolatedPedestrianOption" +) + +// Values returns all known values for RoutePedestrianNoticeCode. 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 (RoutePedestrianNoticeCode) Values() []RoutePedestrianNoticeCode { + return []RoutePedestrianNoticeCode{ + "AccuratePolylineUnavailable", + "Other", + "ViolatedAvoidDirtRoad", + "ViolatedAvoidTunnel", + "ViolatedPedestrianOption", + } +} + +type RoutePedestrianTravelStepType string + +// Enum values for RoutePedestrianTravelStepType +const ( + RoutePedestrianTravelStepTypeArrive RoutePedestrianTravelStepType = "Arrive" + RoutePedestrianTravelStepTypeContinue RoutePedestrianTravelStepType = "Continue" + RoutePedestrianTravelStepTypeDepart RoutePedestrianTravelStepType = "Depart" + RoutePedestrianTravelStepTypeKeep RoutePedestrianTravelStepType = "Keep" + RoutePedestrianTravelStepTypeRoundaboutEnter RoutePedestrianTravelStepType = "RoundaboutEnter" + RoutePedestrianTravelStepTypeRoundaboutExit RoutePedestrianTravelStepType = "RoundaboutExit" + RoutePedestrianTravelStepTypeRoundaboutPass RoutePedestrianTravelStepType = "RoundaboutPass" + RoutePedestrianTravelStepTypeTurn RoutePedestrianTravelStepType = "Turn" + RoutePedestrianTravelStepTypeExit RoutePedestrianTravelStepType = "Exit" + RoutePedestrianTravelStepTypeRamp RoutePedestrianTravelStepType = "Ramp" + RoutePedestrianTravelStepTypeUTurn RoutePedestrianTravelStepType = "UTurn" +) + +// Values returns all known values for RoutePedestrianTravelStepType. 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 (RoutePedestrianTravelStepType) Values() []RoutePedestrianTravelStepType { + return []RoutePedestrianTravelStepType{ + "Arrive", + "Continue", + "Depart", + "Keep", + "RoundaboutEnter", + "RoundaboutExit", + "RoundaboutPass", + "Turn", + "Exit", + "Ramp", + "UTurn", + } +} + +type RouteResponseNoticeCode string + +// Enum values for RouteResponseNoticeCode +const ( + RouteResponseNoticeCodeMainLanguageNotFound RouteResponseNoticeCode = "MainLanguageNotFound" + RouteResponseNoticeCodeOther RouteResponseNoticeCode = "Other" + RouteResponseNoticeCodeTravelTimeExceedsDriverWorkHours RouteResponseNoticeCode = "TravelTimeExceedsDriverWorkHours" +) + +// Values returns all known values for RouteResponseNoticeCode. 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 (RouteResponseNoticeCode) Values() []RouteResponseNoticeCode { + return []RouteResponseNoticeCode{ + "MainLanguageNotFound", + "Other", + "TravelTimeExceedsDriverWorkHours", + } +} + +type RouteRoadType string + +// Enum values for RouteRoadType +const ( + RouteRoadTypeHighway RouteRoadType = "Highway" + RouteRoadTypeRural RouteRoadType = "Rural" + RouteRoadTypeUrban RouteRoadType = "Urban" +) + +// Values returns all known values for RouteRoadType. 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 (RouteRoadType) Values() []RouteRoadType { + return []RouteRoadType{ + "Highway", + "Rural", + "Urban", + } +} + +type RouteSideOfStreet string + +// Enum values for RouteSideOfStreet +const ( + RouteSideOfStreetLeft RouteSideOfStreet = "Left" + RouteSideOfStreetRight RouteSideOfStreet = "Right" +) + +// Values returns all known values for RouteSideOfStreet. 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 (RouteSideOfStreet) Values() []RouteSideOfStreet { + return []RouteSideOfStreet{ + "Left", + "Right", + } +} + +type RouteSpanAdditionalFeature string + +// Enum values for RouteSpanAdditionalFeature +const ( + RouteSpanAdditionalFeatureBestCaseDuration RouteSpanAdditionalFeature = "BestCaseDuration" + RouteSpanAdditionalFeatureCarAccess RouteSpanAdditionalFeature = "CarAccess" + RouteSpanAdditionalFeatureCountry RouteSpanAdditionalFeature = "Country" + RouteSpanAdditionalFeatureDistance RouteSpanAdditionalFeature = "Distance" + RouteSpanAdditionalFeatureDuration RouteSpanAdditionalFeature = "Duration" + RouteSpanAdditionalFeatureDynamicSpeed RouteSpanAdditionalFeature = "DynamicSpeed" + RouteSpanAdditionalFeatureFunctionalClassification RouteSpanAdditionalFeature = "FunctionalClassification" + RouteSpanAdditionalFeatureGates RouteSpanAdditionalFeature = "Gates" + RouteSpanAdditionalFeatureIncidents RouteSpanAdditionalFeature = "Incidents" + RouteSpanAdditionalFeatureNames RouteSpanAdditionalFeature = "Names" + RouteSpanAdditionalFeatureNotices RouteSpanAdditionalFeature = "Notices" + RouteSpanAdditionalFeaturePedestrianAccess RouteSpanAdditionalFeature = "PedestrianAccess" + RouteSpanAdditionalFeatureRailwayCrossings RouteSpanAdditionalFeature = "RailwayCrossings" + RouteSpanAdditionalFeatureRegion RouteSpanAdditionalFeature = "Region" + RouteSpanAdditionalFeatureRoadAttributes RouteSpanAdditionalFeature = "RoadAttributes" + RouteSpanAdditionalFeatureRouteNumbers RouteSpanAdditionalFeature = "RouteNumbers" + RouteSpanAdditionalFeatureScooterAccess RouteSpanAdditionalFeature = "ScooterAccess" + RouteSpanAdditionalFeatureSpeedLimit RouteSpanAdditionalFeature = "SpeedLimit" + RouteSpanAdditionalFeatureTollSystems RouteSpanAdditionalFeature = "TollSystems" + RouteSpanAdditionalFeatureTruckAccess RouteSpanAdditionalFeature = "TruckAccess" + RouteSpanAdditionalFeatureTruckRoadTypes RouteSpanAdditionalFeature = "TruckRoadTypes" + RouteSpanAdditionalFeatureTypicalDuration RouteSpanAdditionalFeature = "TypicalDuration" + RouteSpanAdditionalFeatureZones RouteSpanAdditionalFeature = "Zones" + RouteSpanAdditionalFeatureConsumption RouteSpanAdditionalFeature = "Consumption" +) + +// Values returns all known values for RouteSpanAdditionalFeature. 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 (RouteSpanAdditionalFeature) Values() []RouteSpanAdditionalFeature { + return []RouteSpanAdditionalFeature{ + "BestCaseDuration", + "CarAccess", + "Country", + "Distance", + "Duration", + "DynamicSpeed", + "FunctionalClassification", + "Gates", + "Incidents", + "Names", + "Notices", + "PedestrianAccess", + "RailwayCrossings", + "Region", + "RoadAttributes", + "RouteNumbers", + "ScooterAccess", + "SpeedLimit", + "TollSystems", + "TruckAccess", + "TruckRoadTypes", + "TypicalDuration", + "Zones", + "Consumption", + } +} + +type RouteSpanCarAccessAttribute string + +// Enum values for RouteSpanCarAccessAttribute +const ( + RouteSpanCarAccessAttributeAllowed RouteSpanCarAccessAttribute = "Allowed" + RouteSpanCarAccessAttributeNoThroughTraffic RouteSpanCarAccessAttribute = "NoThroughTraffic" + RouteSpanCarAccessAttributeTollRoad RouteSpanCarAccessAttribute = "TollRoad" +) + +// Values returns all known values for RouteSpanCarAccessAttribute. 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 (RouteSpanCarAccessAttribute) Values() []RouteSpanCarAccessAttribute { + return []RouteSpanCarAccessAttribute{ + "Allowed", + "NoThroughTraffic", + "TollRoad", + } +} + +type RouteSpanGateAttribute string + +// Enum values for RouteSpanGateAttribute +const ( + RouteSpanGateAttributeEmergency RouteSpanGateAttribute = "Emergency" + RouteSpanGateAttributeKeyAccess RouteSpanGateAttribute = "KeyAccess" + RouteSpanGateAttributePermissionRequired RouteSpanGateAttribute = "PermissionRequired" +) + +// Values returns all known values for RouteSpanGateAttribute. 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 (RouteSpanGateAttribute) Values() []RouteSpanGateAttribute { + return []RouteSpanGateAttribute{ + "Emergency", + "KeyAccess", + "PermissionRequired", + } +} + +type RouteSpanPedestrianAccessAttribute string + +// Enum values for RouteSpanPedestrianAccessAttribute +const ( + RouteSpanPedestrianAccessAttributeAllowed RouteSpanPedestrianAccessAttribute = "Allowed" + RouteSpanPedestrianAccessAttributeIndoors RouteSpanPedestrianAccessAttribute = "Indoors" + RouteSpanPedestrianAccessAttributeNoThroughTraffic RouteSpanPedestrianAccessAttribute = "NoThroughTraffic" + RouteSpanPedestrianAccessAttributePark RouteSpanPedestrianAccessAttribute = "Park" + RouteSpanPedestrianAccessAttributeStairs RouteSpanPedestrianAccessAttribute = "Stairs" + RouteSpanPedestrianAccessAttributeTollRoad RouteSpanPedestrianAccessAttribute = "TollRoad" +) + +// Values returns all known values for RouteSpanPedestrianAccessAttribute. 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 (RouteSpanPedestrianAccessAttribute) Values() []RouteSpanPedestrianAccessAttribute { + return []RouteSpanPedestrianAccessAttribute{ + "Allowed", + "Indoors", + "NoThroughTraffic", + "Park", + "Stairs", + "TollRoad", + } +} + +type RouteSpanRailwayCrossingAttribute string + +// Enum values for RouteSpanRailwayCrossingAttribute +const ( + RouteSpanRailwayCrossingAttributeProtected RouteSpanRailwayCrossingAttribute = "Protected" + RouteSpanRailwayCrossingAttributeUnprotected RouteSpanRailwayCrossingAttribute = "Unprotected" +) + +// Values returns all known values for RouteSpanRailwayCrossingAttribute. 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 (RouteSpanRailwayCrossingAttribute) Values() []RouteSpanRailwayCrossingAttribute { + return []RouteSpanRailwayCrossingAttribute{ + "Protected", + "Unprotected", + } +} + +type RouteSpanRoadAttribute string + +// Enum values for RouteSpanRoadAttribute +const ( + RouteSpanRoadAttributeBridge RouteSpanRoadAttribute = "Bridge" + RouteSpanRoadAttributeBuiltUpArea RouteSpanRoadAttribute = "BuiltUpArea" + RouteSpanRoadAttributeControlledAccessHighway RouteSpanRoadAttribute = "ControlledAccessHighway" + RouteSpanRoadAttributeDirtRoad RouteSpanRoadAttribute = "DirtRoad" + RouteSpanRoadAttributeDividedRoad RouteSpanRoadAttribute = "DividedRoad" + RouteSpanRoadAttributeMotorway RouteSpanRoadAttribute = "Motorway" + RouteSpanRoadAttributePrivateRoad RouteSpanRoadAttribute = "PrivateRoad" + RouteSpanRoadAttributeRamp RouteSpanRoadAttribute = "Ramp" + RouteSpanRoadAttributeRightHandTraffic RouteSpanRoadAttribute = "RightHandTraffic" + RouteSpanRoadAttributeRoundabout RouteSpanRoadAttribute = "Roundabout" + RouteSpanRoadAttributeTunnel RouteSpanRoadAttribute = "Tunnel" + RouteSpanRoadAttributeUnderConstruction RouteSpanRoadAttribute = "UnderConstruction" +) + +// Values returns all known values for RouteSpanRoadAttribute. 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 (RouteSpanRoadAttribute) Values() []RouteSpanRoadAttribute { + return []RouteSpanRoadAttribute{ + "Bridge", + "BuiltUpArea", + "ControlledAccessHighway", + "DirtRoad", + "DividedRoad", + "Motorway", + "PrivateRoad", + "Ramp", + "RightHandTraffic", + "Roundabout", + "Tunnel", + "UnderConstruction", + } +} + +type RouteSpanScooterAccessAttribute string + +// Enum values for RouteSpanScooterAccessAttribute +const ( + RouteSpanScooterAccessAttributeAllowed RouteSpanScooterAccessAttribute = "Allowed" + RouteSpanScooterAccessAttributeNoThroughTraffic RouteSpanScooterAccessAttribute = "NoThroughTraffic" + RouteSpanScooterAccessAttributeTollRoad RouteSpanScooterAccessAttribute = "TollRoad" +) + +// Values returns all known values for RouteSpanScooterAccessAttribute. 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 (RouteSpanScooterAccessAttribute) Values() []RouteSpanScooterAccessAttribute { + return []RouteSpanScooterAccessAttribute{ + "Allowed", + "NoThroughTraffic", + "TollRoad", + } +} + +type RouteSpanTruckAccessAttribute string + +// Enum values for RouteSpanTruckAccessAttribute +const ( + RouteSpanTruckAccessAttributeAllowed RouteSpanTruckAccessAttribute = "Allowed" + RouteSpanTruckAccessAttributeNoThroughTraffic RouteSpanTruckAccessAttribute = "NoThroughTraffic" + RouteSpanTruckAccessAttributeTollRoad RouteSpanTruckAccessAttribute = "TollRoad" +) + +// Values returns all known values for RouteSpanTruckAccessAttribute. 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 (RouteSpanTruckAccessAttribute) Values() []RouteSpanTruckAccessAttribute { + return []RouteSpanTruckAccessAttribute{ + "Allowed", + "NoThroughTraffic", + "TollRoad", + } +} + +type RouteSteeringDirection string + +// Enum values for RouteSteeringDirection +const ( + RouteSteeringDirectionLeft RouteSteeringDirection = "Left" + RouteSteeringDirectionRight RouteSteeringDirection = "Right" + RouteSteeringDirectionStraight RouteSteeringDirection = "Straight" +) + +// Values returns all known values for RouteSteeringDirection. 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 (RouteSteeringDirection) Values() []RouteSteeringDirection { + return []RouteSteeringDirection{ + "Left", + "Right", + "Straight", + } +} + +type RouteTollPassValidityPeriodType string + +// Enum values for RouteTollPassValidityPeriodType +const ( + RouteTollPassValidityPeriodTypeAnnual RouteTollPassValidityPeriodType = "Annual" + RouteTollPassValidityPeriodTypeDays RouteTollPassValidityPeriodType = "Days" + RouteTollPassValidityPeriodTypeExtendedAnnual RouteTollPassValidityPeriodType = "ExtendedAnnual" + RouteTollPassValidityPeriodTypeMinutes RouteTollPassValidityPeriodType = "Minutes" + RouteTollPassValidityPeriodTypeMonths RouteTollPassValidityPeriodType = "Months" +) + +// Values returns all known values for RouteTollPassValidityPeriodType. 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 (RouteTollPassValidityPeriodType) Values() []RouteTollPassValidityPeriodType { + return []RouteTollPassValidityPeriodType{ + "Annual", + "Days", + "ExtendedAnnual", + "Minutes", + "Months", + } +} + +type RouteTollPaymentMethod string + +// Enum values for RouteTollPaymentMethod +const ( + RouteTollPaymentMethodBankCard RouteTollPaymentMethod = "BankCard" + RouteTollPaymentMethodCash RouteTollPaymentMethod = "Cash" + RouteTollPaymentMethodCashExact RouteTollPaymentMethod = "CashExact" + RouteTollPaymentMethodCreditCard RouteTollPaymentMethod = "CreditCard" + RouteTollPaymentMethodPassSubscription RouteTollPaymentMethod = "PassSubscription" + RouteTollPaymentMethodTravelCard RouteTollPaymentMethod = "TravelCard" + RouteTollPaymentMethodTransponder RouteTollPaymentMethod = "Transponder" + RouteTollPaymentMethodVideoToll RouteTollPaymentMethod = "VideoToll" +) + +// Values returns all known values for RouteTollPaymentMethod. 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 (RouteTollPaymentMethod) Values() []RouteTollPaymentMethod { + return []RouteTollPaymentMethod{ + "BankCard", + "Cash", + "CashExact", + "CreditCard", + "PassSubscription", + "TravelCard", + "Transponder", + "VideoToll", + } +} + +type RouteTollVehicleCategory string + +// Enum values for RouteTollVehicleCategory +const ( + RouteTollVehicleCategoryMinibus RouteTollVehicleCategory = "Minibus" +) + +// Values returns all known values for RouteTollVehicleCategory. 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 (RouteTollVehicleCategory) Values() []RouteTollVehicleCategory { + return []RouteTollVehicleCategory{ + "Minibus", + } +} + +type RouteTravelMode string + +// Enum values for RouteTravelMode +const ( + RouteTravelModeCar RouteTravelMode = "Car" + RouteTravelModePedestrian RouteTravelMode = "Pedestrian" + RouteTravelModeScooter RouteTravelMode = "Scooter" + RouteTravelModeTruck RouteTravelMode = "Truck" +) + +// Values returns all known values for RouteTravelMode. 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 (RouteTravelMode) Values() []RouteTravelMode { + return []RouteTravelMode{ + "Car", + "Pedestrian", + "Scooter", + "Truck", + } +} + +type RouteTravelStepType string + +// Enum values for RouteTravelStepType +const ( + RouteTravelStepTypeDefault RouteTravelStepType = "Default" + RouteTravelStepTypeTurnByTurn RouteTravelStepType = "TurnByTurn" +) + +// Values returns all known values for RouteTravelStepType. 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 (RouteTravelStepType) Values() []RouteTravelStepType { + return []RouteTravelStepType{ + "Default", + "TurnByTurn", + } +} + +type RouteTruckType string + +// Enum values for RouteTruckType +const ( + RouteTruckTypeLightTruck RouteTruckType = "LightTruck" + RouteTruckTypeStraightTruck RouteTruckType = "StraightTruck" + RouteTruckTypeTractor RouteTruckType = "Tractor" +) + +// Values returns all known values for RouteTruckType. 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 (RouteTruckType) Values() []RouteTruckType { + return []RouteTruckType{ + "LightTruck", + "StraightTruck", + "Tractor", + } +} + +type RouteTurnIntensity string + +// Enum values for RouteTurnIntensity +const ( + RouteTurnIntensitySharp RouteTurnIntensity = "Sharp" + RouteTurnIntensitySlight RouteTurnIntensity = "Slight" + RouteTurnIntensityTypical RouteTurnIntensity = "Typical" +) + +// Values returns all known values for RouteTurnIntensity. 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 (RouteTurnIntensity) Values() []RouteTurnIntensity { + return []RouteTurnIntensity{ + "Sharp", + "Slight", + "Typical", + } +} + +type RouteVehicleIncidentSeverity string + +// Enum values for RouteVehicleIncidentSeverity +const ( + RouteVehicleIncidentSeverityCritical RouteVehicleIncidentSeverity = "Critical" + RouteVehicleIncidentSeverityHigh RouteVehicleIncidentSeverity = "High" + RouteVehicleIncidentSeverityMedium RouteVehicleIncidentSeverity = "Medium" + RouteVehicleIncidentSeverityLow RouteVehicleIncidentSeverity = "Low" +) + +// Values returns all known values for RouteVehicleIncidentSeverity. 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 (RouteVehicleIncidentSeverity) Values() []RouteVehicleIncidentSeverity { + return []RouteVehicleIncidentSeverity{ + "Critical", + "High", + "Medium", + "Low", + } +} + +type RouteVehicleIncidentType string + +// Enum values for RouteVehicleIncidentType +const ( + RouteVehicleIncidentTypeAccident RouteVehicleIncidentType = "Accident" + RouteVehicleIncidentTypeCongestion RouteVehicleIncidentType = "Congestion" + RouteVehicleIncidentTypeConstruction RouteVehicleIncidentType = "Construction" + RouteVehicleIncidentTypeDisabledVehicle RouteVehicleIncidentType = "DisabledVehicle" + RouteVehicleIncidentTypeLaneRestriction RouteVehicleIncidentType = "LaneRestriction" + RouteVehicleIncidentTypeMassTransit RouteVehicleIncidentType = "MassTransit" + RouteVehicleIncidentTypeOther RouteVehicleIncidentType = "Other" + RouteVehicleIncidentTypePlannedEvent RouteVehicleIncidentType = "PlannedEvent" + RouteVehicleIncidentTypeRoadClosure RouteVehicleIncidentType = "RoadClosure" + RouteVehicleIncidentTypeRoadHazard RouteVehicleIncidentType = "RoadHazard" + RouteVehicleIncidentTypeWeather RouteVehicleIncidentType = "Weather" +) + +// Values returns all known values for RouteVehicleIncidentType. 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 (RouteVehicleIncidentType) Values() []RouteVehicleIncidentType { + return []RouteVehicleIncidentType{ + "Accident", + "Congestion", + "Construction", + "DisabledVehicle", + "LaneRestriction", + "MassTransit", + "Other", + "PlannedEvent", + "RoadClosure", + "RoadHazard", + "Weather", + } +} + +type RouteVehicleNoticeCode string + +// Enum values for RouteVehicleNoticeCode +const ( + RouteVehicleNoticeCodeAccuratePolylineUnavailable RouteVehicleNoticeCode = "AccuratePolylineUnavailable" + RouteVehicleNoticeCodeOther RouteVehicleNoticeCode = "Other" + RouteVehicleNoticeCodePotentialViolatedAvoidTollRoadUsage RouteVehicleNoticeCode = "PotentialViolatedAvoidTollRoadUsage" + RouteVehicleNoticeCodePotentialViolatedCarpoolUsage RouteVehicleNoticeCode = "PotentialViolatedCarpoolUsage" + RouteVehicleNoticeCodePotentialViolatedTurnRestrictionUsage RouteVehicleNoticeCode = "PotentialViolatedTurnRestrictionUsage" + RouteVehicleNoticeCodePotentialViolatedVehicleRestrictionUsage RouteVehicleNoticeCode = "PotentialViolatedVehicleRestrictionUsage" + RouteVehicleNoticeCodePotentialViolatedZoneRestrictionUsage RouteVehicleNoticeCode = "PotentialViolatedZoneRestrictionUsage" + RouteVehicleNoticeCodeSeasonalClosure RouteVehicleNoticeCode = "SeasonalClosure" + RouteVehicleNoticeCodeTollsDataTemporarilyUnavailable RouteVehicleNoticeCode = "TollsDataTemporarilyUnavailable" + RouteVehicleNoticeCodeTollsDataUnavailable RouteVehicleNoticeCode = "TollsDataUnavailable" + RouteVehicleNoticeCodeTollTransponder RouteVehicleNoticeCode = "TollTransponder" + RouteVehicleNoticeCodeViolatedAvoidControlledAccessHighway RouteVehicleNoticeCode = "ViolatedAvoidControlledAccessHighway" + RouteVehicleNoticeCodeViolatedAvoidDifficultTurns RouteVehicleNoticeCode = "ViolatedAvoidDifficultTurns" + RouteVehicleNoticeCodeViolatedAvoidDirtRoad RouteVehicleNoticeCode = "ViolatedAvoidDirtRoad" + RouteVehicleNoticeCodeViolatedAvoidSeasonalClosure RouteVehicleNoticeCode = "ViolatedAvoidSeasonalClosure" + RouteVehicleNoticeCodeViolatedAvoidTollRoad RouteVehicleNoticeCode = "ViolatedAvoidTollRoad" + RouteVehicleNoticeCodeViolatedAvoidTollTransponder RouteVehicleNoticeCode = "ViolatedAvoidTollTransponder" + RouteVehicleNoticeCodeViolatedAvoidTruckRoadType RouteVehicleNoticeCode = "ViolatedAvoidTruckRoadType" + RouteVehicleNoticeCodeViolatedAvoidTunnel RouteVehicleNoticeCode = "ViolatedAvoidTunnel" + RouteVehicleNoticeCodeViolatedAvoidUTurns RouteVehicleNoticeCode = "ViolatedAvoidUTurns" + RouteVehicleNoticeCodeViolatedBlockedRoad RouteVehicleNoticeCode = "ViolatedBlockedRoad" + RouteVehicleNoticeCodeViolatedCarpool RouteVehicleNoticeCode = "ViolatedCarpool" + RouteVehicleNoticeCodeViolatedEmergencyGate RouteVehicleNoticeCode = "ViolatedEmergencyGate" + RouteVehicleNoticeCodeViolatedStartDirection RouteVehicleNoticeCode = "ViolatedStartDirection" + RouteVehicleNoticeCodeViolatedTurnRestriction RouteVehicleNoticeCode = "ViolatedTurnRestriction" + RouteVehicleNoticeCodeViolatedVehicleRestriction RouteVehicleNoticeCode = "ViolatedVehicleRestriction" + RouteVehicleNoticeCodeViolatedZoneRestriction RouteVehicleNoticeCode = "ViolatedZoneRestriction" +) + +// Values returns all known values for RouteVehicleNoticeCode. 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 (RouteVehicleNoticeCode) Values() []RouteVehicleNoticeCode { + return []RouteVehicleNoticeCode{ + "AccuratePolylineUnavailable", + "Other", + "PotentialViolatedAvoidTollRoadUsage", + "PotentialViolatedCarpoolUsage", + "PotentialViolatedTurnRestrictionUsage", + "PotentialViolatedVehicleRestrictionUsage", + "PotentialViolatedZoneRestrictionUsage", + "SeasonalClosure", + "TollsDataTemporarilyUnavailable", + "TollsDataUnavailable", + "TollTransponder", + "ViolatedAvoidControlledAccessHighway", + "ViolatedAvoidDifficultTurns", + "ViolatedAvoidDirtRoad", + "ViolatedAvoidSeasonalClosure", + "ViolatedAvoidTollRoad", + "ViolatedAvoidTollTransponder", + "ViolatedAvoidTruckRoadType", + "ViolatedAvoidTunnel", + "ViolatedAvoidUTurns", + "ViolatedBlockedRoad", + "ViolatedCarpool", + "ViolatedEmergencyGate", + "ViolatedStartDirection", + "ViolatedTurnRestriction", + "ViolatedVehicleRestriction", + "ViolatedZoneRestriction", + } +} + +type RouteVehicleTravelStepType string + +// Enum values for RouteVehicleTravelStepType +const ( + RouteVehicleTravelStepTypeArrive RouteVehicleTravelStepType = "Arrive" + RouteVehicleTravelStepTypeContinue RouteVehicleTravelStepType = "Continue" + RouteVehicleTravelStepTypeContinueHighway RouteVehicleTravelStepType = "ContinueHighway" + RouteVehicleTravelStepTypeDepart RouteVehicleTravelStepType = "Depart" + RouteVehicleTravelStepTypeEnterHighway RouteVehicleTravelStepType = "EnterHighway" + RouteVehicleTravelStepTypeExit RouteVehicleTravelStepType = "Exit" + RouteVehicleTravelStepTypeKeep RouteVehicleTravelStepType = "Keep" + RouteVehicleTravelStepTypeRamp RouteVehicleTravelStepType = "Ramp" + RouteVehicleTravelStepTypeRoundaboutEnter RouteVehicleTravelStepType = "RoundaboutEnter" + RouteVehicleTravelStepTypeRoundaboutExit RouteVehicleTravelStepType = "RoundaboutExit" + RouteVehicleTravelStepTypeRoundaboutPass RouteVehicleTravelStepType = "RoundaboutPass" + RouteVehicleTravelStepTypeTurn RouteVehicleTravelStepType = "Turn" + RouteVehicleTravelStepTypeUTurn RouteVehicleTravelStepType = "UTurn" +) + +// Values returns all known values for RouteVehicleTravelStepType. 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 (RouteVehicleTravelStepType) Values() []RouteVehicleTravelStepType { + return []RouteVehicleTravelStepType{ + "Arrive", + "Continue", + "ContinueHighway", + "Depart", + "EnterHighway", + "Exit", + "Keep", + "Ramp", + "RoundaboutEnter", + "RoundaboutExit", + "RoundaboutPass", + "Turn", + "UTurn", + } +} + +type RouteWeightConstraintType string + +// Enum values for RouteWeightConstraintType +const ( + RouteWeightConstraintTypeCurrent RouteWeightConstraintType = "Current" + RouteWeightConstraintTypeGross RouteWeightConstraintType = "Gross" + RouteWeightConstraintTypeUnknown RouteWeightConstraintType = "Unknown" +) + +// Values returns all known values for RouteWeightConstraintType. 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 (RouteWeightConstraintType) Values() []RouteWeightConstraintType { + return []RouteWeightConstraintType{ + "Current", + "Gross", + "Unknown", + } +} + +type RouteZoneCategory string + +// Enum values for RouteZoneCategory +const ( + RouteZoneCategoryCongestionPricing RouteZoneCategory = "CongestionPricing" + RouteZoneCategoryEnvironmental RouteZoneCategory = "Environmental" + RouteZoneCategoryVignette RouteZoneCategory = "Vignette" +) + +// Values returns all known values for RouteZoneCategory. 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 (RouteZoneCategory) Values() []RouteZoneCategory { + return []RouteZoneCategory{ + "CongestionPricing", + "Environmental", + "Vignette", + } +} + +type RoutingObjective string + +// Enum values for RoutingObjective +const ( + RoutingObjectiveFastestRoute RoutingObjective = "FastestRoute" + RoutingObjectiveShortestRoute RoutingObjective = "ShortestRoute" +) + +// Values returns all known values for RoutingObjective. 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 (RoutingObjective) Values() []RoutingObjective { + return []RoutingObjective{ + "FastestRoute", + "ShortestRoute", + } +} + +type SideOfStreetMatchingStrategy string + +// Enum values for SideOfStreetMatchingStrategy +const ( + SideOfStreetMatchingStrategyAnyStreet SideOfStreetMatchingStrategy = "AnyStreet" + SideOfStreetMatchingStrategyDividedStreetOnly SideOfStreetMatchingStrategy = "DividedStreetOnly" +) + +// Values returns all known values for SideOfStreetMatchingStrategy. 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 (SideOfStreetMatchingStrategy) Values() []SideOfStreetMatchingStrategy { + return []SideOfStreetMatchingStrategy{ + "AnyStreet", + "DividedStreetOnly", + } +} + +type TrafficUsage string + +// Enum values for TrafficUsage +const ( + TrafficUsageIgnoreTrafficData TrafficUsage = "IgnoreTrafficData" + TrafficUsageUseTrafficData TrafficUsage = "UseTrafficData" +) + +// Values returns all known values for TrafficUsage. 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 (TrafficUsage) Values() []TrafficUsage { + return []TrafficUsage{ + "IgnoreTrafficData", + "UseTrafficData", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + // No such operation is supported. + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "UnknownOperation" + // The required input is missing. + ValidationExceptionReasonMissing ValidationExceptionReason = "Missing" + // The input cannot be parsed. For example a required JSON document, ARN + // identifier, date value, or numeric field cannot be parsed. + ValidationExceptionReasonCannotParse ValidationExceptionReason = "CannotParse" + // The input is present and parsable, but it is otherwise invalid. For example, a + // required numeric argument is outside the allowed range. + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FieldValidationFailed" + // The input is invalid but no more specific reason is applicable. + ValidationExceptionReasonOther ValidationExceptionReason = "Other" + // No such field is supported. + ValidationExceptionReasonUnknownField ValidationExceptionReason = "UnknownField" +) + +// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "UnknownOperation", + "Missing", + "CannotParse", + "FieldValidationFailed", + "Other", + "UnknownField", + } +} + +type WaypointOptimizationConstraint string + +// Enum values for WaypointOptimizationConstraint +const ( + WaypointOptimizationConstraintAccessHours WaypointOptimizationConstraint = "AccessHours" + WaypointOptimizationConstraintAppointmentTime WaypointOptimizationConstraint = "AppointmentTime" + WaypointOptimizationConstraintBefore WaypointOptimizationConstraint = "Before" + WaypointOptimizationConstraintHeading WaypointOptimizationConstraint = "Heading" + WaypointOptimizationConstraintServiceDuration WaypointOptimizationConstraint = "ServiceDuration" + WaypointOptimizationConstraintSideOfStreet WaypointOptimizationConstraint = "SideOfStreet" +) + +// Values returns all known values for WaypointOptimizationConstraint. 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 (WaypointOptimizationConstraint) Values() []WaypointOptimizationConstraint { + return []WaypointOptimizationConstraint{ + "AccessHours", + "AppointmentTime", + "Before", + "Heading", + "ServiceDuration", + "SideOfStreet", + } +} + +type WaypointOptimizationHazardousCargoType string + +// Enum values for WaypointOptimizationHazardousCargoType +const ( + WaypointOptimizationHazardousCargoTypeCombustible WaypointOptimizationHazardousCargoType = "Combustible" + WaypointOptimizationHazardousCargoTypeCorrosive WaypointOptimizationHazardousCargoType = "Corrosive" + WaypointOptimizationHazardousCargoTypeExplosive WaypointOptimizationHazardousCargoType = "Explosive" + WaypointOptimizationHazardousCargoTypeFlammable WaypointOptimizationHazardousCargoType = "Flammable" + WaypointOptimizationHazardousCargoTypeGas WaypointOptimizationHazardousCargoType = "Gas" + WaypointOptimizationHazardousCargoTypeHarmfulToWater WaypointOptimizationHazardousCargoType = "HarmfulToWater" + WaypointOptimizationHazardousCargoTypeOrganic WaypointOptimizationHazardousCargoType = "Organic" + WaypointOptimizationHazardousCargoTypeOther WaypointOptimizationHazardousCargoType = "Other" + WaypointOptimizationHazardousCargoTypePoison WaypointOptimizationHazardousCargoType = "Poison" + WaypointOptimizationHazardousCargoTypePoisonousInhalation WaypointOptimizationHazardousCargoType = "PoisonousInhalation" + WaypointOptimizationHazardousCargoTypeRadioactive WaypointOptimizationHazardousCargoType = "Radioactive" +) + +// Values returns all known values for WaypointOptimizationHazardousCargoType. +// 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 (WaypointOptimizationHazardousCargoType) Values() []WaypointOptimizationHazardousCargoType { + return []WaypointOptimizationHazardousCargoType{ + "Combustible", + "Corrosive", + "Explosive", + "Flammable", + "Gas", + "HarmfulToWater", + "Organic", + "Other", + "Poison", + "PoisonousInhalation", + "Radioactive", + } +} + +type WaypointOptimizationSequencingObjective string + +// Enum values for WaypointOptimizationSequencingObjective +const ( + WaypointOptimizationSequencingObjectiveFastestRoute WaypointOptimizationSequencingObjective = "FastestRoute" + WaypointOptimizationSequencingObjectiveShortestRoute WaypointOptimizationSequencingObjective = "ShortestRoute" +) + +// Values returns all known values for WaypointOptimizationSequencingObjective. +// 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 (WaypointOptimizationSequencingObjective) Values() []WaypointOptimizationSequencingObjective { + return []WaypointOptimizationSequencingObjective{ + "FastestRoute", + "ShortestRoute", + } +} + +type WaypointOptimizationServiceTimeTreatment string + +// Enum values for WaypointOptimizationServiceTimeTreatment +const ( + WaypointOptimizationServiceTimeTreatmentRest WaypointOptimizationServiceTimeTreatment = "Rest" + WaypointOptimizationServiceTimeTreatmentWork WaypointOptimizationServiceTimeTreatment = "Work" +) + +// Values returns all known values for WaypointOptimizationServiceTimeTreatment. +// 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 (WaypointOptimizationServiceTimeTreatment) Values() []WaypointOptimizationServiceTimeTreatment { + return []WaypointOptimizationServiceTimeTreatment{ + "Rest", + "Work", + } +} + +type WaypointOptimizationTravelMode string + +// Enum values for WaypointOptimizationTravelMode +const ( + WaypointOptimizationTravelModeCar WaypointOptimizationTravelMode = "Car" + WaypointOptimizationTravelModePedestrian WaypointOptimizationTravelMode = "Pedestrian" + WaypointOptimizationTravelModeScooter WaypointOptimizationTravelMode = "Scooter" + WaypointOptimizationTravelModeTruck WaypointOptimizationTravelMode = "Truck" +) + +// Values returns all known values for WaypointOptimizationTravelMode. 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 (WaypointOptimizationTravelMode) Values() []WaypointOptimizationTravelMode { + return []WaypointOptimizationTravelMode{ + "Car", + "Pedestrian", + "Scooter", + "Truck", + } +} + +type WaypointOptimizationTruckType string + +// Enum values for WaypointOptimizationTruckType +const ( + WaypointOptimizationTruckTypeStraightTruck WaypointOptimizationTruckType = "StraightTruck" + WaypointOptimizationTruckTypeTractor WaypointOptimizationTruckType = "Tractor" +) + +// Values returns all known values for WaypointOptimizationTruckType. 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 (WaypointOptimizationTruckType) Values() []WaypointOptimizationTruckType { + return []WaypointOptimizationTruckType{ + "StraightTruck", + "Tractor", + } +} diff --git a/service/georoutes/types/errors.go b/service/georoutes/types/errors.go new file mode 100644 index 00000000000..35d3dedb70d --- /dev/null +++ b/service/georoutes/types/errors.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You don't have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request processing has failed because of an unknown error, exception or +// failure. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/georoutes/types/types.go b/service/georoutes/types/types.go new file mode 100644 index 00000000000..f4568a761f9 --- /dev/null +++ b/service/georoutes/types/types.go @@ -0,0 +1,4254 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// Geometry defined as a circle. When request routing boundary was set as +// AutoCircle , the response routing boundary will return Circle derived from the +// AutoCircle settings. +type Circle struct { + + // Center of the Circle defined in longitude and latitude coordinates. + // + // Example: [-123.1174, 49.2847] represents the position with longitude -123.1174 + // and latitude 49.2847 . + // + // This member is required. + Center []float64 + + // Radius of the Circle. + // + // Unit: meters + // + // This member is required. + Radius *float64 + + noSmithyDocumentSerde +} + +// Geometry defined as a corridor - a LineString with a radius that defines the +// width of the corridor. +type Corridor struct { + + // An ordered list of positions used to plot a route on a map. + // + // LineString and Polyline are mutually exclusive properties. + // + // This member is required. + LineString [][]float64 + + // Radius that defines the width of the corridor. + // + // This member is required. + Radius *int32 + + noSmithyDocumentSerde +} + +// Calculated isolines and associated properties. +type Isoline struct { + + // Isolines may contain multiple components, if these components are connected by + // ferry links. These components are returned as separate polygons while the ferry + // links are returned as connections. + // + // This member is required. + Connections []IsolineConnection + + // Geometries for the Calculated isolines. + // + // This member is required. + Geometries []IsolineShapeGeometry + + // Distance threshold corresponding to the calculated Isoline. + DistanceThreshold int64 + + // Time threshold corresponding to the calculated isoline. + TimeThreshold int64 + + noSmithyDocumentSerde +} + +// Features that are allowed while calculating. a route +type IsolineAllowOptions struct { + + // Allow Hot (High Occupancy Toll) lanes while calculating the route. + Hot *bool + + // Allow Hov (High Occupancy vehicle) lanes while calculating the route. + Hov *bool + + noSmithyDocumentSerde +} + +// The area to be avoided. +type IsolineAvoidanceArea struct { + + // Geometry of the area to be avoided. + // + // This member is required. + Geometry *IsolineAvoidanceAreaGeometry + + // Exceptions to the provided avoidance geometry, to be included while calculating + // the route. + Except []IsolineAvoidanceAreaGeometry + + noSmithyDocumentSerde +} + +// The avoidance geometry, to be included while calculating the route. +type IsolineAvoidanceAreaGeometry struct { + + // Geometry defined as a bounding box. The first pair represents the X and Y + // coordinates (longitude and latitude,) of the southwest corner of the bounding + // box; the second pair represents the X and Y coordinates (longitude and latitude) + // of the northeast corner. + BoundingBox []float64 + + // Geometry defined as a corridor - a LineString with a radius that defines the + // width of the corridor. + Corridor *Corridor + + // A list of Polygon will be excluded for calculating isolines, the list can only + // contain 1 polygon. + Polygon [][][]float64 + + // Geometry defined as an encoded corridor – a polyline with a radius that defines + // the width of the corridor. For more information on polyline encoding, see [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]. + // + // [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]: https://github.com/heremaps/flexiblepolyline/blob/master/README.md + PolylineCorridor *PolylineCorridor + + // A list of PolylinePolygon's that are excluded for calculating isolines, the + // list can only contain 1 polygon. For more information on polyline encoding, see [https://github.com/heremaps/flexiblepolyline/blob/master/README.md] + // . + // + // [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]: https://github.com/heremaps/flexiblepolyline/blob/master/README.md + PolylinePolygon []string + + noSmithyDocumentSerde +} + +// Features that are avoided while calculating a route. Avoidance is on a +// best-case basis. If an avoidance can't be satisfied for a particular case, it +// violates the avoidance and the returned response produces a notice for the +// violation. +type IsolineAvoidanceOptions struct { + + // Areas to be avoided. + Areas []IsolineAvoidanceArea + + // Avoid car-shuttle-trains while calculating the route. + CarShuttleTrains *bool + + // Avoid controlled access highways while calculating the route. + ControlledAccessHighways *bool + + // Avoid dirt roads while calculating the route. + DirtRoads *bool + + // Avoid ferries while calculating the route. + Ferries *bool + + // Avoid roads that have seasonal closure while calculating the route. + SeasonalClosure *bool + + // Avoids roads where the specified toll transponders are the only mode of payment. + TollRoads *bool + + // Avoids roads where the specified toll transponders are the only mode of payment. + TollTransponders *bool + + // Truck road type identifiers. BK1 through BK4 apply only to Sweden. + // A2,A4,B2,B4,C,D,ET2,ET4 apply only to Mexico. + // + // There are currently no other supported values as of 26th April 2024. + TruckRoadTypes []string + + // Avoid tunnels while calculating the route. + Tunnels *bool + + // Avoid U-turns for calculation on highways and motorways. + UTurns *bool + + // Zone categories to be avoided. + ZoneCategories []IsolineAvoidanceZoneCategory + + noSmithyDocumentSerde +} + +// Zone category to be avoided. +type IsolineAvoidanceZoneCategory struct { + + // Zone category to be avoided. + Category IsolineZoneCategory + + noSmithyDocumentSerde +} + +// Options for vehicles. +type IsolineCarOptions struct { + + // Engine type of the vehicle. + EngineType IsolineEngineType + + // The vehicle License Plate. + LicensePlate *IsolineVehicleLicensePlate + + // Maximum speed. + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + noSmithyDocumentSerde +} + +// Isolines may contain multiple components, if these components are connected by +// ferry links. These components are returned as separate polygons while the ferry +// links are returned as connections. +type IsolineConnection struct { + + // Index of the polygon corresponding to the "from" component of the connection. + // The polygon is available from Isoline[].Geometries . + // + // This member is required. + FromPolygonIndex *int32 + + // The isoline geometry. + // + // This member is required. + Geometry *IsolineConnectionGeometry + + // Index of the polygon corresponding to the "to" component of the connection. The + // polygon is available from Isoline[].Geometries . + // + // This member is required. + ToPolygonIndex *int32 + + noSmithyDocumentSerde +} + +// Geometry of the connection between different Isoline components. +type IsolineConnectionGeometry struct { + + // An ordered list of positions used to plot a route on a map. + // + // LineString and Polyline are mutually exclusive properties. + LineString [][]float64 + + // An ordered list of positions used to plot a route on a map in a lossy + // compression format. + // + // LineString and Polyline are mutually exclusive properties. + Polyline *string + + noSmithyDocumentSerde +} + +// Destination related options. +type IsolineDestinationOptions struct { + + // Avoids actions for the provided distance. This is typically to consider for + // users in moving vehicles who may not have sufficient time to make an action at + // an origin or a destination. + AvoidActionsForDistance int64 + + // GPS Heading at the position. + Heading float64 + + // Options to configure matching the provided position to the road network. + Matching *IsolineMatchingOptions + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *IsolineSideOfStreetOptions + + noSmithyDocumentSerde +} + +// Isoline granularity related options. +type IsolineGranularityOptions struct { + + // Maximum number of points of returned Isoline. + MaxPoints *int32 + + // Maximum resolution of the returned isoline. + // + // Unit: centimeters + MaxResolution int64 + + noSmithyDocumentSerde +} + +// Isoline matching related options. +type IsolineMatchingOptions struct { + + // Attempts to match the provided position to a road similar to the provided name. + NameHint *string + + // If the distance to a highway/bridge/tunnel/sliproad is within threshold, the + // waypoint will be snapped to the highway/bridge/tunnel/sliproad. + // + // Unit: meters + OnRoadThreshold int64 + + // Considers all roads within the provided radius to match the provided + // destination to. The roads that are considered are determined by the provided + // Strategy. + // + // Unit: Meters + Radius int64 + + // Strategy that defines matching of the position onto the road network. MatchAny + // considers all roads possible, whereas MatchMostSignificantRoad matches to the + // most significant road. + Strategy MatchingStrategy + + noSmithyDocumentSerde +} + +// Options for the property. +type IsolineOriginOptions struct { + + // Avoids actions for the provided distance. This is typically to consider for + // users in moving vehicles who may not have sufficient time to make an action at + // an origin or a destination. + AvoidActionsForDistance int64 + + // GPS Heading at the position. + Heading float64 + + // Options to configure matching the provided position to the road network. + Matching *IsolineMatchingOptions + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *IsolineSideOfStreetOptions + + noSmithyDocumentSerde +} + +// Options for the property. +type IsolineScooterOptions struct { + + // Engine type of the vehicle. + EngineType IsolineEngineType + + // The vehicle License Plate. + LicensePlate *IsolineVehicleLicensePlate + + // Maximum speed specified. + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + noSmithyDocumentSerde +} + +// Geometry of the connection between different Isoline components. +type IsolineShapeGeometry struct { + + // A list of Isoline Polygons, for each isoline polygon, it contains polygons of + // the first linear ring (the outer ring) and from 2nd item to the last item (the + // inner rings). + Polygon [][][]float64 + + // A list of Isoline PolylinePolygon, for each isoline PolylinePolygon, it + // contains PolylinePolygon of the first linear ring (the outer ring) and from 2nd + // item to the last item (the inner rings). For more information on polyline + // encoding, see [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]. + // + // [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]: https://github.com/heremaps/flexiblepolyline/blob/master/README.md + PolylinePolygon []string + + noSmithyDocumentSerde +} + +// Options to configure matching the provided position to a side of the street. +type IsolineSideOfStreetOptions struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Strategy that defines when the side of street position should be used. + // AnyStreet will always use the provided position. + // + // Default Value: DividedStreetOnly + UseWith SideOfStreetMatchingStrategy + + noSmithyDocumentSerde +} + +// Threshold to be used for the isoline calculation. Up to 3 thresholds per +// provided type can be requested. +type IsolineThresholds struct { + + // Distance to be used for the isoline calculation. + Distance []int64 + + // Time to be used for the isoline calculation. + Time []int64 + + noSmithyDocumentSerde +} + +// Options related to traffic. +type IsolineTrafficOptions struct { + + // Duration for which flow traffic is considered valid. For this period, the flow + // traffic is used over historical traffic data. Flow traffic refers to congestion, + // which changes very quickly. Duration in seconds for which flow traffic event + // would be considered valid. While flow traffic event is valid it will be used + // over the historical traffic data. + // + // Unit: seconds + FlowEventThresholdOverride int64 + + // Determines if traffic should be used or ignored while calculating the route. + // + // Default Value: UseTrafficData + Usage TrafficUsage + + noSmithyDocumentSerde +} + +// Trailer options corresponding to the vehicle. +type IsolineTrailerOptions struct { + + // Total number of axles of the vehicle. + AxleCount *int32 + + // Number of trailers attached to the vehicle. + // + // Default Value: 0 + TrailerCount *int32 + + noSmithyDocumentSerde +} + +// Travel mode related options for the provided travel mode. +type IsolineTravelModeOptions struct { + + // Travel mode options when the provided travel mode is "Car" + Car *IsolineCarOptions + + // Travel mode options when the provided travel mode is "Scooter" + Scooter *IsolineScooterOptions + + // Travel mode options when the provided travel mode is "Truck" + Truck *IsolineTruckOptions + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Truck" +type IsolineTruckOptions struct { + + // Total number of axles of the vehicle. + AxleCount *int32 + + // Engine type of the vehicle. + EngineType IsolineEngineType + + // Gross weight of the vehicle including trailers, and goods at capacity. + // + // Unit: Kilograms + GrossWeight int64 + + // List of Hazardous cargo contained in the vehicle. + HazardousCargos []IsolineHazardousCargoType + + // Height of the vehicle. + // + // Unit: centimeters + Height int64 + + // Height of the vehicle above its first axle. + // + // Unit: centimeters + HeightAboveFirstAxle int64 + + // Kingpin to rear axle length of the vehicle. + // + // Unit: centimeters + KpraLength int64 + + // Length of the vehicle. + // + // Unit: centimeters + Length int64 + + // The vehicle License Plate. + LicensePlate *IsolineVehicleLicensePlate + + // Maximum speed specified. + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + // Payload capacity of the vehicle and trailers attached. + // + // Unit: kilograms + PayloadCapacity int64 + + // Number of tires on the vehicle. + TireCount *int32 + + // Trailer options corresponding to the vehicle. + Trailer *IsolineTrailerOptions + + // Type of the truck. + TruckType IsolineTruckType + + // The tunnel restriction code. + // + // Tunnel categories in this list indicate the restrictions which apply to certain + // tunnels in Great Britain. They relate to the types of dangerous goods that can + // be transported through them. + // + // - Tunnel Category B + // + // - Risk Level: Limited risk + // + // - Restrictions: Few restrictions + // + // - Tunnel Category C + // + // - Risk Level: Medium risk + // + // - Restrictions: Some restrictions + // + // - Tunnel Category D + // + // - Risk Level: High risk + // + // - Restrictions: Many restrictions occur + // + // - Tunnel Category E + // + // - Risk Level: Very high risk + // + // - Restrictions: Restricted tunnel + TunnelRestrictionCode *string + + // Heaviest weight per axle irrespective of the axle type or the axle group. Meant + // for usage in countries where the differences in axle types or axle groups are + // not distinguished. + // + // Unit: Kilograms + WeightPerAxle int64 + + // Specifies the total weight for the specified axle group. Meant for usage in + // countries that have different regulations based on the axle group type. + // + // Unit: Kilograms + WeightPerAxleGroup *WeightPerAxleGroup + + // Width of the vehicle. + // + // Unit: centimeters + Width int64 + + noSmithyDocumentSerde +} + +// The vehicle license plate. +type IsolineVehicleLicensePlate struct { + + // The last character of the License Plate. + LastCharacter *string + + noSmithyDocumentSerde +} + +// The localized string. +type LocalizedString struct { + + // The value of the localized string. + // + // This member is required. + Value *string + + // A list of BCP 47 compliant language codes for the results to be rendered in. + // The request uses the regional default as the fallback if the requested language + // can't be provided. + Language *string + + noSmithyDocumentSerde +} + +// Geometry defined as an encoded corridor - an encoded polyline with a radius +// that defines the width of the corridor. +type PolylineCorridor struct { + + // An ordered list of positions used to plot a route on a map in a lossy + // compression format. + // + // LineString and Polyline are mutually exclusive properties. + // + // This member is required. + Polyline *string + + // Considers all roads within the provided radius to match the provided + // destination to. The roads that are considered are determined by the provided + // Strategy. + // + // Unit: Meters + // + // This member is required. + Radius *int32 + + noSmithyDocumentSerde +} + +// Notices provide information around factors that may have influenced snapping in +// a manner atypical to the standard use cases. +type RoadSnapNotice struct { + + // Code corresponding to the issue. + // + // This member is required. + Code RoadSnapNoticeCode + + // The notice title. + // + // This member is required. + Title *string + + // TracePoint indices for which the provided notice code corresponds to. + // + // This member is required. + TracePointIndexes []int32 + + noSmithyDocumentSerde +} + +// Interpolated geometry for the snapped route that is overlay-able onto a map. +type RoadSnapSnappedGeometry struct { + + // An ordered list of positions used to plot a route on a map. + // + // LineString and Polyline are mutually exclusive properties. + LineString [][]float64 + + // An ordered list of positions used to plot a route on a map in a lossy + // compression format. + // + // LineString and Polyline are mutually exclusive properties. + Polyline *string + + noSmithyDocumentSerde +} + +// TracePoints snapped onto the road network. +type RoadSnapSnappedTracePoint struct { + + // Confidence value for the correctness of this point match. + // + // This member is required. + Confidence *float64 + + // Position of the TracePoint provided within the request, at the same index. + // + // This member is required. + OriginalPosition []float64 + + // Snapped position of the TracePoint provided within the request, at the same + // index. + // + // This member is required. + SnappedPosition []float64 + + noSmithyDocumentSerde +} + +// TracePoint indices for which the provided notice code corresponds to. +type RoadSnapTracePoint struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // GPS Heading at the position. + Heading float64 + + // Speed at the specified trace point . + // + // Unit: KilometersPerHour + Speed float64 + + // Timestamp of the event. + Timestamp *string + + noSmithyDocumentSerde +} + +// Trailer options corresponding to the vehicle. +type RoadSnapTrailerOptions struct { + + // Number of trailers attached to the vehicle. + // + // Default Value: 0 + TrailerCount *int32 + + noSmithyDocumentSerde +} + +// Travel mode related options for the provided travel mode. +type RoadSnapTravelModeOptions struct { + + // Travel mode options when the provided travel mode is "Truck". + Truck *RoadSnapTruckOptions + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Truck". +type RoadSnapTruckOptions struct { + + // Gross weight of the vehicle including trailers, and goods at capacity. + // + // Unit: Kilograms + GrossWeight int64 + + // List of Hazardous cargos contained in the vehicle. + HazardousCargos []RoadSnapHazardousCargoType + + // Height of the vehicle. + // + // Unit: centimeters + Height int64 + + // Length of the vehicle. + // + // Unit: centimeters + Length int64 + + // Trailer options corresponding to the vehicle. + Trailer *RoadSnapTrailerOptions + + // The tunnel restriction code. + // + // Tunnel categories in this list indicate the restrictions which apply to certain + // tunnels in Great Britain. They relate to the types of dangerous goods that can + // be transported through them. + // + // - Tunnel Category B + // + // - Risk Level: Limited risk + // + // - Restrictions: Few restrictions + // + // - Tunnel Category C + // + // - Risk Level: Medium risk + // + // - Restrictions: Some restrictions + // + // - Tunnel Category D + // + // - Risk Level: High risk + // + // - Restrictions: Many restrictions occur + // + // - Tunnel Category E + // + // - Risk Level: Very high risk + // + // - Restrictions: Restricted tunnel + TunnelRestrictionCode *string + + // Width of the vehicle in centimenters. + Width int64 + + noSmithyDocumentSerde +} + +// The route. +type Route struct { + + // A leg is a section of a route from one waypoint to the next. A leg could be of + // type Vehicle, Pedestrian or Ferry. Legs of different types could occur together + // within a single route. For example, a car employing the use of a Ferry will + // contain Vehicle legs corresponding to journey on land, and Ferry legs + // corresponding to the journey via Ferry. + // + // This member is required. + Legs []RouteLeg + + // Important labels including names and route numbers that differentiate the + // current route from the alternatives presented. + // + // This member is required. + MajorRoadLabels []RouteMajorRoadLabel + + // Summarized details of the leg. + Summary *RouteSummary + + noSmithyDocumentSerde +} + +// Features that are allowed while calculating. a route +type RouteAllowOptions struct { + + // Allow Hot (High Occupancy Toll) lanes while calculating the route. + Hot *bool + + // Allow Hov (High Occupancy vehicle) lanes while calculating the route. + Hov *bool + + noSmithyDocumentSerde +} + +// Areas to be avoided. +type RouteAvoidanceArea struct { + + // Geometry of the area to be avoided. + // + // This member is required. + Geometry *RouteAvoidanceAreaGeometry + + // Exceptions to the provided avoidance geometry, to be included while calculating + // the route. + Except []RouteAvoidanceAreaGeometry + + noSmithyDocumentSerde +} + +// Geometry of the area to be avoided. +type RouteAvoidanceAreaGeometry struct { + + // Geometry defined as a bounding box. The first pair represents the X and Y + // coordinates (longitude and latitude,) of the southwest corner of the bounding + // box; the second pair represents the X and Y coordinates (longitude and latitude) + // of the northeast corner. + BoundingBox []float64 + + // Geometry defined as a corridor - a LineString with a radius that defines the + // width of the corridor. + Corridor *Corridor + + // Geometry defined as a polygon with only one linear ring. + Polygon [][][]float64 + + // Geometry defined as an encoded corridor - an encoded polyline with a radius + // that defines the width of the corridor. + PolylineCorridor *PolylineCorridor + + // A list of Isoline PolylinePolygon, for each isoline PolylinePolygon, it + // contains PolylinePolygon of the first linear ring (the outer ring) and from 2nd + // item to the last item (the inner rings). For more information on polyline + // encoding, see [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]. + // + // [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]: https://github.com/heremaps/flexiblepolyline/blob/master/README.md + PolylinePolygon []string + + noSmithyDocumentSerde +} + +// Options related to areas to be avoided. +type RouteAvoidanceOptions struct { + + // Areas to be avoided. + Areas []RouteAvoidanceArea + + // Avoid car-shuttle-trains while calculating the route. + CarShuttleTrains *bool + + // Avoid controlled access highways while calculating the route. + ControlledAccessHighways *bool + + // Avoid dirt roads while calculating the route. + DirtRoads *bool + + // Avoid ferries while calculating the route. + Ferries *bool + + // Avoid roads that have seasonal closure while calculating the route. + SeasonalClosure *bool + + // Avoids roads where the specified toll transponders are the only mode of payment. + TollRoads *bool + + // Avoids roads where the specified toll transponders are the only mode of payment. + TollTransponders *bool + + // Truck road type identifiers. BK1 through BK4 apply only to Sweden. + // A2,A4,B2,B4,C,D,ET2,ET4 apply only to Mexico. + // + // There are currently no other supported values as of 26th April 2024. + TruckRoadTypes []string + + // Avoid tunnels while calculating the route. + Tunnels *bool + + // Avoid U-turns for calculation on highways and motorways. + UTurns *bool + + // Zone categories to be avoided. + ZoneCategories []RouteAvoidanceZoneCategory + + noSmithyDocumentSerde +} + +// Zone categories to be avoided. +type RouteAvoidanceZoneCategory struct { + + // Zone category to be avoided. + // + // This member is required. + Category RouteZoneCategory + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Car" +type RouteCarOptions struct { + + // Engine type of the vehicle. + EngineType RouteEngineType + + // The vehicle License Plate. + LicensePlate *RouteVehicleLicensePlate + + // Maximum speed specified. + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + noSmithyDocumentSerde +} + +// Details related to the continue highway step. +type RouteContinueHighwayStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Details related to the continue step. +type RouteContinueStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + noSmithyDocumentSerde +} + +// Options related to the destination. +type RouteDestinationOptions struct { + + // Avoids actions for the provided distance. This is typically to consider for + // users in moving vehicles who may not have sufficient time to make an action at + // an origin or a destination. + AvoidActionsForDistance int64 + + // Avoid U-turns for calculation on highways and motorways. + AvoidUTurns *bool + + // GPS Heading at the position. + Heading float64 + + // Options to configure matching the provided position to the road network. + Matching *RouteMatchingOptions + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *RouteSideOfStreetOptions + + // Duration of the stop. + // + // Unit: seconds + StopDuration int64 + + noSmithyDocumentSerde +} + +// Driver related options. +type RouteDriverOptions struct { + + // Driver work-rest schedule. Stops are added to fulfil the provided rest schedule. + Schedule []RouteDriverScheduleInterval + + noSmithyDocumentSerde +} + +// Interval of the driver work-rest schedule. Stops are added to fulfil the +// provided rest schedule. +type RouteDriverScheduleInterval struct { + + // Maximum allowed driving time before stopping to rest. + // + // Unit: seconds + // + // This member is required. + DriveDuration int64 + + // Resting time before the driver can continue driving. + // + // Unit: seconds + // + // This member is required. + RestDuration int64 + + noSmithyDocumentSerde +} + +// Type of the emission. +// +// Valid values: Euro1, Euro2, Euro3, Euro4, Euro5, Euro6, EuroEev +type RouteEmissionType struct { + + // Type of the emission. + // + // Valid values: Euro1, Euro2, Euro3, Euro4, Euro5, Euro6, EuroEev + // + // This member is required. + Type *string + + // The CO 2 emission classes. + Co2EmissionClass *string + + noSmithyDocumentSerde +} + +// Details related to the enter highway step. +type RouteEnterHighwayStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Exclusion options for the route. +type RouteExclusionOptions struct { + + // List of countries to be avoided defined by two-letter or three-letter country + // codes. + // + // This member is required. + Countries []string + + noSmithyDocumentSerde +} + +// Details related to the exit step. +type RouteExitStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Exit to be taken. + RelativeExit *int32 + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Steps of a leg that must be performed after the travel portion of the leg. +type RouteFerryAfterTravelStep struct { + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Type of the step. + // + // This member is required. + Type RouteFerryAfterTravelStepType + + // Brief description of the step in the requested language. + // + // Only available when the TravelStepType is Default. + Instruction *string + + noSmithyDocumentSerde +} + +// Details corresponding to the arrival for the leg. +type RouteFerryArrival struct { + + // The place details. + // + // This member is required. + Place *RouteFerryPlace + + // The time. + Time *string + + noSmithyDocumentSerde +} + +// Steps of a leg that must be performed before the travel portion of the leg. +type RouteFerryBeforeTravelStep struct { + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Type of the step. + // + // This member is required. + Type RouteFerryBeforeTravelStepType + + // Brief description of the step in the requested language. + // + // Only available when the TravelStepType is Default. + Instruction *string + + noSmithyDocumentSerde +} + +// Details corresponding to the departure for the leg. +type RouteFerryDeparture struct { + + // The place details. + // + // This member is required. + Place *RouteFerryPlace + + // The time. + Time *string + + noSmithyDocumentSerde +} + +// FerryLegDetails is populated when the Leg type is Ferry, and provides +// additional information that is specific +type RouteFerryLegDetails struct { + + // Steps of a leg that must be performed after the travel portion of the leg. + // + // This member is required. + AfterTravelSteps []RouteFerryAfterTravelStep + + // Details corresponding to the arrival for the leg. + // + // This member is required. + Arrival *RouteFerryArrival + + // Steps of a leg that must be performed before the travel portion of the leg. + // + // This member is required. + BeforeTravelSteps []RouteFerryBeforeTravelStep + + // Details corresponding to the departure for the leg. + // + // This member is required. + Departure *RouteFerryDeparture + + // Notices are additional information returned that indicate issues that occurred + // during route calculation. + // + // This member is required. + Notices []RouteFerryNotice + + // Waypoints that were passed through during the leg. This includes the waypoints + // that were configured with the PassThrough option. + // + // This member is required. + PassThroughWaypoints []RoutePassThroughWaypoint + + // Spans that were computed for the requested SpanAdditionalFeatures. + // + // This member is required. + Spans []RouteFerrySpan + + // Steps of a leg that must be performed before the travel portion of the leg. + // + // This member is required. + TravelSteps []RouteFerryTravelStep + + // Route name of the ferry line. + RouteName *string + + // Summarized details of the leg. + Summary *RouteFerrySummary + + noSmithyDocumentSerde +} + +// Notices are additional information returned that indicate issues that occurred +// during route calculation. +type RouteFerryNotice struct { + + // Code corresponding to the issue. + // + // This member is required. + Code RouteFerryNoticeCode + + // Impact corresponding to the issue. While Low impact notices can be safely + // ignored, High impact notices must be evaluated further to determine the impact. + Impact RouteNoticeImpact + + noSmithyDocumentSerde +} + +// Summarized details of the leg. +type RouteFerryOverviewSummary struct { + + // Distance of the step. + // + // This member is required. + Distance int64 + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + noSmithyDocumentSerde +} + +// Position provided in the request. +type RouteFerryPlace struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // The name of the place. + Name *string + + // Position provided in the request. + OriginalPosition []float64 + + // Index of the waypoint in the request. + WaypointIndex *int32 + + noSmithyDocumentSerde +} + +// Span computed for the requested SpanAdditionalFeatures. +type RouteFerrySpan struct { + + // 3 letter Country code corresponding to the Span. + Country *string + + // Distance of the computed span. This feature doesn't split a span, but is always + // computed on a span split by other properties. + Distance int64 + + // Duration of the computed span. This feature doesn't split a span, but is always + // computed on a span split by other properties. + // + // Unit: seconds + Duration int64 + + // Offset in the leg geometry corresponding to the start of this span. + GeometryOffset *int32 + + // Provides an array of names of the ferry span in available languages. + Names []LocalizedString + + // 2-3 letter Region code corresponding to the Span. This is either a province or + // a state. + Region *string + + noSmithyDocumentSerde +} + +// Summarized details for the leg including travel steps only. The Distance for +// the travel only portion of the journey is the same as the Distance within the +// Overview summary. +type RouteFerrySummary struct { + + // Summarized details for the leg including before travel, travel and after travel + // steps. + Overview *RouteFerryOverviewSummary + + // Summarized details for the leg including travel steps only. The Distance for + // the travel only portion of the journey is in meters + TravelOnly *RouteFerryTravelOnlySummary + + noSmithyDocumentSerde +} + +// Summarized details for the leg including travel steps only. The Distance for +// the travel only portion of the journey is the same as the Distance within the +// Overview summary. +type RouteFerryTravelOnlySummary struct { + + // Total duration in free flowing traffic, which is the best case or shortest + // duration possible to cover the leg. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + noSmithyDocumentSerde +} + +// Steps of a leg that must be performed during the travel portion of the leg. +type RouteFerryTravelStep struct { + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Type of the step. + // + // This member is required. + Type RouteFerryTravelStepType + + // Distance of the step. + Distance int64 + + // Offset in the leg geometry corresponding to the start of this step. + GeometryOffset *int32 + + // Brief description of the step in the requested language. + // + // Only available when the TravelStepType is Default. + Instruction *string + + noSmithyDocumentSerde +} + +// Details that are specific to a Keep step. +type RouteKeepStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// A leg is a section of a route from one waypoint to the next. A leg could be of +// type Vehicle, Pedestrian or Ferry. Legs of different types could occur together +// within a single route. For example, a car employing the use of a Ferry will +// contain Vehicle legs corresponding to journey on land, and Ferry legs +// corresponding to the journey via Ferry. +type RouteLeg struct { + + // Geometry of the area to be avoided. + // + // This member is required. + Geometry *RouteLegGeometry + + // Specifies the mode of transport when calculating a route. Used in estimating + // the speed of travel and road compatibility. + // + // Default Value: Car + // + // This member is required. + TravelMode RouteLegTravelMode + + // Type of the leg. + // + // This member is required. + Type RouteLegType + + // FerryLegDetails is populated when the Leg type is Ferry, and provides + // additional information that is specific + FerryLegDetails *RouteFerryLegDetails + + // List of languages for instructions within steps in the response. + Language *string + + // Details related to the pedestrian leg. + PedestrianLegDetails *RoutePedestrianLegDetails + + // Details related to the vehicle leg. + VehicleLegDetails *RouteVehicleLegDetails + + noSmithyDocumentSerde +} + +// The returned Route leg geometry. +type RouteLegGeometry struct { + + // An ordered list of positions used to plot a route on a map. + // + // LineString and Polyline are mutually exclusive properties. + LineString [][]float64 + + // An ordered list of positions used to plot a route on a map in a lossy + // compression format. + // + // LineString and Polyline are mutually exclusive properties. + Polyline *string + + noSmithyDocumentSerde +} + +// Important labels including names and route numbers that differentiate the +// current route from the alternatives presented. +type RouteMajorRoadLabel struct { + + // Name of the road (localized). + RoadName *LocalizedString + + // Route number of the road. + RouteNumber *RouteNumber + + noSmithyDocumentSerde +} + +// Options related to route matching. +type RouteMatchingOptions struct { + + // Attempts to match the provided position to a road similar to the provided name. + NameHint *string + + // If the distance to a highway/bridge/tunnel/sliproad is within threshold, the + // waypoint will be snapped to the highway/bridge/tunnel/sliproad. + // + // Unit: meters + OnRoadThreshold int64 + + // Considers all roads within the provided radius to match the provided + // destination to. The roads that are considered are determined by the provided + // Strategy. + // + // Unit: Meters + Radius int64 + + // Strategy that defines matching of the position onto the road network. MatchAny + // considers all roads possible, whereas MatchMostSignificantRoad matches to the + // most significant road. + Strategy MatchingStrategy + + noSmithyDocumentSerde +} + +// Allow Options related to the route matrix. +type RouteMatrixAllowOptions struct { + + // Allow Hot (High Occupancy Toll) lanes while calculating the route. + Hot *bool + + // Allow Hov (High Occupancy vehicle) lanes while calculating the route. + Hov *bool + + noSmithyDocumentSerde +} + +// Provides the circle that was used while calculating the route. +type RouteMatrixAutoCircle struct { + + // The margin provided for the calculation. + Margin int64 + + // The maximum size of the radius provided for the calculation. + MaxRadius int64 + + noSmithyDocumentSerde +} + +// Area to be avoided. +type RouteMatrixAvoidanceArea struct { + + // Geometry of the area to be avoided. + // + // This member is required. + Geometry *RouteMatrixAvoidanceAreaGeometry + + noSmithyDocumentSerde +} + +// Geometry of the area to be avoided. +type RouteMatrixAvoidanceAreaGeometry struct { + + // Geometry defined as a bounding box. The first pair represents the X and Y + // coordinates (longitude and latitude,) of the southwest corner of the bounding + // box; the second pair represents the X and Y coordinates (longitude and latitude) + // of the northeast corner. + BoundingBox []float64 + + // Geometry defined as a polygon with only one linear ring. + Polygon [][][]float64 + + // A list of Isoline PolylinePolygon, for each isoline PolylinePolygon, it + // contains PolylinePolygon of the first linear ring (the outer ring) and from + // second item to the last item (the inner rings). For more information on polyline + // encoding, see [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]. + // + // [https://github.com/heremaps/flexiblepolyline/blob/master/README.md]: https://github.com/heremaps/flexiblepolyline/blob/master/README.md + PolylinePolygon []string + + noSmithyDocumentSerde +} + +// Options related to the route matrix. +type RouteMatrixAvoidanceOptions struct { + + // Areas to be avoided. + Areas []RouteMatrixAvoidanceArea + + // Avoid car-shuttle-trains while calculating the route. + CarShuttleTrains *bool + + // Avoid controlled access highways while calculating the route. + ControlledAccessHighways *bool + + // Avoid dirt roads while calculating the route. + DirtRoads *bool + + // Avoid ferries while calculating the route. + Ferries *bool + + // Avoids roads where the specified toll transponders are the only mode of payment. + TollRoads *bool + + // Avoids roads where the specified toll transponders are the only mode of payment. + TollTransponders *bool + + // Truck road type identifiers. BK1 through BK4 apply only to Sweden. + // A2,A4,B2,B4,C,D,ET2,ET4 apply only to Mexico. + // + // There are currently no other supported values as of 26th April 2024. + TruckRoadTypes []string + + // Avoid tunnels while calculating the route. + Tunnels *bool + + // Avoid U-turns for calculation on highways and motorways. + UTurns *bool + + // Zone categories to be avoided. + ZoneCategories []RouteMatrixAvoidanceZoneCategory + + noSmithyDocumentSerde +} + +// Zone categories to be avoided. +type RouteMatrixAvoidanceZoneCategory struct { + + // Zone category to be avoided. + Category RouteMatrixZoneCategory + + noSmithyDocumentSerde +} + +// Boundary within which the matrix is to be calculated. All data, origins and +// destinations outside the boundary are considered invalid. +type RouteMatrixBoundary struct { + + // Geometry of the area to be avoided. + Geometry *RouteMatrixBoundaryGeometry + + // No restrictions in terms of a routing boundary, and is typically used for + // longer routes. + Unbounded *bool + + noSmithyDocumentSerde +} + +// Geometry of the routing boundary. +type RouteMatrixBoundaryGeometry struct { + + // Provides the circle that was used while calculating the route. + AutoCircle *RouteMatrixAutoCircle + + // Geometry defined as a bounding box. The first pair represents the X and Y + // coordinates (longitude and latitude,) of the southwest corner of the bounding + // box; the second pair represents the X and Y coordinates (longitude and latitude) + // of the northeast corner. + BoundingBox []float64 + + // Geometry defined as a circle. When request routing boundary was set as + // AutoCircle , the response routing boundary will return Circle derived from the + // AutoCircle settings. + Circle *Circle + + // Geometry defined as a polygon with only one linear ring. + Polygon [][][]float64 + + noSmithyDocumentSerde +} + +// Options related to the car. +type RouteMatrixCarOptions struct { + + // The vehicle License Plate. + LicensePlate *RouteMatrixVehicleLicensePlate + + // Maximum speed + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + noSmithyDocumentSerde +} + +// The route destination. +type RouteMatrixDestination struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Destination related options. + Options *RouteMatrixDestinationOptions + + noSmithyDocumentSerde +} + +// Options related to the destination. +type RouteMatrixDestinationOptions struct { + + // Avoids actions for the provided distance. This is typically to consider for + // users in moving vehicles who may not have sufficient time to make an action at + // an origin or a destination. + AvoidActionsForDistance int64 + + // GPS Heading at the position. + Heading float64 + + // Options to configure matching the provided position to the road network. + Matching *RouteMatrixMatchingOptions + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *RouteMatrixSideOfStreetOptions + + noSmithyDocumentSerde +} + +// The calculated route matrix containing the results for all pairs of Origins to +// Destination positions. Each row corresponds to one entry in Origins. Each entry +// in the row corresponds to the route from that entry in Origins to an entry in +// Destination positions. +type RouteMatrixEntry struct { + + // The total distance of travel for the route. + // + // This member is required. + Distance int64 + + // The expected duration of travel for the route. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Error code that occurred during calculation of the route. + Error RouteMatrixErrorCode + + noSmithyDocumentSerde +} + +// Exclusion options. +type RouteMatrixExclusionOptions struct { + + // List of countries to be avoided defined by two-letter or three-letter country + // codes. + // + // This member is required. + Countries []string + + noSmithyDocumentSerde +} + +// Matching options. +type RouteMatrixMatchingOptions struct { + + // Attempts to match the provided position to a road similar to the provided name. + NameHint *string + + // If the distance to a highway/bridge/tunnel/sliproad is within threshold, the + // waypoint will be snapped to the highway/bridge/tunnel/sliproad. + // + // Unit: meters + OnRoadThreshold int64 + + // Considers all roads within the provided radius to match the provided + // destination to. The roads that are considered are determined by the provided + // Strategy. + // + // Unit: Meters + Radius int64 + + // Strategy that defines matching of the position onto the road network. MatchAny + // considers all roads possible, whereas MatchMostSignificantRoad matches to the + // most significant road. + Strategy MatchingStrategy + + noSmithyDocumentSerde +} + +// The start position for the route. +type RouteMatrixOrigin struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Origin related options. + Options *RouteMatrixOriginOptions + + noSmithyDocumentSerde +} + +// Origin related options. +type RouteMatrixOriginOptions struct { + + // Avoids actions for the provided distance. This is typically to consider for + // users in moving vehicles who may not have sufficient time to make an action at + // an origin or a destination. + AvoidActionsForDistance int64 + + // GPS Heading at the position. + Heading float64 + + // Options to configure matching the provided position to the road network. + Matching *RouteMatrixMatchingOptions + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *RouteMatrixSideOfStreetOptions + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Scooter" +type RouteMatrixScooterOptions struct { + + // The vehicle License Plate. + LicensePlate *RouteMatrixVehicleLicensePlate + + // Maximum speed. + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + noSmithyDocumentSerde +} + +// Options to configure matching the provided position to a side of the street. +type RouteMatrixSideOfStreetOptions struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Strategy that defines when the side of street position should be used. + // AnyStreet will always use the provided position. + // + // Default Value: DividedStreetOnly + UseWith SideOfStreetMatchingStrategy + + noSmithyDocumentSerde +} + +// Traffic related options. +type RouteMatrixTrafficOptions struct { + + // Duration for which flow traffic is considered valid. For this period, the flow + // traffic is used over historical traffic data. Flow traffic refers to congestion, + // which changes very quickly. Duration in seconds for which flow traffic event + // would be considered valid. While flow traffic event is valid it will be used + // over the historical traffic data. + FlowEventThresholdOverride int64 + + // Determines if traffic should be used or ignored while calculating the route. + // + // Default Value: UseTrafficData + Usage TrafficUsage + + noSmithyDocumentSerde +} + +// Trailer options corresponding to the vehicle. +type RouteMatrixTrailerOptions struct { + + // Number of trailers attached to the vehicle. + // + // Default Value: 0 + TrailerCount *int32 + + noSmithyDocumentSerde +} + +// Travel mode related options for the provided travel mode. +type RouteMatrixTravelModeOptions struct { + + // Travel mode options when the provided travel mode is "Car" + Car *RouteMatrixCarOptions + + // Travel mode options when the provided travel mode is "Scooter" + Scooter *RouteMatrixScooterOptions + + // Travel mode options when the provided travel mode is "Truck" + Truck *RouteMatrixTruckOptions + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Truck" +type RouteMatrixTruckOptions struct { + + // Total number of axles of the vehicle. + AxleCount *int32 + + // Gross weight of the vehicle including trailers, and goods at capacity. + // + // Unit: Kilograms + GrossWeight int64 + + // List of Hazardous cargo contained in the vehicle. + HazardousCargos []RouteMatrixHazardousCargoType + + // Height of the vehicle. + // + // Unit: centimeters + Height int64 + + // Kingpin to rear axle length of the vehicle + // + // Unit: centimeters + KpraLength int64 + + // Length of the vehicle. + // + // Unit: centimeters + Length int64 + + // The vehicle License Plate. + LicensePlate *RouteMatrixVehicleLicensePlate + + // Maximum speed + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + // Payload capacity of the vehicle and trailers attached. + // + // Unit: kilograms + PayloadCapacity int64 + + // Trailer options corresponding to the vehicle. + Trailer *RouteMatrixTrailerOptions + + // Type of the truck. + TruckType RouteMatrixTruckType + + // The tunnel restriction code. + // + // Tunnel categories in this list indicate the restrictions which apply to certain + // tunnels in Great Britain. They relate to the types of dangerous goods that can + // be transported through them. + // + // - Tunnel Category B + // + // - Risk Level: Limited risk + // + // - Restrictions: Few restrictions + // + // - Tunnel Category C + // + // - Risk Level: Medium risk + // + // - Restrictions: Some restrictions + // + // - Tunnel Category D + // + // - Risk Level: High risk + // + // - Restrictions: Many restrictions occur + // + // - Tunnel Category E + // + // - Risk Level: Very high risk + // + // - Restrictions: Restricted tunnel + TunnelRestrictionCode *string + + // Heaviest weight per axle irrespective of the axle type or the axle group. Meant + // for usage in countries where the differences in axle types or axle groups are + // not distinguished. + // + // Unit: Kilograms + WeightPerAxle int64 + + // Specifies the total weight for the specified axle group. Meant for usage in + // countries that have different regulations based on the axle group type. + WeightPerAxleGroup *WeightPerAxleGroup + + // Width of the vehicle. + // + // Unit: centimeters + Width int64 + + noSmithyDocumentSerde +} + +// The vehicle License Plate. +type RouteMatrixVehicleLicensePlate struct { + + // The last character of the License Plate. + LastCharacter *string + + noSmithyDocumentSerde +} + +// Notice Detail that is a range. +type RouteNoticeDetailRange struct { + + // Maximum value for the range. + Max *int32 + + // Minimum value for the range. + Min *int32 + + noSmithyDocumentSerde +} + +// The route number. +type RouteNumber struct { + + // The route number. + // + // This member is required. + Value *string + + // Directional identifier of the route. + Direction RouteDirection + + // List of languages for instructions corresponding to the route number. + Language *string + + noSmithyDocumentSerde +} + +// Origin related options. +type RouteOriginOptions struct { + + // Avoids actions for the provided distance. This is typically to consider for + // users in moving vehicles who may not have sufficient time to make an action at + // an origin or a destination. + AvoidActionsForDistance int64 + + // Avoid U-turns for calculation on highways and motorways. + AvoidUTurns *bool + + // GPS Heading at the position. + Heading float64 + + // Options to configure matching the provided position to the road network. + Matching *RouteMatchingOptions + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *RouteSideOfStreetOptions + + noSmithyDocumentSerde +} + +// The place where the waypoint is passed through and not treated as a stop. +type RoutePassThroughPlace struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Position provided in the request. + OriginalPosition []float64 + + // Index of the waypoint in the request. + WaypointIndex *int32 + + noSmithyDocumentSerde +} + +// If the waypoint should be treated as a stop. If yes, the route is split up into +// different legs around the stop. +type RoutePassThroughWaypoint struct { + + // The place details. + // + // This member is required. + Place *RoutePassThroughPlace + + // Offset in the leg geometry corresponding to the start of this step. + GeometryOffset *int32 + + noSmithyDocumentSerde +} + +// Details corresponding to the arrival for a leg. +// +// Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm +// +// Examples: +// +// 2020-04-22T17:57:24Z +// +// 2020-04-22T17:57:24+02:00 +type RoutePedestrianArrival struct { + + // The place details. + // + // This member is required. + Place *RoutePedestrianPlace + + // The time. + Time *string + + noSmithyDocumentSerde +} + +// Details corresponding to the departure for a leg. +// +// Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm +// +// Examples: +// +// 2020-04-22T17:57:24Z +// +// 2020-04-22T17:57:24+02:00 +type RoutePedestrianDeparture struct { + + // The place details. + // + // This member is required. + Place *RoutePedestrianPlace + + // The time. + Time *string + + noSmithyDocumentSerde +} + +// Details that are specific to a pedestrian leg. +type RoutePedestrianLegDetails struct { + + // Details corresponding to the arrival for the leg. + // + // This member is required. + Arrival *RoutePedestrianArrival + + // Details corresponding to the departure for the leg. + // + // This member is required. + Departure *RoutePedestrianDeparture + + // Notices are additional information returned that indicate issues that occurred + // during route calculation. + // + // This member is required. + Notices []RoutePedestrianNotice + + // Waypoints that were passed through during the leg. This includes the waypoints + // that were configured with the PassThrough option. + // + // This member is required. + PassThroughWaypoints []RoutePassThroughWaypoint + + // Spans that were computed for the requested SpanAdditionalFeatures. + // + // This member is required. + Spans []RoutePedestrianSpan + + // Steps of a leg that must be performed before the travel portion of the leg. + // + // This member is required. + TravelSteps []RoutePedestrianTravelStep + + // Summarized details of the leg. + Summary *RoutePedestrianSummary + + noSmithyDocumentSerde +} + +// Notices are additional information returned that indicate issues that occurred +// during route calculation. +type RoutePedestrianNotice struct { + + // Code corresponding to the issue. + // + // This member is required. + Code RoutePedestrianNoticeCode + + // Impact corresponding to the issue. While Low impact notices can be safely + // ignored, High impact notices must be evaluated further to determine the impact. + Impact RouteNoticeImpact + + noSmithyDocumentSerde +} + +// Options related to the pedestrian. +type RoutePedestrianOptions struct { + + // Walking speed in Kilometers per hour. + Speed *float64 + + noSmithyDocumentSerde +} + +// Provides a summary of a pedestrian route step. +type RoutePedestrianOverviewSummary struct { + + // Distance of the step. + // + // This member is required. + Distance int64 + + // Duration of the step. + // + // This member is required. + Duration int64 + + noSmithyDocumentSerde +} + +// Place details corresponding to the arrival or departure. +type RoutePedestrianPlace struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // The name of the place. + Name *string + + // Position provided in the request. + OriginalPosition []float64 + + // Options to configure matching the provided position to a side of the street. + SideOfStreet RouteSideOfStreet + + // Index of the waypoint in the request. + WaypointIndex *int32 + + noSmithyDocumentSerde +} + +// Span computed for the requested SpanAdditionalFeatures. +type RoutePedestrianSpan struct { + + // Duration of the computed span without traffic congestion. + // + // Unit: seconds + BestCaseDuration int64 + + // 3 letter Country code corresponding to the Span. + Country *string + + // Distance of the computed span. This feature doesn't split a span, but is always + // computed on a span split by other properties. + Distance int64 + + // Duration of the computed span. This feature doesn't split a span, but is always + // computed on a span split by other properties. + // + // Unit: seconds + Duration int64 + + // Dynamic speed details corresponding to the span. + // + // Unit: KilometersPerHour + DynamicSpeed *RouteSpanDynamicSpeedDetails + + // Functional classification of the road segment corresponding to the span. + FunctionalClassification *int32 + + // Offset in the leg geometry corresponding to the start of this span. + GeometryOffset *int32 + + // Incidents corresponding to the span. These index into the Incidents in the + // parent Leg. + Incidents []int32 + + // Provides an array of names of the pedestrian span in available languages. + Names []LocalizedString + + // Access attributes for a pedestrian corresponding to the span. + PedestrianAccess []RouteSpanPedestrianAccessAttribute + + // 2-3 letter Region code corresponding to the Span. This is either a province or + // a state. + Region *string + + // Attributes for the road segment corresponding to the span. + RoadAttributes []RouteSpanRoadAttribute + + // Designated route name or number corresponding to the span. + RouteNumbers []RouteNumber + + // Speed limit details corresponding to the span. + // + // Unit: KilometersPerHour + SpeedLimit *RouteSpanSpeedLimitDetails + + // Duration of the computed span under typical traffic congestion. + // + // Unit: seconds + TypicalDuration int64 + + noSmithyDocumentSerde +} + +// Summarized details for the leg including before travel, travel and after travel +// steps. +type RoutePedestrianSummary struct { + + // Summarized details for the leg including before travel, travel and after travel + // steps. + Overview *RoutePedestrianOverviewSummary + + // Summarized details for the leg including travel steps only. The Distance for + // the travel only portion of the journey is in meters + TravelOnly *RoutePedestrianTravelOnlySummary + + noSmithyDocumentSerde +} + +// Summarized details for the leg including travel steps. +type RoutePedestrianTravelOnlySummary struct { + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + noSmithyDocumentSerde +} + +// Steps of a leg that must be performed during the travel portion of the leg. +type RoutePedestrianTravelStep struct { + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Type of the step. + // + // This member is required. + Type RoutePedestrianTravelStepType + + // Details related to the continue step. + ContinueStepDetails *RouteContinueStepDetails + + // Details of the current road. See RouteRoad for details of sub-attributes. + CurrentRoad *RouteRoad + + // Distance of the step. + Distance int64 + + // Exit number of the road exit, if applicable. + ExitNumber []LocalizedString + + // Offset in the leg geometry corresponding to the start of this step. + GeometryOffset *int32 + + // Brief description of the step in the requested language. + // + // Only available when the TravelStepType is Default. + Instruction *string + + // Details that are specific to a Keep step. + KeepStepDetails *RouteKeepStepDetails + + // Details of the next road. See RouteRoad for details of sub-attributes. + NextRoad *RouteRoad + + // Details that are specific to a Roundabout Enter step. + RoundaboutEnterStepDetails *RouteRoundaboutEnterStepDetails + + // Details that are specific to a Roundabout Exit step. + RoundaboutExitStepDetails *RouteRoundaboutExitStepDetails + + // Details that are specific to a Roundabout Pass step. + RoundaboutPassStepDetails *RouteRoundaboutPassStepDetails + + // Sign post information of the action, applicable only for TurnByTurn steps. See + // RouteSignpost for details of sub-attributes. + Signpost *RouteSignpost + + // Details that are specific to a turn step. + TurnStepDetails *RouteTurnStepDetails + + noSmithyDocumentSerde +} + +// Details that are specific to a ramp step. +type RouteRampStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Notices are additional information returned that indicate issues that occurred +// during route calculation. +type RouteResponseNotice struct { + + // Code corresponding to the issue. + // + // This member is required. + Code RouteResponseNoticeCode + + // Impact corresponding to the issue. While Low impact notices can be safely + // ignored, High impact notices must be evaluated further to determine the impact. + Impact RouteNoticeImpact + + noSmithyDocumentSerde +} + +// The road on the route. +type RouteRoad struct { + + // Name of the road (localized). + // + // This member is required. + RoadName []LocalizedString + + // Route number of the road. + // + // This member is required. + RouteNumber []RouteNumber + + // Names of destinations that can be reached when traveling on the road. + // + // This member is required. + Towards []LocalizedString + + // The type of road. + Type RouteRoadType + + noSmithyDocumentSerde +} + +// Details about the roundabout leg. +type RouteRoundaboutEnterStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Details about the roundabout step. +type RouteRoundaboutExitStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Exit to be taken. + RelativeExit *int32 + + // Angle of the roundabout. + RoundaboutAngle float64 + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + noSmithyDocumentSerde +} + +// Details about the step. +type RouteRoundaboutPassStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Scooter" +type RouteScooterOptions struct { + + // Engine type of the vehicle. + EngineType RouteEngineType + + // The vehicle License Plate. + LicensePlate *RouteVehicleLicensePlate + + // Maximum speed + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + noSmithyDocumentSerde +} + +// Options to configure matching the provided position to a side of the street. +type RouteSideOfStreetOptions struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Strategy that defines when the side of street position should be used. + // + // Default Value: DividedStreetOnly + UseWith SideOfStreetMatchingStrategy + + noSmithyDocumentSerde +} + +// Sign post information of the action, applicable only for TurnByTurn steps. See +// RouteSignpost for details of sub-attributes. +type RouteSignpost struct { + + // Labels present on the sign post. + // + // This member is required. + Labels []RouteSignpostLabel + + noSmithyDocumentSerde +} + +// Labels presented on the sign post. +type RouteSignpostLabel struct { + + // Route number of the road. + RouteNumber *RouteNumber + + // The Signpost text. + Text *LocalizedString + + noSmithyDocumentSerde +} + +// Details about the dynamic speed. +// +// Unit: KilometersPerHour +type RouteSpanDynamicSpeedDetails struct { + + // Estimated speed while traversing the span without traffic congestion. + // + // Unit: KilometersPerHour + BestCaseSpeed float64 + + // Estimated time to turn from this span into the next. + // + // Unit: seconds + TurnDuration int64 + + // Estimated speed while traversing the span under typical traffic congestion. + // + // Unit: KilometersPerHour + TypicalSpeed float64 + + noSmithyDocumentSerde +} + +// Details about the speed limit corresponding to the span. +// +// Unit: KilometersPerHour +type RouteSpanSpeedLimitDetails struct { + + // Maximum speed. + // + // Unit: KilometersPerHour + MaxSpeed float64 + + // If the span doesn't have a speed limit like the Autobahn. + Unlimited *bool + + noSmithyDocumentSerde +} + +// Summarized details for the leg including travel steps only. The Distance for +// the travel only portion of the journey is the same as the Distance within the +// Overview summary. +type RouteSummary struct { + + // Distance of the route. + Distance int64 + + // Duration of the route. + // + // Unit: seconds + Duration int64 + + // Toll summary for the complete route. + Tolls *RouteTollSummary + + noSmithyDocumentSerde +} + +// Provides details about toll information along a route, including the payment +// sites, applicable toll rates, toll systems, and the country associated with the +// toll collection. +type RouteToll struct { + + // Locations or sites where the toll fare is collected. + // + // This member is required. + PaymentSites []RouteTollPaymentSite + + // Toll rates that need to be paid to travel this leg of the route. + // + // This member is required. + Rates []RouteTollRate + + // Toll systems are authorities that collect payments for the toll. + // + // This member is required. + Systems []int32 + + // The alpha-2 or alpha-3 character code for the country. + Country *string + + noSmithyDocumentSerde +} + +// Options related to Tolls on a route. +type RouteTollOptions struct { + + // Specifies if the user has valid transponder with access to all toll systems. + // This impacts toll calculation, and if true the price with transponders is used. + AllTransponders *bool + + // Specifies if the user has valid vignettes with access for all toll roads. If a + // user has a vignette for a toll road, then toll cost for that road is omitted + // since no further payment is necessary. + AllVignettes *bool + + // Currency code corresponding to the price. This is the same as Currency + // specified in the request. + Currency *string + + // Emission type of the vehicle for toll cost calculation. + // + // Valid values: Euro1, Euro2, Euro3, Euro4, Euro5, Euro6, EuroEev + EmissionType *RouteEmissionType + + // Vehicle category for toll cost calculation. + VehicleCategory RouteTollVehicleCategory + + noSmithyDocumentSerde +} + +// Details if the toll rate can be a pass that supports multiple trips. +type RouteTollPass struct { + + // If the pass includes the rate for the return leg of the trip. + IncludesReturnTrip *bool + + // If the pass is only valid for senior persons. + SeniorPass *bool + + // If the toll pass can be transferred, and how many times. + TransferCount *int32 + + // Number of trips the pass is valid for. + TripCount *int32 + + // Period for which the pass is valid. + ValidityPeriod *RouteTollPassValidityPeriod + + noSmithyDocumentSerde +} + +// Period for which the pass is valid. +type RouteTollPassValidityPeriod struct { + + // Validity period. + // + // This member is required. + Period RouteTollPassValidityPeriodType + + // Counts for the validity period. + PeriodCount *int32 + + noSmithyDocumentSerde +} + +// Locations or sites where the toll fare is collected. +type RouteTollPaymentSite struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Name of the payment site. + Name *string + + noSmithyDocumentSerde +} + +// The toll price. +type RouteTollPrice struct { + + // Currency code corresponding to the price. This is the same as Currency + // specified in the request. + // + // This member is required. + Currency *string + + // If the price is an estimate or an exact value. + // + // This member is required. + Estimate *bool + + // If the price is a range or an exact value. If any of the toll fares making up + // the route is a range, the overall price is also a range. + // + // This member is required. + Range *bool + + // Exact price, if not a range. + // + // This member is required. + Value *float64 + + // Duration for which the price corresponds to. + // + // Unit: seconds + PerDuration int64 + + // Price range with a minimum and maximum value, if a range. + RangeValue *RouteTollPriceValueRange + + noSmithyDocumentSerde +} + +// Summary of the route and toll price. +type RouteTollPriceSummary struct { + + // Currency code corresponding to the price. This is the same as Currency + // specified in the request. + // + // This member is required. + Currency *string + + // If the price is an estimate or an exact value. + // + // This member is required. + Estimate *bool + + // If the price is a range or an exact value. If any of the toll fares making up + // the route is a range, the overall price is also a range. + // + // This member is required. + Range *bool + + // Exact price, if not a range. + // + // This member is required. + Value *float64 + + // Price range with a minimum and maximum value, if a range. + RangeValue *RouteTollPriceValueRange + + noSmithyDocumentSerde +} + +// Price range with a minimum and maximum value, if a range. +type RouteTollPriceValueRange struct { + + // Maximum price. + // + // This member is required. + Max *float64 + + // Minimum price. + // + // This member is required. + Min *float64 + + noSmithyDocumentSerde +} + +// The toll rate. +type RouteTollRate struct { + + // The Toll rate Id. + // + // This member is required. + Id *string + + // Price in the local regional currency. + // + // This member is required. + LocalPrice *RouteTollPrice + + // The name of the toll. + // + // This member is required. + Name *string + + // Accepted payment methods at the toll. + // + // This member is required. + PaymentMethods []RouteTollPaymentMethod + + // Transponders for which this toll can be applied. + // + // This member is required. + Transponders []RouteTransponder + + // Time when the rate is valid. + ApplicableTimes *string + + // Price in the converted currency as specified in the request. + ConvertedPrice *RouteTollPrice + + // Details if the toll rate can be a pass that supports multiple trips. + Pass *RouteTollPass + + noSmithyDocumentSerde +} + +// The toll summary for the complete route. +type RouteTollSummary struct { + + // Total toll summary for the complete route. Total is the only summary available + // today. + Total *RouteTollPriceSummary + + noSmithyDocumentSerde +} + +// Toll systems are authorities that collect payments for the toll. +type RouteTollSystem struct { + + // The toll system name. + Name *string + + noSmithyDocumentSerde +} + +// Traffic options for the route. +type RouteTrafficOptions struct { + + // Duration for which flow traffic is considered valid. For this period, the flow + // traffic is used over historical traffic data. Flow traffic refers to congestion, + // which changes very quickly. Duration in seconds for which flow traffic event + // would be considered valid. While flow traffic event is valid it will be used + // over the historical traffic data. + FlowEventThresholdOverride int64 + + // Determines if traffic should be used or ignored while calculating the route. + // + // Default Value: UseTrafficData + Usage TrafficUsage + + noSmithyDocumentSerde +} + +// Trailer options corresponding to the vehicle. +type RouteTrailerOptions struct { + + // Total number of axles of the vehicle. + AxleCount *int32 + + // Number of trailers attached to the vehicle. + // + // Default Value: 0 + TrailerCount *int32 + + noSmithyDocumentSerde +} + +// Transponders for which this toll can be applied. +type RouteTransponder struct { + + // Names of the toll system collecting the toll. + SystemName *string + + noSmithyDocumentSerde +} + +// Travel mode related options for the provided travel mode. +type RouteTravelModeOptions struct { + + // Travel mode options when the provided travel mode is "Car" + Car *RouteCarOptions + + // Travel mode options when the provided travel mode is "Pedestrian" + Pedestrian *RoutePedestrianOptions + + // Travel mode options when the provided travel mode is "Scooter" + Scooter *RouteScooterOptions + + // Travel mode options when the provided travel mode is "Truck" + Truck *RouteTruckOptions + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Truck" +type RouteTruckOptions struct { + + // Total number of axles of the vehicle. + AxleCount *int32 + + // Engine type of the vehicle. + EngineType RouteEngineType + + // Gross weight of the vehicle including trailers, and goods at capacity. + // + // Unit: Kilograms + GrossWeight int64 + + // List of Hazardous cargo contained in the vehicle. + HazardousCargos []RouteHazardousCargoType + + // Height of the vehicle. + // + // Unit: centimeters + Height int64 + + // Height of the vehicle above its first axle. + // + // Unit: centimeters + HeightAboveFirstAxle int64 + + // Kingpin to rear axle length of the vehicle. + // + // Unit: centimeters + KpraLength int64 + + // Length of the vehicle. + // + // Unit: c + Length int64 + + // The vehicle License Plate. + LicensePlate *RouteVehicleLicensePlate + + // Maximum speed + // + // Unit: KilometersPerHour + MaxSpeed *float64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *int32 + + // Payload capacity of the vehicle and trailers attached. + // + // Unit: kilograms + PayloadCapacity int64 + + // Number of tires on the vehicle. + TireCount *int32 + + // Trailer options corresponding to the vehicle. + Trailer *RouteTrailerOptions + + // Type of the truck. + TruckType RouteTruckType + + // The tunnel restriction code. + // + // Tunnel categories in this list indicate the restrictions which apply to certain + // tunnels in Great Britain. They relate to the types of dangerous goods that can + // be transported through them. + // + // - Tunnel Category B + // + // - Risk Level: Limited risk + // + // - Restrictions: Few restrictions + // + // - Tunnel Category C + // + // - Risk Level: Medium risk + // + // - Restrictions: Some restrictions + // + // - Tunnel Category D + // + // - Risk Level: High risk + // + // - Restrictions: Many restrictions occur + // + // - Tunnel Category E + // + // - Risk Level: Very high risk + // + // - Restrictions: Restricted tunnel + TunnelRestrictionCode *string + + // Heaviest weight per axle irrespective of the axle type or the axle group. Meant + // for usage in countries where the differences in axle types or axle groups are + // not distinguished. + // + // Unit: Kilograms + WeightPerAxle int64 + + // Specifies the total weight for the specified axle group. Meant for usage in + // countries that have different regulations based on the axle group type. + // + // Unit: Kilograms + WeightPerAxleGroup *WeightPerAxleGroup + + // Width of the vehicle. + // + // Unit: centimeters + Width int64 + + noSmithyDocumentSerde +} + +// Details related to the turn step. +type RouteTurnStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Details related to the U-turn step. +type RouteUTurnStepDetails struct { + + // Name of the intersection, if applicable to the step. + // + // This member is required. + Intersection []LocalizedString + + // Steering direction for the step. + SteeringDirection RouteSteeringDirection + + // Angle of the turn. + TurnAngle float64 + + // Intensity of the turn. + TurnIntensity RouteTurnIntensity + + noSmithyDocumentSerde +} + +// Details corresponding to the arrival for a leg. +type RouteVehicleArrival struct { + + // The place details. + // + // This member is required. + Place *RouteVehiclePlace + + // The time. + Time *string + + noSmithyDocumentSerde +} + +// Details corresponding to the departure for the leg. +type RouteVehicleDeparture struct { + + // The place details. + // + // This member is required. + Place *RouteVehiclePlace + + // The departure time. + Time *string + + noSmithyDocumentSerde +} + +// Incidents corresponding to this leg of the route. +type RouteVehicleIncident struct { + + // Brief readable description of the incident. + Description *string + + // End timestamp of the incident. + EndTime *string + + // Severity of the incident Critical - The part of the route the incident affects + // is unusable. Major- Major impact on the leg duration, for example stop and go + // Minor- Minor impact on the leg duration, for example traffic jam Low - Low on + // duration, for example slightly increased traffic + Severity RouteVehicleIncidentSeverity + + // Start time of the incident. + StartTime *string + + // Type of the incident. + Type RouteVehicleIncidentType + + noSmithyDocumentSerde +} + +// Steps of a leg that correspond to the travel portion of the leg. +type RouteVehicleLegDetails struct { + + // Details corresponding to the arrival for the leg. + // + // This member is required. + Arrival *RouteVehicleArrival + + // Details corresponding to the departure for the leg. + // + // This member is required. + Departure *RouteVehicleDeparture + + // Incidents corresponding to this leg of the route. + // + // This member is required. + Incidents []RouteVehicleIncident + + // Notices are additional information returned that indicate issues that occurred + // during route calculation. + // + // This member is required. + Notices []RouteVehicleNotice + + // Waypoints that were passed through during the leg. This includes the waypoints + // that were configured with the PassThrough option. + // + // This member is required. + PassThroughWaypoints []RoutePassThroughWaypoint + + // Spans that were computed for the requested SpanAdditionalFeatures. + // + // This member is required. + Spans []RouteVehicleSpan + + // Toll systems are authorities that collect payments for the toll. + // + // This member is required. + TollSystems []RouteTollSystem + + // Toll related options. + // + // This member is required. + Tolls []RouteToll + + // Steps of a leg that must be performed before the travel portion of the leg. + // + // This member is required. + TravelSteps []RouteVehicleTravelStep + + // Truck road type identifiers. BK1 through BK4 apply only to Sweden. + // A2,A4,B2,B4,C,D,ET2,ET4 apply only to Mexico. + // + // There are currently no other supported values as of 26th April 2024. + // + // This member is required. + TruckRoadTypes []string + + // Zones corresponding to this leg of the route. + // + // This member is required. + Zones []RouteZone + + // Summarized details of the leg. + Summary *RouteVehicleSummary + + noSmithyDocumentSerde +} + +// License plate information of the vehicle. Currently, only the last character is +// used where license plate based controlled access is enforced. +type RouteVehicleLicensePlate struct { + + // The last character of the License Plate. + LastCharacter *string + + noSmithyDocumentSerde +} + +// Notices are additional information returned that indicate issues that occurred +// during route calculation. +type RouteVehicleNotice struct { + + // Code corresponding to the issue. + // + // This member is required. + Code RouteVehicleNoticeCode + + // Additional details of the notice. + // + // This member is required. + Details []RouteVehicleNoticeDetail + + // Impact corresponding to the issue. While Low impact notices can be safely + // ignored, High impact notices must be evaluated further to determine the impact. + Impact RouteNoticeImpact + + noSmithyDocumentSerde +} + +// Additional details of the notice. +type RouteVehicleNoticeDetail struct { + + // The notice title. + Title *string + + // Any violated constraints. + ViolatedConstraints *RouteViolatedConstraints + + noSmithyDocumentSerde +} + +// Summarized details of the leg. +type RouteVehicleOverviewSummary struct { + + // Distance of the step. + // + // This member is required. + Distance int64 + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Total duration in free flowing traffic, which is the best case or shortest + // duration possible to cover the leg. + // + // Unit: seconds + BestCaseDuration int64 + + // Duration of the computed span under typical traffic congestion. + // + // Unit: seconds + TypicalDuration int64 + + noSmithyDocumentSerde +} + +// Place details corresponding to the arrival or departure. +type RouteVehiclePlace struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // The name of the place. + Name *string + + // Position provided in the request. + OriginalPosition []float64 + + // Options to configure matching the provided position to a side of the street. + SideOfStreet RouteSideOfStreet + + // Index of the waypoint in the request. + WaypointIndex *int32 + + noSmithyDocumentSerde +} + +// Span computed for the requested SpanAdditionalFeatures. +type RouteVehicleSpan struct { + + // Duration of the computed span without traffic congestion. + // + // Unit: seconds + BestCaseDuration int64 + + // Access attributes for a car corresponding to the span. + CarAccess []RouteSpanCarAccessAttribute + + // 3 letter Country code corresponding to the Span. + Country *string + + // Distance of the computed span. This feature doesn't split a span, but is always + // computed on a span split by other properties. + Distance int64 + + // Duration of the computed span. This feature doesn't split a span, but is always + // computed on a span split by other properties. + // + // Unit: seconds + Duration int64 + + // Dynamic speed details corresponding to the span. + // + // Unit: KilometersPerHour + DynamicSpeed *RouteSpanDynamicSpeedDetails + + // Functional classification of the road segment corresponding to the span. + FunctionalClassification *int32 + + // Attributes corresponding to a gate. The gate is present at the end of the + // returned span. + Gate RouteSpanGateAttribute + + // Offset in the leg geometry corresponding to the start of this span. + GeometryOffset *int32 + + // Incidents corresponding to the span. These index into the Incidents in the + // parent Leg. + Incidents []int32 + + // Provides an array of names of the vehicle span in available languages. + Names []LocalizedString + + // Notices are additional information returned that indicate issues that occurred + // during route calculation. + Notices []int32 + + // Attributes corresponding to a railway crossing. The gate is present at the end + // of the returned span. + RailwayCrossing RouteSpanRailwayCrossingAttribute + + // 2-3 letter Region code corresponding to the Span. This is either a province or + // a state. + Region *string + + // Attributes for the road segment corresponding to the span. + RoadAttributes []RouteSpanRoadAttribute + + // Designated route name or number corresponding to the span. + RouteNumbers []RouteNumber + + // Access attributes for a scooter corresponding to the span. + ScooterAccess []RouteSpanScooterAccessAttribute + + // Speed limit details corresponding to the span. + // + // Unit: KilometersPerHour + SpeedLimit *RouteSpanSpeedLimitDetails + + // Toll systems are authorities that collect payments for the toll. + TollSystems []int32 + + // Access attributes for a truck corresponding to the span. + TruckAccess []RouteSpanTruckAccessAttribute + + // Truck road type identifiers. BK1 through BK4 apply only to Sweden. + // A2,A4,B2,B4,C,D,ET2,ET4 apply only to Mexico. + // + // There are currently no other supported values as of 26th April 2024. + TruckRoadTypes []int32 + + // Duration of the computed span under typical traffic congestion. + // + // Unit: seconds + TypicalDuration int64 + + // Zones corresponding to this leg of the route. + Zones []int32 + + noSmithyDocumentSerde +} + +// Summarized details of the route. +type RouteVehicleSummary struct { + + // Summarized details for the leg including before travel, travel and after travel + // steps. + Overview *RouteVehicleOverviewSummary + + // Summarized details for the leg including travel steps only. The Distance for + // the travel only portion of the journey is in meters + TravelOnly *RouteVehicleTravelOnlySummary + + noSmithyDocumentSerde +} + +// Summarized details of the route. +type RouteVehicleTravelOnlySummary struct { + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Total duration in free flowing traffic, which is the best case or shortest + // duration possible to cover the leg. + // + // Unit: seconds + BestCaseDuration int64 + + // Duration of the computed span under typical traffic congestion. + // + // Unit: seconds + TypicalDuration int64 + + noSmithyDocumentSerde +} + +// Steps of a leg that correspond to the travel portion of the leg. +type RouteVehicleTravelStep struct { + + // Duration of the step. + // + // Unit: seconds + // + // This member is required. + Duration int64 + + // Type of the step. + // + // This member is required. + Type RouteVehicleTravelStepType + + // Details that are specific to a Continue Highway step. + ContinueHighwayStepDetails *RouteContinueHighwayStepDetails + + // Details that are specific to a Continue step. + ContinueStepDetails *RouteContinueStepDetails + + // Details of the current road. + CurrentRoad *RouteRoad + + // Distance of the step. + Distance int64 + + // Details that are specific to a Enter Highway step. + EnterHighwayStepDetails *RouteEnterHighwayStepDetails + + // Exit number of the road exit, if applicable. + ExitNumber []LocalizedString + + // Details that are specific to a Roundabout Exit step. + ExitStepDetails *RouteExitStepDetails + + // Offset in the leg geometry corresponding to the start of this step. + GeometryOffset *int32 + + // Brief description of the step in the requested language. + // + // Only available when the TravelStepType is Default. + Instruction *string + + // Details that are specific to a Keep step. + KeepStepDetails *RouteKeepStepDetails + + // Details of the next road. See RouteRoad for details of sub-attributes. + NextRoad *RouteRoad + + // Details that are specific to a Ramp step. + RampStepDetails *RouteRampStepDetails + + // Details that are specific to a Roundabout Enter step. + RoundaboutEnterStepDetails *RouteRoundaboutEnterStepDetails + + // Details that are specific to a Roundabout Exit step. + RoundaboutExitStepDetails *RouteRoundaboutExitStepDetails + + // Details that are specific to a Roundabout Pass step. + RoundaboutPassStepDetails *RouteRoundaboutPassStepDetails + + // Sign post information of the action, applicable only for TurnByTurn steps. See + // RouteSignpost for details of sub-attributes. + Signpost *RouteSignpost + + // Details that are specific to a Turn step. + TurnStepDetails *RouteTurnStepDetails + + // Details that are specific to a Turn step. + UTurnStepDetails *RouteUTurnStepDetails + + noSmithyDocumentSerde +} + +// This property contains a summary of violated constraints. +type RouteViolatedConstraints struct { + + // List of Hazardous cargo contained in the vehicle. + // + // This member is required. + HazardousCargos []RouteHazardousCargoType + + // This restriction applies to truck cargo, where the resulting route excludes + // roads on which hazardous materials are prohibited from being transported. + AllHazardsRestricted *bool + + // Total number of axles of the vehicle. + AxleCount *RouteNoticeDetailRange + + // The maximum height of the vehicle. + MaxHeight int64 + + // The maximum Kpra length of the vehicle. + // + // Unit: centimeters + MaxKpraLength int64 + + // The maximum length of the vehicle. + MaxLength int64 + + // The maximum load capacity of the vehicle. + // + // Unit: kilograms + MaxPayloadCapacity int64 + + // The maximum weight of the route. + // + // Unit: Kilograms + MaxWeight *RouteWeightConstraint + + // The maximum weight per axle of the vehicle. + // + // Unit: Kilograms + MaxWeightPerAxle int64 + + // The maximum weight per axle group of the vehicle. + // + // Unit: Kilograms + MaxWeightPerAxleGroup *WeightPerAxleGroup + + // The maximum width of the vehicle. + MaxWidth int64 + + // The number of occupants in the vehicle. + // + // Default Value: 1 + Occupancy *RouteNoticeDetailRange + + // Access radius restrictions based on time. + RestrictedTimes *string + + // The time dependent constraint. + TimeDependent *bool + + // Number of trailers attached to the vehicle. + // + // Default Value: 0 + TrailerCount *RouteNoticeDetailRange + + // Travel mode corresponding to the leg. + TravelMode *bool + + // Truck road type identifiers. BK1 through BK4 apply only to Sweden. + // A2,A4,B2,B4,C,D,ET2,ET4 apply only to Mexico. + // + // There are currently no other supported values as of 26th April 2024. + TruckRoadType *string + + // Type of the truck. + TruckType RouteTruckType + + // The tunnel restriction code. + // + // Tunnel categories in this list indicate the restrictions which apply to certain + // tunnels in Great Britain. They relate to the types of dangerous goods that can + // be transported through them. + // + // - Tunnel Category B + // + // - Risk Level: Limited risk + // + // - Restrictions: Few restrictions + // + // - Tunnel Category C + // + // - Risk Level: Medium risk + // + // - Restrictions: Some restrictions + // + // - Tunnel Category D + // + // - Risk Level: High risk + // + // - Restrictions: Many restrictions occur + // + // - Tunnel Category E + // + // - Risk Level: Very high risk + // + // - Restrictions: Restricted tunnel + TunnelRestrictionCode *string + + noSmithyDocumentSerde +} + +// Waypoint between the Origin and Destination. +type RouteWaypoint struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Avoids actions for the provided distance. This is typically to consider for + // users in moving vehicles who may not have sufficient time to make an action at + // an origin or a destination. + AvoidActionsForDistance int64 + + // Avoid U-turns for calculation on highways and motorways. + AvoidUTurns *bool + + // GPS Heading at the position. + Heading float64 + + // Options to configure matching the provided position to the road network. + Matching *RouteMatchingOptions + + // If the waypoint should not be treated as a stop. If yes, the waypoint is passed + // through and doesn't split the route into different legs. + PassThrough *bool + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *RouteSideOfStreetOptions + + // Duration of the stop. + // + // Unit: seconds + StopDuration int64 + + noSmithyDocumentSerde +} + +// The weight constraint for the route. +// +// Unit: Kilograms +type RouteWeightConstraint struct { + + // The type of constraint. + // + // This member is required. + Type RouteWeightConstraintType + + // The constraint value. + // + // Unit: Kilograms + // + // This member is required. + Value int64 + + noSmithyDocumentSerde +} + +// The zone. +type RouteZone struct { + + // The zone category. + Category RouteZoneCategory + + // The name of the zone. + Name *string + + noSmithyDocumentSerde +} + +// The input fails to satisfy the constraints specified by the Amazon Location +// service. +type ValidationExceptionField struct { + + // The error message. + // + // This member is required. + Message *string + + // The name of the Validation Exception Field. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Access hours corresponding to when a destination can be visited. +type WaypointOptimizationAccessHours struct { + + // Contains the ID of the starting waypoint in this connection. + // + // This member is required. + From *WaypointOptimizationAccessHoursEntry + + // Contains the ID of the ending waypoint in this connection. + // + // This member is required. + To *WaypointOptimizationAccessHoursEntry + + noSmithyDocumentSerde +} + +// Hours of entry. +type WaypointOptimizationAccessHoursEntry struct { + + // Day of the week. + // + // This member is required. + DayOfWeek DayOfWeek + + // Time of the day. + // + // This member is required. + TimeOfDay *string + + noSmithyDocumentSerde +} + +// The area to be avoided. +type WaypointOptimizationAvoidanceArea struct { + + // Geometry of the area to be avoided. + // + // This member is required. + Geometry *WaypointOptimizationAvoidanceAreaGeometry + + noSmithyDocumentSerde +} + +// Geometry of the area to be avoided. +type WaypointOptimizationAvoidanceAreaGeometry struct { + + // Geometry defined as a bounding box. The first pair represents the X and Y + // coordinates (longitude and latitude,) of the southwest corner of the bounding + // box; the second pair represents the X and Y coordinates (longitude and latitude) + // of the northeast corner. + BoundingBox []float64 + + noSmithyDocumentSerde +} + +// Options for WaypointOptimizationAvoidance. +type WaypointOptimizationAvoidanceOptions struct { + + // Areas to be avoided. + Areas []WaypointOptimizationAvoidanceArea + + // Avoidance options for cars-shuttles-trains. + CarShuttleTrains *bool + + // Avoid controlled access highways while calculating the route. + ControlledAccessHighways *bool + + // Avoid dirt roads while calculating the route. + DirtRoads *bool + + // Avoidance options for ferries. + Ferries *bool + + // Avoids roads where the specified toll transponders are the only mode of payment. + TollRoads *bool + + // Avoid tunnels while calculating the route. + Tunnels *bool + + // Avoid U-turns for calculation on highways and motorways. + UTurns *bool + + noSmithyDocumentSerde +} + +// This contains information such as distance and duration from one waypoint to +// the next waypoint in the sequence. +type WaypointOptimizationConnection struct { + + // Distance of the step. + // + // This member is required. + Distance int64 + + // contains the ID of the starting waypoint in this connection. + // + // This member is required. + From *string + + // Resting time before the driver can continue driving. + // + // This member is required. + RestDuration int64 + + // Contains the ID of the ending waypoint in this connection. + // + // This member is required. + To *string + + // Total duration. + // + // Unit: seconds + // + // This member is required. + TravelDuration int64 + + // Duration of a wait step. + // + // Unit: seconds + // + // This member is required. + WaitDuration int64 + + noSmithyDocumentSerde +} + +// Destination related options. +type WaypointOptimizationDestinationOptions struct { + + // Access hours corresponding to when a waypoint can be visited. + AccessHours *WaypointOptimizationAccessHours + + // Appointment time at the destination. + AppointmentTime *string + + // GPS Heading at the position. + Heading float64 + + // The waypoint Id. + Id *string + + // Service time spent at the destination. At an appointment, the service time + // should be the appointment duration. + // + // Unit: seconds + ServiceDuration int64 + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *WaypointOptimizationSideOfStreetOptions + + noSmithyDocumentSerde +} + +// Driver related options. +type WaypointOptimizationDriverOptions struct { + + // Driver work-rest schedules defined by a short and long cycle. A rest needs to + // be taken after the short work duration. The short cycle can be repeated until + // you hit the long work duration, at which point the long rest duration should be + // taken before restarting. + RestCycles *WaypointOptimizationRestCycles + + // Pre defined rest profiles for a driver schedule. The only currently supported + // profile is EU. + RestProfile *WaypointOptimizationRestProfile + + // If the service time provided at a waypoint/destination should be considered as + // rest or work. This contributes to the total time breakdown returned within the + // response. + TreatServiceTimeAs WaypointOptimizationServiceTimeTreatment + + noSmithyDocumentSerde +} + +// Exclusion options. +type WaypointOptimizationExclusionOptions struct { + + // List of countries to be avoided defined by two-letter or three-letter country + // codes. + // + // This member is required. + Countries []string + + noSmithyDocumentSerde +} + +// The failed constraint. +type WaypointOptimizationFailedConstraint struct { + + // The failed constraint. + Constraint WaypointOptimizationConstraint + + // Reason for the failed constraint. + Reason *string + + noSmithyDocumentSerde +} + +// The impeding waypoint. +type WaypointOptimizationImpedingWaypoint struct { + + // Failed constraints for an impeding waypoint. + // + // This member is required. + FailedConstraints []WaypointOptimizationFailedConstraint + + // The waypoint Id. + // + // This member is required. + Id *string + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + noSmithyDocumentSerde +} + +// The optimized waypoint. +type WaypointOptimizationOptimizedWaypoint struct { + + // Estimated time of departure from thr origin. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + // + // This member is required. + DepartureTime *string + + // The waypoint Id. + // + // This member is required. + Id *string + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Estimated time of arrival at the destination. + // + // Time format: YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm + // + // Examples: + // + // 2020-04-22T17:57:24Z + // + // 2020-04-22T17:57:24+02:00 + ArrivalTime *string + + noSmithyDocumentSerde +} + +// Options related to the origin. +type WaypointOptimizationOriginOptions struct { + + // The Origin Id. + Id *string + + noSmithyDocumentSerde +} + +// Options related to a pedestrian. +type WaypointOptimizationPedestrianOptions struct { + + // Walking speed. + // + // Unit: KilometersPerHour + Speed *float64 + + noSmithyDocumentSerde +} + +// Driver work-rest schedules defined by a short and long cycle. A rest needs to +// be taken after the short work duration. The short cycle can be repeated until +// you hit the long work duration, at which point the long rest duration should be +// taken before restarting. +// +// Unit: seconds +type WaypointOptimizationRestCycleDurations struct { + + // Resting phase of the cycle. + // + // Unit: seconds + // + // This member is required. + RestDuration int64 + + // Working phase of the cycle. + // + // Unit: seconds + // + // This member is required. + WorkDuration int64 + + noSmithyDocumentSerde +} + +// Resting phase of the cycle. +type WaypointOptimizationRestCycles struct { + + // Long cycle for a driver work-rest schedule. + // + // This member is required. + LongCycle *WaypointOptimizationRestCycleDurations + + // Short cycle for a driver work-rest schedule + // + // This member is required. + ShortCycle *WaypointOptimizationRestCycleDurations + + noSmithyDocumentSerde +} + +// Pre defined rest profiles for a driver schedule. The only currently supported +// profile is EU. +type WaypointOptimizationRestProfile struct { + + // Pre defined rest profiles for a driver schedule. The only currently supported + // profile is EU. + // + // This member is required. + Profile *string + + noSmithyDocumentSerde +} + +// Options to configure matching the provided position to a side of the street. +type WaypointOptimizationSideOfStreetOptions struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Strategy that defines when the side of street position should be used. + // AnyStreet will always use the provided position. + // + // Default Value: DividedStreetOnly + UseWith SideOfStreetMatchingStrategy + + noSmithyDocumentSerde +} + +// Time breakdown for the sequence. +type WaypointOptimizationTimeBreakdown struct { + + // Resting phase of the cycle. + // + // Unit: seconds + // + // This member is required. + RestDuration int64 + + // Service time spent at the destination. At an appointment, the service time + // should be the appointment duration. + // + // Unit: seconds + // + // This member is required. + ServiceDuration int64 + + // Traveling phase of the cycle. + // + // Unit: seconds + // + // This member is required. + TravelDuration int64 + + // Waiting phase of the cycle. + // + // Unit: seconds + // + // This member is required. + WaitDuration int64 + + noSmithyDocumentSerde +} + +// Options related to traffic. +type WaypointOptimizationTrafficOptions struct { + + // Determines if traffic should be used or ignored while calculating the route. + // + // Default Value: UseTrafficData + Usage TrafficUsage + + noSmithyDocumentSerde +} + +// Trailer options corresponding to the vehicle. +type WaypointOptimizationTrailerOptions struct { + + // Number of trailers attached to the vehicle. + // + // Default Value: 0 + TrailerCount *int32 + + noSmithyDocumentSerde +} + +// Travel mode related options for the provided travel mode. +type WaypointOptimizationTravelModeOptions struct { + + // Travel mode options when the provided travel mode is "Pedestrian" + Pedestrian *WaypointOptimizationPedestrianOptions + + // Travel mode options when the provided travel mode is "Truck" + Truck *WaypointOptimizationTruckOptions + + noSmithyDocumentSerde +} + +// Travel mode options when the provided travel mode is "Truck" +type WaypointOptimizationTruckOptions struct { + + // Gross weight of the vehicle including trailers, and goods at capacity. + // + // Unit: Kilograms + GrossWeight int64 + + // List of Hazardous cargo contained in the vehicle. + HazardousCargos []WaypointOptimizationHazardousCargoType + + // Height of the vehicle. + // + // Unit: centimeters + Height int64 + + // Length of the vehicle. + // + // Unit: centimeters + Length int64 + + // Trailer options corresponding to the vehicle. + Trailer *WaypointOptimizationTrailerOptions + + // Type of the truck. + TruckType WaypointOptimizationTruckType + + // The tunnel restriction code. + // + // Tunnel categories in this list indicate the restrictions which apply to certain + // tunnels in Great Britain. They relate to the types of dangerous goods that can + // be transported through them. + // + // - Tunnel Category B + // + // - Risk Level: Limited risk + // + // - Restrictions: Few restrictions + // + // - Tunnel Category C + // + // - Risk Level: Medium risk + // + // - Restrictions: Some restrictions + // + // - Tunnel Category D + // + // - Risk Level: High risk + // + // - Restrictions: Many restrictions occur + // + // - Tunnel Category E + // + // - Risk Level: Very high risk + // + // - Restrictions: Restricted tunnel + TunnelRestrictionCode *string + + // Heaviest weight per axle irrespective of the axle type or the axle group. Meant + // for usage in countries where the differences in axle types or axle groups are + // not distinguished. + // + // Unit: Kilograms + WeightPerAxle int64 + + // Width of the vehicle. + // + // Unit: centimeters + Width int64 + + noSmithyDocumentSerde +} + +// Waypoint between the Origin and Destination. +type WaypointOptimizationWaypoint struct { + + // Position defined as [longitude, latitude] . + // + // This member is required. + Position []float64 + + // Access hours corresponding to when a waypoint can be visited. + AccessHours *WaypointOptimizationAccessHours + + // Appointment time at the waypoint. + AppointmentTime *string + + // Constraint defining what waypoints are to be visited after this waypoint. + Before []int32 + + // GPS Heading at the position. + Heading float64 + + // The waypoint Id. + Id *string + + // Service time spent at the waypoint. At an appointment, the service time should + // be the appointment duration. + // + // Unit: seconds + ServiceDuration int64 + + // Options to configure matching the provided position to a side of the street. + SideOfStreet *WaypointOptimizationSideOfStreetOptions + + noSmithyDocumentSerde +} + +// Specifies the total weight for the specified axle group. Meant for usage in +// countries that have different regulations based on the axle group type. +// +// Unit: Kilograms +type WeightPerAxleGroup struct { + + // Weight for quad axle group. + // + // Unit: Kilograms + Quad int64 + + // Weight for quad quint group. + // + // Unit: Kilograms + Quint int64 + + // Weight for single axle group. + // + // Unit: Kilograms + Single int64 + + // Weight for tandem axle group. + // + // Unit: Kilograms + Tandem int64 + + // Weight for triple axle group. + // + // Unit: Kilograms + Triple int64 + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/georoutes/validators.go b/service/georoutes/validators.go new file mode 100644 index 00000000000..b67dd3b128f --- /dev/null +++ b/service/georoutes/validators.go @@ -0,0 +1,1344 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/georoutes/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCalculateIsolines struct { +} + +func (*validateOpCalculateIsolines) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCalculateIsolines) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CalculateIsolinesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCalculateIsolinesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCalculateRouteMatrix struct { +} + +func (*validateOpCalculateRouteMatrix) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCalculateRouteMatrix) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CalculateRouteMatrixInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCalculateRouteMatrixInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCalculateRoutes struct { +} + +func (*validateOpCalculateRoutes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCalculateRoutes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CalculateRoutesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCalculateRoutesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpOptimizeWaypoints struct { +} + +func (*validateOpOptimizeWaypoints) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpOptimizeWaypoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*OptimizeWaypointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpOptimizeWaypointsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSnapToRoads struct { +} + +func (*validateOpSnapToRoads) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSnapToRoads) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SnapToRoadsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSnapToRoadsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCalculateIsolinesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCalculateIsolines{}, middleware.After) +} + +func addOpCalculateRouteMatrixValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCalculateRouteMatrix{}, middleware.After) +} + +func addOpCalculateRoutesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCalculateRoutes{}, middleware.After) +} + +func addOpOptimizeWaypointsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpOptimizeWaypoints{}, middleware.After) +} + +func addOpSnapToRoadsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSnapToRoads{}, middleware.After) +} + +func validateCircle(v *types.Circle) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Circle"} + if v.Center == nil { + invalidParams.Add(smithy.NewErrParamRequired("Center")) + } + if v.Radius == nil { + invalidParams.Add(smithy.NewErrParamRequired("Radius")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCorridor(v *types.Corridor) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Corridor"} + if v.LineString == nil { + invalidParams.Add(smithy.NewErrParamRequired("LineString")) + } + if v.Radius == nil { + invalidParams.Add(smithy.NewErrParamRequired("Radius")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineAvoidanceArea(v *types.IsolineAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineAvoidanceArea"} + if v.Except != nil { + if err := validateIsolineAvoidanceAreaGeometryList(v.Except); err != nil { + invalidParams.AddNested("Except", err.(smithy.InvalidParamsError)) + } + } + if v.Geometry == nil { + invalidParams.Add(smithy.NewErrParamRequired("Geometry")) + } else if v.Geometry != nil { + if err := validateIsolineAvoidanceAreaGeometry(v.Geometry); err != nil { + invalidParams.AddNested("Geometry", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineAvoidanceAreaGeometry(v *types.IsolineAvoidanceAreaGeometry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineAvoidanceAreaGeometry"} + if v.Corridor != nil { + if err := validateCorridor(v.Corridor); err != nil { + invalidParams.AddNested("Corridor", err.(smithy.InvalidParamsError)) + } + } + if v.PolylineCorridor != nil { + if err := validatePolylineCorridor(v.PolylineCorridor); err != nil { + invalidParams.AddNested("PolylineCorridor", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineAvoidanceAreaGeometryList(v []types.IsolineAvoidanceAreaGeometry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineAvoidanceAreaGeometryList"} + for i := range v { + if err := validateIsolineAvoidanceAreaGeometry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineAvoidanceAreaList(v []types.IsolineAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineAvoidanceAreaList"} + for i := range v { + if err := validateIsolineAvoidanceArea(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineAvoidanceOptions(v *types.IsolineAvoidanceOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineAvoidanceOptions"} + if v.Areas != nil { + if err := validateIsolineAvoidanceAreaList(v.Areas); err != nil { + invalidParams.AddNested("Areas", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineDestinationOptions(v *types.IsolineDestinationOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineDestinationOptions"} + if v.SideOfStreet != nil { + if err := validateIsolineSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineOriginOptions(v *types.IsolineOriginOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineOriginOptions"} + if v.SideOfStreet != nil { + if err := validateIsolineSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIsolineSideOfStreetOptions(v *types.IsolineSideOfStreetOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IsolineSideOfStreetOptions"} + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePolylineCorridor(v *types.PolylineCorridor) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PolylineCorridor"} + if v.Polyline == nil { + invalidParams.Add(smithy.NewErrParamRequired("Polyline")) + } + if v.Radius == nil { + invalidParams.Add(smithy.NewErrParamRequired("Radius")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRoadSnapTracePoint(v *types.RoadSnapTracePoint) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RoadSnapTracePoint"} + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRoadSnapTracePointList(v []types.RoadSnapTracePoint) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RoadSnapTracePointList"} + for i := range v { + if err := validateRoadSnapTracePoint(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteAvoidanceArea(v *types.RouteAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteAvoidanceArea"} + if v.Except != nil { + if err := validateRouteAvoidanceAreaGeometryList(v.Except); err != nil { + invalidParams.AddNested("Except", err.(smithy.InvalidParamsError)) + } + } + if v.Geometry == nil { + invalidParams.Add(smithy.NewErrParamRequired("Geometry")) + } else if v.Geometry != nil { + if err := validateRouteAvoidanceAreaGeometry(v.Geometry); err != nil { + invalidParams.AddNested("Geometry", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteAvoidanceAreaGeometry(v *types.RouteAvoidanceAreaGeometry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteAvoidanceAreaGeometry"} + if v.Corridor != nil { + if err := validateCorridor(v.Corridor); err != nil { + invalidParams.AddNested("Corridor", err.(smithy.InvalidParamsError)) + } + } + if v.PolylineCorridor != nil { + if err := validatePolylineCorridor(v.PolylineCorridor); err != nil { + invalidParams.AddNested("PolylineCorridor", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteAvoidanceAreaGeometryList(v []types.RouteAvoidanceAreaGeometry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteAvoidanceAreaGeometryList"} + for i := range v { + if err := validateRouteAvoidanceAreaGeometry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteAvoidanceAreaList(v []types.RouteAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteAvoidanceAreaList"} + for i := range v { + if err := validateRouteAvoidanceArea(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteAvoidanceOptions(v *types.RouteAvoidanceOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteAvoidanceOptions"} + if v.Areas != nil { + if err := validateRouteAvoidanceAreaList(v.Areas); err != nil { + invalidParams.AddNested("Areas", err.(smithy.InvalidParamsError)) + } + } + if v.ZoneCategories != nil { + if err := validateRouteAvoidanceZoneCategoryList(v.ZoneCategories); err != nil { + invalidParams.AddNested("ZoneCategories", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteAvoidanceZoneCategory(v *types.RouteAvoidanceZoneCategory) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteAvoidanceZoneCategory"} + if len(v.Category) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Category")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteAvoidanceZoneCategoryList(v []types.RouteAvoidanceZoneCategory) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteAvoidanceZoneCategoryList"} + for i := range v { + if err := validateRouteAvoidanceZoneCategory(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteDestinationOptions(v *types.RouteDestinationOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteDestinationOptions"} + if v.SideOfStreet != nil { + if err := validateRouteSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteDriverOptions(v *types.RouteDriverOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteDriverOptions"} + if v.Schedule != nil { + if err := validateRouteDriverScheduleIntervalList(v.Schedule); err != nil { + invalidParams.AddNested("Schedule", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteDriverScheduleInterval(v *types.RouteDriverScheduleInterval) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteDriverScheduleInterval"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteDriverScheduleIntervalList(v []types.RouteDriverScheduleInterval) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteDriverScheduleIntervalList"} + for i := range v { + if err := validateRouteDriverScheduleInterval(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteEmissionType(v *types.RouteEmissionType) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteEmissionType"} + if v.Type == nil { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteExclusionOptions(v *types.RouteExclusionOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteExclusionOptions"} + if v.Countries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Countries")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixAvoidanceArea(v *types.RouteMatrixAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixAvoidanceArea"} + if v.Geometry == nil { + invalidParams.Add(smithy.NewErrParamRequired("Geometry")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixAvoidanceAreaList(v []types.RouteMatrixAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixAvoidanceAreaList"} + for i := range v { + if err := validateRouteMatrixAvoidanceArea(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixAvoidanceOptions(v *types.RouteMatrixAvoidanceOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixAvoidanceOptions"} + if v.Areas != nil { + if err := validateRouteMatrixAvoidanceAreaList(v.Areas); err != nil { + invalidParams.AddNested("Areas", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixBoundary(v *types.RouteMatrixBoundary) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixBoundary"} + if v.Geometry != nil { + if err := validateRouteMatrixBoundaryGeometry(v.Geometry); err != nil { + invalidParams.AddNested("Geometry", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixBoundaryGeometry(v *types.RouteMatrixBoundaryGeometry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixBoundaryGeometry"} + if v.Circle != nil { + if err := validateCircle(v.Circle); err != nil { + invalidParams.AddNested("Circle", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixDestination(v *types.RouteMatrixDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixDestination"} + if v.Options != nil { + if err := validateRouteMatrixDestinationOptions(v.Options); err != nil { + invalidParams.AddNested("Options", err.(smithy.InvalidParamsError)) + } + } + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixDestinationList(v []types.RouteMatrixDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixDestinationList"} + for i := range v { + if err := validateRouteMatrixDestination(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixDestinationOptions(v *types.RouteMatrixDestinationOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixDestinationOptions"} + if v.SideOfStreet != nil { + if err := validateRouteMatrixSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixExclusionOptions(v *types.RouteMatrixExclusionOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixExclusionOptions"} + if v.Countries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Countries")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixOrigin(v *types.RouteMatrixOrigin) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixOrigin"} + if v.Options != nil { + if err := validateRouteMatrixOriginOptions(v.Options); err != nil { + invalidParams.AddNested("Options", err.(smithy.InvalidParamsError)) + } + } + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixOriginList(v []types.RouteMatrixOrigin) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixOriginList"} + for i := range v { + if err := validateRouteMatrixOrigin(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixOriginOptions(v *types.RouteMatrixOriginOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixOriginOptions"} + if v.SideOfStreet != nil { + if err := validateRouteMatrixSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteMatrixSideOfStreetOptions(v *types.RouteMatrixSideOfStreetOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteMatrixSideOfStreetOptions"} + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteOriginOptions(v *types.RouteOriginOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteOriginOptions"} + if v.SideOfStreet != nil { + if err := validateRouteSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteSideOfStreetOptions(v *types.RouteSideOfStreetOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteSideOfStreetOptions"} + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteTollOptions(v *types.RouteTollOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteTollOptions"} + if v.EmissionType != nil { + if err := validateRouteEmissionType(v.EmissionType); err != nil { + invalidParams.AddNested("EmissionType", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteWaypoint(v *types.RouteWaypoint) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteWaypoint"} + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if v.SideOfStreet != nil { + if err := validateRouteSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRouteWaypointList(v []types.RouteWaypoint) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RouteWaypointList"} + for i := range v { + if err := validateRouteWaypoint(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationAccessHours(v *types.WaypointOptimizationAccessHours) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationAccessHours"} + if v.From == nil { + invalidParams.Add(smithy.NewErrParamRequired("From")) + } else if v.From != nil { + if err := validateWaypointOptimizationAccessHoursEntry(v.From); err != nil { + invalidParams.AddNested("From", err.(smithy.InvalidParamsError)) + } + } + if v.To == nil { + invalidParams.Add(smithy.NewErrParamRequired("To")) + } else if v.To != nil { + if err := validateWaypointOptimizationAccessHoursEntry(v.To); err != nil { + invalidParams.AddNested("To", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationAccessHoursEntry(v *types.WaypointOptimizationAccessHoursEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationAccessHoursEntry"} + if len(v.DayOfWeek) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("DayOfWeek")) + } + if v.TimeOfDay == nil { + invalidParams.Add(smithy.NewErrParamRequired("TimeOfDay")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationAvoidanceArea(v *types.WaypointOptimizationAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationAvoidanceArea"} + if v.Geometry == nil { + invalidParams.Add(smithy.NewErrParamRequired("Geometry")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationAvoidanceAreaList(v []types.WaypointOptimizationAvoidanceArea) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationAvoidanceAreaList"} + for i := range v { + if err := validateWaypointOptimizationAvoidanceArea(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationAvoidanceOptions(v *types.WaypointOptimizationAvoidanceOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationAvoidanceOptions"} + if v.Areas != nil { + if err := validateWaypointOptimizationAvoidanceAreaList(v.Areas); err != nil { + invalidParams.AddNested("Areas", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationDestinationOptions(v *types.WaypointOptimizationDestinationOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationDestinationOptions"} + if v.AccessHours != nil { + if err := validateWaypointOptimizationAccessHours(v.AccessHours); err != nil { + invalidParams.AddNested("AccessHours", err.(smithy.InvalidParamsError)) + } + } + if v.SideOfStreet != nil { + if err := validateWaypointOptimizationSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationDriverOptions(v *types.WaypointOptimizationDriverOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationDriverOptions"} + if v.RestCycles != nil { + if err := validateWaypointOptimizationRestCycles(v.RestCycles); err != nil { + invalidParams.AddNested("RestCycles", err.(smithy.InvalidParamsError)) + } + } + if v.RestProfile != nil { + if err := validateWaypointOptimizationRestProfile(v.RestProfile); err != nil { + invalidParams.AddNested("RestProfile", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationExclusionOptions(v *types.WaypointOptimizationExclusionOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationExclusionOptions"} + if v.Countries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Countries")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationRestCycleDurations(v *types.WaypointOptimizationRestCycleDurations) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationRestCycleDurations"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationRestCycles(v *types.WaypointOptimizationRestCycles) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationRestCycles"} + if v.LongCycle == nil { + invalidParams.Add(smithy.NewErrParamRequired("LongCycle")) + } else if v.LongCycle != nil { + if err := validateWaypointOptimizationRestCycleDurations(v.LongCycle); err != nil { + invalidParams.AddNested("LongCycle", err.(smithy.InvalidParamsError)) + } + } + if v.ShortCycle == nil { + invalidParams.Add(smithy.NewErrParamRequired("ShortCycle")) + } else if v.ShortCycle != nil { + if err := validateWaypointOptimizationRestCycleDurations(v.ShortCycle); err != nil { + invalidParams.AddNested("ShortCycle", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationRestProfile(v *types.WaypointOptimizationRestProfile) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationRestProfile"} + if v.Profile == nil { + invalidParams.Add(smithy.NewErrParamRequired("Profile")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationSideOfStreetOptions(v *types.WaypointOptimizationSideOfStreetOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationSideOfStreetOptions"} + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationWaypoint(v *types.WaypointOptimizationWaypoint) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationWaypoint"} + if v.AccessHours != nil { + if err := validateWaypointOptimizationAccessHours(v.AccessHours); err != nil { + invalidParams.AddNested("AccessHours", err.(smithy.InvalidParamsError)) + } + } + if v.Position == nil { + invalidParams.Add(smithy.NewErrParamRequired("Position")) + } + if v.SideOfStreet != nil { + if err := validateWaypointOptimizationSideOfStreetOptions(v.SideOfStreet); err != nil { + invalidParams.AddNested("SideOfStreet", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateWaypointOptimizationWaypointList(v []types.WaypointOptimizationWaypoint) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "WaypointOptimizationWaypointList"} + for i := range v { + if err := validateWaypointOptimizationWaypoint(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCalculateIsolinesInput(v *CalculateIsolinesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CalculateIsolinesInput"} + if v.Avoid != nil { + if err := validateIsolineAvoidanceOptions(v.Avoid); err != nil { + invalidParams.AddNested("Avoid", err.(smithy.InvalidParamsError)) + } + } + if v.DestinationOptions != nil { + if err := validateIsolineDestinationOptions(v.DestinationOptions); err != nil { + invalidParams.AddNested("DestinationOptions", err.(smithy.InvalidParamsError)) + } + } + if v.OriginOptions != nil { + if err := validateIsolineOriginOptions(v.OriginOptions); err != nil { + invalidParams.AddNested("OriginOptions", err.(smithy.InvalidParamsError)) + } + } + if v.Thresholds == nil { + invalidParams.Add(smithy.NewErrParamRequired("Thresholds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCalculateRouteMatrixInput(v *CalculateRouteMatrixInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CalculateRouteMatrixInput"} + if v.Avoid != nil { + if err := validateRouteMatrixAvoidanceOptions(v.Avoid); err != nil { + invalidParams.AddNested("Avoid", err.(smithy.InvalidParamsError)) + } + } + if v.Destinations == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destinations")) + } else if v.Destinations != nil { + if err := validateRouteMatrixDestinationList(v.Destinations); err != nil { + invalidParams.AddNested("Destinations", err.(smithy.InvalidParamsError)) + } + } + if v.Exclude != nil { + if err := validateRouteMatrixExclusionOptions(v.Exclude); err != nil { + invalidParams.AddNested("Exclude", err.(smithy.InvalidParamsError)) + } + } + if v.Origins == nil { + invalidParams.Add(smithy.NewErrParamRequired("Origins")) + } else if v.Origins != nil { + if err := validateRouteMatrixOriginList(v.Origins); err != nil { + invalidParams.AddNested("Origins", err.(smithy.InvalidParamsError)) + } + } + if v.RoutingBoundary == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoutingBoundary")) + } else if v.RoutingBoundary != nil { + if err := validateRouteMatrixBoundary(v.RoutingBoundary); err != nil { + invalidParams.AddNested("RoutingBoundary", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCalculateRoutesInput(v *CalculateRoutesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CalculateRoutesInput"} + if v.Avoid != nil { + if err := validateRouteAvoidanceOptions(v.Avoid); err != nil { + invalidParams.AddNested("Avoid", err.(smithy.InvalidParamsError)) + } + } + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if v.DestinationOptions != nil { + if err := validateRouteDestinationOptions(v.DestinationOptions); err != nil { + invalidParams.AddNested("DestinationOptions", err.(smithy.InvalidParamsError)) + } + } + if v.Driver != nil { + if err := validateRouteDriverOptions(v.Driver); err != nil { + invalidParams.AddNested("Driver", err.(smithy.InvalidParamsError)) + } + } + if v.Exclude != nil { + if err := validateRouteExclusionOptions(v.Exclude); err != nil { + invalidParams.AddNested("Exclude", err.(smithy.InvalidParamsError)) + } + } + if v.Origin == nil { + invalidParams.Add(smithy.NewErrParamRequired("Origin")) + } + if v.OriginOptions != nil { + if err := validateRouteOriginOptions(v.OriginOptions); err != nil { + invalidParams.AddNested("OriginOptions", err.(smithy.InvalidParamsError)) + } + } + if v.Tolls != nil { + if err := validateRouteTollOptions(v.Tolls); err != nil { + invalidParams.AddNested("Tolls", err.(smithy.InvalidParamsError)) + } + } + if v.Waypoints != nil { + if err := validateRouteWaypointList(v.Waypoints); err != nil { + invalidParams.AddNested("Waypoints", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpOptimizeWaypointsInput(v *OptimizeWaypointsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OptimizeWaypointsInput"} + if v.Avoid != nil { + if err := validateWaypointOptimizationAvoidanceOptions(v.Avoid); err != nil { + invalidParams.AddNested("Avoid", err.(smithy.InvalidParamsError)) + } + } + if v.DestinationOptions != nil { + if err := validateWaypointOptimizationDestinationOptions(v.DestinationOptions); err != nil { + invalidParams.AddNested("DestinationOptions", err.(smithy.InvalidParamsError)) + } + } + if v.Driver != nil { + if err := validateWaypointOptimizationDriverOptions(v.Driver); err != nil { + invalidParams.AddNested("Driver", err.(smithy.InvalidParamsError)) + } + } + if v.Exclude != nil { + if err := validateWaypointOptimizationExclusionOptions(v.Exclude); err != nil { + invalidParams.AddNested("Exclude", err.(smithy.InvalidParamsError)) + } + } + if v.Origin == nil { + invalidParams.Add(smithy.NewErrParamRequired("Origin")) + } + if v.Waypoints != nil { + if err := validateWaypointOptimizationWaypointList(v.Waypoints); err != nil { + invalidParams.AddNested("Waypoints", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSnapToRoadsInput(v *SnapToRoadsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SnapToRoadsInput"} + if v.TracePoints == nil { + invalidParams.Add(smithy.NewErrParamRequired("TracePoints")) + } else if v.TracePoints != nil { + if err := validateRoadSnapTracePointList(v.TracePoints); err != nil { + invalidParams.AddNested("TracePoints", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/keyspaces/api_op_CreateKeyspace.go b/service/keyspaces/api_op_CreateKeyspace.go index 4787a848d73..088f6945020 100644 --- a/service/keyspaces/api_op_CreateKeyspace.go +++ b/service/keyspaces/api_op_CreateKeyspace.go @@ -17,9 +17,9 @@ import ( // CreateKeyspace is an asynchronous operation. You can monitor the creation // status of the new keyspace by using the GetKeyspace operation. // -// For more information, see [Creating keyspaces] in the Amazon Keyspaces Developer Guide. +// For more information, see [Create a keyspace] in the Amazon Keyspaces Developer Guide. // -// [Creating keyspaces]: https://docs.aws.amazon.com/keyspaces/latest/devguide/working-with-keyspaces.html#keyspaces-create +// [Create a keyspace]: https://docs.aws.amazon.com/keyspaces/latest/devguide/getting-started.keyspaces.html func (c *Client) CreateKeyspace(ctx context.Context, params *CreateKeyspaceInput, optFns ...func(*Options)) (*CreateKeyspaceOutput, error) { if params == nil { params = &CreateKeyspaceInput{} diff --git a/service/keyspaces/api_op_CreateTable.go b/service/keyspaces/api_op_CreateTable.go index 497e2e5a456..3f46a440bc0 100644 --- a/service/keyspaces/api_op_CreateTable.go +++ b/service/keyspaces/api_op_CreateTable.go @@ -19,9 +19,9 @@ import ( // the new table by using the GetTable operation, which returns the current status // of the table. You can start using a table when the status is ACTIVE . // -// For more information, see [Creating tables] in the Amazon Keyspaces Developer Guide. +// For more information, see [Create a table] in the Amazon Keyspaces Developer Guide. // -// [Creating tables]: https://docs.aws.amazon.com/keyspaces/latest/devguide/working-with-tables.html#tables-create +// [Create a table]: https://docs.aws.amazon.com/keyspaces/latest/devguide/getting-started.tables.html func (c *Client) CreateTable(ctx context.Context, params *CreateTableInput, optFns ...func(*Options)) (*CreateTableOutput, error) { if params == nil { params = &CreateTableInput{} diff --git a/service/keyspaces/api_op_CreateType.go b/service/keyspaces/api_op_CreateType.go new file mode 100644 index 00000000000..d32c58d9ca1 --- /dev/null +++ b/service/keyspaces/api_op_CreateType.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package keyspaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/keyspaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The CreateType operation creates a new user-defined type in the specified +// +// keyspace. +// +// For more information, see [User-defined types (UDTs)] in the Amazon Keyspaces Developer Guide. +// +// [User-defined types (UDTs)]: https://docs.aws.amazon.com/keyspaces/latest/devguide/udts.html +func (c *Client) CreateType(ctx context.Context, params *CreateTypeInput, optFns ...func(*Options)) (*CreateTypeOutput, error) { + if params == nil { + params = &CreateTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateType", params, optFns, c.addOperationCreateTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTypeInput struct { + + // The field definitions, consisting of names and types, that define this type. + // + // This member is required. + FieldDefinitions []types.FieldDefinition + + // The name of the keyspace. + // + // This member is required. + KeyspaceName *string + + // The name of the user-defined type. + // + // UDT names must contain 48 characters or less, must begin with an alphabetic + // character, and can only contain alpha-numeric characters and underscores. Amazon + // Keyspaces converts upper case characters automatically into lower case + // characters. + // + // Alternatively, you can declare a UDT name in double quotes. When declaring a + // UDT name inside double quotes, Amazon Keyspaces preserves upper casing and + // allows special characters. + // + // You can also use double quotes as part of the name when you create the UDT, but + // you must escape each double quote character with an additional double quote + // character. + // + // This member is required. + TypeName *string + + noSmithyDocumentSerde +} + +type CreateTypeOutput struct { + + // The unique identifier of the keyspace that contains the new type in the format + // of an Amazon Resource Name (ARN). + // + // This member is required. + KeyspaceArn *string + + // The formatted name of the user-defined type that was created. Note that Amazon + // Keyspaces requires the formatted name of the type for other operations, for + // example GetType . + // + // This member is required. + TypeName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateType{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateType"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateType(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateType", + } +} diff --git a/service/keyspaces/api_op_DeleteType.go b/service/keyspaces/api_op_DeleteType.go new file mode 100644 index 00000000000..be7fc963a68 --- /dev/null +++ b/service/keyspaces/api_op_DeleteType.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package keyspaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The DeleteType operation deletes a user-defined type (UDT). You can only +// +// delete a type that is not used in a table or another UDT. +func (c *Client) DeleteType(ctx context.Context, params *DeleteTypeInput, optFns ...func(*Options)) (*DeleteTypeOutput, error) { + if params == nil { + params = &DeleteTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteType", params, optFns, c.addOperationDeleteTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTypeInput struct { + + // The name of the keyspace of the to be deleted type. + // + // This member is required. + KeyspaceName *string + + // The name of the type to be deleted. + // + // This member is required. + TypeName *string + + noSmithyDocumentSerde +} + +type DeleteTypeOutput struct { + + // The unique identifier of the keyspace from which the type was deleted in the + // format of an Amazon Resource Name (ARN). + // + // This member is required. + KeyspaceArn *string + + // The name of the type that was deleted. + // + // This member is required. + TypeName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteType{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteType"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteType(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteType", + } +} diff --git a/service/keyspaces/api_op_GetTable.go b/service/keyspaces/api_op_GetTable.go index 8a6e24d18ec..17186db80b6 100644 --- a/service/keyspaces/api_op_GetTable.go +++ b/service/keyspaces/api_op_GetTable.go @@ -15,8 +15,8 @@ import ( // Returns information about the table, including the table's name and current // status, the keyspace name, configuration settings, and metadata. // -// To read table metadata using GetTable , Select action permissions for the table -// and system tables are required to complete the operation. +// To read table metadata using GetTable , the IAM principal needs Select action +// permissions for the table and the system keyspace. func (c *Client) GetTable(ctx context.Context, params *GetTableInput, optFns ...func(*Options)) (*GetTableOutput, error) { if params == nil { params = &GetTableInput{} diff --git a/service/keyspaces/api_op_GetType.go b/service/keyspaces/api_op_GetType.go new file mode 100644 index 00000000000..4a1f0d95e69 --- /dev/null +++ b/service/keyspaces/api_op_GetType.go @@ -0,0 +1,204 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package keyspaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/keyspaces/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// The GetType operation returns information about the type, for example the +// +// field definitions, the timestamp when the type was last modified, the level of +// nesting, the status, and details about if the type is used in other types and +// tables. +// +// To read keyspace metadata using GetType , the IAM principal needs Select action +// permissions for the system keyspace. +func (c *Client) GetType(ctx context.Context, params *GetTypeInput, optFns ...func(*Options)) (*GetTypeOutput, error) { + if params == nil { + params = &GetTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetType", params, optFns, c.addOperationGetTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTypeInput struct { + + // The name of the keyspace that contains this type. + // + // This member is required. + KeyspaceName *string + + // The formatted name of the type. For example, if the name of the type was + // created without double quotes, Amazon Keyspaces saved the name in lower-case + // characters. If the name was created in double quotes, you must use double quotes + // to specify the type name. + // + // This member is required. + TypeName *string + + noSmithyDocumentSerde +} + +type GetTypeOutput struct { + + // The unique identifier of the keyspace that contains this type in the format of + // an Amazon Resource Name (ARN). + // + // This member is required. + KeyspaceArn *string + + // The name of the keyspace that contains this type. + // + // This member is required. + KeyspaceName *string + + // The name of the type. + // + // This member is required. + TypeName *string + + // The types that use this type. + DirectParentTypes []string + + // The tables that use this type. + DirectReferringTables []string + + // The names and types that define this type. + FieldDefinitions []types.FieldDefinition + + // The timestamp that shows when this type was last modified. + LastModifiedTimestamp *time.Time + + // The level of nesting implemented for this type. + MaxNestingDepth int32 + + // The status of this type. + Status types.TypeStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetType{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetType"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetType(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetType", + } +} diff --git a/service/keyspaces/api_op_ListKeyspaces.go b/service/keyspaces/api_op_ListKeyspaces.go index 9df214fe515..6bb47d73246 100644 --- a/service/keyspaces/api_op_ListKeyspaces.go +++ b/service/keyspaces/api_op_ListKeyspaces.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of keyspaces. +// The ListKeyspaces operation returns a list of keyspaces. func (c *Client) ListKeyspaces(ctx context.Context, params *ListKeyspacesInput, optFns ...func(*Options)) (*ListKeyspacesOutput, error) { if params == nil { params = &ListKeyspacesInput{} diff --git a/service/keyspaces/api_op_ListTables.go b/service/keyspaces/api_op_ListTables.go index f1f0df84d32..a9dc5841469 100644 --- a/service/keyspaces/api_op_ListTables.go +++ b/service/keyspaces/api_op_ListTables.go @@ -11,7 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of tables for a specified keyspace. +// The ListTables operation returns a list of tables for a specified keyspace. +// +// To read keyspace metadata using ListTables , the IAM principal needs Select +// action permissions for the system keyspace. func (c *Client) ListTables(ctx context.Context, params *ListTablesInput, optFns ...func(*Options)) (*ListTablesOutput, error) { if params == nil { params = &ListTablesInput{} diff --git a/service/keyspaces/api_op_ListTagsForResource.go b/service/keyspaces/api_op_ListTagsForResource.go index 8526f0abc3e..3171cdb28b9 100644 --- a/service/keyspaces/api_op_ListTagsForResource.go +++ b/service/keyspaces/api_op_ListTagsForResource.go @@ -13,6 +13,9 @@ import ( // Returns a list of all tags associated with the specified Amazon Keyspaces // resource. +// +// To read keyspace metadata using ListTagsForResource , the IAM principal needs +// Select action permissions for the specified resource and the system keyspace. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} diff --git a/service/keyspaces/api_op_ListTypes.go b/service/keyspaces/api_op_ListTypes.go new file mode 100644 index 00000000000..9ba7e6db049 --- /dev/null +++ b/service/keyspaces/api_op_ListTypes.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package keyspaces + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The ListTypes operation returns a list of types for a specified keyspace. +// +// To read keyspace metadata using ListTypes , the IAM principal needs Select +// action permissions for the system keyspace. +func (c *Client) ListTypes(ctx context.Context, params *ListTypesInput, optFns ...func(*Options)) (*ListTypesOutput, error) { + if params == nil { + params = &ListTypesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTypes", params, optFns, c.addOperationListTypesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTypesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTypesInput struct { + + // The name of the keyspace that contains the listed types. + // + // This member is required. + KeyspaceName *string + + // The total number of types to return in the output. If the total number of + // types available is more than the value specified, a NextToken is provided in + // the output. To resume pagination, provide the NextToken value as an argument of + // a subsequent API invocation. + MaxResults *int32 + + // The pagination token. To resume pagination, provide the NextToken value as an + // argument of a subsequent API invocation. + NextToken *string + + noSmithyDocumentSerde +} + +type ListTypesOutput struct { + + // The list of types contained in the specified keyspace. + // + // This member is required. + Types []string + + // The pagination token. To resume pagination, provide the NextToken value as an + // argument of a subsequent API invocation. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListTypes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListTypes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTypes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListTypesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTypes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListTypesPaginatorOptions is the paginator options for ListTypes +type ListTypesPaginatorOptions struct { + // The total number of types to return in the output. If the total number of + // types available is more than the value specified, a NextToken is provided in + // the output. To resume pagination, provide the NextToken value as an argument of + // a subsequent API invocation. + 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 +} + +// ListTypesPaginator is a paginator for ListTypes +type ListTypesPaginator struct { + options ListTypesPaginatorOptions + client ListTypesAPIClient + params *ListTypesInput + nextToken *string + firstPage bool +} + +// NewListTypesPaginator returns a new ListTypesPaginator +func NewListTypesPaginator(client ListTypesAPIClient, params *ListTypesInput, optFns ...func(*ListTypesPaginatorOptions)) *ListTypesPaginator { + if params == nil { + params = &ListTypesInput{} + } + + options := ListTypesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTypes page. +func (p *ListTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypesOutput, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListTypes(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 +} + +// ListTypesAPIClient is a client that implements the ListTypes operation. +type ListTypesAPIClient interface { + ListTypes(context.Context, *ListTypesInput, ...func(*Options)) (*ListTypesOutput, error) +} + +var _ ListTypesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListTypes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTypes", + } +} diff --git a/service/keyspaces/deserializers.go b/service/keyspaces/deserializers.go index 15e7038ebac..e394aba8815 100644 --- a/service/keyspaces/deserializers.go +++ b/service/keyspaces/deserializers.go @@ -279,14 +279,14 @@ func awsAwsjson10_deserializeOpErrorCreateTable(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpDeleteKeyspace struct { +type awsAwsjson10_deserializeOpCreateType struct { } -func (*awsAwsjson10_deserializeOpDeleteKeyspace) ID() string { +func (*awsAwsjson10_deserializeOpCreateType) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteKeyspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpCreateType) 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) @@ -304,9 +304,9 @@ func (m *awsAwsjson10_deserializeOpDeleteKeyspace) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteKeyspace(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorCreateType(response, &metadata) } - output := &DeleteKeyspaceOutput{} + output := &CreateTypeOutput{} out.Result = output var buff [1024]byte @@ -326,7 +326,7 @@ func (m *awsAwsjson10_deserializeOpDeleteKeyspace) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteKeyspaceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentCreateTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -340,7 +340,7 @@ func (m *awsAwsjson10_deserializeOpDeleteKeyspace) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteKeyspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorCreateType(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)} @@ -405,14 +405,14 @@ func awsAwsjson10_deserializeOpErrorDeleteKeyspace(response *smithyhttp.Response } } -type awsAwsjson10_deserializeOpDeleteTable struct { +type awsAwsjson10_deserializeOpDeleteKeyspace struct { } -func (*awsAwsjson10_deserializeOpDeleteTable) ID() string { +func (*awsAwsjson10_deserializeOpDeleteKeyspace) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpDeleteTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteKeyspace) 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) @@ -430,9 +430,9 @@ func (m *awsAwsjson10_deserializeOpDeleteTable) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorDeleteTable(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteKeyspace(response, &metadata) } - output := &DeleteTableOutput{} + output := &DeleteKeyspaceOutput{} out.Result = output var buff [1024]byte @@ -452,7 +452,7 @@ func (m *awsAwsjson10_deserializeOpDeleteTable) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentDeleteTableOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteKeyspaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -466,7 +466,7 @@ func (m *awsAwsjson10_deserializeOpDeleteTable) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorDeleteTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteKeyspace(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)} @@ -531,14 +531,14 @@ func awsAwsjson10_deserializeOpErrorDeleteTable(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpGetKeyspace struct { +type awsAwsjson10_deserializeOpDeleteTable struct { } -func (*awsAwsjson10_deserializeOpGetKeyspace) ID() string { +func (*awsAwsjson10_deserializeOpDeleteTable) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpGetKeyspace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteTable) 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) @@ -556,9 +556,9 @@ func (m *awsAwsjson10_deserializeOpGetKeyspace) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorGetKeyspace(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteTable(response, &metadata) } - output := &GetKeyspaceOutput{} + output := &DeleteTableOutput{} out.Result = output var buff [1024]byte @@ -578,7 +578,7 @@ func (m *awsAwsjson10_deserializeOpGetKeyspace) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentGetKeyspaceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteTableOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -592,7 +592,7 @@ func (m *awsAwsjson10_deserializeOpGetKeyspace) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorGetKeyspace(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteTable(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)} @@ -632,6 +632,9 @@ func awsAwsjson10_deserializeOpErrorGetKeyspace(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -654,14 +657,14 @@ func awsAwsjson10_deserializeOpErrorGetKeyspace(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpGetTable struct { +type awsAwsjson10_deserializeOpDeleteType struct { } -func (*awsAwsjson10_deserializeOpGetTable) ID() string { +func (*awsAwsjson10_deserializeOpDeleteType) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpGetTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteType) 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) @@ -679,9 +682,9 @@ func (m *awsAwsjson10_deserializeOpGetTable) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorGetTable(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteType(response, &metadata) } - output := &GetTableOutput{} + output := &DeleteTypeOutput{} out.Result = output var buff [1024]byte @@ -701,7 +704,7 @@ func (m *awsAwsjson10_deserializeOpGetTable) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentGetTableOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDeleteTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -715,7 +718,7 @@ func (m *awsAwsjson10_deserializeOpGetTable) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsAwsjson10_deserializeOpErrorGetTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteType(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)} @@ -755,6 +758,9 @@ func awsAwsjson10_deserializeOpErrorGetTable(response *smithyhttp.Response, meta case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -777,14 +783,14 @@ func awsAwsjson10_deserializeOpErrorGetTable(response *smithyhttp.Response, meta } } -type awsAwsjson10_deserializeOpGetTableAutoScalingSettings struct { +type awsAwsjson10_deserializeOpGetKeyspace struct { } -func (*awsAwsjson10_deserializeOpGetTableAutoScalingSettings) ID() string { +func (*awsAwsjson10_deserializeOpGetKeyspace) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpGetTableAutoScalingSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetKeyspace) 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) @@ -802,9 +808,9 @@ func (m *awsAwsjson10_deserializeOpGetTableAutoScalingSettings) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorGetTableAutoScalingSettings(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetKeyspace(response, &metadata) } - output := &GetTableAutoScalingSettingsOutput{} + output := &GetKeyspaceOutput{} out.Result = output var buff [1024]byte @@ -824,7 +830,7 @@ func (m *awsAwsjson10_deserializeOpGetTableAutoScalingSettings) HandleDeserializ return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentGetTableAutoScalingSettingsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetKeyspaceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -838,7 +844,7 @@ func (m *awsAwsjson10_deserializeOpGetTableAutoScalingSettings) HandleDeserializ return out, metadata, err } -func awsAwsjson10_deserializeOpErrorGetTableAutoScalingSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetKeyspace(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)} @@ -900,14 +906,14 @@ func awsAwsjson10_deserializeOpErrorGetTableAutoScalingSettings(response *smithy } } -type awsAwsjson10_deserializeOpListKeyspaces struct { +type awsAwsjson10_deserializeOpGetTable struct { } -func (*awsAwsjson10_deserializeOpListKeyspaces) ID() string { +func (*awsAwsjson10_deserializeOpGetTable) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListKeyspaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetTable) 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) @@ -925,9 +931,9 @@ func (m *awsAwsjson10_deserializeOpListKeyspaces) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListKeyspaces(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetTable(response, &metadata) } - output := &ListKeyspacesOutput{} + output := &GetTableOutput{} out.Result = output var buff [1024]byte @@ -947,7 +953,7 @@ func (m *awsAwsjson10_deserializeOpListKeyspaces) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListKeyspacesOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetTableOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -961,7 +967,7 @@ func (m *awsAwsjson10_deserializeOpListKeyspaces) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListKeyspaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetTable(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)} @@ -1023,14 +1029,14 @@ func awsAwsjson10_deserializeOpErrorListKeyspaces(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpListTables struct { +type awsAwsjson10_deserializeOpGetTableAutoScalingSettings struct { } -func (*awsAwsjson10_deserializeOpListTables) ID() string { +func (*awsAwsjson10_deserializeOpGetTableAutoScalingSettings) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetTableAutoScalingSettings) 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) @@ -1048,9 +1054,9 @@ func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTables(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetTableAutoScalingSettings(response, &metadata) } - output := &ListTablesOutput{} + output := &GetTableAutoScalingSettingsOutput{} out.Result = output var buff [1024]byte @@ -1070,7 +1076,7 @@ func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTablesOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetTableAutoScalingSettingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1084,7 +1090,7 @@ func (m *awsAwsjson10_deserializeOpListTables) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTables(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetTableAutoScalingSettings(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)} @@ -1146,14 +1152,14 @@ func awsAwsjson10_deserializeOpErrorListTables(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpListTagsForResource struct { +type awsAwsjson10_deserializeOpGetType struct { } -func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson10_deserializeOpGetType) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetType) 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) @@ -1171,9 +1177,9 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetType(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &GetTypeOutput{} out.Result = output var buff [1024]byte @@ -1193,7 +1199,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1207,7 +1213,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetType(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)} @@ -1269,14 +1275,14 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpRestoreTable struct { +type awsAwsjson10_deserializeOpListKeyspaces struct { } -func (*awsAwsjson10_deserializeOpRestoreTable) ID() string { +func (*awsAwsjson10_deserializeOpListKeyspaces) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpRestoreTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListKeyspaces) 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) @@ -1294,9 +1300,9 @@ func (m *awsAwsjson10_deserializeOpRestoreTable) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorRestoreTable(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListKeyspaces(response, &metadata) } - output := &RestoreTableOutput{} + output := &ListKeyspacesOutput{} out.Result = output var buff [1024]byte @@ -1316,7 +1322,7 @@ func (m *awsAwsjson10_deserializeOpRestoreTable) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentRestoreTableOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListKeyspacesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1330,7 +1336,7 @@ func (m *awsAwsjson10_deserializeOpRestoreTable) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson10_deserializeOpErrorRestoreTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListKeyspaces(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)} @@ -1370,9 +1376,6 @@ func awsAwsjson10_deserializeOpErrorRestoreTable(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -1395,14 +1398,14 @@ func awsAwsjson10_deserializeOpErrorRestoreTable(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpTagResource struct { +type awsAwsjson10_deserializeOpListTables struct { } -func (*awsAwsjson10_deserializeOpTagResource) ID() string { +func (*awsAwsjson10_deserializeOpListTables) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTables) 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) @@ -1420,9 +1423,9 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTables(response, &metadata) } - output := &TagResourceOutput{} + output := &ListTablesOutput{} out.Result = output var buff [1024]byte @@ -1442,7 +1445,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTablesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1456,7 +1459,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTables(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)} @@ -1518,14 +1521,14 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpUntagResource struct { +type awsAwsjson10_deserializeOpListTagsForResource struct { } -func (*awsAwsjson10_deserializeOpUntagResource) ID() string { +func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_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) @@ -1543,9 +1546,9 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &UntagResourceOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -1565,7 +1568,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUntagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1579,7 +1582,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_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)} @@ -1619,9 +1622,6 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -1644,14 +1644,14 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpUpdateTable struct { +type awsAwsjson10_deserializeOpListTypes struct { } -func (*awsAwsjson10_deserializeOpUpdateTable) ID() string { +func (*awsAwsjson10_deserializeOpListTypes) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateTable) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTypes) 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) @@ -1669,9 +1669,9 @@ func (m *awsAwsjson10_deserializeOpUpdateTable) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateTable(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTypes(response, &metadata) } - output := &UpdateTableOutput{} + output := &ListTypesOutput{} out.Result = output var buff [1024]byte @@ -1691,7 +1691,7 @@ func (m *awsAwsjson10_deserializeOpUpdateTable) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateTableOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTypesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1705,7 +1705,7 @@ func (m *awsAwsjson10_deserializeOpUpdateTable) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateTable(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTypes(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)} @@ -1745,9 +1745,6 @@ func awsAwsjson10_deserializeOpErrorUpdateTable(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -1770,46 +1767,40 @@ func awsAwsjson10_deserializeOpErrorUpdateTable(response *smithyhttp.Response, m } } -func awsAwsjson10_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 - } +type awsAwsjson10_deserializeOpRestoreTable struct { +} - output := &types.AccessDeniedException{} - err := awsAwsjson10_deserializeDocumentAccessDeniedException(&output, shape) +func (*awsAwsjson10_deserializeOpRestoreTable) ID() string { + return "OperationDeserializer" +} +func (m *awsAwsjson10_deserializeOpRestoreTable) 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 -} + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_deserializeOpErrorRestoreTable(response, &metadata) + } + output := &RestoreTableOutput{} + out.Result = output -func awsAwsjson10_deserializeErrorConflictException(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{} @@ -1820,12 +1811,10 @@ func awsAwsjson10_deserializeErrorConflictException(response *smithyhttp.Respons Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.ConflictException{} - err := awsAwsjson10_deserializeDocumentConflictException(&output, shape) - + err = awsAwsjson10_deserializeOpDocumentRestoreTableOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1833,34 +1822,31 @@ func awsAwsjson10_deserializeErrorConflictException(response *smithyhttp.Respons 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 awsAwsjson10_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeOpErrorRestoreTable(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") + 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.InternalServerException{} - err := awsAwsjson10_deserializeDocumentInternalServerException(&output, shape) - + bodyInfo, err := getProtocolErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1872,12 +1858,527 @@ func awsAwsjson10_deserializeErrorInternalServerException(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpTagResource struct { +} + +func (*awsAwsjson10_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_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 = awsAwsjson10_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 awsAwsjson10_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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUntagResource struct { +} + +func (*awsAwsjson10_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_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 = awsAwsjson10_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 awsAwsjson10_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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateTable struct { +} + +func (*awsAwsjson10_deserializeOpUpdateTable) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateTable) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsjson10_deserializeOpErrorUpdateTable(response, &metadata) + } + output := &UpdateTableOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdateTableOutput(&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 awsAwsjson10_deserializeOpErrorUpdateTable(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson10_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 := awsAwsjson10_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 awsAwsjson10_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 := awsAwsjson10_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 awsAwsjson10_deserializeErrorInternalServerException(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.InternalServerException{} + err := awsAwsjson10_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson10_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) @@ -2585,6 +3086,89 @@ func awsAwsjson10_deserializeDocumentEncryptionSpecification(v **types.Encryptio return nil } +func awsAwsjson10_deserializeDocumentFieldDefinition(v **types.FieldDefinition, 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.FieldDefinition + if *v == nil { + sv = &types.FieldDefinition{} + } 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 GenericString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentFieldList(v *[]types.FieldDefinition, 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.FieldDefinition + if *v == nil { + cv = []types.FieldDefinition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldDefinition + destAddr := &col + if err := awsAwsjson10_deserializeDocumentFieldDefinition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3261,7 +3845,43 @@ func awsAwsjson10_deserializeDocumentStaticColumnList(v *[]types.StaticColumn, v if err := awsAwsjson10_deserializeDocumentStaticColumn(&destAddr, value); err != nil { return err } - col = *destAddr + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentTableNameList(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 TableName to be of type string, got %T instead", value) + } + col = jtv + } cv = append(cv, col) } @@ -3584,6 +4204,42 @@ func awsAwsjson10_deserializeDocumentTimeToLive(v **types.TimeToLive, value inte return nil } +func awsAwsjson10_deserializeDocumentTypeNameList(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 TypeName to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3704,6 +4360,55 @@ func awsAwsjson10_deserializeOpDocumentCreateTableOutput(v **CreateTableOutput, return nil } +func awsAwsjson10_deserializeOpDocumentCreateTypeOutput(v **CreateTypeOutput, 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 *CreateTypeOutput + if *v == nil { + sv = &CreateTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "keyspaceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.KeyspaceArn = ptr.String(jtv) + } + + case "typeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeName to be of type string, got %T instead", value) + } + sv.TypeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentDeleteKeyspaceOutput(v **DeleteKeyspaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3766,6 +4471,55 @@ func awsAwsjson10_deserializeOpDocumentDeleteTableOutput(v **DeleteTableOutput, return nil } +func awsAwsjson10_deserializeOpDocumentDeleteTypeOutput(v **DeleteTypeOutput, 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 *DeleteTypeOutput + if *v == nil { + sv = &DeleteTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "keyspaceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.KeyspaceArn = ptr.String(jtv) + } + + case "typeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeName to be of type string, got %T instead", value) + } + sv.TypeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentGetKeyspaceOutput(v **GetKeyspaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4033,6 +4787,117 @@ func awsAwsjson10_deserializeOpDocumentGetTableOutput(v **GetTableOutput, value return nil } +func awsAwsjson10_deserializeOpDocumentGetTypeOutput(v **GetTypeOutput, 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 *GetTypeOutput + if *v == nil { + sv = &GetTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "directParentTypes": + if err := awsAwsjson10_deserializeDocumentTypeNameList(&sv.DirectParentTypes, value); err != nil { + return err + } + + case "directReferringTables": + if err := awsAwsjson10_deserializeDocumentTableNameList(&sv.DirectReferringTables, value); err != nil { + return err + } + + case "fieldDefinitions": + if err := awsAwsjson10_deserializeDocumentFieldList(&sv.FieldDefinitions, value); err != nil { + return err + } + + case "keyspaceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.KeyspaceArn = ptr.String(jtv) + } + + case "keyspaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KeyspaceName to be of type string, got %T instead", value) + } + sv.KeyspaceName = ptr.String(jtv) + } + + case "lastModifiedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "maxNestingDepth": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Depth to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxNestingDepth = int32(i64) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeStatus to be of type string, got %T instead", value) + } + sv.Status = types.TypeStatus(jtv) + } + + case "typeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TypeName to be of type string, got %T instead", value) + } + sv.TypeName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListKeyspacesOutput(v **ListKeyspacesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4168,6 +5033,51 @@ func awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } +func awsAwsjson10_deserializeOpDocumentListTypesOutput(v **ListTypesOutput, 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 *ListTypesOutput + if *v == nil { + sv = &ListTypesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "types": + if err := awsAwsjson10_deserializeDocumentTypeNameList(&sv.Types, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentRestoreTableOutput(v **RestoreTableOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/keyspaces/generated.json b/service/keyspaces/generated.json index cee061283f8..7dd26df5318 100644 --- a/service/keyspaces/generated.json +++ b/service/keyspaces/generated.json @@ -10,14 +10,18 @@ "api_client_test.go", "api_op_CreateKeyspace.go", "api_op_CreateTable.go", + "api_op_CreateType.go", "api_op_DeleteKeyspace.go", "api_op_DeleteTable.go", + "api_op_DeleteType.go", "api_op_GetKeyspace.go", "api_op_GetTable.go", "api_op_GetTableAutoScalingSettings.go", + "api_op_GetType.go", "api_op_ListKeyspaces.go", "api_op_ListTables.go", "api_op_ListTagsForResource.go", + "api_op_ListTypes.go", "api_op_RestoreTable.go", "api_op_TagResource.go", "api_op_UntagResource.go", diff --git a/service/keyspaces/serializers.go b/service/keyspaces/serializers.go index d4bd6b229df..22dba837868 100644 --- a/service/keyspaces/serializers.go +++ b/service/keyspaces/serializers.go @@ -140,6 +140,67 @@ func (m *awsAwsjson10_serializeOpCreateTable) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpCreateType struct { +} + +func (*awsAwsjson10_serializeOpCreateType) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateTypeInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("KeyspacesService.CreateType") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateTypeInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpDeleteKeyspace struct { } @@ -262,6 +323,67 @@ func (m *awsAwsjson10_serializeOpDeleteTable) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDeleteType struct { +} + +func (*awsAwsjson10_serializeOpDeleteType) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteTypeInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("KeyspacesService.DeleteType") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteTypeInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpGetKeyspace struct { } @@ -445,6 +567,67 @@ func (m *awsAwsjson10_serializeOpGetTableAutoScalingSettings) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpGetType struct { +} + +func (*awsAwsjson10_serializeOpGetType) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetTypeInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("KeyspacesService.GetType") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetTypeInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpListKeyspaces struct { } @@ -628,6 +811,67 @@ func (m *awsAwsjson10_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListTypes struct { +} + +func (*awsAwsjson10_serializeOpListTypes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListTypesInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("KeyspacesService.ListTypes") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListTypesInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpRestoreTable struct { } @@ -1058,6 +1302,36 @@ func awsAwsjson10_serializeDocumentEncryptionSpecification(v *types.EncryptionSp return nil } +func awsAwsjson10_serializeDocumentFieldDefinition(v *types.FieldDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Type != nil { + ok := object.Key("type") + ok.String(*v.Type) + } + + return nil +} + +func awsAwsjson10_serializeDocumentFieldList(v []types.FieldDefinition, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentFieldDefinition(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson10_serializeDocumentPartitionKey(v *types.PartitionKey, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1422,6 +1696,30 @@ func awsAwsjson10_serializeOpDocumentCreateTableInput(v *CreateTableInput, value return nil } +func awsAwsjson10_serializeOpDocumentCreateTypeInput(v *CreateTypeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FieldDefinitions != nil { + ok := object.Key("fieldDefinitions") + if err := awsAwsjson10_serializeDocumentFieldList(v.FieldDefinitions, ok); err != nil { + return err + } + } + + if v.KeyspaceName != nil { + ok := object.Key("keyspaceName") + ok.String(*v.KeyspaceName) + } + + if v.TypeName != nil { + ok := object.Key("typeName") + ok.String(*v.TypeName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDeleteKeyspaceInput(v *DeleteKeyspaceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1451,6 +1749,23 @@ func awsAwsjson10_serializeOpDocumentDeleteTableInput(v *DeleteTableInput, value return nil } +func awsAwsjson10_serializeOpDocumentDeleteTypeInput(v *DeleteTypeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyspaceName != nil { + ok := object.Key("keyspaceName") + ok.String(*v.KeyspaceName) + } + + if v.TypeName != nil { + ok := object.Key("typeName") + ok.String(*v.TypeName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentGetKeyspaceInput(v *GetKeyspaceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1497,6 +1812,23 @@ func awsAwsjson10_serializeOpDocumentGetTableInput(v *GetTableInput, value smith return nil } +func awsAwsjson10_serializeOpDocumentGetTypeInput(v *GetTypeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyspaceName != nil { + ok := object.Key("keyspaceName") + ok.String(*v.KeyspaceName) + } + + if v.TypeName != nil { + ok := object.Key("typeName") + ok.String(*v.TypeName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListKeyspacesInput(v *ListKeyspacesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1558,6 +1890,28 @@ func awsAwsjson10_serializeOpDocumentListTagsForResourceInput(v *ListTagsForReso return nil } +func awsAwsjson10_serializeOpDocumentListTypesInput(v *ListTypesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyspaceName != nil { + ok := object.Key("keyspaceName") + ok.String(*v.KeyspaceName) + } + + 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 awsAwsjson10_serializeOpDocumentRestoreTableInput(v *RestoreTableInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/keyspaces/snapshot/api_op_CreateType.go.snap b/service/keyspaces/snapshot/api_op_CreateType.go.snap new file mode 100644 index 00000000000..9ad6124a2fd --- /dev/null +++ b/service/keyspaces/snapshot/api_op_CreateType.go.snap @@ -0,0 +1,41 @@ +CreateType + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/keyspaces/snapshot/api_op_DeleteType.go.snap b/service/keyspaces/snapshot/api_op_DeleteType.go.snap new file mode 100644 index 00000000000..14cc248b3d2 --- /dev/null +++ b/service/keyspaces/snapshot/api_op_DeleteType.go.snap @@ -0,0 +1,41 @@ +DeleteType + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/keyspaces/snapshot/api_op_GetType.go.snap b/service/keyspaces/snapshot/api_op_GetType.go.snap new file mode 100644 index 00000000000..764cc0b4c51 --- /dev/null +++ b/service/keyspaces/snapshot/api_op_GetType.go.snap @@ -0,0 +1,41 @@ +GetType + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/keyspaces/snapshot/api_op_ListTypes.go.snap b/service/keyspaces/snapshot/api_op_ListTypes.go.snap new file mode 100644 index 00000000000..f6c0cc1cf02 --- /dev/null +++ b/service/keyspaces/snapshot/api_op_ListTypes.go.snap @@ -0,0 +1,41 @@ +ListTypes + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/keyspaces/snapshot_test.go b/service/keyspaces/snapshot_test.go index a21e1f7f43c..32acd8f6f4a 100644 --- a/service/keyspaces/snapshot_test.go +++ b/service/keyspaces/snapshot_test.go @@ -86,6 +86,18 @@ func TestCheckSnapshot_CreateTable(t *testing.T) { } } +func TestCheckSnapshot_CreateType(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteKeyspace(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteKeyspace(context.Background(), nil, func(o *Options) { @@ -110,6 +122,18 @@ func TestCheckSnapshot_DeleteTable(t *testing.T) { } } +func TestCheckSnapshot_DeleteType(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetKeyspace(t *testing.T) { svc := New(Options{}) _, err := svc.GetKeyspace(context.Background(), nil, func(o *Options) { @@ -146,6 +170,18 @@ func TestCheckSnapshot_GetTableAutoScalingSettings(t *testing.T) { } } +func TestCheckSnapshot_GetType(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListKeyspaces(t *testing.T) { svc := New(Options{}) _, err := svc.ListKeyspaces(context.Background(), nil, func(o *Options) { @@ -182,6 +218,18 @@ func TestCheckSnapshot_ListTagsForResource(t *testing.T) { } } +func TestCheckSnapshot_ListTypes(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTypes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTypes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_RestoreTable(t *testing.T) { svc := New(Options{}) _, err := svc.RestoreTable(context.Background(), nil, func(o *Options) { @@ -253,6 +301,18 @@ func TestUpdateSnapshot_CreateTable(t *testing.T) { } } +func TestUpdateSnapshot_CreateType(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteKeyspace(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteKeyspace(context.Background(), nil, func(o *Options) { @@ -277,6 +337,18 @@ func TestUpdateSnapshot_DeleteTable(t *testing.T) { } } +func TestUpdateSnapshot_DeleteType(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetKeyspace(t *testing.T) { svc := New(Options{}) _, err := svc.GetKeyspace(context.Background(), nil, func(o *Options) { @@ -313,6 +385,18 @@ func TestUpdateSnapshot_GetTableAutoScalingSettings(t *testing.T) { } } +func TestUpdateSnapshot_GetType(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetType(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetType") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListKeyspaces(t *testing.T) { svc := New(Options{}) _, err := svc.ListKeyspaces(context.Background(), nil, func(o *Options) { @@ -349,6 +433,18 @@ func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { } } +func TestUpdateSnapshot_ListTypes(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTypes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTypes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_RestoreTable(t *testing.T) { svc := New(Options{}) _, err := svc.RestoreTable(context.Background(), nil, func(o *Options) { diff --git a/service/keyspaces/types/enums.go b/service/keyspaces/types/enums.go index 300e2d7fbd5..1b3db8566ad 100644 --- a/service/keyspaces/types/enums.go +++ b/service/keyspaces/types/enums.go @@ -159,3 +159,26 @@ func (TimeToLiveStatus) Values() []TimeToLiveStatus { "ENABLED", } } + +type TypeStatus string + +// Enum values for TypeStatus +const ( + TypeStatusActive TypeStatus = "ACTIVE" + TypeStatusCreating TypeStatus = "CREATING" + TypeStatusDeleting TypeStatus = "DELETING" + TypeStatusRestoring TypeStatus = "RESTORING" +) + +// Values returns all known values for TypeStatus. 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 (TypeStatus) Values() []TypeStatus { + return []TypeStatus{ + "ACTIVE", + "CREATING", + "DELETING", + "RESTORING", + } +} diff --git a/service/keyspaces/types/errors.go b/service/keyspaces/types/errors.go index eb367db734a..6994df816b7 100644 --- a/service/keyspaces/types/errors.go +++ b/service/keyspaces/types/errors.go @@ -88,8 +88,9 @@ func (e *InternalServerException) ErrorCode() string { } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } -// The operation tried to access a keyspace or table that doesn't exist. The -// resource might not be specified correctly, or its status might not be ACTIVE . +// The operation tried to access a keyspace, table, or type that doesn't exist. +// The resource might not be specified correctly, or its status might not be ACTIVE +// . type ResourceNotFoundException struct { Message *string diff --git a/service/keyspaces/types/types.go b/service/keyspaces/types/types.go index 1c7607899b6..fde02bb0686 100644 --- a/service/keyspaces/types/types.go +++ b/service/keyspaces/types/types.go @@ -295,6 +295,27 @@ type EncryptionSpecification struct { noSmithyDocumentSerde } +// A field definition consists out of a name and a type. +type FieldDefinition struct { + + // The identifier. + // + // This member is required. + Name *string + + // Any supported Cassandra data type, including collections and other + // user-defined types that are contained in the same keyspace. + // + // For more information, see [Cassandra data type support] in the Amazon Keyspaces Developer Guide. + // + // [Cassandra data type support]: https://docs.aws.amazon.com/keyspaces/latest/devguide/cassandra-apis.html#cassandra-data-type + // + // This member is required. + Type *string + + noSmithyDocumentSerde +} + // Represents the properties of a keyspace. type KeyspaceSummary struct { diff --git a/service/keyspaces/validators.go b/service/keyspaces/validators.go index d1bd7443fb4..76adefc2103 100644 --- a/service/keyspaces/validators.go +++ b/service/keyspaces/validators.go @@ -50,6 +50,26 @@ func (m *validateOpCreateTable) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateType struct { +} + +func (*validateOpCreateType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteKeyspace struct { } @@ -90,6 +110,26 @@ func (m *validateOpDeleteTable) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDeleteType struct { +} + +func (*validateOpDeleteType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetKeyspace struct { } @@ -150,6 +190,26 @@ func (m *validateOpGetTable) HandleInitialize(ctx context.Context, in middleware return next.HandleInitialize(ctx, in) } +type validateOpGetType struct { +} + +func (*validateOpGetType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTables struct { } @@ -190,6 +250,26 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpListTypes struct { +} + +func (*validateOpListTypes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTypesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTypesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRestoreTable struct { } @@ -278,6 +358,10 @@ func addOpCreateTableValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateTable{}, middleware.After) } +func addOpCreateTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateType{}, middleware.After) +} + func addOpDeleteKeyspaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteKeyspace{}, middleware.After) } @@ -286,6 +370,10 @@ func addOpDeleteTableValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTable{}, middleware.After) } +func addOpDeleteTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteType{}, middleware.After) +} + func addOpGetKeyspaceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetKeyspace{}, middleware.After) } @@ -298,6 +386,10 @@ func addOpGetTableValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTable{}, middleware.After) } +func addOpGetTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetType{}, middleware.After) +} + func addOpListTablesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTables{}, middleware.After) } @@ -306,6 +398,10 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpListTypesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTypes{}, middleware.After) +} + func addOpRestoreTableValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRestoreTable{}, middleware.After) } @@ -508,6 +604,41 @@ func validateEncryptionSpecification(v *types.EncryptionSpecification) error { } } +func validateFieldDefinition(v *types.FieldDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldDefinition"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Type == nil { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldList(v []types.FieldDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldList"} + for i := range v { + if err := validateFieldDefinition(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validatePartitionKey(v *types.PartitionKey) error { if v == nil { return nil @@ -832,6 +963,31 @@ func validateOpCreateTableInput(v *CreateTableInput) error { } } +func validateOpCreateTypeInput(v *CreateTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTypeInput"} + if v.KeyspaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyspaceName")) + } + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if v.FieldDefinitions == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldDefinitions")) + } else if v.FieldDefinitions != nil { + if err := validateFieldList(v.FieldDefinitions); err != nil { + invalidParams.AddNested("FieldDefinitions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteKeyspaceInput(v *DeleteKeyspaceInput) error { if v == nil { return nil @@ -865,6 +1021,24 @@ func validateOpDeleteTableInput(v *DeleteTableInput) error { } } +func validateOpDeleteTypeInput(v *DeleteTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteTypeInput"} + if v.KeyspaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyspaceName")) + } + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetKeyspaceInput(v *GetKeyspaceInput) error { if v == nil { return nil @@ -916,6 +1090,24 @@ func validateOpGetTableInput(v *GetTableInput) error { } } +func validateOpGetTypeInput(v *GetTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTypeInput"} + if v.KeyspaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyspaceName")) + } + if v.TypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTablesInput(v *ListTablesInput) error { if v == nil { return nil @@ -946,6 +1138,21 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpListTypesInput(v *ListTypesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTypesInput"} + if v.KeyspaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyspaceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRestoreTableInput(v *RestoreTableInput) error { if v == nil { return nil diff --git a/service/memorydb/internal/endpoints/endpoints.go b/service/memorydb/internal/endpoints/endpoints.go index 4e8873c1ade..c32afe6d4bd 100644 --- a/service/memorydb/internal/endpoints/endpoints.go +++ b/service/memorydb/internal/endpoints/endpoints.go @@ -367,5 +367,13 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + }, }, } diff --git a/service/networkfirewall/deserializers.go b/service/networkfirewall/deserializers.go index bd742cb890d..97edb3f1316 100644 --- a/service/networkfirewall/deserializers.go +++ b/service/networkfirewall/deserializers.go @@ -6119,6 +6119,50 @@ func awsAwsjson10_deserializeDocumentFlags(v *[]types.TCPFlag, value interface{} return nil } +func awsAwsjson10_deserializeDocumentFlowTimeouts(v **types.FlowTimeouts, 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.FlowTimeouts + if *v == nil { + sv = &types.FlowTimeouts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TcpIdleTimeoutSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TcpIdleTimeoutRangeBound to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TcpIdleTimeoutSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentHeader(v **types.Header, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8446,6 +8490,11 @@ func awsAwsjson10_deserializeDocumentStatefulEngineOptions(v **types.StatefulEng for key, value := range shape { switch key { + case "FlowTimeouts": + if err := awsAwsjson10_deserializeDocumentFlowTimeouts(&sv.FlowTimeouts, value); err != nil { + return err + } + case "RuleOrder": if value != nil { jtv, ok := value.(string) diff --git a/service/networkfirewall/doc.go b/service/networkfirewall/doc.go index 9be6e7668fb..cfcdb4e6644 100644 --- a/service/networkfirewall/doc.go +++ b/service/networkfirewall/doc.go @@ -29,8 +29,7 @@ // includes filtering traffic going to and coming from an internet gateway, NAT // gateway, or over VPN or Direct Connect. Network Firewall uses rules that are // compatible with Suricata, a free, open source network analysis and threat -// detection engine. Network Firewall supports Suricata version 6.0.9. For -// information about Suricata, see the [Suricata website]. +// detection engine. // // You can use Network Firewall to monitor and protect your VPC traffic in a // number of ways. The following are just a few examples: @@ -71,7 +70,6 @@ // - In Amazon VPC, use ingress routing enhancements to route traffic through // the new firewall endpoints. // -// [Suricata website]: https://suricata.io/ // [Amazon Web Services APIs]: https://docs.aws.amazon.com/general/latest/gr/aws-apis.html // [Amazon VPC User Guide]: https://docs.aws.amazon.com/vpc/latest/userguide/ // diff --git a/service/networkfirewall/serializers.go b/service/networkfirewall/serializers.go index c1c0a7f98e8..e4925cb5a09 100644 --- a/service/networkfirewall/serializers.go +++ b/service/networkfirewall/serializers.go @@ -2431,6 +2431,18 @@ func awsAwsjson10_serializeDocumentFlags(v []types.TCPFlag, value smithyjson.Val return nil } +func awsAwsjson10_serializeDocumentFlowTimeouts(v *types.FlowTimeouts, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TcpIdleTimeoutSeconds != nil { + ok := object.Key("TcpIdleTimeoutSeconds") + ok.Integer(*v.TcpIdleTimeoutSeconds) + } + + return nil +} + func awsAwsjson10_serializeDocumentHeader(v *types.Header, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3092,6 +3104,13 @@ func awsAwsjson10_serializeDocumentStatefulEngineOptions(v *types.StatefulEngine object := value.Object() defer object.Close() + if v.FlowTimeouts != nil { + ok := object.Key("FlowTimeouts") + if err := awsAwsjson10_serializeDocumentFlowTimeouts(v.FlowTimeouts, ok); err != nil { + return err + } + } + if len(v.RuleOrder) > 0 { ok := object.Key("RuleOrder") ok.String(string(v.RuleOrder)) diff --git a/service/networkfirewall/types/types.go b/service/networkfirewall/types/types.go index dcae145efb5..ce9bee88c43 100644 --- a/service/networkfirewall/types/types.go +++ b/service/networkfirewall/types/types.go @@ -579,6 +579,26 @@ type FirewallStatus struct { noSmithyDocumentSerde } +// Describes the amount of time that can pass without any traffic sent through the +// firewall before the firewall determines that the connection is idle and Network +// Firewall removes the flow entry from its flow table. Existing connections and +// flows are not impacted when you update this value. Only new connections after +// you update this value are impacted. +type FlowTimeouts struct { + + // The number of seconds that can pass without any TCP traffic sent through the + // firewall before the firewall determines that the connection is idle. After the + // idle timeout passes, data packets are dropped, however, the next TCP SYN packet + // is considered a new flow and is processed by the firewall. Clients or targets + // can use TCP keepalive packets to reset the idle timeout. + // + // You can define the TcpIdleTimeoutSeconds value to be between 60 and 6000 + // seconds. If no value is provided, it defaults to 350 seconds. + TcpIdleTimeoutSeconds *int32 + + noSmithyDocumentSerde +} + // The basic rule criteria for Network Firewall to use to inspect packet headers // in stateful traffic flow inspection. Traffic flows that match the criteria are a // match for the corresponding StatefulRule. @@ -1342,6 +1362,10 @@ type SourceMetadata struct { // firewall policy. type StatefulEngineOptions struct { + // Configures the amount of time that can pass without any traffic sent through + // the firewall before the firewall determines that the connection is idle. + FlowTimeouts *FlowTimeouts + // Indicates how to manage the order of stateful rule evaluation for the policy. // STRICT_ORDER is the default and recommended option. With STRICT_ORDER , provide // your rules in the order that you want them to be evaluated. You can then choose diff --git a/service/opensearch/api_client.go b/service/opensearch/api_client.go index 351d593d50a..d04c689f01b 100644 --- a/service/opensearch/api_client.go +++ b/service/opensearch/api_client.go @@ -4,6 +4,7 @@ package opensearch import ( "context" + cryptorand "crypto/rand" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" @@ -22,6 +23,7 @@ import ( "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/metrics" "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" "net" @@ -185,6 +187,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) + resolveIdempotencyTokenProvider(&options) + resolveEndpointResolverV2(&options) resolveTracerProvider(&options) @@ -680,6 +684,13 @@ func addIsPaginatorUserAgent(o *Options) { }) } +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + func addRetry(stack *middleware.Stack, o Options) error { attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { m.LogAttempts = o.ClientLogMode.IsRetries() @@ -774,6 +785,11 @@ func resolveMeterProvider(options *Options) { } } +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + func addRecursionDetection(stack *middleware.Stack) error { return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) } diff --git a/service/opensearch/api_op_AuthorizeVpcEndpointAccess.go b/service/opensearch/api_op_AuthorizeVpcEndpointAccess.go index 9e8dbc1b9ff..718dc6078fb 100644 --- a/service/opensearch/api_op_AuthorizeVpcEndpointAccess.go +++ b/service/opensearch/api_op_AuthorizeVpcEndpointAccess.go @@ -30,16 +30,17 @@ func (c *Client) AuthorizeVpcEndpointAccess(ctx context.Context, params *Authori type AuthorizeVpcEndpointAccessInput struct { - // The Amazon Web Services account ID to grant access to. - // - // This member is required. - Account *string - // The name of the OpenSearch Service domain to provide access to. // // This member is required. DomainName *string + // The Amazon Web Services account ID to grant access to. + Account *string + + // The Amazon Web Services service SP to grant access to. + Service types.AWSServicePrincipal + noSmithyDocumentSerde } diff --git a/service/opensearch/api_op_CreateApplication.go b/service/opensearch/api_op_CreateApplication.go new file mode 100644 index 00000000000..ce659e2d4b8 --- /dev/null +++ b/service/opensearch/api_op_CreateApplication.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates an OpenSearch Application. +func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicationInput, optFns ...func(*Options)) (*CreateApplicationOutput, error) { + if params == nil { + params = &CreateApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateApplication", params, optFns, c.addOperationCreateApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateApplicationInput struct { + + // Name of the OpenSearch Appication to create. Application names are unique + // across the applications owned by an account within an Amazon Web Services + // Region. + // + // This member is required. + Name *string + + // Configurations of the OpenSearch Application, inlcuding admin configuration. + AppConfigs []types.AppConfig + + // A unique client idempotency token. It will be auto generated if not provided. + ClientToken *string + + // Data sources to be associated with the OpenSearch Application. + DataSources []types.DataSource + + // Settings of IAM Identity Center for the OpenSearch Application. + IamIdentityCenterOptions *types.IamIdentityCenterOptionsInput + + // A list of tags attached to a domain. + TagList []types.Tag + + noSmithyDocumentSerde +} + +type CreateApplicationOutput struct { + + // Configurations of the OpenSearch Application, inlcuding admin configuration. + AppConfigs []types.AppConfig + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + Arn *string + + // Timestamp when the OpenSearch Application was created. + CreatedAt *time.Time + + // Data sources associated with the created OpenSearch Application. + DataSources []types.DataSource + + // Settings of IAM Identity Center for the created OpenSearch Application. + IamIdentityCenterOptions *types.IamIdentityCenterOptions + + // Unique identifier for the created OpenSearch Application. + Id *string + + // Name of the created OpenSearch Application. + Name *string + + // A list of tags attached to a domain. + TagList []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateApplicationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateApplication struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateApplication) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateApplication) 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.(*CreateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateApplicationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateApplicationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateApplication{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateApplication", + } +} diff --git a/service/opensearch/api_op_CreateDomain.go b/service/opensearch/api_op_CreateDomain.go index 6339a09b3f5..045745d114e 100644 --- a/service/opensearch/api_op_CreateDomain.go +++ b/service/opensearch/api_op_CreateDomain.go @@ -111,6 +111,9 @@ type CreateDomainInput struct { // change your address type later. IPAddressType types.IPAddressType + // Options for IAM Identity Center Option control for the domain. + IdentityCenterOptions *types.IdentityCenterOptionsInput + // Key-value pairs to configure log publishing. LogPublishingOptions map[string]types.LogPublishingOption diff --git a/service/opensearch/api_op_DeleteApplication.go b/service/opensearch/api_op_DeleteApplication.go new file mode 100644 index 00000000000..ba50603c37f --- /dev/null +++ b/service/opensearch/api_op_DeleteApplication.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an existing OpenSearch Application. +func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicationInput, optFns ...func(*Options)) (*DeleteApplicationOutput, error) { + if params == nil { + params = &DeleteApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteApplication", params, optFns, c.addOperationDeleteApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteApplicationInput struct { + + // Unique identifier for the OpenSearch Application that you want to delete. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteApplication", + } +} diff --git a/service/opensearch/api_op_GetApplication.go b/service/opensearch/api_op_GetApplication.go new file mode 100644 index 00000000000..4d72c5914a9 --- /dev/null +++ b/service/opensearch/api_op_GetApplication.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Check the configuration and status of an existing OpenSearch Application. +func (c *Client) GetApplication(ctx context.Context, params *GetApplicationInput, optFns ...func(*Options)) (*GetApplicationOutput, error) { + if params == nil { + params = &GetApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetApplication", params, optFns, c.addOperationGetApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetApplicationInput struct { + + // Unique identifier of the checked OpenSearch Application. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetApplicationOutput struct { + + // App configurations of the checked OpenSearch Application. + AppConfigs []types.AppConfig + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + Arn *string + + // Timestamp at which the checked OpenSearch Application was created. + CreatedAt *time.Time + + // Associated data sources to the checked OpenSearch Application. + DataSources []types.DataSource + + // Endpoint URL of the checked OpenSearch Application. + Endpoint *string + + // IAM Identity Center settings for the checked OpenSearch Application. + IamIdentityCenterOptions *types.IamIdentityCenterOptions + + // Unique identifier of the checked OpenSearch Application. + Id *string + + // Timestamp at which the checked OpenSearch Application was last updated. + LastUpdatedAt *time.Time + + // Name of the checked OpenSearch Application. + Name *string + + // Current status of the checked OpenSearch Application. Possible values are + // CREATING , UPDATING , DELETING , FAILED , ACTIVE , and DELETED . + Status types.ApplicationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetApplication", + } +} diff --git a/service/opensearch/api_op_ListApplications.go b/service/opensearch/api_op_ListApplications.go new file mode 100644 index 00000000000..216abe9d495 --- /dev/null +++ b/service/opensearch/api_op_ListApplications.go @@ -0,0 +1,259 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List all OpenSearch Applications under your account. +func (c *Client) ListApplications(ctx context.Context, params *ListApplicationsInput, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if params == nil { + params = &ListApplicationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListApplications", params, optFns, c.addOperationListApplicationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListApplicationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListApplicationsInput struct { + + // An optional parameter that specifies the maximum number of results to return + // for a given request. + MaxResults int32 + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Send the request again + // using the returned token to retrieve the next page. + NextToken *string + + // OpenSearch Application Status can be used as filters for the listing request. + // Possible values are CREATING , UPDATING , DELETING , FAILED , ACTIVE , and + // DELETED . + Statuses []types.ApplicationStatus + + noSmithyDocumentSerde +} + +type ListApplicationsOutput struct { + + // Summary of the OpenSearch Applications, including ID, ARN, name, endpoint, + // status, create time and last update time. + ApplicationSummaries []types.ApplicationSummary + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Send the request again + // using the returned token to retrieve the next page. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplications{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListApplications"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplications(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // An optional parameter that specifies the maximum number of results to return + // for a given request. + 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 +} + +// ListApplicationsPaginator is a paginator for ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + if params == nil { + params = &ListApplicationsInput{} + } + + options := ListApplicationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListApplications(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 +} + +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListApplications", + } +} diff --git a/service/opensearch/api_op_RevokeVpcEndpointAccess.go b/service/opensearch/api_op_RevokeVpcEndpointAccess.go index a8c7fd3c556..8bcd09dfe75 100644 --- a/service/opensearch/api_op_RevokeVpcEndpointAccess.go +++ b/service/opensearch/api_op_RevokeVpcEndpointAccess.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -29,16 +30,17 @@ func (c *Client) RevokeVpcEndpointAccess(ctx context.Context, params *RevokeVpcE type RevokeVpcEndpointAccessInput struct { - // The account ID to revoke access from. - // - // This member is required. - Account *string - // The name of the OpenSearch Service domain. // // This member is required. DomainName *string + // The account ID to revoke access from. + Account *string + + // The service SP to revoke access from. + Service types.AWSServicePrincipal + noSmithyDocumentSerde } diff --git a/service/opensearch/api_op_UpdateApplication.go b/service/opensearch/api_op_UpdateApplication.go new file mode 100644 index 00000000000..931e019cece --- /dev/null +++ b/service/opensearch/api_op_UpdateApplication.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Update the OpenSearch Application. +func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error) { + if params == nil { + params = &UpdateApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateApplication", params, optFns, c.addOperationUpdateApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateApplicationInput struct { + + // Unique identifier of the OpenSearch Application to be updated. + // + // This member is required. + Id *string + + // Configurations to be changed for the OpenSearch Application. + AppConfigs []types.AppConfig + + // Data sources to be associated with the OpenSearch Application. + DataSources []types.DataSource + + noSmithyDocumentSerde +} + +type UpdateApplicationOutput struct { + + // Configurations for the updated OpenSearch Application. + AppConfigs []types.AppConfig + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + Arn *string + + // Timestamp at which the OpenSearch Application was created. + CreatedAt *time.Time + + // Data sources associated with the updated OpenSearch Application. + DataSources []types.DataSource + + // IAM Identity Center settings for the updated OpenSearch Application. + IamIdentityCenterOptions *types.IamIdentityCenterOptions + + // Unique identifier of the updated OpenSearch Application. + Id *string + + // Timestamp at which the OpenSearch Application was last updated. + LastUpdatedAt *time.Time + + // Name of the updated OpenSearch Application. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateApplication", + } +} diff --git a/service/opensearch/api_op_UpdateDomainConfig.go b/service/opensearch/api_op_UpdateDomainConfig.go index ececf263cd8..fbbc98d2adc 100644 --- a/service/opensearch/api_op_UpdateDomainConfig.go +++ b/service/opensearch/api_op_UpdateDomainConfig.go @@ -111,6 +111,9 @@ type UpdateDomainConfigInput struct { // can't change it. IPAddressType types.IPAddressType + // Container for IAM Identity Center Options settings. + IdentityCenterOptions *types.IdentityCenterOptionsInput + // Options to publish OpenSearch logs to Amazon CloudWatch Logs. LogPublishingOptions map[string]types.LogPublishingOption diff --git a/service/opensearch/deserializers.go b/service/opensearch/deserializers.go index fadb61378f5..158751d876b 100644 --- a/service/opensearch/deserializers.go +++ b/service/opensearch/deserializers.go @@ -1139,6 +1139,231 @@ func awsRestjson1_deserializeOpDocumentCancelServiceSoftwareUpdateOutput(v **Can return nil } +type awsRestjson1_deserializeOpCreateApplication struct { +} + +func (*awsRestjson1_deserializeOpCreateApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateApplication) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCreateApplication(response, &metadata) + } + output := &CreateApplicationOutput{} + 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_deserializeOpDocumentCreateApplicationOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateApplication(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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, 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 *CreateApplicationOutput + if *v == nil { + sv = &CreateApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appConfigs": + if err := awsRestjson1_deserializeDocumentAppConfigs(&sv.AppConfigs, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dataSources": + if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { + return err + } + + case "iamIdentityCenterOptions": + if err := awsRestjson1_deserializeDocumentIamIdentityCenterOptions(&sv.IamIdentityCenterOptions, value); err != nil { + return err + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "tagList": + if err := awsRestjson1_deserializeDocumentTagList(&sv.TagList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateDomain struct { } @@ -1849,14 +2074,14 @@ func awsRestjson1_deserializeOpDocumentCreateVpcEndpointOutput(v **CreateVpcEndp return nil } -type awsRestjson1_deserializeOpDeleteDataSource struct { +type awsRestjson1_deserializeOpDeleteApplication struct { } -func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string { +func (*awsRestjson1_deserializeOpDeleteApplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1874,44 +2099,16 @@ func (m *awsRestjson1_deserializeOpDeleteDataSource) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteApplication(response, &metadata) } - output := &DeleteDataSourceOutput{} + output := &DeleteApplicationOutput{} 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_deserializeOpDocumentDeleteDataSourceOutput(&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(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1952,11 +2149,14 @@ func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Respon } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) - case strings.EqualFold("DependencyFailureException", errorCode): - return awsRestjson1_deserializeErrorDependencyFailureException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) @@ -1980,20 +2180,151 @@ func awsRestjson1_deserializeOpErrorDeleteDataSource(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSourceOutput, 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) - } +type awsRestjson1_deserializeOpDeleteDataSource struct { +} - var sv *DeleteDataSourceOutput +func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDataSource) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDeleteDataSource(response, &metadata) + } + output := &DeleteDataSourceOutput{} + 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_deserializeOpDocumentDeleteDataSourceOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDataSource(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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DependencyFailureException", errorCode): + return awsRestjson1_deserializeErrorDependencyFailureException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSourceOutput, 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 *DeleteDataSourceOutput if *v == nil { sv = &DeleteDataSourceOutput{} } else { @@ -5584,14 +5915,14 @@ func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePac return nil } -type awsRestjson1_deserializeOpGetCompatibleVersions struct { +type awsRestjson1_deserializeOpGetApplication struct { } -func (*awsRestjson1_deserializeOpGetCompatibleVersions) ID() string { +func (*awsRestjson1_deserializeOpGetApplication) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetApplication) 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) @@ -5609,9 +5940,9 @@ func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetCompatibleVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetApplication(response, &metadata) } - output := &GetCompatibleVersionsOutput{} + output := &GetApplicationOutput{} out.Result = output var buff [1024]byte @@ -5632,7 +5963,7 @@ func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5646,7 +5977,7 @@ func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetApplication(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)} @@ -5687,6 +6018,9 @@ func awsRestjson1_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.R } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) @@ -5712,7 +6046,7 @@ func awsRestjson1_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompatibleVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5725,20 +6059,107 @@ func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetCompatibleVersionsOutput + var sv *GetApplicationOutput if *v == nil { - sv = &GetCompatibleVersionsOutput{} + sv = &GetApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CompatibleVersions": - if err := awsRestjson1_deserializeDocumentCompatibleVersionsList(&sv.CompatibleVersions, value); err != nil { + case "appConfigs": + if err := awsRestjson1_deserializeDocumentAppConfigs(&sv.AppConfigs, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dataSources": + if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { + return err + } + + case "endpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Endpoint = ptr.String(jtv) + } + + case "iamIdentityCenterOptions": + if err := awsRestjson1_deserializeDocumentIamIdentityCenterOptions(&sv.IamIdentityCenterOptions, value); err != nil { return err } + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ApplicationStatus(jtv) + } + default: _, _ = key, value @@ -5748,14 +6169,14 @@ func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompat return nil } -type awsRestjson1_deserializeOpGetDataSource struct { +type awsRestjson1_deserializeOpGetCompatibleVersions struct { } -func (*awsRestjson1_deserializeOpGetDataSource) ID() string { +func (*awsRestjson1_deserializeOpGetCompatibleVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetCompatibleVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5773,9 +6194,9 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDataSource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetCompatibleVersions(response, &metadata) } - output := &GetDataSourceOutput{} + output := &GetCompatibleVersionsOutput{} out.Result = output var buff [1024]byte @@ -5796,7 +6217,7 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDataSourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5810,7 +6231,7 @@ func (m *awsRestjson1_deserializeOpGetDataSource) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetCompatibleVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5854,9 +6275,6 @@ func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) - case strings.EqualFold("DependencyFailureException", errorCode): - return awsRestjson1_deserializeErrorDependencyFailureException(response, errorBody) - case strings.EqualFold("DisabledOperationException", errorCode): return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) @@ -5879,7 +6297,7 @@ func awsRestjson1_deserializeOpErrorGetDataSource(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetCompatibleVersionsOutput(v **GetCompatibleVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5892,23 +6310,190 @@ func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDataSourceOutput + var sv *GetCompatibleVersionsOutput if *v == nil { - sv = &GetDataSourceOutput{} + sv = &GetCompatibleVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DataSourceType": - if err := awsRestjson1_deserializeDocumentDataSourceType(&sv.DataSourceType, value); err != nil { + case "CompatibleVersions": + if err := awsRestjson1_deserializeDocumentCompatibleVersionsList(&sv.CompatibleVersions, value); err != nil { return err } - case "Description": - if value != nil { - jtv, ok := value.(string) + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDataSource struct { +} + +func (*awsRestjson1_deserializeOpGetDataSource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDataSource) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetDataSource(response, &metadata) + } + output := &GetDataSourceOutput{} + 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_deserializeOpDocumentGetDataSourceOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetDataSource(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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DependencyFailureException", errorCode): + return awsRestjson1_deserializeErrorDependencyFailureException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutput, 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 *GetDataSourceOutput + if *v == nil { + sv = &GetDataSourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataSourceType": + if err := awsRestjson1_deserializeDocumentDataSourceType(&sv.DataSourceType, value); err != nil { + return err + } + + case "Description": + if value != nil { + jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSourceDescription to be of type string, got %T instead", value) } @@ -6297,7 +6882,189 @@ func awsRestjson1_deserializeOpErrorGetPackageVersionHistory(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPackageVersionHistoryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPackageVersionHistoryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetPackageVersionHistoryOutput + if *v == nil { + sv = &GetPackageVersionHistoryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "PackageID": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) + } + sv.PackageID = ptr.String(jtv) + } + + case "PackageVersionHistoryList": + if err := awsRestjson1_deserializeDocumentPackageVersionHistoryList(&sv.PackageVersionHistoryList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetUpgradeHistory struct { +} + +func (*awsRestjson1_deserializeOpGetUpgradeHistory) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetUpgradeHistory(response, &metadata) + } + output := &GetUpgradeHistoryOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6310,9 +7077,9 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPackageVersionHistoryOutput + var sv *GetUpgradeHistoryOutput if *v == nil { - sv = &GetPackageVersionHistoryOutput{} + sv = &GetUpgradeHistoryOutput{} } else { sv = *v } @@ -6328,17 +7095,8 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPac sv.NextToken = ptr.String(jtv) } - case "PackageID": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) - } - sv.PackageID = ptr.String(jtv) - } - - case "PackageVersionHistoryList": - if err := awsRestjson1_deserializeDocumentPackageVersionHistoryList(&sv.PackageVersionHistoryList, value); err != nil { + case "UpgradeHistories": + if err := awsRestjson1_deserializeDocumentUpgradeHistoryList(&sv.UpgradeHistories, value); err != nil { return err } @@ -6351,14 +7109,14 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPac return nil } -type awsRestjson1_deserializeOpGetUpgradeHistory struct { +type awsRestjson1_deserializeOpGetUpgradeStatus struct { } -func (*awsRestjson1_deserializeOpGetUpgradeHistory) ID() string { +func (*awsRestjson1_deserializeOpGetUpgradeStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6376,9 +7134,9 @@ func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeHistory(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeStatus(response, &metadata) } - output := &GetUpgradeHistoryOutput{} + output := &GetUpgradeStatusOutput{} out.Result = output var buff [1024]byte @@ -6399,7 +7157,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6413,7 +7171,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6479,7 +7237,7 @@ func awsRestjson1_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHistoryOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6492,27 +7250,40 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHis return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetUpgradeHistoryOutput + var sv *GetUpgradeStatusOutput if *v == nil { - sv = &GetUpgradeHistoryOutput{} + sv = &GetUpgradeStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "NextToken": + case "StepStatus": 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 UpgradeStatus to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.StepStatus = types.UpgradeStatus(jtv) } - case "UpgradeHistories": - if err := awsRestjson1_deserializeDocumentUpgradeHistoryList(&sv.UpgradeHistories, value); err != nil { - return err + case "UpgradeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) + } + sv.UpgradeName = ptr.String(jtv) + } + + case "UpgradeStep": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) + } + sv.UpgradeStep = types.UpgradeStep(jtv) } default: @@ -6524,14 +7295,14 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHis return nil } -type awsRestjson1_deserializeOpGetUpgradeStatus struct { +type awsRestjson1_deserializeOpListApplications struct { } -func (*awsRestjson1_deserializeOpGetUpgradeStatus) ID() string { +func (*awsRestjson1_deserializeOpListApplications) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListApplications) 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) @@ -6549,9 +7320,9 @@ func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeStatus(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListApplications(response, &metadata) } - output := &GetUpgradeStatusOutput{} + output := &ListApplicationsOutput{} out.Result = output var buff [1024]byte @@ -6572,7 +7343,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListApplicationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6586,7 +7357,7 @@ func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListApplications(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)} @@ -6627,6 +7398,9 @@ func awsRestjson1_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Respon } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) @@ -6652,7 +7426,7 @@ func awsRestjson1_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStatusOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6665,40 +7439,27 @@ func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetUpgradeStatusOutput + var sv *ListApplicationsOutput if *v == nil { - sv = &GetUpgradeStatusOutput{} + sv = &ListApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "StepStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) - } - sv.StepStatus = types.UpgradeStatus(jtv) - } - - case "UpgradeName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) - } - sv.UpgradeName = ptr.String(jtv) + case "ApplicationSummaries": + if err := awsRestjson1_deserializeDocumentApplicationSummaries(&sv.ApplicationSummaries, value); err != nil { + return err } - case "UpgradeStep": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.UpgradeStep = types.UpgradeStep(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -9537,10 +10298,180 @@ func awsRestjson1_deserializeOpErrorStartServiceSoftwareUpdate(response *smithyh errorMessage = message } - switch { + switch { + case strings.EqualFold("BaseException", errorCode): + return awsRestjson1_deserializeErrorBaseException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartServiceSoftwareUpdateOutput(v **StartServiceSoftwareUpdateOutput, 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 *StartServiceSoftwareUpdateOutput + if *v == nil { + sv = &StartServiceSoftwareUpdateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ServiceSoftwareOptions": + if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateApplication struct { +} + +func (*awsRestjson1_deserializeOpUpdateApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateApplication) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateApplication(response, &metadata) + } + output := &UpdateApplicationOutput{} + 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_deserializeOpDocumentUpdateApplicationOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateApplication(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("BaseException", errorCode): return awsRestjson1_deserializeErrorBaseException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("DisabledOperationException", errorCode): + return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -9560,7 +10491,7 @@ func awsRestjson1_deserializeOpErrorStartServiceSoftwareUpdate(response *smithyh } } -func awsRestjson1_deserializeOpDocumentStartServiceSoftwareUpdateOutput(v **StartServiceSoftwareUpdateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(v **UpdateApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9573,20 +10504,89 @@ func awsRestjson1_deserializeOpDocumentStartServiceSoftwareUpdateOutput(v **Star return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartServiceSoftwareUpdateOutput + var sv *UpdateApplicationOutput if *v == nil { - sv = &StartServiceSoftwareUpdateOutput{} + sv = &UpdateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ServiceSoftwareOptions": - if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { + case "appConfigs": + if err := awsRestjson1_deserializeDocumentAppConfigs(&sv.AppConfigs, value); err != nil { + return err + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dataSources": + if err := awsRestjson1_deserializeDocumentDataSources(&sv.DataSources, value); err != nil { + return err + } + + case "iamIdentityCenterOptions": + if err := awsRestjson1_deserializeDocumentIamIdentityCenterOptions(&sv.IamIdentityCenterOptions, value); err != nil { return err } + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + default: _, _ = key, value @@ -11546,16 +12546,241 @@ func awsRestjson1_deserializeDocumentAIMLOptionsStatus(v **types.AIMLOptionsStat sv = *v } - for key, value := range shape { - switch key { - case "Options": - if err := awsRestjson1_deserializeDocumentAIMLOptionsOutput(&sv.Options, value); err != nil { - return err + for key, value := range shape { + switch key { + case "Options": + if err := awsRestjson1_deserializeDocumentAIMLOptionsOutput(&sv.Options, value); err != nil { + return err + } + + case "Status": + if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppConfig(v **types.AppConfig, 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.AppConfig + if *v == nil { + sv = &types.AppConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppConfigType to be of type string, got %T instead", value) + } + sv.Key = types.AppConfigType(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppConfigValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAppConfigs(v *[]types.AppConfig, 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.AppConfig + if *v == nil { + cv = []types.AppConfig{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AppConfig + destAddr := &col + if err := awsRestjson1_deserializeDocumentAppConfig(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationSummaries(v *[]types.ApplicationSummary, 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.ApplicationSummary + if *v == nil { + cv = []types.ApplicationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ApplicationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentApplicationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationSummary(v **types.ApplicationSummary, 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.ApplicationSummary + if *v == nil { + sv = &types.ApplicationSummary{} + } 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 "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "endpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Endpoint = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } - case "Status": - if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { - return err + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationStatus to be of type string, got %T instead", value) + } + sv.Status = types.ApplicationStatus(jtv) } default: @@ -13345,6 +14570,55 @@ func awsRestjson1_deserializeDocumentCrossClusterSearchConnectionProperties(v ** return nil } +func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, 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.DataSource + if *v == nil { + sv = &types.DataSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataSourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.DataSourceArn = ptr.String(jtv) + } + + case "dataSourceDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceDescription to be of type string, got %T instead", value) + } + sv.DataSourceDescription = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDataSourceDetails(v **types.DataSourceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13442,6 +14716,40 @@ func awsRestjson1_deserializeDocumentDataSourceList(v *[]types.DataSourceDetails return nil } +func awsRestjson1_deserializeDocumentDataSources(v *[]types.DataSource, 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.DataSource + if *v == nil { + cv = []types.DataSource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DataSource + destAddr := &col + if err := awsRestjson1_deserializeDocumentDataSource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentDataSourceType(v *types.DataSourceType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13644,6 +14952,11 @@ func awsRestjson1_deserializeDocumentDomainConfig(v **types.DomainConfig, value return err } + case "IdentityCenterOptions": + if err := awsRestjson1_deserializeDocumentIdentityCenterOptionsStatus(&sv.IdentityCenterOptions, value); err != nil { + return err + } + case "IPAddressType": if err := awsRestjson1_deserializeDocumentIPAddressTypeStatus(&sv.IPAddressType, value); err != nil { return err @@ -14542,6 +15855,11 @@ func awsRestjson1_deserializeDocumentDomainStatus(v **types.DomainStatus, value sv.EngineVersion = ptr.String(jtv) } + case "IdentityCenterOptions": + if err := awsRestjson1_deserializeDocumentIdentityCenterOptions(&sv.IdentityCenterOptions, value); err != nil { + return err + } + case "IPAddressType": if value != nil { jtv, ok := value.(string) @@ -15236,6 +16554,199 @@ func awsRestjson1_deserializeDocumentGUIDList(v *[]string, value interface{}) er return nil } +func awsRestjson1_deserializeDocumentIamIdentityCenterOptions(v **types.IamIdentityCenterOptions, 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.IamIdentityCenterOptions + if *v == nil { + sv = &types.IamIdentityCenterOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = ptr.Bool(jtv) + } + + case "iamIdentityCenterApplicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.IamIdentityCenterApplicationArn = ptr.String(jtv) + } + + case "iamIdentityCenterInstanceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.IamIdentityCenterInstanceArn = ptr.String(jtv) + } + + case "iamRoleForIdentityCenterApplicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.IamRoleForIdentityCenterApplicationArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIdentityCenterOptions(v **types.IdentityCenterOptions, 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.IdentityCenterOptions + if *v == nil { + sv = &types.IdentityCenterOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnabledAPIAccess": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnabledAPIAccess = ptr.Bool(jtv) + } + + case "IdentityCenterApplicationARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityCenterApplicationARN to be of type string, got %T instead", value) + } + sv.IdentityCenterApplicationARN = ptr.String(jtv) + } + + case "IdentityCenterInstanceARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityCenterInstanceARN to be of type string, got %T instead", value) + } + sv.IdentityCenterInstanceARN = ptr.String(jtv) + } + + case "IdentityStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityStoreId to be of type string, got %T instead", value) + } + sv.IdentityStoreId = ptr.String(jtv) + } + + case "RolesKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RolesKeyIdCOption to be of type string, got %T instead", value) + } + sv.RolesKey = types.RolesKeyIdCOption(jtv) + } + + case "SubjectKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubjectKeyIdCOption to be of type string, got %T instead", value) + } + sv.SubjectKey = types.SubjectKeyIdCOption(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIdentityCenterOptionsStatus(v **types.IdentityCenterOptionsStatus, 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.IdentityCenterOptionsStatus + if *v == nil { + sv = &types.IdentityCenterOptionsStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Options": + if err := awsRestjson1_deserializeDocumentIdentityCenterOptions(&sv.Options, value); err != nil { + return err + } + + case "Status": + if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentInboundConnection(v **types.InboundConnection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/opensearch/generated.json b/service/opensearch/generated.json index 84faaddfce8..25d3a9c4136 100644 --- a/service/opensearch/generated.json +++ b/service/opensearch/generated.json @@ -15,10 +15,12 @@ "api_op_AuthorizeVpcEndpointAccess.go", "api_op_CancelDomainConfigChange.go", "api_op_CancelServiceSoftwareUpdate.go", + "api_op_CreateApplication.go", "api_op_CreateDomain.go", "api_op_CreateOutboundConnection.go", "api_op_CreatePackage.go", "api_op_CreateVpcEndpoint.go", + "api_op_DeleteApplication.go", "api_op_DeleteDataSource.go", "api_op_DeleteDomain.go", "api_op_DeleteInboundConnection.go", @@ -41,12 +43,14 @@ "api_op_DescribeReservedInstances.go", "api_op_DescribeVpcEndpoints.go", "api_op_DissociatePackage.go", + "api_op_GetApplication.go", "api_op_GetCompatibleVersions.go", "api_op_GetDataSource.go", "api_op_GetDomainMaintenanceStatus.go", "api_op_GetPackageVersionHistory.go", "api_op_GetUpgradeHistory.go", "api_op_GetUpgradeStatus.go", + "api_op_ListApplications.go", "api_op_ListDataSources.go", "api_op_ListDomainMaintenances.go", "api_op_ListDomainNames.go", @@ -65,6 +69,7 @@ "api_op_RevokeVpcEndpointAccess.go", "api_op_StartDomainMaintenance.go", "api_op_StartServiceSoftwareUpdate.go", + "api_op_UpdateApplication.go", "api_op_UpdateDataSource.go", "api_op_UpdateDomainConfig.go", "api_op_UpdatePackage.go", diff --git a/service/opensearch/options.go b/service/opensearch/options.go index 4d25967ade4..55533552897 100644 --- a/service/opensearch/options.go +++ b/service/opensearch/options.go @@ -65,6 +65,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 diff --git a/service/opensearch/serializers.go b/service/opensearch/serializers.go index 7c0cc10054d..5ba1917f17c 100644 --- a/service/opensearch/serializers.go +++ b/service/opensearch/serializers.go @@ -452,6 +452,11 @@ func awsRestjson1_serializeOpDocumentAuthorizeVpcEndpointAccessInput(v *Authoriz ok.String(*v.Account) } + if len(v.Service) > 0 { + ok := object.Key("Service") + ok.String(string(v.Service)) + } + return nil } @@ -630,6 +635,120 @@ func awsRestjson1_serializeOpDocumentCancelServiceSoftwareUpdateInput(v *CancelS return nil } +type awsRestjson1_serializeOpCreateApplication struct { +} + +func (*awsRestjson1_serializeOpCreateApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/application") + 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_serializeOpDocumentCreateApplicationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateApplicationInput(v *CreateApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppConfigs != nil { + ok := object.Key("appConfigs") + if err := awsRestjson1_serializeDocumentAppConfigs(v.AppConfigs, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.DataSources != nil { + ok := object.Key("dataSources") + if err := awsRestjson1_serializeDocumentDataSources(v.DataSources, ok); err != nil { + return err + } + } + + if v.IamIdentityCenterOptions != nil { + ok := object.Key("iamIdentityCenterOptions") + if err := awsRestjson1_serializeDocumentIamIdentityCenterOptionsInput(v.IamIdentityCenterOptions, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.TagList != nil { + ok := object.Key("tagList") + if err := awsRestjson1_serializeDocumentTagList(v.TagList, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateDomain struct { } @@ -781,6 +900,13 @@ func awsRestjson1_serializeOpDocumentCreateDomainInput(v *CreateDomainInput, val ok.String(*v.EngineVersion) } + if v.IdentityCenterOptions != nil { + ok := object.Key("IdentityCenterOptions") + if err := awsRestjson1_serializeDocumentIdentityCenterOptionsInput(v.IdentityCenterOptions, ok); err != nil { + return err + } + } + if len(v.IPAddressType) > 0 { ok := object.Key("IPAddressType") ok.String(string(v.IPAddressType)) @@ -1136,6 +1262,77 @@ func awsRestjson1_serializeOpDocumentCreateVpcEndpointInput(v *CreateVpcEndpoint return nil } +type awsRestjson1_serializeOpDeleteApplication struct { +} + +func (*awsRestjson1_serializeOpDeleteApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/application/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteApplicationInput(v *DeleteApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteDataSource struct { } @@ -2865,6 +3062,77 @@ func awsRestjson1_serializeOpHttpBindingsDissociatePackageInput(v *DissociatePac return nil } +type awsRestjson1_serializeOpGetApplication struct { +} + +func (*awsRestjson1_serializeOpGetApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/application/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetApplicationInput(v *GetApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetCompatibleVersions struct { } @@ -3315,6 +3583,82 @@ func awsRestjson1_serializeOpHttpBindingsGetUpgradeStatusInput(v *GetUpgradeStat return nil } +type awsRestjson1_serializeOpListApplications struct { +} + +func (*awsRestjson1_serializeOpListApplications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListApplicationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/list-applications") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListApplicationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListApplicationsInput(v *ListApplicationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.Statuses != nil { + for i := range v.Statuses { + encoder.AddQuery("statuses").String(string(v.Statuses[i])) + } + } + + return nil +} + type awsRestjson1_serializeOpListDataSources struct { } @@ -4560,6 +4904,11 @@ func awsRestjson1_serializeOpDocumentRevokeVpcEndpointAccessInput(v *RevokeVpcEn ok.String(*v.Account) } + if len(v.Service) > 0 { + ok := object.Key("Service") + ok.String(string(v.Service)) + } + return nil } @@ -4753,6 +5102,109 @@ func awsRestjson1_serializeOpDocumentStartServiceSoftwareUpdateInput(v *StartSer return nil } +type awsRestjson1_serializeOpUpdateApplication struct { +} + +func (*awsRestjson1_serializeOpUpdateApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*UpdateApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2021-01-01/opensearch/application/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateApplicationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(v *UpdateApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppConfigs != nil { + ok := object.Key("appConfigs") + if err := awsRestjson1_serializeDocumentAppConfigs(v.AppConfigs, ok); err != nil { + return err + } + } + + if v.DataSources != nil { + ok := object.Key("dataSources") + if err := awsRestjson1_serializeDocumentDataSources(v.DataSources, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateDataSource struct { } @@ -5032,6 +5484,13 @@ func awsRestjson1_serializeOpDocumentUpdateDomainConfigInput(v *UpdateDomainConf } } + if v.IdentityCenterOptions != nil { + ok := object.Key("IdentityCenterOptions") + if err := awsRestjson1_serializeDocumentIdentityCenterOptionsInput(v.IdentityCenterOptions, ok); err != nil { + return err + } + } + if len(v.IPAddressType) > 0 { ok := object.Key("IPAddressType") ok.String(string(v.IPAddressType)) @@ -5543,6 +6002,36 @@ func awsRestjson1_serializeDocumentAIMLOptionsInput(v *types.AIMLOptionsInput, v return nil } +func awsRestjson1_serializeDocumentAppConfig(v *types.AppConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Key) > 0 { + ok := object.Key("key") + ok.String(string(v.Key)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentAppConfigs(v []types.AppConfig, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAppConfig(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAutoTuneMaintenanceSchedule(v *types.AutoTuneMaintenanceSchedule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5803,6 +6292,36 @@ func awsRestjson1_serializeDocumentCrossClusterSearchConnectionProperties(v *typ return nil } +func awsRestjson1_serializeDocumentDataSource(v *types.DataSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataSourceArn != nil { + ok := object.Key("dataSourceArn") + ok.String(*v.DataSourceArn) + } + + if v.DataSourceDescription != nil { + ok := object.Key("dataSourceDescription") + ok.String(*v.DataSourceDescription) + } + + return nil +} + +func awsRestjson1_serializeDocumentDataSources(v []types.DataSource, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDataSource(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentDataSourceType(v types.DataSourceType, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6019,6 +6538,55 @@ func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson return nil } +func awsRestjson1_serializeDocumentIamIdentityCenterOptionsInput(v *types.IamIdentityCenterOptionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Enabled != nil { + ok := object.Key("enabled") + ok.Boolean(*v.Enabled) + } + + if v.IamIdentityCenterInstanceArn != nil { + ok := object.Key("iamIdentityCenterInstanceArn") + ok.String(*v.IamIdentityCenterInstanceArn) + } + + if v.IamRoleForIdentityCenterApplicationArn != nil { + ok := object.Key("iamRoleForIdentityCenterApplicationArn") + ok.String(*v.IamRoleForIdentityCenterApplicationArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentIdentityCenterOptionsInput(v *types.IdentityCenterOptionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnabledAPIAccess != nil { + ok := object.Key("EnabledAPIAccess") + ok.Boolean(*v.EnabledAPIAccess) + } + + if v.IdentityCenterInstanceARN != nil { + ok := object.Key("IdentityCenterInstanceARN") + ok.String(*v.IdentityCenterInstanceARN) + } + + if len(v.RolesKey) > 0 { + ok := object.Key("RolesKey") + ok.String(string(v.RolesKey)) + } + + if len(v.SubjectKey) > 0 { + ok := object.Key("SubjectKey") + ok.String(string(v.SubjectKey)) + } + + return nil +} + func awsRestjson1_serializeDocumentJWTOptionsInput(v *types.JWTOptionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/opensearch/snapshot/api_op_CreateApplication.go.snap b/service/opensearch/snapshot/api_op_CreateApplication.go.snap new file mode 100644 index 00000000000..d164013e153 --- /dev/null +++ b/service/opensearch/snapshot/api_op_CreateApplication.go.snap @@ -0,0 +1,42 @@ +CreateApplication + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot/api_op_DeleteApplication.go.snap b/service/opensearch/snapshot/api_op_DeleteApplication.go.snap new file mode 100644 index 00000000000..7d2f59844da --- /dev/null +++ b/service/opensearch/snapshot/api_op_DeleteApplication.go.snap @@ -0,0 +1,41 @@ +DeleteApplication + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot/api_op_GetApplication.go.snap b/service/opensearch/snapshot/api_op_GetApplication.go.snap new file mode 100644 index 00000000000..0e4d096e441 --- /dev/null +++ b/service/opensearch/snapshot/api_op_GetApplication.go.snap @@ -0,0 +1,41 @@ +GetApplication + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot/api_op_ListApplications.go.snap b/service/opensearch/snapshot/api_op_ListApplications.go.snap new file mode 100644 index 00000000000..a3e5fceba8f --- /dev/null +++ b/service/opensearch/snapshot/api_op_ListApplications.go.snap @@ -0,0 +1,40 @@ +ListApplications + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot/api_op_UpdateApplication.go.snap b/service/opensearch/snapshot/api_op_UpdateApplication.go.snap new file mode 100644 index 00000000000..399df2b250c --- /dev/null +++ b/service/opensearch/snapshot/api_op_UpdateApplication.go.snap @@ -0,0 +1,41 @@ +UpdateApplication + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/opensearch/snapshot_test.go b/service/opensearch/snapshot_test.go index e750dc1fef3..5463f14db4a 100644 --- a/service/opensearch/snapshot_test.go +++ b/service/opensearch/snapshot_test.go @@ -146,6 +146,18 @@ func TestCheckSnapshot_CancelServiceSoftwareUpdate(t *testing.T) { } } +func TestCheckSnapshot_CreateApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateDomain(t *testing.T) { svc := New(Options{}) _, err := svc.CreateDomain(context.Background(), nil, func(o *Options) { @@ -194,6 +206,18 @@ func TestCheckSnapshot_CreateVpcEndpoint(t *testing.T) { } } +func TestCheckSnapshot_DeleteApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteDataSource(context.Background(), nil, func(o *Options) { @@ -458,6 +482,18 @@ func TestCheckSnapshot_DissociatePackage(t *testing.T) { } } +func TestCheckSnapshot_GetApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetCompatibleVersions(t *testing.T) { svc := New(Options{}) _, err := svc.GetCompatibleVersions(context.Background(), nil, func(o *Options) { @@ -530,6 +566,18 @@ func TestCheckSnapshot_GetUpgradeStatus(t *testing.T) { } } +func TestCheckSnapshot_ListApplications(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListApplications(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListApplications") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListDataSources(t *testing.T) { svc := New(Options{}) _, err := svc.ListDataSources(context.Background(), nil, func(o *Options) { @@ -746,6 +794,18 @@ func TestCheckSnapshot_StartServiceSoftwareUpdate(t *testing.T) { } } +func TestCheckSnapshot_UpdateApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateDataSource(context.Background(), nil, func(o *Options) { @@ -901,6 +961,18 @@ func TestUpdateSnapshot_CancelServiceSoftwareUpdate(t *testing.T) { } } +func TestUpdateSnapshot_CreateApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateDomain(t *testing.T) { svc := New(Options{}) _, err := svc.CreateDomain(context.Background(), nil, func(o *Options) { @@ -949,6 +1021,18 @@ func TestUpdateSnapshot_CreateVpcEndpoint(t *testing.T) { } } +func TestUpdateSnapshot_DeleteApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteDataSource(context.Background(), nil, func(o *Options) { @@ -1213,6 +1297,18 @@ func TestUpdateSnapshot_DissociatePackage(t *testing.T) { } } +func TestUpdateSnapshot_GetApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetCompatibleVersions(t *testing.T) { svc := New(Options{}) _, err := svc.GetCompatibleVersions(context.Background(), nil, func(o *Options) { @@ -1285,6 +1381,18 @@ func TestUpdateSnapshot_GetUpgradeStatus(t *testing.T) { } } +func TestUpdateSnapshot_ListApplications(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListApplications(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListApplications") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListDataSources(t *testing.T) { svc := New(Options{}) _, err := svc.ListDataSources(context.Background(), nil, func(o *Options) { @@ -1501,6 +1609,18 @@ func TestUpdateSnapshot_StartServiceSoftwareUpdate(t *testing.T) { } } +func TestUpdateSnapshot_UpdateApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateDataSource(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateDataSource(context.Background(), nil, func(o *Options) { diff --git a/service/opensearch/types/enums.go b/service/opensearch/types/enums.go index 31f957fa3ea..b86a59cf06d 100644 --- a/service/opensearch/types/enums.go +++ b/service/opensearch/types/enums.go @@ -71,6 +71,50 @@ func (ActionType) Values() []ActionType { } } +type AppConfigType string + +// Enum values for AppConfigType +const ( + AppConfigTypeOpensearchDashboardAdminUsers AppConfigType = "opensearchDashboards.dashboardAdmin.users" + AppConfigTypeOpensearchDashboardAdminGroups AppConfigType = "opensearchDashboards.dashboardAdmin.groups" +) + +// Values returns all known values for AppConfigType. 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 (AppConfigType) Values() []AppConfigType { + return []AppConfigType{ + "opensearchDashboards.dashboardAdmin.users", + "opensearchDashboards.dashboardAdmin.groups", + } +} + +type ApplicationStatus string + +// Enum values for ApplicationStatus +const ( + ApplicationStatusCreating ApplicationStatus = "CREATING" + ApplicationStatusUpdating ApplicationStatus = "UPDATING" + ApplicationStatusDeleting ApplicationStatus = "DELETING" + ApplicationStatusActive ApplicationStatus = "ACTIVE" + ApplicationStatusFailed ApplicationStatus = "FAILED" +) + +// Values returns all known values for ApplicationStatus. 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 (ApplicationStatus) Values() []ApplicationStatus { + return []ApplicationStatus{ + "CREATING", + "UPDATING", + "DELETING", + "ACTIVE", + "FAILED", + } +} + type AutoTuneDesiredState string // Enum values for AutoTuneDesiredState @@ -140,6 +184,23 @@ func (AutoTuneType) Values() []AutoTuneType { } } +type AWSServicePrincipal string + +// Enum values for AWSServicePrincipal +const ( + AWSServicePrincipalApplicationOpensearchserviceAmazonawsCom AWSServicePrincipal = "application.opensearchservice.amazonaws.com" +) + +// Values returns all known values for AWSServicePrincipal. 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 (AWSServicePrincipal) Values() []AWSServicePrincipal { + return []AWSServicePrincipal{ + "application.opensearchservice.amazonaws.com", + } +} + type ConfigChangeStatus string // Enum values for ConfigChangeStatus @@ -1095,6 +1156,25 @@ func (ReservedInstancePaymentOption) Values() []ReservedInstancePaymentOption { } } +type RolesKeyIdCOption string + +// Enum values for RolesKeyIdCOption +const ( + RolesKeyIdCOptionGroupName RolesKeyIdCOption = "GroupName" + RolesKeyIdCOptionGroupId RolesKeyIdCOption = "GroupId" +) + +// Values returns all known values for RolesKeyIdCOption. 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 (RolesKeyIdCOption) Values() []RolesKeyIdCOption { + return []RolesKeyIdCOption{ + "GroupName", + "GroupId", + } +} + type RollbackOnDisable string // Enum values for RollbackOnDisable @@ -1214,6 +1294,27 @@ func (SkipUnavailableStatus) Values() []SkipUnavailableStatus { } } +type SubjectKeyIdCOption string + +// Enum values for SubjectKeyIdCOption +const ( + SubjectKeyIdCOptionUserName SubjectKeyIdCOption = "UserName" + SubjectKeyIdCOptionUserId SubjectKeyIdCOption = "UserId" + SubjectKeyIdCOptionEmail SubjectKeyIdCOption = "Email" +) + +// Values returns all known values for SubjectKeyIdCOption. 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 (SubjectKeyIdCOption) Values() []SubjectKeyIdCOption { + return []SubjectKeyIdCOption{ + "UserName", + "UserId", + "Email", + } +} + type TimeUnit string // Enum values for TimeUnit diff --git a/service/opensearch/types/types.go b/service/opensearch/types/types.go index 966da2a4530..b42fe4c4329 100644 --- a/service/opensearch/types/types.go +++ b/service/opensearch/types/types.go @@ -198,6 +198,50 @@ type AIMLOptionsStatus struct { noSmithyDocumentSerde } +// Configurations of the OpenSearch Application. +type AppConfig struct { + + // Specify the item to configure, such as admin role for the OpenSearch + // Application. + Key AppConfigType + + // Specifies the value to configure for the key, such as an IAM user ARN. + Value *string + + noSmithyDocumentSerde +} + +// Basic information of the OpenSearch Application. +type ApplicationSummary struct { + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + Arn *string + + // Timestamp at which an OpenSearch Application was created. + CreatedAt *time.Time + + // Endpoint URL of an OpenSearch Application. + Endpoint *string + + // Unique identifier for an OpenSearch application. + Id *string + + // Timestamp at which an OpenSearch Application was last updated. + LastUpdatedAt *time.Time + + // Name of an OpenSearch Application. + Name *string + + // Status of an OpenSearch Application. Possible values are CREATING , UPDATING , + // DELETING , FAILED , ACTIVE , and DELETED . + Status ApplicationStatus + + noSmithyDocumentSerde +} + // Information about an Amazon Web Services account or service that has access to // an Amazon OpenSearch Service domain through the use of an interface VPC // endpoint. @@ -692,6 +736,21 @@ type CrossClusterSearchConnectionProperties struct { noSmithyDocumentSerde } +// Data sources that are associated with an OpenSearch Application. +type DataSource struct { + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + DataSourceArn *string + + // Detailed description of a data source. + DataSourceDescription *string + + noSmithyDocumentSerde +} + // Details about a direct-query data source. type DataSourceDetails struct { @@ -790,6 +849,9 @@ type DomainConfig struct { // change your address type later. IPAddressType *IPAddressTypeStatus + // Container for IAM Identity Center Option control for the domain. + IdentityCenterOptions *IdentityCenterOptionsStatus + // Key-value pairs to configure log publishing. LogPublishingOptions *LogPublishingOptionsStatus @@ -1086,6 +1148,9 @@ type DomainStatus struct { // The type of IP addresses supported by the endpoint for the domain. IPAddressType IPAddressType + // Container for IAM Identity Center Option control for the domain. + IdentityCenterOptions *IdentityCenterOptions + // Log publishing options for the domain. LogPublishingOptions map[string]LogPublishingOption @@ -1299,6 +1364,113 @@ type Filter struct { noSmithyDocumentSerde } +// Settings for IAM Identity Center for an OpenSearch Application. +type IamIdentityCenterOptions struct { + + // IAM Identity Center is enabled for the OpenSearch Application. + Enabled *bool + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + IamIdentityCenterApplicationArn *string + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + IamIdentityCenterInstanceArn *string + + // Amazon Resource Name of the IAM Identity Center's Application created for the + // OpenSearch Application after enabling IAM Identity Center. + IamRoleForIdentityCenterApplicationArn *string + + noSmithyDocumentSerde +} + +// Settings for IAM Identity Center. +type IamIdentityCenterOptionsInput struct { + + // Enable/disable settings for IAM Identity Center. + Enabled *bool + + // The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities] in Using Amazon Web Services + // Identity and Access Management for more information. + // + // [Identifiers for IAM Entities]: https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html + IamIdentityCenterInstanceArn *string + + // Amazon Resource Name of IAM Identity Center's application. + IamRoleForIdentityCenterApplicationArn *string + + noSmithyDocumentSerde +} + +// Container for IAM Identity Center Options settings. +type IdentityCenterOptions struct { + + // True to enable IAM Identity Center for API access in Amazon OpenSearch Service. + EnabledAPIAccess *bool + + // The ARN for IAM Identity Center Application which will integrate with Amazon + // OpenSearch Service. + IdentityCenterApplicationARN *string + + // The ARN for IAM Identity Center Instance. + IdentityCenterInstanceARN *string + + // The ID of IAM Identity Store. + IdentityStoreId *string + + // Specify the attribute that contains the backend role (groupName, groupID) of + // IAM Identity Center + RolesKey RolesKeyIdCOption + + // Specify the attribute that contains the subject (username, userID, email) of + // IAM Identity Center. + SubjectKey SubjectKeyIdCOption + + noSmithyDocumentSerde +} + +// Container for IAM Identity Center Options settings. +type IdentityCenterOptionsInput struct { + + // True to enable IAM Identity Center for API access in Amazon OpenSearch Service. + EnabledAPIAccess *bool + + // The ARN for IAM Identity Center Instance which will be used for IAM Identity + // Center Application creation. + IdentityCenterInstanceARN *string + + // Specify the attribute that contains the backend role (groupName, groupID) of + // IAM Identity Center + RolesKey RolesKeyIdCOption + + // Specify the attribute that contains the subject (username, userID, email) of + // IAM Identity Center. + SubjectKey SubjectKeyIdCOption + + noSmithyDocumentSerde +} + +// The status of IAM Identity Center Options settings for a domain. +type IdentityCenterOptionsStatus struct { + + // Container for IAM Identity Center Options settings. + // + // This member is required. + Options *IdentityCenterOptions + + // The status of IAM Identity Center Options settings for a domain. + // + // This member is required. + Status *OptionStatus + + noSmithyDocumentSerde +} + // Describes an inbound cross-cluster connection for Amazon OpenSearch Service. // For more information, see [Cross-cluster search for Amazon OpenSearch Service]. // diff --git a/service/opensearch/validators.go b/service/opensearch/validators.go index 2d6a4928e4e..14ffb5e0dc8 100644 --- a/service/opensearch/validators.go +++ b/service/opensearch/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCancelServiceSoftwareUpdate) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpCreateApplication struct { +} + +func (*validateOpCreateApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateDomain struct { } @@ -230,6 +250,26 @@ func (m *validateOpCreateVpcEndpoint) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDeleteApplication struct { +} + +func (*validateOpDeleteApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDataSource struct { } @@ -570,6 +610,26 @@ func (m *validateOpDissociatePackage) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpGetApplication struct { +} + +func (*validateOpGetApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetDataSource struct { } @@ -970,6 +1030,26 @@ func (m *validateOpStartServiceSoftwareUpdate) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpUpdateApplication struct { +} + +func (*validateOpUpdateApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateDataSource struct { } @@ -1118,6 +1198,10 @@ func addOpCancelServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpCancelServiceSoftwareUpdate{}, middleware.After) } +func addOpCreateApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateApplication{}, middleware.After) +} + func addOpCreateDomainValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDomain{}, middleware.After) } @@ -1134,6 +1218,10 @@ func addOpCreateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateVpcEndpoint{}, middleware.After) } +func addOpDeleteApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteApplication{}, middleware.After) +} + func addOpDeleteDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataSource{}, middleware.After) } @@ -1202,6 +1290,10 @@ func addOpDissociatePackageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDissociatePackage{}, middleware.After) } +func addOpGetApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetApplication{}, middleware.After) +} + func addOpGetDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataSource{}, middleware.After) } @@ -1282,6 +1374,10 @@ func addOpStartServiceSoftwareUpdateValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpStartServiceSoftwareUpdate{}, middleware.After) } +func addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After) +} + func addOpUpdateDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDataSource{}, middleware.After) } @@ -1587,9 +1683,6 @@ func validateOpAuthorizeVpcEndpointAccessInput(v *AuthorizeVpcEndpointAccessInpu if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } - if v.Account == nil { - invalidParams.Add(smithy.NewErrParamRequired("Account")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1627,6 +1720,26 @@ func validateOpCancelServiceSoftwareUpdateInput(v *CancelServiceSoftwareUpdateIn } } +func validateOpCreateApplicationInput(v *CreateApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.TagList != nil { + if err := validateTagList(v.TagList); err != nil { + invalidParams.AddNested("TagList", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateDomainInput(v *CreateDomainInput) error { if v == nil { return nil @@ -1730,6 +1843,21 @@ func validateOpCreateVpcEndpointInput(v *CreateVpcEndpointInput) error { } } +func validateOpDeleteApplicationInput(v *DeleteApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDataSourceInput(v *DeleteDataSourceInput) error { if v == nil { return nil @@ -1994,6 +2122,21 @@ func validateOpDissociatePackageInput(v *DissociatePackageInput) error { } } +func validateOpGetApplicationInput(v *GetApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetApplicationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetDataSourceInput(v *GetDataSourceInput) error { if v == nil { return nil @@ -2269,9 +2412,6 @@ func validateOpRevokeVpcEndpointAccessInput(v *RevokeVpcEndpointAccessInput) err if v.DomainName == nil { invalidParams.Add(smithy.NewErrParamRequired("DomainName")) } - if v.Account == nil { - invalidParams.Add(smithy.NewErrParamRequired("Account")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2312,6 +2452,21 @@ func validateOpStartServiceSoftwareUpdateInput(v *StartServiceSoftwareUpdateInpu } } +func validateOpUpdateApplicationInput(v *UpdateApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateDataSourceInput(v *UpdateDataSourceInput) error { if v == nil { return nil diff --git a/service/opensearchserverless/api_op_CreateSecurityConfig.go b/service/opensearchserverless/api_op_CreateSecurityConfig.go index 96556ab61bf..67a0decbe96 100644 --- a/service/opensearchserverless/api_op_CreateSecurityConfig.go +++ b/service/opensearchserverless/api_op_CreateSecurityConfig.go @@ -48,6 +48,10 @@ type CreateSecurityConfigInput struct { // A description of the security configuration. Description *string + // Describes IAM Identity Center options in the form of a key-value map. This + // field is required if you specify iamidentitycenter for the type parameter. + IamIdentityCenterOptions *types.CreateIamIdentityCenterConfigOptions + // Describes SAML options in in the form of a key-value map. This field is // required if you specify saml for the type parameter. SamlOptions *types.SamlConfigOptions diff --git a/service/opensearchserverless/api_op_UpdateSecurityConfig.go b/service/opensearchserverless/api_op_UpdateSecurityConfig.go index 746509fd2e0..d1f5e46469d 100644 --- a/service/opensearchserverless/api_op_UpdateSecurityConfig.go +++ b/service/opensearchserverless/api_op_UpdateSecurityConfig.go @@ -50,6 +50,9 @@ type UpdateSecurityConfigInput struct { // A description of the security configuration. Description *string + // Describes IAM Identity Center options in the form of a key-value map. + IamIdentityCenterOptionsUpdates *types.UpdateIamIdentityCenterConfigOptions + // SAML options in in the form of a key-value map. SamlOptions *types.SamlConfigOptions diff --git a/service/opensearchserverless/deserializers.go b/service/opensearchserverless/deserializers.go index 98a32bdff1a..5e778d3d007 100644 --- a/service/opensearchserverless/deserializers.go +++ b/service/opensearchserverless/deserializers.go @@ -5920,6 +5920,91 @@ func awsAwsjson10_deserializeDocumentEffectiveLifecyclePolicyErrorDetails(v *[]t return nil } +func awsAwsjson10_deserializeDocumentIamIdentityCenterConfigOptions(v **types.IamIdentityCenterConfigOptions, 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.IamIdentityCenterConfigOptions + if *v == nil { + sv = &types.IamIdentityCenterConfigOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "applicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamIdentityCenterApplicationArn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + case "applicationDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ApplicationDescription = ptr.String(jtv) + } + + case "applicationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ApplicationName = ptr.String(jtv) + } + + case "groupAttribute": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamIdentityCenterGroupAttribute to be of type string, got %T instead", value) + } + sv.GroupAttribute = types.IamIdentityCenterGroupAttribute(jtv) + } + + case "instanceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamIdentityCenterInstanceArn to be of type string, got %T instead", value) + } + sv.InstanceArn = ptr.String(jtv) + } + + case "userAttribute": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IamIdentityCenterUserAttribute to be of type string, got %T instead", value) + } + sv.UserAttribute = types.IamIdentityCenterUserAttribute(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6568,6 +6653,11 @@ func awsAwsjson10_deserializeDocumentSecurityConfigDetail(v **types.SecurityConf sv.Description = ptr.String(jtv) } + case "iamIdentityCenterOptions": + if err := awsAwsjson10_deserializeDocumentIamIdentityCenterConfigOptions(&sv.IamIdentityCenterOptions, value); err != nil { + return err + } + case "id": if value != nil { jtv, ok := value.(string) diff --git a/service/opensearchserverless/serializers.go b/service/opensearchserverless/serializers.go index 3947e16b679..838ba8b1bfe 100644 --- a/service/opensearchserverless/serializers.go +++ b/service/opensearchserverless/serializers.go @@ -2328,6 +2328,28 @@ func awsAwsjson10_serializeDocumentCollectionNames(v []string, value smithyjson. return nil } +func awsAwsjson10_serializeDocumentCreateIamIdentityCenterConfigOptions(v *types.CreateIamIdentityCenterConfigOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.GroupAttribute) > 0 { + ok := object.Key("groupAttribute") + ok.String(string(v.GroupAttribute)) + } + + if v.InstanceArn != nil { + ok := object.Key("instanceArn") + ok.String(*v.InstanceArn) + } + + if len(v.UserAttribute) > 0 { + ok := object.Key("userAttribute") + ok.String(string(v.UserAttribute)) + } + + return nil +} + func awsAwsjson10_serializeDocumentLifecyclePolicyIdentifier(v *types.LifecyclePolicyIdentifier, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2500,6 +2522,23 @@ func awsAwsjson10_serializeDocumentTags(v []types.Tag, value smithyjson.Value) e return nil } +func awsAwsjson10_serializeDocumentUpdateIamIdentityCenterConfigOptions(v *types.UpdateIamIdentityCenterConfigOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.GroupAttribute) > 0 { + ok := object.Key("groupAttribute") + ok.String(string(v.GroupAttribute)) + } + + if len(v.UserAttribute) > 0 { + ok := object.Key("userAttribute") + ok.String(string(v.UserAttribute)) + } + + return nil +} + func awsAwsjson10_serializeDocumentVpcEndpointFilters(v *types.VpcEndpointFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2703,6 +2742,13 @@ func awsAwsjson10_serializeOpDocumentCreateSecurityConfigInput(v *CreateSecurity ok.String(*v.Description) } + if v.IamIdentityCenterOptions != nil { + ok := object.Key("iamIdentityCenterOptions") + if err := awsAwsjson10_serializeDocumentCreateIamIdentityCenterConfigOptions(v.IamIdentityCenterOptions, ok); err != nil { + return err + } + } + if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) @@ -3304,6 +3350,13 @@ func awsAwsjson10_serializeOpDocumentUpdateSecurityConfigInput(v *UpdateSecurity ok.String(*v.Description) } + if v.IamIdentityCenterOptionsUpdates != nil { + ok := object.Key("iamIdentityCenterOptionsUpdates") + if err := awsAwsjson10_serializeDocumentUpdateIamIdentityCenterConfigOptions(v.IamIdentityCenterOptionsUpdates, ok); err != nil { + return err + } + } + if v.Id != nil { ok := object.Key("id") ok.String(*v.Id) diff --git a/service/opensearchserverless/types/enums.go b/service/opensearchserverless/types/enums.go index e0751976ed9..ec54c3ad7c0 100644 --- a/service/opensearchserverless/types/enums.go +++ b/service/opensearchserverless/types/enums.go @@ -71,6 +71,53 @@ func (CollectionType) Values() []CollectionType { } } +type IamIdentityCenterGroupAttribute string + +// Enum values for IamIdentityCenterGroupAttribute +const ( + // Group ID + IamIdentityCenterGroupAttributeGroupId IamIdentityCenterGroupAttribute = "GroupId" + // Group Name + IamIdentityCenterGroupAttributeGroupName IamIdentityCenterGroupAttribute = "GroupName" +) + +// Values returns all known values for IamIdentityCenterGroupAttribute. 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 (IamIdentityCenterGroupAttribute) Values() []IamIdentityCenterGroupAttribute { + return []IamIdentityCenterGroupAttribute{ + "GroupId", + "GroupName", + } +} + +type IamIdentityCenterUserAttribute string + +// Enum values for IamIdentityCenterUserAttribute +const ( + // User ID + IamIdentityCenterUserAttributeUserId IamIdentityCenterUserAttribute = "UserId" + // User Name + IamIdentityCenterUserAttributeUserName IamIdentityCenterUserAttribute = "UserName" + // Email + IamIdentityCenterUserAttributeEmail IamIdentityCenterUserAttribute = "Email" +) + +// Values returns all known values for IamIdentityCenterUserAttribute. 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 (IamIdentityCenterUserAttribute) Values() []IamIdentityCenterUserAttribute { + return []IamIdentityCenterUserAttribute{ + "UserId", + "UserName", + "Email", + } +} + type LifecyclePolicyType string // Enum values for LifecyclePolicyType @@ -113,6 +160,8 @@ type SecurityConfigType string const ( // saml provider SecurityConfigTypeSaml SecurityConfigType = "saml" + // iam identity center + SecurityConfigTypeIamidentitycenter SecurityConfigType = "iamidentitycenter" ) // Values returns all known values for SecurityConfigType. Note that this can be @@ -122,6 +171,7 @@ const ( func (SecurityConfigType) Values() []SecurityConfigType { return []SecurityConfigType{ "saml", + "iamidentitycenter", } } diff --git a/service/opensearchserverless/types/types.go b/service/opensearchserverless/types/types.go index 42e32507de7..7a829fd66e1 100644 --- a/service/opensearchserverless/types/types.go +++ b/service/opensearchserverless/types/types.go @@ -234,6 +234,26 @@ type CreateCollectionDetail struct { noSmithyDocumentSerde } +// Describes IAM Identity Center options for creating an OpenSearch Serverless +// security configuration in the form of a key-value map. +type CreateIamIdentityCenterConfigOptions struct { + + // The ARN of the IAM Identity Center instance used to integrate with OpenSearch + // Serverless. + // + // This member is required. + InstanceArn *string + + // The group attribute for this IAM Identity Center integration. Defaults to + // GroupId . + GroupAttribute IamIdentityCenterGroupAttribute + + // The user attribute for this IAM Identity Center integration. Defaults to UserId . + UserAttribute IamIdentityCenterUserAttribute + + noSmithyDocumentSerde +} + // Creation details for an OpenSearch Serverless-managed interface endpoint. For // more information, see [Access Amazon OpenSearch Serverless using an interface endpoint]. // @@ -329,6 +349,36 @@ type EffectiveLifecyclePolicyErrorDetail struct { noSmithyDocumentSerde } +// Describes IAM Identity Center options for an OpenSearch Serverless security +// configuration in the form of a key-value map. +type IamIdentityCenterConfigOptions struct { + + // The ARN of the IAM Identity Center application used to integrate with + // OpenSearch Serverless. + ApplicationArn *string + + // The description of the IAM Identity Center application used to integrate with + // OpenSearch Serverless. + ApplicationDescription *string + + // The name of the IAM Identity Center application used to integrate with + // OpenSearch Serverless. + ApplicationName *string + + // The group attribute for this IAM Identity Center integration. Defaults to + // GroupId . + GroupAttribute IamIdentityCenterGroupAttribute + + // The ARN of the IAM Identity Center instance used to integrate with OpenSearch + // Serverless. + InstanceArn *string + + // The user attribute for this IAM Identity Center integration. Defaults to UserId + UserAttribute IamIdentityCenterUserAttribute + + noSmithyDocumentSerde +} + // Details about an OpenSearch Serverless lifecycle policy. type LifecyclePolicyDetail struct { @@ -473,6 +523,9 @@ type SecurityConfigDetail struct { // The description of the security configuration. Description *string + // Describes IAM Identity Center options in the form of a key-value map. + IamIdentityCenterOptions *IamIdentityCenterConfigOptions + // The unique identifier of the security configuration. Id *string @@ -630,6 +683,20 @@ type UpdateCollectionDetail struct { noSmithyDocumentSerde } +// Describes IAM Identity Center options for updating an OpenSearch Serverless +// security configuration in the form of a key-value map. +type UpdateIamIdentityCenterConfigOptions struct { + + // The group attribute for this IAM Identity Center integration. Defaults to + // GroupId . + GroupAttribute IamIdentityCenterGroupAttribute + + // The user attribute for this IAM Identity Center integration. Defaults to UserId . + UserAttribute IamIdentityCenterUserAttribute + + noSmithyDocumentSerde +} + // Update details for an OpenSearch Serverless-managed interface endpoint. type UpdateVpcEndpointDetail struct { diff --git a/service/opensearchserverless/validators.go b/service/opensearchserverless/validators.go index 616286d00a8..4165a1ee8b5 100644 --- a/service/opensearchserverless/validators.go +++ b/service/opensearchserverless/validators.go @@ -754,6 +754,21 @@ func addOpUpdateVpcEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateVpcEndpoint{}, middleware.After) } +func validateCreateIamIdentityCenterConfigOptions(v *types.CreateIamIdentityCenterConfigOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateIamIdentityCenterConfigOptions"} + if v.InstanceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLifecyclePolicyIdentifier(v *types.LifecyclePolicyIdentifier) error { if v == nil { return nil @@ -1005,6 +1020,11 @@ func validateOpCreateSecurityConfigInput(v *CreateSecurityConfigInput) error { invalidParams.AddNested("SamlOptions", err.(smithy.InvalidParamsError)) } } + if v.IamIdentityCenterOptions != nil { + if err := validateCreateIamIdentityCenterConfigOptions(v.IamIdentityCenterOptions); err != nil { + invalidParams.AddNested("IamIdentityCenterOptions", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/redshift/api_op_CreateIntegration.go b/service/redshift/api_op_CreateIntegration.go index b858ac252cc..9784648ced0 100644 --- a/service/redshift/api_op_CreateIntegration.go +++ b/service/redshift/api_op_CreateIntegration.go @@ -12,7 +12,7 @@ import ( "time" ) -// Creates a zero-ETL integration with Amazon Redshift. +// Creates a zero-ETL integration or S3 event integration with Amazon Redshift. func (c *Client) CreateIntegration(ctx context.Context, params *CreateIntegrationInput, optFns ...func(*Options)) (*CreateIntegrationOutput, error) { if params == nil { params = &CreateIntegrationInput{} diff --git a/service/redshift/api_op_DeleteIntegration.go b/service/redshift/api_op_DeleteIntegration.go index a0833ae00a8..758bdc7dd44 100644 --- a/service/redshift/api_op_DeleteIntegration.go +++ b/service/redshift/api_op_DeleteIntegration.go @@ -12,7 +12,7 @@ import ( "time" ) -// Deletes a zero-ETL integration with Amazon Redshift. +// Deletes a zero-ETL integration or S3 event integration with Amazon Redshift. func (c *Client) DeleteIntegration(ctx context.Context, params *DeleteIntegrationInput, optFns ...func(*Options)) (*DeleteIntegrationOutput, error) { if params == nil { params = &DeleteIntegrationInput{} diff --git a/service/redshift/api_op_DescribeIntegrations.go b/service/redshift/api_op_DescribeIntegrations.go index 5939f67d134..8bcaf348de7 100644 --- a/service/redshift/api_op_DescribeIntegrations.go +++ b/service/redshift/api_op_DescribeIntegrations.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes one or more zero-ETL integrations with Amazon Redshift. +// Describes one or more zero-ETL or S3 event integrations with Amazon Redshift. func (c *Client) DescribeIntegrations(ctx context.Context, params *DescribeIntegrationsInput, optFns ...func(*Options)) (*DescribeIntegrationsOutput, error) { if params == nil { params = &DescribeIntegrationsInput{} diff --git a/service/redshift/api_op_DescribeTags.go b/service/redshift/api_op_DescribeTags.go index d0f9c5cef07..347ffce99f4 100644 --- a/service/redshift/api_op_DescribeTags.go +++ b/service/redshift/api_op_DescribeTags.go @@ -92,7 +92,7 @@ type DescribeTagsInput struct { // // - Snapshot copy grant // - // - Integration (zero-ETL integration) + // - Integration (zero-ETL integration or S3 event integration) // // To describe the tags associated with an integration , don't specify ResourceType // , instead specify the ResourceName of the integration. diff --git a/service/redshift/api_op_ModifyIntegration.go b/service/redshift/api_op_ModifyIntegration.go index 2f148c62b49..13a2074d427 100644 --- a/service/redshift/api_op_ModifyIntegration.go +++ b/service/redshift/api_op_ModifyIntegration.go @@ -12,7 +12,7 @@ import ( "time" ) -// Modifies a zero-ETL integration with Amazon Redshift. +// Modifies a zero-ETL integration or S3 event integration with Amazon Redshift. func (c *Client) ModifyIntegration(ctx context.Context, params *ModifyIntegrationInput, optFns ...func(*Options)) (*ModifyIntegrationOutput, error) { if params == nil { params = &ModifyIntegrationInput{} diff --git a/service/redshift/types/errors.go b/service/redshift/types/errors.go index 3b02a6d12d5..92fd9550261 100644 --- a/service/redshift/types/errors.go +++ b/service/redshift/types/errors.go @@ -1594,8 +1594,8 @@ func (e *IntegrationNotFoundFault) ErrorCode() string { } func (e *IntegrationNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You can't create any more zero-ETL integrations because the quota has been -// reached. +// You can't create any more zero-ETL or S3 event integrations because the quota +// has been reached. type IntegrationQuotaExceededFault struct { Message *string diff --git a/service/redshiftserverless/api_op_CreateWorkgroup.go b/service/redshiftserverless/api_op_CreateWorkgroup.go index fc13dd32d79..408b0afd7ad 100644 --- a/service/redshiftserverless/api_op_CreateWorkgroup.go +++ b/service/redshiftserverless/api_op_CreateWorkgroup.go @@ -70,6 +70,10 @@ type CreateWorkgroupInput struct { // 5431-5455 and 8191-8215. The default is 5439. Port *int32 + // An object that represents the price performance target settings for the + // workgroup. + PricePerformanceTarget *types.PerformanceTarget + // A value that specifies whether the workgroup can be accessed from a public // network. PubliclyAccessible *bool diff --git a/service/redshiftserverless/api_op_UpdateWorkgroup.go b/service/redshiftserverless/api_op_UpdateWorkgroup.go index 5fc60443f23..dc1fed67dff 100644 --- a/service/redshiftserverless/api_op_UpdateWorkgroup.go +++ b/service/redshiftserverless/api_op_UpdateWorkgroup.go @@ -67,6 +67,10 @@ type UpdateWorkgroupInput struct { // 5431-5455 and 8191-8215. The default is 5439. Port *int32 + // An object that represents the price performance target settings for the + // workgroup. + PricePerformanceTarget *types.PerformanceTarget + // A value that specifies whether the workgroup can be accessible from a public // network. PubliclyAccessible *bool diff --git a/service/redshiftserverless/deserializers.go b/service/redshiftserverless/deserializers.go index 5b8c25c4bf9..d93ca19a254 100644 --- a/service/redshiftserverless/deserializers.go +++ b/service/redshiftserverless/deserializers.go @@ -8206,6 +8206,59 @@ func awsAwsjson11_deserializeDocumentNextInvocationsList(v *[]time.Time, value i return nil } +func awsAwsjson11_deserializeDocumentPerformanceTarget(v **types.PerformanceTarget, 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.PerformanceTarget + if *v == nil { + sv = &types.PerformanceTarget{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "level": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Level = ptr.Int32(int32(i64)) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PerformanceTargetStatus to be of type string, got %T instead", value) + } + sv.Status = types.PerformanceTargetStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentRecoveryPoint(v **types.RecoveryPoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10322,6 +10375,11 @@ func awsAwsjson11_deserializeDocumentWorkgroup(v **types.Workgroup, value interf sv.Port = ptr.Int32(int32(i64)) } + case "pricePerformanceTarget": + if err := awsAwsjson11_deserializeDocumentPerformanceTarget(&sv.PricePerformanceTarget, value); err != nil { + return err + } + case "publiclyAccessible": if value != nil { jtv, ok := value.(bool) diff --git a/service/redshiftserverless/serializers.go b/service/redshiftserverless/serializers.go index 127fbac3938..fed19507b5c 100644 --- a/service/redshiftserverless/serializers.go +++ b/service/redshiftserverless/serializers.go @@ -3452,6 +3452,23 @@ func awsAwsjson11_serializeDocumentLogExportList(v []types.LogExport, value smit return nil } +func awsAwsjson11_serializeDocumentPerformanceTarget(v *types.PerformanceTarget, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Level != nil { + ok := object.Key("level") + ok.Integer(*v.Level) + } + + if len(v.Status) > 0 { + ok := object.Key("status") + ok.String(string(v.Status)) + } + + return nil +} + func awsAwsjson11_serializeDocumentSchedule(v types.Schedule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3909,6 +3926,13 @@ func awsAwsjson11_serializeOpDocumentCreateWorkgroupInput(v *CreateWorkgroupInpu ok.Integer(*v.Port) } + if v.PricePerformanceTarget != nil { + ok := object.Key("pricePerformanceTarget") + if err := awsAwsjson11_serializeDocumentPerformanceTarget(v.PricePerformanceTarget, ok); err != nil { + return err + } + } + if v.PubliclyAccessible != nil { ok := object.Key("publiclyAccessible") ok.Boolean(*v.PubliclyAccessible) @@ -4988,6 +5012,13 @@ func awsAwsjson11_serializeOpDocumentUpdateWorkgroupInput(v *UpdateWorkgroupInpu ok.Integer(*v.Port) } + if v.PricePerformanceTarget != nil { + ok := object.Key("pricePerformanceTarget") + if err := awsAwsjson11_serializeDocumentPerformanceTarget(v.PricePerformanceTarget, ok); err != nil { + return err + } + } + if v.PubliclyAccessible != nil { ok := object.Key("publiclyAccessible") ok.Boolean(*v.PubliclyAccessible) diff --git a/service/redshiftserverless/types/enums.go b/service/redshiftserverless/types/enums.go index de41a1f272f..3df11804818 100644 --- a/service/redshiftserverless/types/enums.go +++ b/service/redshiftserverless/types/enums.go @@ -44,6 +44,25 @@ func (NamespaceStatus) Values() []NamespaceStatus { } } +type PerformanceTargetStatus string + +// Enum values for PerformanceTargetStatus +const ( + PerformanceTargetStatusEnabled PerformanceTargetStatus = "ENABLED" + PerformanceTargetStatusDisabled PerformanceTargetStatus = "DISABLED" +) + +// Values returns all known values for PerformanceTargetStatus. 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 (PerformanceTargetStatus) Values() []PerformanceTargetStatus { + return []PerformanceTargetStatus{ + "ENABLED", + "DISABLED", + } +} + type SnapshotStatus string // Enum values for SnapshotStatus diff --git a/service/redshiftserverless/types/types.go b/service/redshiftserverless/types/types.go index ee6dfef2363..c5cc4845732 100644 --- a/service/redshiftserverless/types/types.go +++ b/service/redshiftserverless/types/types.go @@ -205,6 +205,21 @@ type NetworkInterface struct { noSmithyDocumentSerde } +// An object that represents the price performance target settings for the +// workgroup. +type PerformanceTarget struct { + + // The target price performance level for the workgroup. Valid values include 1, + // 25, 50, 75, and 100. These correspond to the price performance levels LOW_COST, + // ECONOMICAL, BALANCED, RESOURCEFUL, and HIGH_PERFORMANCE. + Level *int32 + + // Whether the price performance target is enabled for the workgroup. + Status PerformanceTargetStatus + + noSmithyDocumentSerde +} + // The automatically created recovery point of a namespace. Recovery points are // created every 30 minutes and kept for 24 hours. type RecoveryPoint struct { @@ -683,6 +698,10 @@ type Workgroup struct { // 5431-5455 and 8191-8215. The default is 5439. Port *int32 + // An object that represents the price performance target settings for the + // workgroup. + PricePerformanceTarget *PerformanceTarget + // A value that specifies whether the workgroup can be accessible from a public // network. PubliclyAccessible *bool diff --git a/service/route53/api_op_CreateQueryLoggingConfig.go b/service/route53/api_op_CreateQueryLoggingConfig.go index caa1c885b93..bce958b3799 100644 --- a/service/route53/api_op_CreateQueryLoggingConfig.go +++ b/service/route53/api_op_CreateQueryLoggingConfig.go @@ -54,10 +54,11 @@ import ( // logging. // // - Create a CloudWatch Logs resource policy, and give it the permissions that -// Route 53 needs to create log streams and to send query logs to log streams. For -// the value of Resource , specify the ARN for the log group that you created in -// the previous step. To use the same resource policy for all the CloudWatch Logs -// log groups that you created for query logging configurations, replace the hosted +// Route 53 needs to create log streams and to send query logs to log streams. You +// must create the CloudWatch Logs resource policy in the us-east-1 region. For the +// value of Resource , specify the ARN for the log group that you created in the +// previous step. To use the same resource policy for all the CloudWatch Logs log +// groups that you created for query logging configurations, replace the hosted // zone name with * , for example: // // arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/* diff --git a/service/route53/api_op_GetHostedZone.go b/service/route53/api_op_GetHostedZone.go index 03d43c25c2b..40422e1bcbc 100644 --- a/service/route53/api_op_GetHostedZone.go +++ b/service/route53/api_op_GetHostedZone.go @@ -13,6 +13,12 @@ import ( // Gets information about a specified hosted zone including the four name servers // assigned to the hosted zone. +// +// returns the VPCs associated with the specified hosted zone and does not reflect +// the VPC associations by Route 53 Profiles. To get the associations to a Profile, +// call the [ListProfileAssociations]API. +// +// [ListProfileAssociations]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_ListProfileAssociations.html func (c *Client) GetHostedZone(ctx context.Context, params *GetHostedZoneInput, optFns ...func(*Options)) (*GetHostedZoneOutput, error) { if params == nil { params = &GetHostedZoneInput{} diff --git a/service/route53/api_op_ListHostedZonesByVPC.go b/service/route53/api_op_ListHostedZonesByVPC.go index aed43dc8237..c9c128ef787 100644 --- a/service/route53/api_op_ListHostedZonesByVPC.go +++ b/service/route53/api_op_ListHostedZonesByVPC.go @@ -25,6 +25,10 @@ import ( // by Amazon Elastic File System (Amazon EFS), the value of Owner is // efs.amazonaws.com . // +// ListHostedZonesByVPC returns the hosted zones associated with the specified VPC +// and does not reflect the hosted zone associations to VPCs via Route 53 Profiles. +// To get the associations to a Profile, call the [ListProfileResourceAssociations]API. +// // When listing private hosted zones, the hosted zone and the Amazon VPC must // belong to the same partition where the hosted zones were created. A partition is // a group of Amazon Web Services Regions. Each Amazon Web Services account is @@ -41,6 +45,7 @@ import ( // For more information, see [Access Management] in the Amazon Web Services General Reference. // // [Access Management]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html +// [ListProfileResourceAssociations]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_ListProfileResourceAssociations.html func (c *Client) ListHostedZonesByVPC(ctx context.Context, params *ListHostedZonesByVPCInput, optFns ...func(*Options)) (*ListHostedZonesByVPCOutput, error) { if params == nil { params = &ListHostedZonesByVPCInput{} diff --git a/service/route53/types/enums.go b/service/route53/types/enums.go index 32f54d6226c..eff074a6b3b 100644 --- a/service/route53/types/enums.go +++ b/service/route53/types/enums.go @@ -474,6 +474,10 @@ const ( RRTypeAaaa RRType = "AAAA" RRTypeCaa RRType = "CAA" RRTypeDs RRType = "DS" + RRTypeTlsa RRType = "TLSA" + RRTypeSshfp RRType = "SSHFP" + RRTypeSvcb RRType = "SVCB" + RRTypeHttps RRType = "HTTPS" ) // Values returns all known values for RRType. Note that this can be expanded in @@ -495,6 +499,10 @@ func (RRType) Values() []RRType { "AAAA", "CAA", "DS", + "TLSA", + "SSHFP", + "SVCB", + "HTTPS", } } @@ -575,6 +583,7 @@ const ( VPCRegionSaEast1 VPCRegion = "sa-east-1" VPCRegionCaCentral1 VPCRegion = "ca-central-1" VPCRegionCnNorth1 VPCRegion = "cn-north-1" + VPCRegionCnNorthwest1 VPCRegion = "cn-northwest-1" VPCRegionAfSouth1 VPCRegion = "af-south-1" VPCRegionEuSouth1 VPCRegion = "eu-south-1" VPCRegionEuSouth2 VPCRegion = "eu-south-2" @@ -619,6 +628,7 @@ func (VPCRegion) Values() []VPCRegion { "sa-east-1", "ca-central-1", "cn-north-1", + "cn-northwest-1", "af-south-1", "eu-south-1", "eu-south-2", diff --git a/service/route53/types/types.go b/service/route53/types/types.go index 3ffd60e21f5..a213c93f266 100644 --- a/service/route53/types/types.go +++ b/service/route53/types/types.go @@ -875,8 +875,8 @@ type HealthCheckConfig struct { // 53 submits an HTTPS request and waits for an HTTP status code of 200 or greater // and less than 400. // - // If you specify HTTPS for the value of Type , the endpoint must support TLS v1.0 - // or later. + // If you specify HTTPS for the value of Type , the endpoint must support TLS v1.0, + // v1.1, or v1.2. // // - HTTP_STR_MATCH: Route 53 tries to establish a TCP connection. If // successful, Route 53 submits an HTTP request and searches the first 5,120 bytes @@ -1569,15 +1569,16 @@ type ResourceRecordSet struct { // is encoded for them, see [Supported DNS Resource Record Types]in the Amazon Route 53 Developer Guide. // // Valid values for basic resource record sets: A | AAAA | CAA | CNAME | DS | MX | - // NAPTR | NS | PTR | SOA | SPF | SRV | TXT + // NAPTR | NS | PTR | SOA | SPF | SRV | TXT | TLSA | SSHFP | SVCB | HTTPS // // Values for weighted, latency, geolocation, and failover resource record sets: A - // | AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT . When creating a - // group of weighted, latency, geolocation, or failover resource record sets, - // specify the same value for all of the resource record sets in the group. + // | AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT | TLSA | SSHFP | SVCB + // | HTTPS . When creating a group of weighted, latency, geolocation, or failover + // resource record sets, specify the same value for all of the resource record sets + // in the group. // // Valid values for multivalue answer resource record sets: A | AAAA | MX | NAPTR - // | PTR | SPF | SRV | TXT + // | PTR | SPF | SRV | TXT | CAA | TLSA | SSHFP | SVCB | HTTPS // // SPF records were formerly used to verify the identity of the sender of email // messages. However, we no longer recommend that you create resource record sets diff --git a/service/sagemaker/api_op_CreateModelPackage.go b/service/sagemaker/api_op_CreateModelPackage.go index 0497f4546f5..f7f71b027db 100644 --- a/service/sagemaker/api_op_CreateModelPackage.go +++ b/service/sagemaker/api_op_CreateModelPackage.go @@ -112,6 +112,9 @@ type CreateModelPackageInput struct { // [View the Details of a Model Version]: https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html ModelCard *types.ModelPackageModelCard + // A structure describing the current state of the model in its life cycle. + ModelLifeCycle *types.ModelLifeCycle + // A structure that contains model metrics reports. ModelMetrics *types.ModelMetrics diff --git a/service/sagemaker/api_op_CreatePresignedDomainUrl.go b/service/sagemaker/api_op_CreatePresignedDomainUrl.go index 92c835b6896..e791f6d8e19 100644 --- a/service/sagemaker/api_op_CreatePresignedDomainUrl.go +++ b/service/sagemaker/api_op_CreatePresignedDomainUrl.go @@ -25,10 +25,13 @@ import ( // IP addresses, Amazon VPCs or Amazon VPC Endpoints that you specify. For more // information, see [Connect to Amazon SageMaker Studio Through an Interface VPC Endpoint]. // -// The URL that you get from a call to CreatePresignedDomainUrl has a default -// timeout of 5 minutes. You can configure this value using ExpiresInSeconds . If -// you try to use the URL after the timeout limit expires, you are directed to the -// Amazon Web Services console sign-in page. +// - The URL that you get from a call to CreatePresignedDomainUrl has a default +// timeout of 5 minutes. You can configure this value using ExpiresInSeconds . If +// you try to use the URL after the timeout limit expires, you are directed to the +// Amazon Web Services console sign-in page. +// +// - The JupyterLab session default expiration time is 12 hours. You can +// configure this value using SessionExpirationDurationInSeconds. // // [Connect to Amazon SageMaker Studio Through an Interface VPC Endpoint]: https://docs.aws.amazon.com/sagemaker/latest/dg/studio-interface-endpoint.html func (c *Client) CreatePresignedDomainUrl(ctx context.Context, params *CreatePresignedDomainUrlInput, optFns ...func(*Options)) (*CreatePresignedDomainUrlOutput, error) { diff --git a/service/sagemaker/api_op_DescribeModelPackage.go b/service/sagemaker/api_op_DescribeModelPackage.go index 6d572e95458..93cda691f93 100644 --- a/service/sagemaker/api_op_DescribeModelPackage.go +++ b/service/sagemaker/api_op_DescribeModelPackage.go @@ -137,6 +137,9 @@ type DescribeModelPackageOutput struct { // [View the Details of a Model Version]: https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html ModelCard *types.ModelPackageModelCard + // A structure describing the current state of the model in its life cycle. + ModelLifeCycle *types.ModelLifeCycle + // Metrics for the model. ModelMetrics *types.ModelMetrics diff --git a/service/sagemaker/api_op_UpdateModelPackage.go b/service/sagemaker/api_op_UpdateModelPackage.go index 7d09064837a..37ac9568f6d 100644 --- a/service/sagemaker/api_op_UpdateModelPackage.go +++ b/service/sagemaker/api_op_UpdateModelPackage.go @@ -45,6 +45,9 @@ type UpdateModelPackageInput struct { // A description for the approval status of the model. ApprovalDescription *string + // A unique token that guarantees that the call to this API is idempotent. + ClientToken *string + // The metadata properties associated with the model package versions. CustomerMetadataProperties map[string]string @@ -79,6 +82,9 @@ type UpdateModelPackageInput struct { // [View the Details of a Model Version]: https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html ModelCard *types.ModelPackageModelCard + // A structure describing the current state of the model in its life cycle. + ModelLifeCycle *types.ModelLifeCycle + // The URI of the source for the model package. SourceUri *string diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index 40ef5b7dc57..1eb530c6530 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -62374,6 +62374,64 @@ func awsAwsjson11_deserializeDocumentModelLatencyThresholds(v *[]types.ModelLate return nil } +func awsAwsjson11_deserializeDocumentModelLifeCycle(v **types.ModelLifeCycle, 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.ModelLifeCycle + if *v == nil { + sv = &types.ModelLifeCycle{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Stage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) + } + sv.Stage = ptr.String(jtv) + } + + case "StageDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StageDescription to be of type string, got %T instead", value) + } + sv.StageDescription = ptr.String(jtv) + } + + case "StageStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) + } + sv.StageStatus = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentModelMetadataSummaries(v *[]types.ModelMetadataSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -62665,6 +62723,11 @@ func awsAwsjson11_deserializeDocumentModelPackage(v **types.ModelPackage, value return err } + case "ModelLifeCycle": + if err := awsAwsjson11_deserializeDocumentModelLifeCycle(&sv.ModelLifeCycle, value); err != nil { + return err + } + case "ModelMetrics": if err := awsAwsjson11_deserializeDocumentModelMetrics(&sv.ModelMetrics, value); err != nil { return err @@ -92601,6 +92664,11 @@ func awsAwsjson11_deserializeOpDocumentDescribeModelPackageOutput(v **DescribeMo return err } + case "ModelLifeCycle": + if err := awsAwsjson11_deserializeDocumentModelLifeCycle(&sv.ModelLifeCycle, value); err != nil { + return err + } + case "ModelMetrics": if err := awsAwsjson11_deserializeDocumentModelMetrics(&sv.ModelMetrics, value); err != nil { return err diff --git a/service/sagemaker/serializers.go b/service/sagemaker/serializers.go index 52bb50b40b5..0fa4c313299 100644 --- a/service/sagemaker/serializers.go +++ b/service/sagemaker/serializers.go @@ -26746,6 +26746,28 @@ func awsAwsjson11_serializeDocumentModelLatencyThresholds(v []types.ModelLatency return nil } +func awsAwsjson11_serializeDocumentModelLifeCycle(v *types.ModelLifeCycle, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Stage != nil { + ok := object.Key("Stage") + ok.String(*v.Stage) + } + + if v.StageDescription != nil { + ok := object.Key("StageDescription") + ok.String(*v.StageDescription) + } + + if v.StageStatus != nil { + ok := object.Key("StageStatus") + ok.String(*v.StageStatus) + } + + return nil +} + func awsAwsjson11_serializeDocumentModelMetadataFilter(v *types.ModelMetadataFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -34042,6 +34064,13 @@ func awsAwsjson11_serializeOpDocumentCreateModelPackageInput(v *CreateModelPacka } } + if v.ModelLifeCycle != nil { + ok := object.Key("ModelLifeCycle") + if err := awsAwsjson11_serializeDocumentModelLifeCycle(v.ModelLifeCycle, ok); err != nil { + return err + } + } + if v.ModelMetrics != nil { ok := object.Key("ModelMetrics") if err := awsAwsjson11_serializeDocumentModelMetrics(v.ModelMetrics, ok); err != nil { @@ -41960,6 +41989,11 @@ func awsAwsjson11_serializeOpDocumentUpdateModelPackageInput(v *UpdateModelPacka ok.String(*v.ApprovalDescription) } + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + if v.CustomerMetadataProperties != nil { ok := object.Key("CustomerMetadataProperties") if err := awsAwsjson11_serializeDocumentCustomerMetadataMap(v.CustomerMetadataProperties, ok); err != nil { @@ -41993,6 +42027,13 @@ func awsAwsjson11_serializeOpDocumentUpdateModelPackageInput(v *UpdateModelPacka } } + if v.ModelLifeCycle != nil { + ok := object.Key("ModelLifeCycle") + if err := awsAwsjson11_serializeDocumentModelLifeCycle(v.ModelLifeCycle, ok); err != nil { + return err + } + } + if v.ModelPackageArn != nil { ok := object.Key("ModelPackageArn") ok.String(*v.ModelPackageArn) diff --git a/service/sagemaker/types/enums.go b/service/sagemaker/types/enums.go index 017e5089287..5acac771a88 100644 --- a/service/sagemaker/types/enums.go +++ b/service/sagemaker/types/enums.go @@ -7356,7 +7356,6 @@ const ( TrainingInstanceTypeMlP4de24xlarge TrainingInstanceType = "ml.p4de.24xlarge" TrainingInstanceTypeMlP548xlarge TrainingInstanceType = "ml.p5.48xlarge" TrainingInstanceTypeMlP5e48xlarge TrainingInstanceType = "ml.p5e.48xlarge" - TrainingInstanceTypeMlP5en48xlarge TrainingInstanceType = "ml.p5en.48xlarge" TrainingInstanceTypeMlC5Xlarge TrainingInstanceType = "ml.c5.xlarge" TrainingInstanceTypeMlC52xlarge TrainingInstanceType = "ml.c5.2xlarge" TrainingInstanceTypeMlC54xlarge TrainingInstanceType = "ml.c5.4xlarge" @@ -7378,7 +7377,6 @@ const ( TrainingInstanceTypeMlTrn12xlarge TrainingInstanceType = "ml.trn1.2xlarge" TrainingInstanceTypeMlTrn132xlarge TrainingInstanceType = "ml.trn1.32xlarge" TrainingInstanceTypeMlTrn1n32xlarge TrainingInstanceType = "ml.trn1n.32xlarge" - TrainingInstanceTypeMlTrn248xlarge TrainingInstanceType = "ml.trn2.48xlarge" TrainingInstanceTypeMlM6iLarge TrainingInstanceType = "ml.m6i.large" TrainingInstanceTypeMlM6iXlarge TrainingInstanceType = "ml.m6i.xlarge" TrainingInstanceTypeMlM6i2xlarge TrainingInstanceType = "ml.m6i.2xlarge" @@ -7456,7 +7454,6 @@ func (TrainingInstanceType) Values() []TrainingInstanceType { "ml.p4de.24xlarge", "ml.p5.48xlarge", "ml.p5e.48xlarge", - "ml.p5en.48xlarge", "ml.c5.xlarge", "ml.c5.2xlarge", "ml.c5.4xlarge", @@ -7478,7 +7475,6 @@ func (TrainingInstanceType) Values() []TrainingInstanceType { "ml.trn1.2xlarge", "ml.trn1.32xlarge", "ml.trn1n.32xlarge", - "ml.trn2.48xlarge", "ml.m6i.large", "ml.m6i.xlarge", "ml.m6i.2xlarge", diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index 46191b926a5..0cba8ba5db3 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -11013,6 +11013,25 @@ type ModelLatencyThreshold struct { noSmithyDocumentSerde } +// A structure describing the current state of the model in its life cycle. +type ModelLifeCycle struct { + + // The current stage in the model life cycle. + // + // This member is required. + Stage *string + + // The current status of a stage in model life cycle. + // + // This member is required. + StageStatus *string + + // Describes the stage related details. + StageDescription *string + + noSmithyDocumentSerde +} + // Part of the search expression. You can specify the name and value (domain, // task, framework, framework version, task, and model). type ModelMetadataFilter struct { @@ -11159,6 +11178,9 @@ type ModelPackage struct { // [View the Details of a Model Version]: https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html ModelCard *ModelPackageModelCard + // A structure describing the current state of the model in its life cycle. + ModelLifeCycle *ModelLifeCycle + // Metrics for the model. ModelMetrics *ModelMetrics diff --git a/service/sagemaker/validators.go b/service/sagemaker/validators.go index 194048296e1..8cda94002db 100644 --- a/service/sagemaker/validators.go +++ b/service/sagemaker/validators.go @@ -10176,6 +10176,24 @@ func validateModelInput(v *types.ModelInput) error { } } +func validateModelLifeCycle(v *types.ModelLifeCycle) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModelLifeCycle"} + if v.Stage == nil { + invalidParams.Add(smithy.NewErrParamRequired("Stage")) + } + if v.StageStatus == nil { + invalidParams.Add(smithy.NewErrParamRequired("StageStatus")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateModelMetadataFilter(v *types.ModelMetadataFilter) error { if v == nil { return nil @@ -14381,6 +14399,11 @@ func validateOpCreateModelPackageInput(v *CreateModelPackageInput) error { invalidParams.AddNested("SecurityConfig", err.(smithy.InvalidParamsError)) } } + if v.ModelLifeCycle != nil { + if err := validateModelLifeCycle(v.ModelLifeCycle); err != nil { + invalidParams.AddNested("ModelLifeCycle", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -18276,6 +18299,11 @@ func validateOpUpdateModelPackageInput(v *UpdateModelPackageInput) error { invalidParams.AddNested("InferenceSpecification", err.(smithy.InvalidParamsError)) } } + if v.ModelLifeCycle != nil { + if err := validateModelLifeCycle(v.ModelLifeCycle); err != nil { + invalidParams.AddNested("ModelLifeCycle", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/workmail/api_op_CreateIdentityCenterApplication.go b/service/workmail/api_op_CreateIdentityCenterApplication.go new file mode 100644 index 00000000000..b07c412210d --- /dev/null +++ b/service/workmail/api_op_CreateIdentityCenterApplication.go @@ -0,0 +1,204 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates the WorkMail application in IAM Identity Center that can be used later +// +// in the WorkMail - IdC integration. For more information, see +// PutIdentityProviderConfiguration. This action does not affect the authentication +// settings for any WorkMail organizations. +func (c *Client) CreateIdentityCenterApplication(ctx context.Context, params *CreateIdentityCenterApplicationInput, optFns ...func(*Options)) (*CreateIdentityCenterApplicationOutput, error) { + if params == nil { + params = &CreateIdentityCenterApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateIdentityCenterApplication", params, optFns, c.addOperationCreateIdentityCenterApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateIdentityCenterApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateIdentityCenterApplicationInput struct { + + // The Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceArn *string + + // The name of the IAM Identity Center application. + // + // This member is required. + Name *string + + // The idempotency token associated with the request. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreateIdentityCenterApplicationOutput struct { + + // The Amazon Resource Name (ARN) of the application. + ApplicationArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateIdentityCenterApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateIdentityCenterApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateIdentityCenterApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateIdentityCenterApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateIdentityCenterApplicationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateIdentityCenterApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIdentityCenterApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateIdentityCenterApplication struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateIdentityCenterApplication) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateIdentityCenterApplication) 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.(*CreateIdentityCenterApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIdentityCenterApplicationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateIdentityCenterApplicationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIdentityCenterApplication{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateIdentityCenterApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateIdentityCenterApplication", + } +} diff --git a/service/workmail/api_op_CreateUser.go b/service/workmail/api_op_CreateUser.go index c36aa3fe725..f8c6ab95acd 100644 --- a/service/workmail/api_op_CreateUser.go +++ b/service/workmail/api_op_CreateUser.go @@ -51,6 +51,11 @@ type CreateUserInput struct { // If this parameter is enabled, the user will be hidden from the address book. HiddenFromGlobalAddressList bool + // User ID from the IAM Identity Center. If this parameter is empty it will be + // updated automatically when the user logs in for the first time to the mailbox + // associated with WorkMail. + IdentityProviderUserId *string + // The last name of the new user. LastName *string diff --git a/service/workmail/api_op_DeleteIdentityCenterApplication.go b/service/workmail/api_op_DeleteIdentityCenterApplication.go new file mode 100644 index 00000000000..f3a248ac563 --- /dev/null +++ b/service/workmail/api_op_DeleteIdentityCenterApplication.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the IAM Identity Center application from WorkMail. This action does +// +// not affect the authentication settings for any WorkMail organizations. +func (c *Client) DeleteIdentityCenterApplication(ctx context.Context, params *DeleteIdentityCenterApplicationInput, optFns ...func(*Options)) (*DeleteIdentityCenterApplicationOutput, error) { + if params == nil { + params = &DeleteIdentityCenterApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIdentityCenterApplication", params, optFns, c.addOperationDeleteIdentityCenterApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIdentityCenterApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIdentityCenterApplicationInput struct { + + // The Amazon Resource Name (ARN) of the application. + // + // This member is required. + ApplicationArn *string + + noSmithyDocumentSerde +} + +type DeleteIdentityCenterApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIdentityCenterApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteIdentityCenterApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteIdentityCenterApplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIdentityCenterApplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteIdentityCenterApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIdentityCenterApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteIdentityCenterApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteIdentityCenterApplication", + } +} diff --git a/service/workmail/api_op_DeleteIdentityProviderConfiguration.go b/service/workmail/api_op_DeleteIdentityProviderConfiguration.go new file mode 100644 index 00000000000..fbbf1e68ac0 --- /dev/null +++ b/service/workmail/api_op_DeleteIdentityProviderConfiguration.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disables the integration between IdC and WorkMail. Authentication will +// +// continue with the directory as it was before the IdC integration. You might have +// to reset your directory passwords and reconfigure your desktop and mobile email +// clients. +func (c *Client) DeleteIdentityProviderConfiguration(ctx context.Context, params *DeleteIdentityProviderConfigurationInput, optFns ...func(*Options)) (*DeleteIdentityProviderConfigurationOutput, error) { + if params == nil { + params = &DeleteIdentityProviderConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIdentityProviderConfiguration", params, optFns, c.addOperationDeleteIdentityProviderConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIdentityProviderConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIdentityProviderConfigurationInput struct { + + // The Organization ID. + // + // This member is required. + OrganizationId *string + + noSmithyDocumentSerde +} + +type DeleteIdentityProviderConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIdentityProviderConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteIdentityProviderConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteIdentityProviderConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIdentityProviderConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteIdentityProviderConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIdentityProviderConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteIdentityProviderConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteIdentityProviderConfiguration", + } +} diff --git a/service/workmail/api_op_DeleteOrganization.go b/service/workmail/api_op_DeleteOrganization.go index 0b4e5894328..b74a89b426f 100644 --- a/service/workmail/api_op_DeleteOrganization.go +++ b/service/workmail/api_op_DeleteOrganization.go @@ -47,6 +47,10 @@ type DeleteOrganizationInput struct { // The idempotency token associated with the request. ClientToken *string + // Deletes IAM Identity Center application for WorkMail. This action does not + // affect authentication settings for any organization. + DeleteIdentityCenterApplication bool + // Deletes a WorkMail organization even if the organization has enabled users. ForceDelete bool diff --git a/service/workmail/api_op_DeletePersonalAccessToken.go b/service/workmail/api_op_DeletePersonalAccessToken.go new file mode 100644 index 00000000000..4f2b477547c --- /dev/null +++ b/service/workmail/api_op_DeletePersonalAccessToken.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the Personal Access Token from the provided WorkMail Organization. +func (c *Client) DeletePersonalAccessToken(ctx context.Context, params *DeletePersonalAccessTokenInput, optFns ...func(*Options)) (*DeletePersonalAccessTokenOutput, error) { + if params == nil { + params = &DeletePersonalAccessTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePersonalAccessToken", params, optFns, c.addOperationDeletePersonalAccessTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePersonalAccessTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePersonalAccessTokenInput struct { + + // The Organization ID. + // + // This member is required. + OrganizationId *string + + // The Personal Access Token ID. + // + // This member is required. + PersonalAccessTokenId *string + + noSmithyDocumentSerde +} + +type DeletePersonalAccessTokenOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePersonalAccessTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePersonalAccessToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePersonalAccessToken{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePersonalAccessToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeletePersonalAccessTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePersonalAccessToken(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeletePersonalAccessToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeletePersonalAccessToken", + } +} diff --git a/service/workmail/api_op_DescribeIdentityProviderConfiguration.go b/service/workmail/api_op_DescribeIdentityProviderConfiguration.go new file mode 100644 index 00000000000..47336a862e0 --- /dev/null +++ b/service/workmail/api_op_DescribeIdentityProviderConfiguration.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns detailed information on the current IdC setup for the WorkMail +// +// organization. +func (c *Client) DescribeIdentityProviderConfiguration(ctx context.Context, params *DescribeIdentityProviderConfigurationInput, optFns ...func(*Options)) (*DescribeIdentityProviderConfigurationOutput, error) { + if params == nil { + params = &DescribeIdentityProviderConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeIdentityProviderConfiguration", params, optFns, c.addOperationDescribeIdentityProviderConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeIdentityProviderConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeIdentityProviderConfigurationInput struct { + + // The Organization ID. + // + // This member is required. + OrganizationId *string + + noSmithyDocumentSerde +} + +type DescribeIdentityProviderConfigurationOutput struct { + + // The authentication mode used in WorkMail. + AuthenticationMode types.IdentityProviderAuthenticationMode + + // The details of the IAM Identity Center configuration. + IdentityCenterConfiguration *types.IdentityCenterConfiguration + + // The details of the Personal Access Token configuration. + PersonalAccessTokenConfiguration *types.PersonalAccessTokenConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeIdentityProviderConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeIdentityProviderConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeIdentityProviderConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIdentityProviderConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeIdentityProviderConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIdentityProviderConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeIdentityProviderConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeIdentityProviderConfiguration", + } +} diff --git a/service/workmail/api_op_DescribeUser.go b/service/workmail/api_op_DescribeUser.go index 65ddbc8eb03..fe1f36de2d6 100644 --- a/service/workmail/api_op_DescribeUser.go +++ b/service/workmail/api_op_DescribeUser.go @@ -87,6 +87,16 @@ type DescribeUserOutput struct { // If enabled, the user is hidden from the global address list. HiddenFromGlobalAddressList bool + // Identity Store ID from the IAM Identity Center. If this parameter is empty it + // will be updated automatically when the user logs in for the first time to the + // mailbox associated with WorkMail. + IdentityProviderIdentityStoreId *string + + // User ID from the IAM Identity Center. If this parameter is empty it will be + // updated automatically when the user logs in for the first time to the mailbox + // associated with WorkMail. + IdentityProviderUserId *string + // Initials of the user. Initials *string diff --git a/service/workmail/api_op_GetPersonalAccessTokenMetadata.go b/service/workmail/api_op_GetPersonalAccessTokenMetadata.go new file mode 100644 index 00000000000..31962e18f92 --- /dev/null +++ b/service/workmail/api_op_GetPersonalAccessTokenMetadata.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Requests details of a specific Personal Access Token within the WorkMail +// +// organization. +func (c *Client) GetPersonalAccessTokenMetadata(ctx context.Context, params *GetPersonalAccessTokenMetadataInput, optFns ...func(*Options)) (*GetPersonalAccessTokenMetadataOutput, error) { + if params == nil { + params = &GetPersonalAccessTokenMetadataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPersonalAccessTokenMetadata", params, optFns, c.addOperationGetPersonalAccessTokenMetadataMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPersonalAccessTokenMetadataOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPersonalAccessTokenMetadataInput struct { + + // The Organization ID. + // + // This member is required. + OrganizationId *string + + // The Personal Access Token ID. + // + // This member is required. + PersonalAccessTokenId *string + + noSmithyDocumentSerde +} + +type GetPersonalAccessTokenMetadataOutput struct { + + // The date when the Personal Access Token ID was created. + DateCreated *time.Time + + // The date when the Personal Access Token ID was last used. + DateLastUsed *time.Time + + // The time when the Personal Access Token ID will expire. + ExpiresTime *time.Time + + // The Personal Access Token name. + Name *string + + // The Personal Access Token ID. + PersonalAccessTokenId *string + + // Lists all the Personal Access Token permissions for a mailbox. + Scopes []string + + // The WorkMail User ID. + UserId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPersonalAccessTokenMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetPersonalAccessTokenMetadata{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetPersonalAccessTokenMetadata{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPersonalAccessTokenMetadata"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetPersonalAccessTokenMetadataValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPersonalAccessTokenMetadata(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetPersonalAccessTokenMetadata(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetPersonalAccessTokenMetadata", + } +} diff --git a/service/workmail/api_op_ListPersonalAccessTokens.go b/service/workmail/api_op_ListPersonalAccessTokens.go new file mode 100644 index 00000000000..fccdc5aa21b --- /dev/null +++ b/service/workmail/api_op_ListPersonalAccessTokens.go @@ -0,0 +1,265 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a summary of your Personal Access Tokens. +func (c *Client) ListPersonalAccessTokens(ctx context.Context, params *ListPersonalAccessTokensInput, optFns ...func(*Options)) (*ListPersonalAccessTokensOutput, error) { + if params == nil { + params = &ListPersonalAccessTokensInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPersonalAccessTokens", params, optFns, c.addOperationListPersonalAccessTokensMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPersonalAccessTokensOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPersonalAccessTokensInput struct { + + // The Organization ID. + // + // This member is required. + OrganizationId *string + + // The maximum amount of items that should be returned in a response. + MaxResults *int32 + + // The token from the previous response to query the next page. + NextToken *string + + // The WorkMail User ID. + UserId *string + + noSmithyDocumentSerde +} + +type ListPersonalAccessTokensOutput struct { + + // The token from the previous response to query the next page. + NextToken *string + + // Lists all the personal tokens in an organization or user, if user ID is + // provided. + PersonalAccessTokenSummaries []types.PersonalAccessTokenSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPersonalAccessTokensMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListPersonalAccessTokens{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListPersonalAccessTokens{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListPersonalAccessTokens"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListPersonalAccessTokensValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPersonalAccessTokens(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListPersonalAccessTokensPaginatorOptions is the paginator options for +// ListPersonalAccessTokens +type ListPersonalAccessTokensPaginatorOptions struct { + // The maximum amount of items that should be returned in a response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListPersonalAccessTokensPaginator is a paginator for ListPersonalAccessTokens +type ListPersonalAccessTokensPaginator struct { + options ListPersonalAccessTokensPaginatorOptions + client ListPersonalAccessTokensAPIClient + params *ListPersonalAccessTokensInput + nextToken *string + firstPage bool +} + +// NewListPersonalAccessTokensPaginator returns a new +// ListPersonalAccessTokensPaginator +func NewListPersonalAccessTokensPaginator(client ListPersonalAccessTokensAPIClient, params *ListPersonalAccessTokensInput, optFns ...func(*ListPersonalAccessTokensPaginatorOptions)) *ListPersonalAccessTokensPaginator { + if params == nil { + params = &ListPersonalAccessTokensInput{} + } + + options := ListPersonalAccessTokensPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPersonalAccessTokensPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPersonalAccessTokensPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPersonalAccessTokens page. +func (p *ListPersonalAccessTokensPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPersonalAccessTokensOutput, 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 + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListPersonalAccessTokens(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 +} + +// ListPersonalAccessTokensAPIClient is a client that implements the +// ListPersonalAccessTokens operation. +type ListPersonalAccessTokensAPIClient interface { + ListPersonalAccessTokens(context.Context, *ListPersonalAccessTokensInput, ...func(*Options)) (*ListPersonalAccessTokensOutput, error) +} + +var _ ListPersonalAccessTokensAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListPersonalAccessTokens(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListPersonalAccessTokens", + } +} diff --git a/service/workmail/api_op_PutIdentityProviderConfiguration.go b/service/workmail/api_op_PutIdentityProviderConfiguration.go new file mode 100644 index 00000000000..3c6ffb2cfc8 --- /dev/null +++ b/service/workmail/api_op_PutIdentityProviderConfiguration.go @@ -0,0 +1,173 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables integration between IAM Identity Center (IdC) and WorkMail to proxy +// +// authentication requests for mailbox users. You can connect your IdC directory or +// your external directory to WorkMail through IdC and manage access to WorkMail +// mailboxes in a single place. For enhanced protection, you could enable +// Multifactor Authentication (MFA) and Personal Access Tokens. +func (c *Client) PutIdentityProviderConfiguration(ctx context.Context, params *PutIdentityProviderConfigurationInput, optFns ...func(*Options)) (*PutIdentityProviderConfigurationOutput, error) { + if params == nil { + params = &PutIdentityProviderConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutIdentityProviderConfiguration", params, optFns, c.addOperationPutIdentityProviderConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutIdentityProviderConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutIdentityProviderConfigurationInput struct { + + // The authentication mode used in WorkMail. + // + // This member is required. + AuthenticationMode types.IdentityProviderAuthenticationMode + + // The details of the IAM Identity Center configuration. + // + // This member is required. + IdentityCenterConfiguration *types.IdentityCenterConfiguration + + // The ID of the WorkMail Organization. + // + // This member is required. + OrganizationId *string + + // The details of the Personal Access Token configuration. + // + // This member is required. + PersonalAccessTokenConfiguration *types.PersonalAccessTokenConfiguration + + noSmithyDocumentSerde +} + +type PutIdentityProviderConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutIdentityProviderConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutIdentityProviderConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutIdentityProviderConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutIdentityProviderConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPutIdentityProviderConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutIdentityProviderConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutIdentityProviderConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutIdentityProviderConfiguration", + } +} diff --git a/service/workmail/api_op_UpdateGroup.go b/service/workmail/api_op_UpdateGroup.go index c04ce6866d5..b390ef34dde 100644 --- a/service/workmail/api_op_UpdateGroup.go +++ b/service/workmail/api_op_UpdateGroup.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates attibutes in a group. +// Updates attributes in a group. func (c *Client) UpdateGroup(ctx context.Context, params *UpdateGroupInput, optFns ...func(*Options)) (*UpdateGroupOutput, error) { if params == nil { params = &UpdateGroupInput{} diff --git a/service/workmail/api_op_UpdateUser.go b/service/workmail/api_op_UpdateUser.go index 04d78b836aa..2e1dd60b98c 100644 --- a/service/workmail/api_op_UpdateUser.go +++ b/service/workmail/api_op_UpdateUser.go @@ -72,6 +72,11 @@ type UpdateUserInput struct { // If enabled, the user is hidden from the global address list. HiddenFromGlobalAddressList *bool + // User ID from the IAM Identity Center. If this parameter is empty it will be + // updated automatically when the user logs in for the first time to the mailbox + // associated with WorkMail. + IdentityProviderUserId *string + // Updates the user's initials. Initials *string @@ -95,7 +100,7 @@ type UpdateUserInput struct { // Updates the user's contact details. Telephone *string - // Updates the user's zipcode. + // Updates the user's zip code. ZipCode *string noSmithyDocumentSerde diff --git a/service/workmail/deserializers.go b/service/workmail/deserializers.go index 357b3b83bef..621f5e65da5 100644 --- a/service/workmail/deserializers.go +++ b/service/workmail/deserializers.go @@ -918,6 +918,117 @@ func awsAwsjson11_deserializeOpErrorCreateGroup(response *smithyhttp.Response, m } } +type awsAwsjson11_deserializeOpCreateIdentityCenterApplication struct { +} + +func (*awsAwsjson11_deserializeOpCreateIdentityCenterApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateIdentityCenterApplication) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCreateIdentityCenterApplication(response, &metadata) + } + output := &CreateIdentityCenterApplicationOutput{} + 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_deserializeOpDocumentCreateIdentityCenterApplicationOutput(&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_deserializeOpErrorCreateIdentityCenterApplication(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateImpersonationRole struct { } @@ -2151,14 +2262,14 @@ func awsAwsjson11_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpDeleteImpersonationRole struct { +type awsAwsjson11_deserializeOpDeleteIdentityCenterApplication struct { } -func (*awsAwsjson11_deserializeOpDeleteImpersonationRole) ID() string { +func (*awsAwsjson11_deserializeOpDeleteIdentityCenterApplication) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteIdentityCenterApplication) 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) @@ -2176,9 +2287,9 @@ func (m *awsAwsjson11_deserializeOpDeleteImpersonationRole) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteIdentityCenterApplication(response, &metadata) } - output := &DeleteImpersonationRoleOutput{} + output := &DeleteIdentityCenterApplicationOutput{} out.Result = output var buff [1024]byte @@ -2198,7 +2309,7 @@ func (m *awsAwsjson11_deserializeOpDeleteImpersonationRole) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteImpersonationRoleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteIdentityCenterApplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2212,7 +2323,7 @@ func (m *awsAwsjson11_deserializeOpDeleteImpersonationRole) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteIdentityCenterApplication(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)} @@ -2252,9 +2363,6 @@ func awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(response *smithyhttp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) @@ -2268,14 +2376,14 @@ func awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(response *smithyhttp } } -type awsAwsjson11_deserializeOpDeleteMailboxPermissions struct { +type awsAwsjson11_deserializeOpDeleteIdentityProviderConfiguration struct { } -func (*awsAwsjson11_deserializeOpDeleteMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpDeleteIdentityProviderConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteIdentityProviderConfiguration) 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) @@ -2293,9 +2401,9 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteIdentityProviderConfiguration(response, &metadata) } - output := &DeleteMailboxPermissionsOutput{} + output := &DeleteIdentityProviderConfigurationOutput{} out.Result = output var buff [1024]byte @@ -2315,7 +2423,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteIdentityProviderConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2329,7 +2437,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteIdentityProviderConfiguration(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)} @@ -2366,12 +2474,6 @@ func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhtt errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2391,14 +2493,14 @@ func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhtt } } -type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride struct { +type awsAwsjson11_deserializeOpDeleteImpersonationRole struct { } -func (*awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) ID() string { +func (*awsAwsjson11_deserializeOpDeleteImpersonationRole) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2416,9 +2518,9 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(response, &metadata) } - output := &DeleteMobileDeviceAccessOverrideOutput{} + output := &DeleteImpersonationRoleOutput{} out.Result = output var buff [1024]byte @@ -2438,7 +2540,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeser return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessOverrideOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteImpersonationRoleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2452,7 +2554,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeser return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(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)} @@ -2489,9 +2591,6 @@ func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response *s errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2511,14 +2610,14 @@ func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response *s } } -type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule struct { +type awsAwsjson11_deserializeOpDeleteMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule) ID() string { +func (*awsAwsjson11_deserializeOpDeleteMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) 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) @@ -2536,9 +2635,9 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessRule(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response, &metadata) } - output := &DeleteMobileDeviceAccessRuleOutput{} + output := &DeleteMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -2558,7 +2657,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule) HandleDeseriali return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessRuleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2572,7 +2671,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule) HandleDeseriali return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2609,6 +2708,12 @@ func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessRule(response *smith errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2628,14 +2733,14 @@ func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessRule(response *smith } } -type awsAwsjson11_deserializeOpDeleteOrganization struct { +type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride struct { } -func (*awsAwsjson11_deserializeOpDeleteOrganization) ID() string { +func (*awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) 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) @@ -2653,9 +2758,9 @@ func (m *awsAwsjson11_deserializeOpDeleteOrganization) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteOrganization(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response, &metadata) } - output := &DeleteOrganizationOutput{} + output := &DeleteMobileDeviceAccessOverrideOutput{} out.Result = output var buff [1024]byte @@ -2675,7 +2780,7 @@ func (m *awsAwsjson11_deserializeOpDeleteOrganization) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteOrganizationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessOverrideOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2689,7 +2794,7 @@ func (m *awsAwsjson11_deserializeOpDeleteOrganization) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(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)} @@ -2726,6 +2831,9 @@ func awsAwsjson11_deserializeOpErrorDeleteOrganization(response *smithyhttp.Resp errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2745,14 +2853,14 @@ func awsAwsjson11_deserializeOpErrorDeleteOrganization(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpDeleteResource struct { +type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule struct { } -func (*awsAwsjson11_deserializeOpDeleteResource) ID() string { +func (*awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessRule) 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) @@ -2770,9 +2878,9 @@ func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessRule(response, &metadata) } - output := &DeleteResourceOutput{} + output := &DeleteMobileDeviceAccessRuleOutput{} out.Result = output var buff [1024]byte @@ -2792,7 +2900,7 @@ func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2806,7 +2914,7 @@ func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessRule(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)} @@ -2843,9 +2951,6 @@ func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2855,9 +2960,6 @@ func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2868,14 +2970,14 @@ func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpDeleteRetentionPolicy struct { +type awsAwsjson11_deserializeOpDeleteOrganization struct { } -func (*awsAwsjson11_deserializeOpDeleteRetentionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpDeleteOrganization) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteOrganization) 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) @@ -2893,9 +2995,9 @@ func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteOrganization(response, &metadata) } - output := &DeleteRetentionPolicyOutput{} + output := &DeleteOrganizationOutput{} out.Result = output var buff [1024]byte @@ -2915,7 +3017,7 @@ func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteRetentionPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteOrganizationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2929,7 +3031,7 @@ func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteOrganization(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)} @@ -2985,14 +3087,14 @@ func awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpDeleteUser struct { +type awsAwsjson11_deserializeOpDeletePersonalAccessToken struct { } -func (*awsAwsjson11_deserializeOpDeleteUser) ID() string { +func (*awsAwsjson11_deserializeOpDeletePersonalAccessToken) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeletePersonalAccessToken) 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) @@ -3010,9 +3112,9 @@ func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteUser(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeletePersonalAccessToken(response, &metadata) } - output := &DeleteUserOutput{} + output := &DeletePersonalAccessTokenOutput{} out.Result = output var buff [1024]byte @@ -3032,7 +3134,7 @@ func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteUserOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeletePersonalAccessTokenOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3046,7 +3148,7 @@ func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeletePersonalAccessToken(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)} @@ -3083,15 +3185,6 @@ func awsAwsjson11_deserializeOpErrorDeleteUser(response *smithyhttp.Response, me errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3101,9 +3194,6 @@ func awsAwsjson11_deserializeOpErrorDeleteUser(response *smithyhttp.Response, me case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3114,14 +3204,14 @@ func awsAwsjson11_deserializeOpErrorDeleteUser(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpDeregisterFromWorkMail struct { +type awsAwsjson11_deserializeOpDeleteResource struct { } -func (*awsAwsjson11_deserializeOpDeregisterFromWorkMail) ID() string { +func (*awsAwsjson11_deserializeOpDeleteResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteResource) 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) @@ -3139,9 +3229,9 @@ func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResource(response, &metadata) } - output := &DeregisterFromWorkMailOutput{} + output := &DeleteResourceOutput{} out.Result = output var buff [1024]byte @@ -3161,7 +3251,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeregisterFromWorkMailOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3175,7 +3265,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteResource(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)} @@ -3212,9 +3302,6 @@ func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response *smithyhttp. errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) @@ -3227,6 +3314,9 @@ func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response *smithyhttp. case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3237,14 +3327,14 @@ func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response *smithyhttp. } } -type awsAwsjson11_deserializeOpDeregisterMailDomain struct { +type awsAwsjson11_deserializeOpDeleteRetentionPolicy struct { } -func (*awsAwsjson11_deserializeOpDeregisterMailDomain) ID() string { +func (*awsAwsjson11_deserializeOpDeleteRetentionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeregisterMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) 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) @@ -3262,9 +3352,9 @@ func (m *awsAwsjson11_deserializeOpDeregisterMailDomain) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterMailDomain(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response, &metadata) } - output := &DeregisterMailDomainOutput{} + output := &DeleteRetentionPolicyOutput{} out.Result = output var buff [1024]byte @@ -3284,7 +3374,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterMailDomain) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeregisterMailDomainOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteRetentionPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3298,7 +3388,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterMailDomain) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeregisterMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(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)} @@ -3335,15 +3425,9 @@ func awsAwsjson11_deserializeOpErrorDeregisterMailDomain(response *smithyhttp.Re errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("InvalidCustomSesConfigurationException", errorCode): - return awsAwsjson11_deserializeErrorInvalidCustomSesConfigurationException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainInUseException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainInUseException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -3360,14 +3444,14 @@ func awsAwsjson11_deserializeOpErrorDeregisterMailDomain(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration struct { +type awsAwsjson11_deserializeOpDeleteUser struct { } -func (*awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration) ID() string { +func (*awsAwsjson11_deserializeOpDeleteUser) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteUser) 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) @@ -3385,9 +3469,9 @@ func (m *awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEmailMonitoringConfiguration(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteUser(response, &metadata) } - output := &DescribeEmailMonitoringConfigurationOutput{} + output := &DeleteUserOutput{} out.Result = output var buff [1024]byte @@ -3407,7 +3491,7 @@ func (m *awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration) HandleD return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeEmailMonitoringConfigurationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteUserOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3421,7 +3505,7 @@ func (m *awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration) HandleD return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeEmailMonitoringConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteUser(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)} @@ -3458,6 +3542,15 @@ func awsAwsjson11_deserializeOpErrorDescribeEmailMonitoringConfiguration(respons errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3467,8 +3560,8 @@ func awsAwsjson11_deserializeOpErrorDescribeEmailMonitoringConfiguration(respons case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3480,14 +3573,14 @@ func awsAwsjson11_deserializeOpErrorDescribeEmailMonitoringConfiguration(respons } } -type awsAwsjson11_deserializeOpDescribeEntity struct { +type awsAwsjson11_deserializeOpDeregisterFromWorkMail struct { } -func (*awsAwsjson11_deserializeOpDescribeEntity) ID() string { +func (*awsAwsjson11_deserializeOpDeregisterFromWorkMail) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeEntity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) 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) @@ -3505,9 +3598,9 @@ func (m *awsAwsjson11_deserializeOpDescribeEntity) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEntity(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response, &metadata) } - output := &DescribeEntityOutput{} + output := &DeregisterFromWorkMailOutput{} out.Result = output var buff [1024]byte @@ -3527,7 +3620,7 @@ func (m *awsAwsjson11_deserializeOpDescribeEntity) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeEntityOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeregisterFromWorkMailOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3541,7 +3634,7 @@ func (m *awsAwsjson11_deserializeOpDescribeEntity) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(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)} @@ -3581,6 +3674,9 @@ func awsAwsjson11_deserializeOpErrorDescribeEntity(response *smithyhttp.Response case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3600,14 +3696,14 @@ func awsAwsjson11_deserializeOpErrorDescribeEntity(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpDescribeGroup struct { +type awsAwsjson11_deserializeOpDeregisterMailDomain struct { } -func (*awsAwsjson11_deserializeOpDescribeGroup) ID() string { +func (*awsAwsjson11_deserializeOpDeregisterMailDomain) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeregisterMailDomain) 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) @@ -3625,9 +3721,9 @@ func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterMailDomain(response, &metadata) } - output := &DescribeGroupOutput{} + output := &DeregisterMailDomainOutput{} out.Result = output var buff [1024]byte @@ -3647,7 +3743,7 @@ func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeregisterMailDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3661,7 +3757,7 @@ func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeregisterMailDomain(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)} @@ -3698,12 +3794,15 @@ func awsAwsjson11_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidCustomSesConfigurationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidCustomSesConfigurationException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("MailDomainInUseException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainInUseException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -3720,14 +3819,14 @@ func awsAwsjson11_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpDescribeInboundDmarcSettings struct { +type awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration struct { } -func (*awsAwsjson11_deserializeOpDescribeInboundDmarcSettings) ID() string { +func (*awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeInboundDmarcSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeEmailMonitoringConfiguration) 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) @@ -3745,9 +3844,9 @@ func (m *awsAwsjson11_deserializeOpDescribeInboundDmarcSettings) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeInboundDmarcSettings(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEmailMonitoringConfiguration(response, &metadata) } - output := &DescribeInboundDmarcSettingsOutput{} + output := &DescribeEmailMonitoringConfigurationOutput{} out.Result = output var buff [1024]byte @@ -3767,7 +3866,7 @@ func (m *awsAwsjson11_deserializeOpDescribeInboundDmarcSettings) HandleDeseriali return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeInboundDmarcSettingsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeEmailMonitoringConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3781,7 +3880,7 @@ func (m *awsAwsjson11_deserializeOpDescribeInboundDmarcSettings) HandleDeseriali return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeInboundDmarcSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeEmailMonitoringConfiguration(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)} @@ -3818,12 +3917,18 @@ func awsAwsjson11_deserializeOpErrorDescribeInboundDmarcSettings(response *smith errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3834,14 +3939,14 @@ func awsAwsjson11_deserializeOpErrorDescribeInboundDmarcSettings(response *smith } } -type awsAwsjson11_deserializeOpDescribeMailboxExportJob struct { +type awsAwsjson11_deserializeOpDescribeEntity struct { } -func (*awsAwsjson11_deserializeOpDescribeMailboxExportJob) ID() string { +func (*awsAwsjson11_deserializeOpDescribeEntity) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeMailboxExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeEntity) 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) @@ -3859,9 +3964,9 @@ func (m *awsAwsjson11_deserializeOpDescribeMailboxExportJob) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeMailboxExportJob(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEntity(response, &metadata) } - output := &DescribeMailboxExportJobOutput{} + output := &DescribeEntityOutput{} out.Result = output var buff [1024]byte @@ -3881,7 +3986,7 @@ func (m *awsAwsjson11_deserializeOpDescribeMailboxExportJob) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeMailboxExportJobOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeEntityOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3895,7 +4000,7 @@ func (m *awsAwsjson11_deserializeOpDescribeMailboxExportJob) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeMailboxExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeEntity(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)} @@ -3954,14 +4059,14 @@ func awsAwsjson11_deserializeOpErrorDescribeMailboxExportJob(response *smithyhtt } } -type awsAwsjson11_deserializeOpDescribeOrganization struct { +type awsAwsjson11_deserializeOpDescribeGroup struct { } -func (*awsAwsjson11_deserializeOpDescribeOrganization) ID() string { +func (*awsAwsjson11_deserializeOpDescribeGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeGroup) 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) @@ -3979,9 +4084,9 @@ func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeOrganization(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeGroup(response, &metadata) } - output := &DescribeOrganizationOutput{} + output := &DescribeGroupOutput{} out.Result = output var buff [1024]byte @@ -4001,7 +4106,7 @@ func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4015,7 +4120,7 @@ func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeGroup(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)} @@ -4052,12 +4157,18 @@ func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Re errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4068,14 +4179,14 @@ func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpDescribeResource struct { +type awsAwsjson11_deserializeOpDescribeIdentityProviderConfiguration struct { } -func (*awsAwsjson11_deserializeOpDescribeResource) ID() string { +func (*awsAwsjson11_deserializeOpDescribeIdentityProviderConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeIdentityProviderConfiguration) 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) @@ -4093,9 +4204,9 @@ func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeIdentityProviderConfiguration(response, &metadata) } - output := &DescribeResourceOutput{} + output := &DescribeIdentityProviderConfigurationOutput{} out.Result = output var buff [1024]byte @@ -4115,7 +4226,7 @@ func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeIdentityProviderConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4129,7 +4240,7 @@ func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeIdentityProviderConfiguration(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)} @@ -4166,9 +4277,6 @@ func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Respon errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4178,8 +4286,8 @@ func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Respon case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4191,14 +4299,14 @@ func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpDescribeUser struct { +type awsAwsjson11_deserializeOpDescribeInboundDmarcSettings struct { } -func (*awsAwsjson11_deserializeOpDescribeUser) ID() string { +func (*awsAwsjson11_deserializeOpDescribeInboundDmarcSettings) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeInboundDmarcSettings) 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) @@ -4216,9 +4324,9 @@ func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeUser(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeInboundDmarcSettings(response, &metadata) } - output := &DescribeUserOutput{} + output := &DescribeInboundDmarcSettingsOutput{} out.Result = output var buff [1024]byte @@ -4238,7 +4346,7 @@ func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeUserOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeInboundDmarcSettingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4252,7 +4360,7 @@ func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeInboundDmarcSettings(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)} @@ -4289,12 +4397,6 @@ func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -4311,14 +4413,14 @@ func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpDisassociateDelegateFromResource struct { +type awsAwsjson11_deserializeOpDescribeMailboxExportJob struct { } -func (*awsAwsjson11_deserializeOpDisassociateDelegateFromResource) ID() string { +func (*awsAwsjson11_deserializeOpDescribeMailboxExportJob) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeMailboxExportJob) 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) @@ -4336,9 +4438,9 @@ func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeMailboxExportJob(response, &metadata) } - output := &DisassociateDelegateFromResourceOutput{} + output := &DescribeMailboxExportJobOutput{} out.Result = output var buff [1024]byte @@ -4358,7 +4460,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeser return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDisassociateDelegateFromResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeMailboxExportJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4372,7 +4474,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeser return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeMailboxExportJob(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)} @@ -4412,9 +4514,6 @@ func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response *s case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4424,9 +4523,6 @@ func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response *s case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4437,14 +4533,14 @@ func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response *s } } -type awsAwsjson11_deserializeOpDisassociateMemberFromGroup struct { +type awsAwsjson11_deserializeOpDescribeOrganization struct { } -func (*awsAwsjson11_deserializeOpDisassociateMemberFromGroup) ID() string { +func (*awsAwsjson11_deserializeOpDescribeOrganization) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeOrganization) 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) @@ -4462,9 +4558,9 @@ func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeOrganization(response, &metadata) } - output := &DisassociateMemberFromGroupOutput{} + output := &DescribeOrganizationOutput{} out.Result = output var buff [1024]byte @@ -4484,7 +4580,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDisassociateMemberFromGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4498,7 +4594,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeOrganization(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)} @@ -4535,30 +4631,12 @@ func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithy errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - case strings.EqualFold("OrganizationStateException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4569,14 +4647,14 @@ func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithy } } -type awsAwsjson11_deserializeOpGetAccessControlEffect struct { +type awsAwsjson11_deserializeOpDescribeResource struct { } -func (*awsAwsjson11_deserializeOpGetAccessControlEffect) ID() string { +func (*awsAwsjson11_deserializeOpDescribeResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetAccessControlEffect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeResource) 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) @@ -4594,9 +4672,9 @@ func (m *awsAwsjson11_deserializeOpGetAccessControlEffect) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResource(response, &metadata) } - output := &GetAccessControlEffectOutput{} + output := &DescribeResourceOutput{} out.Result = output var buff [1024]byte @@ -4616,7 +4694,7 @@ func (m *awsAwsjson11_deserializeOpGetAccessControlEffect) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetAccessControlEffectOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4630,7 +4708,7 @@ func (m *awsAwsjson11_deserializeOpGetAccessControlEffect) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeResource(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)} @@ -4679,8 +4757,8 @@ func awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response *smithyhttp. case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4692,14 +4770,14 @@ func awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response *smithyhttp. } } -type awsAwsjson11_deserializeOpGetDefaultRetentionPolicy struct { +type awsAwsjson11_deserializeOpDescribeUser struct { } -func (*awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpDescribeUser) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeUser) 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) @@ -4717,9 +4795,9 @@ func (m *awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeUser(response, &metadata) } - output := &GetDefaultRetentionPolicyOutput{} + output := &DescribeUserOutput{} out.Result = output var buff [1024]byte @@ -4739,7 +4817,7 @@ func (m *awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) HandleDeserialize( return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetDefaultRetentionPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeUserOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4753,7 +4831,7 @@ func (m *awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) HandleDeserialize( return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeUser(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)} @@ -4790,7 +4868,13 @@ func awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response *smithyht errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): @@ -4812,14 +4896,14 @@ func awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response *smithyht } } -type awsAwsjson11_deserializeOpGetImpersonationRole struct { +type awsAwsjson11_deserializeOpDisassociateDelegateFromResource struct { } -func (*awsAwsjson11_deserializeOpGetImpersonationRole) ID() string { +func (*awsAwsjson11_deserializeOpDisassociateDelegateFromResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4837,9 +4921,9 @@ func (m *awsAwsjson11_deserializeOpGetImpersonationRole) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetImpersonationRole(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response, &metadata) } - output := &GetImpersonationRoleOutput{} + output := &DisassociateDelegateFromResourceOutput{} out.Result = output var buff [1024]byte @@ -4859,7 +4943,7 @@ func (m *awsAwsjson11_deserializeOpGetImpersonationRole) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetImpersonationRoleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDisassociateDelegateFromResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4873,7 +4957,7 @@ func (m *awsAwsjson11_deserializeOpGetImpersonationRole) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetImpersonationRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(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)} @@ -4910,6 +4994,12 @@ func awsAwsjson11_deserializeOpErrorGetImpersonationRole(response *smithyhttp.Re errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -4919,8 +5009,8 @@ func awsAwsjson11_deserializeOpErrorGetImpersonationRole(response *smithyhttp.Re case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4932,14 +5022,14 @@ func awsAwsjson11_deserializeOpErrorGetImpersonationRole(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpGetImpersonationRoleEffect struct { +type awsAwsjson11_deserializeOpDisassociateMemberFromGroup struct { } -func (*awsAwsjson11_deserializeOpGetImpersonationRoleEffect) ID() string { +func (*awsAwsjson11_deserializeOpDisassociateMemberFromGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetImpersonationRoleEffect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) 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) @@ -4957,9 +5047,9 @@ func (m *awsAwsjson11_deserializeOpGetImpersonationRoleEffect) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response, &metadata) } - output := &GetImpersonationRoleEffectOutput{} + output := &DisassociateMemberFromGroupOutput{} out.Result = output var buff [1024]byte @@ -4979,7 +5069,7 @@ func (m *awsAwsjson11_deserializeOpGetImpersonationRoleEffect) HandleDeserialize return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetImpersonationRoleEffectOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDisassociateMemberFromGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4993,7 +5083,7 @@ func (m *awsAwsjson11_deserializeOpGetImpersonationRoleEffect) HandleDeserialize return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(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)} @@ -5030,6 +5120,12 @@ func awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response *smithyh errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) @@ -5045,8 +5141,8 @@ func awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response *smithyh case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5058,14 +5154,14 @@ func awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response *smithyh } } -type awsAwsjson11_deserializeOpGetMailboxDetails struct { +type awsAwsjson11_deserializeOpGetAccessControlEffect struct { } -func (*awsAwsjson11_deserializeOpGetMailboxDetails) ID() string { +func (*awsAwsjson11_deserializeOpGetAccessControlEffect) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetAccessControlEffect) 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) @@ -5083,9 +5179,9 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMailboxDetails(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response, &metadata) } - output := &GetMailboxDetailsOutput{} + output := &GetAccessControlEffectOutput{} out.Result = output var buff [1024]byte @@ -5105,7 +5201,7 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetAccessControlEffectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5119,7 +5215,7 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetAccessControlEffect(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)} @@ -5168,6 +5264,9 @@ func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Respo case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5178,14 +5277,14 @@ func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpGetMailDomain struct { +type awsAwsjson11_deserializeOpGetDefaultRetentionPolicy struct { } -func (*awsAwsjson11_deserializeOpGetMailDomain) ID() string { +func (*awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) 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) @@ -5203,9 +5302,9 @@ func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMailDomain(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response, &metadata) } - output := &GetMailDomainOutput{} + output := &GetDefaultRetentionPolicyOutput{} out.Result = output var buff [1024]byte @@ -5225,7 +5324,7 @@ func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMailDomainOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDefaultRetentionPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5239,7 +5338,7 @@ func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(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)} @@ -5276,12 +5375,12 @@ func awsAwsjson11_deserializeOpErrorGetMailDomain(response *smithyhttp.Response, errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -5298,14 +5397,14 @@ func awsAwsjson11_deserializeOpErrorGetMailDomain(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect struct { +type awsAwsjson11_deserializeOpGetImpersonationRole struct { } -func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) ID() string { +func (*awsAwsjson11_deserializeOpGetImpersonationRole) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetImpersonationRole) 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) @@ -5323,9 +5422,9 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetImpersonationRole(response, &metadata) } - output := &GetMobileDeviceAccessEffectOutput{} + output := &GetImpersonationRoleOutput{} out.Result = output var buff [1024]byte @@ -5345,7 +5444,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessEffectOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetImpersonationRoleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5359,7 +5458,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetImpersonationRole(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)} @@ -5405,6 +5504,9 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithy case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5415,14 +5517,14 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithy } } -type awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride struct { +type awsAwsjson11_deserializeOpGetImpersonationRoleEffect struct { } -func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) ID() string { +func (*awsAwsjson11_deserializeOpGetImpersonationRoleEffect) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetImpersonationRoleEffect) 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) @@ -5440,9 +5542,9 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response, &metadata) } - output := &GetMobileDeviceAccessOverrideOutput{} + output := &GetImpersonationRoleEffectOutput{} out.Result = output var buff [1024]byte @@ -5462,7 +5564,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessOverrideOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetImpersonationRoleEffectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5476,7 +5578,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(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)} @@ -5516,6 +5618,9 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response *smit case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -5538,14 +5643,14 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response *smit } } -type awsAwsjson11_deserializeOpListAccessControlRules struct { +type awsAwsjson11_deserializeOpGetMailboxDetails struct { } -func (*awsAwsjson11_deserializeOpListAccessControlRules) ID() string { +func (*awsAwsjson11_deserializeOpGetMailboxDetails) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMailboxDetails) 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) @@ -5563,9 +5668,9 @@ func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAccessControlRules(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMailboxDetails(response, &metadata) } - output := &ListAccessControlRulesOutput{} + output := &GetMailboxDetailsOutput{} out.Result = output var buff [1024]byte @@ -5585,7 +5690,7 @@ func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5599,7 +5704,7 @@ func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMailboxDetails(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)} @@ -5636,6 +5741,12 @@ func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp. errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -5652,14 +5763,14 @@ func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListAliases struct { +type awsAwsjson11_deserializeOpGetMailDomain struct { } -func (*awsAwsjson11_deserializeOpListAliases) ID() string { +func (*awsAwsjson11_deserializeOpGetMailDomain) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMailDomain) 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) @@ -5677,9 +5788,9 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMailDomain(response, &metadata) } - output := &ListAliasesOutput{} + output := &GetMailDomainOutput{} out.Result = output var buff [1024]byte @@ -5699,7 +5810,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMailDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5713,7 +5824,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMailDomain(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)} @@ -5750,15 +5861,12 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -5775,14 +5883,14 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpListAvailabilityConfigurations struct { +type awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect struct { } -func (*awsAwsjson11_deserializeOpListAvailabilityConfigurations) ID() string { +func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) 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) @@ -5800,9 +5908,9 @@ func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response, &metadata) } - output := &ListAvailabilityConfigurationsOutput{} + output := &GetMobileDeviceAccessEffectOutput{} out.Result = output var buff [1024]byte @@ -5822,7 +5930,7 @@ func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeseria return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAvailabilityConfigurationsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessEffectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5836,7 +5944,7 @@ func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeseria return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(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)} @@ -5873,6 +5981,9 @@ func awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response *smi errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -5889,14 +6000,14 @@ func awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response *smi } } -type awsAwsjson11_deserializeOpListGroupMembers struct { +type awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride struct { } -func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { +func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) 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) @@ -5914,9 +6025,9 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response, &metadata) } - output := &ListGroupMembersOutput{} + output := &GetMobileDeviceAccessOverrideOutput{} out.Result = output var buff [1024]byte @@ -5936,7 +6047,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessOverrideOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5950,7 +6061,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(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)} @@ -5990,9 +6101,6 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6002,6 +6110,9 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6012,14 +6123,14 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpListGroups struct { +type awsAwsjson11_deserializeOpGetPersonalAccessTokenMetadata struct { } -func (*awsAwsjson11_deserializeOpListGroups) ID() string { +func (*awsAwsjson11_deserializeOpGetPersonalAccessTokenMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetPersonalAccessTokenMetadata) 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) @@ -6037,9 +6148,9 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetPersonalAccessTokenMetadata(response, &metadata) } - output := &ListGroupsOutput{} + output := &GetPersonalAccessTokenMetadataOutput{} out.Result = output var buff [1024]byte @@ -6059,7 +6170,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetPersonalAccessTokenMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6073,7 +6184,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetPersonalAccessTokenMetadata(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)} @@ -6110,9 +6221,6 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6122,6 +6230,9 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6132,14 +6243,14 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpListGroupsForEntity struct { +type awsAwsjson11_deserializeOpListAccessControlRules struct { } -func (*awsAwsjson11_deserializeOpListGroupsForEntity) ID() string { +func (*awsAwsjson11_deserializeOpListAccessControlRules) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroupsForEntity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAccessControlRules) 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) @@ -6157,9 +6268,9 @@ func (m *awsAwsjson11_deserializeOpListGroupsForEntity) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroupsForEntity(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAccessControlRules(response, &metadata) } - output := &ListGroupsForEntityOutput{} + output := &ListAccessControlRulesOutput{} out.Result = output var buff [1024]byte @@ -6179,7 +6290,7 @@ func (m *awsAwsjson11_deserializeOpListGroupsForEntity) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupsForEntityOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6193,7 +6304,7 @@ func (m *awsAwsjson11_deserializeOpListGroupsForEntity) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroupsForEntity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAccessControlRules(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)} @@ -6230,15 +6341,6 @@ func awsAwsjson11_deserializeOpErrorListGroupsForEntity(response *smithyhttp.Res errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -6255,14 +6357,14 @@ func awsAwsjson11_deserializeOpErrorListGroupsForEntity(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpListImpersonationRoles struct { +type awsAwsjson11_deserializeOpListAliases struct { } -func (*awsAwsjson11_deserializeOpListImpersonationRoles) ID() string { +func (*awsAwsjson11_deserializeOpListAliases) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListImpersonationRoles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAliases) 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) @@ -6280,9 +6382,9 @@ func (m *awsAwsjson11_deserializeOpListImpersonationRoles) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListImpersonationRoles(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) } - output := &ListImpersonationRolesOutput{} + output := &ListAliasesOutput{} out.Result = output var buff [1024]byte @@ -6302,7 +6404,7 @@ func (m *awsAwsjson11_deserializeOpListImpersonationRoles) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListImpersonationRolesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6316,7 +6418,7 @@ func (m *awsAwsjson11_deserializeOpListImpersonationRoles) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListImpersonationRoles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAliases(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)} @@ -6353,6 +6455,12 @@ func awsAwsjson11_deserializeOpErrorListImpersonationRoles(response *smithyhttp. errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6372,14 +6480,14 @@ func awsAwsjson11_deserializeOpErrorListImpersonationRoles(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListMailboxExportJobs struct { +type awsAwsjson11_deserializeOpListAvailabilityConfigurations struct { } -func (*awsAwsjson11_deserializeOpListMailboxExportJobs) ID() string { +func (*awsAwsjson11_deserializeOpListAvailabilityConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) 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) @@ -6397,9 +6505,9 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response, &metadata) } - output := &ListMailboxExportJobsOutput{} + output := &ListAvailabilityConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -6419,7 +6527,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAvailabilityConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6433,7 +6541,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(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)} @@ -6489,14 +6597,14 @@ func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpListMailboxPermissions struct { +type awsAwsjson11_deserializeOpListGroupMembers struct { } -func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroupMembers) 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) @@ -6514,9 +6622,9 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) } - output := &ListMailboxPermissionsOutput{} + output := &ListGroupMembersOutput{} out.Result = output var buff [1024]byte @@ -6536,7 +6644,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6550,7 +6658,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroupMembers(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)} @@ -6590,6 +6698,9 @@ func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp. case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6609,14 +6720,14 @@ func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListMailDomains struct { +type awsAwsjson11_deserializeOpListGroups struct { } -func (*awsAwsjson11_deserializeOpListMailDomains) ID() string { +func (*awsAwsjson11_deserializeOpListGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroups) 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) @@ -6634,9 +6745,9 @@ func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailDomains(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) } - output := &ListMailDomainsOutput{} + output := &ListGroupsOutput{} out.Result = output var buff [1024]byte @@ -6656,7 +6767,7 @@ func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailDomainsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6670,7 +6781,7 @@ func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroups(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)} @@ -6707,6 +6818,9 @@ func awsAwsjson11_deserializeOpErrorListMailDomains(response *smithyhttp.Respons errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6726,14 +6840,14 @@ func awsAwsjson11_deserializeOpErrorListMailDomains(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides struct { +type awsAwsjson11_deserializeOpListGroupsForEntity struct { } -func (*awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) ID() string { +func (*awsAwsjson11_deserializeOpListGroupsForEntity) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroupsForEntity) 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) @@ -6751,9 +6865,9 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroupsForEntity(response, &metadata) } - output := &ListMobileDeviceAccessOverridesOutput{} + output := &ListGroupsForEntityOutput{} out.Result = output var buff [1024]byte @@ -6773,7 +6887,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessOverridesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupsForEntityOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6787,7 +6901,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroupsForEntity(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)} @@ -6827,6 +6941,9 @@ func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response *sm case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6846,14 +6963,14 @@ func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response *sm } } -type awsAwsjson11_deserializeOpListMobileDeviceAccessRules struct { +type awsAwsjson11_deserializeOpListImpersonationRoles struct { } -func (*awsAwsjson11_deserializeOpListMobileDeviceAccessRules) ID() string { +func (*awsAwsjson11_deserializeOpListImpersonationRoles) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListImpersonationRoles) 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) @@ -6871,9 +6988,9 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListImpersonationRoles(response, &metadata) } - output := &ListMobileDeviceAccessRulesOutput{} + output := &ListImpersonationRolesOutput{} out.Result = output var buff [1024]byte @@ -6893,7 +7010,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessRulesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListImpersonationRolesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6907,7 +7024,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListImpersonationRoles(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)} @@ -6963,14 +7080,14 @@ func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response *smithy } } -type awsAwsjson11_deserializeOpListOrganizations struct { +type awsAwsjson11_deserializeOpListMailboxExportJobs struct { } -func (*awsAwsjson11_deserializeOpListOrganizations) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxExportJobs) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) 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) @@ -6988,9 +7105,9 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOrganizations(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response, &metadata) } - output := &ListOrganizationsOutput{} + output := &ListMailboxExportJobsOutput{} out.Result = output var buff [1024]byte @@ -7010,7 +7127,7 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListOrganizationsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7024,7 +7141,7 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(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)} @@ -7064,6 +7181,12 @@ func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Respo case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7074,14 +7197,14 @@ func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListResourceDelegates struct { +type awsAwsjson11_deserializeOpListMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpListResourceDelegates) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxPermissions) 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) @@ -7099,9 +7222,9 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDelegates(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) } - output := &ListResourceDelegatesOutput{} + output := &ListMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -7121,7 +7244,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourceDelegatesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7135,7 +7258,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxPermissions(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)} @@ -7175,9 +7298,6 @@ func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.R case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -7187,9 +7307,6 @@ func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.R case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7200,14 +7317,14 @@ func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpListResources struct { +type awsAwsjson11_deserializeOpListMailDomains struct { } -func (*awsAwsjson11_deserializeOpListResources) ID() string { +func (*awsAwsjson11_deserializeOpListMailDomains) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailDomains) 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) @@ -7225,9 +7342,9 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResources(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailDomains(response, &metadata) } - output := &ListResourcesOutput{} + output := &ListMailDomainsOutput{} out.Result = output var buff [1024]byte @@ -7247,7 +7364,7 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourcesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailDomainsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7261,7 +7378,7 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailDomains(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)} @@ -7307,9 +7424,6 @@ func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7320,14 +7434,14 @@ func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) 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) @@ -7345,9 +7459,9 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListMobileDeviceAccessOverridesOutput{} out.Result = output var buff [1024]byte @@ -7367,7 +7481,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessOverridesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7381,7 +7495,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(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)} @@ -7418,8 +7532,17 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7431,14 +7554,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpListUsers struct { +type awsAwsjson11_deserializeOpListMobileDeviceAccessRules struct { } -func (*awsAwsjson11_deserializeOpListUsers) ID() string { +func (*awsAwsjson11_deserializeOpListMobileDeviceAccessRules) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) 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) @@ -7456,9 +7579,9 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListUsers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response, &metadata) } - output := &ListUsersOutput{} + output := &ListMobileDeviceAccessRulesOutput{} out.Result = output var buff [1024]byte @@ -7478,7 +7601,7 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListUsersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7492,7 +7615,7 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(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)} @@ -7548,14 +7671,14 @@ func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpPutAccessControlRule struct { +type awsAwsjson11_deserializeOpListOrganizations struct { } -func (*awsAwsjson11_deserializeOpPutAccessControlRule) ID() string { +func (*awsAwsjson11_deserializeOpListOrganizations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListOrganizations) 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) @@ -7573,9 +7696,9 @@ func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutAccessControlRule(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListOrganizations(response, &metadata) } - output := &PutAccessControlRuleOutput{} + output := &ListOrganizationsOutput{} out.Result = output var buff [1024]byte @@ -7595,7 +7718,7 @@ func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutAccessControlRuleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListOrganizationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7609,7 +7732,7 @@ func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListOrganizations(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)} @@ -7646,24 +7769,9 @@ func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Re errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("OrganizationNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - - case strings.EqualFold("OrganizationStateException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7674,14 +7782,14 @@ func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration struct { +type awsAwsjson11_deserializeOpListPersonalAccessTokens struct { } -func (*awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) ID() string { +func (*awsAwsjson11_deserializeOpListPersonalAccessTokens) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListPersonalAccessTokens) 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) @@ -7699,9 +7807,9 @@ func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListPersonalAccessTokens(response, &metadata) } - output := &PutEmailMonitoringConfigurationOutput{} + output := &ListPersonalAccessTokensOutput{} out.Result = output var buff [1024]byte @@ -7721,7 +7829,7 @@ func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutEmailMonitoringConfigurationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListPersonalAccessTokensOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7735,7 +7843,7 @@ func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListPersonalAccessTokens(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)} @@ -7772,6 +7880,12 @@ func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *sm errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -7781,9 +7895,6 @@ func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *sm case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7794,14 +7905,14 @@ func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *sm } } -type awsAwsjson11_deserializeOpPutInboundDmarcSettings struct { +type awsAwsjson11_deserializeOpListResourceDelegates struct { } -func (*awsAwsjson11_deserializeOpPutInboundDmarcSettings) ID() string { +func (*awsAwsjson11_deserializeOpListResourceDelegates) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResourceDelegates) 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) @@ -7819,9 +7930,9 @@ func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDelegates(response, &metadata) } - output := &PutInboundDmarcSettingsOutput{} + output := &ListResourceDelegatesOutput{} out.Result = output var buff [1024]byte @@ -7841,7 +7952,7 @@ func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutInboundDmarcSettingsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourceDelegatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7855,7 +7966,7 @@ func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResourceDelegates(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)} @@ -7892,12 +8003,24 @@ func awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response *smithyhttp errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7908,7 +8031,835 @@ func awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response *smithyhttp } } -type awsAwsjson11_deserializeOpPutMailboxPermissions struct { +type awsAwsjson11_deserializeOpListResources struct { +} + +func (*awsAwsjson11_deserializeOpListResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListResources) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListResources(response, &metadata) + } + output := &ListResourcesOutput{} + 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_deserializeOpDocumentListResourcesOutput(&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_deserializeOpErrorListResources(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListUsers struct { +} + +func (*awsAwsjson11_deserializeOpListUsers) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListUsers(response, &metadata) + } + output := &ListUsersOutput{} + 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_deserializeOpDocumentListUsersOutput(&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_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutAccessControlRule struct { +} + +func (*awsAwsjson11_deserializeOpPutAccessControlRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutAccessControlRule) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorPutAccessControlRule(response, &metadata) + } + output := &PutAccessControlRuleOutput{} + 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_deserializeOpDocumentPutAccessControlRuleOutput(&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_deserializeOpErrorPutAccessControlRule(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration struct { +} + +func (*awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorPutEmailMonitoringConfiguration(response, &metadata) + } + output := &PutEmailMonitoringConfigurationOutput{} + 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_deserializeOpDocumentPutEmailMonitoringConfigurationOutput(&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_deserializeOpErrorPutEmailMonitoringConfiguration(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutIdentityProviderConfiguration struct { +} + +func (*awsAwsjson11_deserializeOpPutIdentityProviderConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutIdentityProviderConfiguration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorPutIdentityProviderConfiguration(response, &metadata) + } + output := &PutIdentityProviderConfigurationOutput{} + 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_deserializeOpDocumentPutIdentityProviderConfigurationOutput(&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_deserializeOpErrorPutIdentityProviderConfiguration(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutInboundDmarcSettings struct { +} + +func (*awsAwsjson11_deserializeOpPutInboundDmarcSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorPutInboundDmarcSettings(response, &metadata) + } + output := &PutInboundDmarcSettingsOutput{} + 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_deserializeOpDocumentPutInboundDmarcSettingsOutput(&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_deserializeOpErrorPutInboundDmarcSettings(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutMailboxPermissions struct { } func (*awsAwsjson11_deserializeOpPutMailboxPermissions) ID() string { @@ -12407,6 +13358,55 @@ func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) return nil } +func awsAwsjson11_deserializeDocumentIdentityCenterConfiguration(v **types.IdentityCenterConfiguration, 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.IdentityCenterConfiguration + if *v == nil { + sv = &types.IdentityCenterConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationArn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + case "InstanceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceArn to be of type string, got %T instead", value) + } + sv.InstanceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentImpersonationMatchedRule(v **types.ImpersonationMatchedRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14156,7 +15156,131 @@ func awsAwsjson11_deserializeDocumentOrganizationSummary(v **types.OrganizationS return nil } -func awsAwsjson11_deserializeDocumentPermission(v **types.Permission, value interface{}) error { +func awsAwsjson11_deserializeDocumentPermission(v **types.Permission, 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.Permission + if *v == nil { + sv = &types.Permission{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GranteeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.GranteeId = ptr.String(jtv) + } + + case "GranteeType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MemberType to be of type string, got %T instead", value) + } + sv.GranteeType = types.MemberType(jtv) + } + + case "PermissionValues": + if err := awsAwsjson11_deserializeDocumentPermissionValues(&sv.PermissionValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPermissions(v *[]types.Permission, 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.Permission + if *v == nil { + cv = []types.Permission{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Permission + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPermission(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPermissionValues(v *[]types.PermissionType, 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.PermissionType + if *v == nil { + cv = []types.PermissionType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PermissionType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PermissionType to be of type string, got %T instead", value) + } + col = types.PermissionType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPersonalAccessTokenConfiguration(v **types.PersonalAccessTokenConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14169,36 +15293,35 @@ func awsAwsjson11_deserializeDocumentPermission(v **types.Permission, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Permission + var sv *types.PersonalAccessTokenConfiguration if *v == nil { - sv = &types.Permission{} + sv = &types.PersonalAccessTokenConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "GranteeId": + case "LifetimeInDays": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + return fmt.Errorf("expected PersonalAccessTokenLifetimeInDays to be json.Number, got %T instead", value) } - sv.GranteeId = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LifetimeInDays = ptr.Int32(int32(i64)) } - case "GranteeType": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MemberType to be of type string, got %T instead", value) + return fmt.Errorf("expected PersonalAccessTokenConfigurationStatus to be of type string, got %T instead", value) } - sv.GranteeType = types.MemberType(jtv) - } - - case "PermissionValues": - if err := awsAwsjson11_deserializeDocumentPermissionValues(&sv.PermissionValues, value); err != nil { - return err + sv.Status = types.PersonalAccessTokenConfigurationStatus(jtv) } default: @@ -14210,7 +15333,7 @@ func awsAwsjson11_deserializeDocumentPermission(v **types.Permission, value inte return nil } -func awsAwsjson11_deserializeDocumentPermissions(v *[]types.Permission, value interface{}) error { +func awsAwsjson11_deserializeDocumentPersonalAccessTokenScopeList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14223,20 +15346,22 @@ func awsAwsjson11_deserializeDocumentPermissions(v *[]types.Permission, value in return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Permission + var cv []string if *v == nil { - cv = []types.Permission{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.Permission - destAddr := &col - if err := awsAwsjson11_deserializeDocumentPermission(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PersonalAccessTokenScope to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -14244,7 +15369,118 @@ func awsAwsjson11_deserializeDocumentPermissions(v *[]types.Permission, value in return nil } -func awsAwsjson11_deserializeDocumentPermissionValues(v *[]types.PermissionType, value interface{}) error { +func awsAwsjson11_deserializeDocumentPersonalAccessTokenSummary(v **types.PersonalAccessTokenSummary, 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.PersonalAccessTokenSummary + if *v == nil { + sv = &types.PersonalAccessTokenSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DateCreated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateCreated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DateLastUsed": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateLastUsed = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "ExpiresTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpiresTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PersonalAccessTokenName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "PersonalAccessTokenId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PersonalAccessTokenId to be of type string, got %T instead", value) + } + sv.PersonalAccessTokenId = ptr.String(jtv) + } + + case "Scopes": + if err := awsAwsjson11_deserializeDocumentPersonalAccessTokenScopeList(&sv.Scopes, value); err != nil { + return err + } + + case "UserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.UserId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPersonalAccessTokenSummaryList(v *[]types.PersonalAccessTokenSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14257,22 +15493,20 @@ func awsAwsjson11_deserializeDocumentPermissionValues(v *[]types.PermissionType, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PermissionType + var cv []types.PersonalAccessTokenSummary if *v == nil { - cv = []types.PermissionType{} + cv = []types.PersonalAccessTokenSummary{} } else { cv = *v } for _, value := range shape { - var col types.PermissionType - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PermissionType to be of type string, got %T instead", value) - } - col = types.PermissionType(jtv) + var col types.PersonalAccessTokenSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPersonalAccessTokenSummary(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -14874,6 +16108,24 @@ func awsAwsjson11_deserializeDocumentUser(v **types.User, value interface{}) err sv.Id = ptr.String(jtv) } + case "IdentityProviderIdentityStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityProviderIdentityStoreId to be of type string, got %T instead", value) + } + sv.IdentityProviderIdentityStoreId = ptr.String(jtv) + } + + case "IdentityProviderUserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityProviderUserId to be of type string, got %T instead", value) + } + sv.IdentityProviderUserId = ptr.String(jtv) + } + case "Name": if value != nil { jtv, ok := value.(string) @@ -15228,6 +16480,46 @@ func awsAwsjson11_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, return nil } +func awsAwsjson11_deserializeOpDocumentCreateIdentityCenterApplicationOutput(v **CreateIdentityCenterApplicationOutput, 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 *CreateIdentityCenterApplicationOutput + if *v == nil { + sv = &CreateIdentityCenterApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationArn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateImpersonationRoleOutput(v **CreateImpersonationRoleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15503,9 +16795,71 @@ func awsAwsjson11_deserializeOpDocumentDeleteAvailabilityConfigurationOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteAvailabilityConfigurationOutput + var sv *DeleteAvailabilityConfigurationOutput + if *v == nil { + sv = &DeleteAvailabilityConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteEmailMonitoringConfigurationOutput(v **DeleteEmailMonitoringConfigurationOutput, 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 *DeleteEmailMonitoringConfigurationOutput + if *v == nil { + sv = &DeleteEmailMonitoringConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, 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 *DeleteGroupOutput if *v == nil { - sv = &DeleteAvailabilityConfigurationOutput{} + sv = &DeleteGroupOutput{} } else { sv = *v } @@ -15521,7 +16875,7 @@ func awsAwsjson11_deserializeOpDocumentDeleteAvailabilityConfigurationOutput(v * return nil } -func awsAwsjson11_deserializeOpDocumentDeleteEmailMonitoringConfigurationOutput(v **DeleteEmailMonitoringConfigurationOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteIdentityCenterApplicationOutput(v **DeleteIdentityCenterApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15534,9 +16888,9 @@ func awsAwsjson11_deserializeOpDocumentDeleteEmailMonitoringConfigurationOutput( return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteEmailMonitoringConfigurationOutput + var sv *DeleteIdentityCenterApplicationOutput if *v == nil { - sv = &DeleteEmailMonitoringConfigurationOutput{} + sv = &DeleteIdentityCenterApplicationOutput{} } else { sv = *v } @@ -15552,7 +16906,7 @@ func awsAwsjson11_deserializeOpDocumentDeleteEmailMonitoringConfigurationOutput( return nil } -func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteIdentityProviderConfigurationOutput(v **DeleteIdentityProviderConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15565,9 +16919,9 @@ func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteGroupOutput + var sv *DeleteIdentityProviderConfigurationOutput if *v == nil { - sv = &DeleteGroupOutput{} + sv = &DeleteIdentityProviderConfigurationOutput{} } else { sv = *v } @@ -15756,6 +17110,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteOrganizationOutput(v **DeleteOrgani return nil } +func awsAwsjson11_deserializeOpDocumentDeletePersonalAccessTokenOutput(v **DeletePersonalAccessTokenOutput, 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 *DeletePersonalAccessTokenOutput + if *v == nil { + sv = &DeletePersonalAccessTokenOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(v **DeleteResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16126,6 +17511,56 @@ func awsAwsjson11_deserializeOpDocumentDescribeGroupOutput(v **DescribeGroupOutp return nil } +func awsAwsjson11_deserializeOpDocumentDescribeIdentityProviderConfigurationOutput(v **DescribeIdentityProviderConfigurationOutput, 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 *DescribeIdentityProviderConfigurationOutput + if *v == nil { + sv = &DescribeIdentityProviderConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AuthenticationMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityProviderAuthenticationMode to be of type string, got %T instead", value) + } + sv.AuthenticationMode = types.IdentityProviderAuthenticationMode(jtv) + } + + case "IdentityCenterConfiguration": + if err := awsAwsjson11_deserializeDocumentIdentityCenterConfiguration(&sv.IdentityCenterConfiguration, value); err != nil { + return err + } + + case "PersonalAccessTokenConfiguration": + if err := awsAwsjson11_deserializeDocumentPersonalAccessTokenConfiguration(&sv.PersonalAccessTokenConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeInboundDmarcSettingsOutput(v **DescribeInboundDmarcSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16717,6 +18152,24 @@ func awsAwsjson11_deserializeOpDocumentDescribeUserOutput(v **DescribeUserOutput sv.HiddenFromGlobalAddressList = jtv } + case "IdentityProviderIdentityStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityProviderIdentityStoreId to be of type string, got %T instead", value) + } + sv.IdentityProviderIdentityStoreId = ptr.String(jtv) + } + + case "IdentityProviderUserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdentityProviderUserId to be of type string, got %T instead", value) + } + sv.IdentityProviderUserId = ptr.String(jtv) + } + case "Initials": if value != nil { jtv, ok := value.(string) @@ -17479,6 +18932,117 @@ func awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessOverrideOutput(v **G return nil } +func awsAwsjson11_deserializeOpDocumentGetPersonalAccessTokenMetadataOutput(v **GetPersonalAccessTokenMetadataOutput, 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 *GetPersonalAccessTokenMetadataOutput + if *v == nil { + sv = &GetPersonalAccessTokenMetadataOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DateCreated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateCreated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DateLastUsed": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateLastUsed = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "ExpiresTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpiresTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PersonalAccessTokenName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "PersonalAccessTokenId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PersonalAccessTokenId to be of type string, got %T instead", value) + } + sv.PersonalAccessTokenId = ptr.String(jtv) + } + + case "Scopes": + if err := awsAwsjson11_deserializeDocumentPersonalAccessTokenScopeList(&sv.Scopes, value); err != nil { + return err + } + + case "UserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.UserId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(v **ListAccessControlRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18046,6 +19610,51 @@ func awsAwsjson11_deserializeOpDocumentListOrganizationsOutput(v **ListOrganizat return nil } +func awsAwsjson11_deserializeOpDocumentListPersonalAccessTokensOutput(v **ListPersonalAccessTokensOutput, 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 *ListPersonalAccessTokensOutput + if *v == nil { + sv = &ListPersonalAccessTokensOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "PersonalAccessTokenSummaries": + if err := awsAwsjson11_deserializeDocumentPersonalAccessTokenSummaryList(&sv.PersonalAccessTokenSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListResourceDelegatesOutput(v **ListResourceDelegatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18279,6 +19888,37 @@ func awsAwsjson11_deserializeOpDocumentPutEmailMonitoringConfigurationOutput(v * return nil } +func awsAwsjson11_deserializeOpDocumentPutIdentityProviderConfigurationOutput(v **PutIdentityProviderConfigurationOutput, 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 *PutIdentityProviderConfigurationOutput + if *v == nil { + sv = &PutIdentityProviderConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentPutInboundDmarcSettingsOutput(v **PutInboundDmarcSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/workmail/endpoints.go b/service/workmail/endpoints.go index 26864ece41d..8362d5225e3 100644 --- a/service/workmail/endpoints.go +++ b/service/workmail/endpoints.go @@ -385,7 +385,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://workmail-fips.") diff --git a/service/workmail/generated.json b/service/workmail/generated.json index a03a6e8c607..f99053326e4 100644 --- a/service/workmail/generated.json +++ b/service/workmail/generated.json @@ -15,6 +15,7 @@ "api_op_CreateAlias.go", "api_op_CreateAvailabilityConfiguration.go", "api_op_CreateGroup.go", + "api_op_CreateIdentityCenterApplication.go", "api_op_CreateImpersonationRole.go", "api_op_CreateMobileDeviceAccessRule.go", "api_op_CreateOrganization.go", @@ -25,11 +26,14 @@ "api_op_DeleteAvailabilityConfiguration.go", "api_op_DeleteEmailMonitoringConfiguration.go", "api_op_DeleteGroup.go", + "api_op_DeleteIdentityCenterApplication.go", + "api_op_DeleteIdentityProviderConfiguration.go", "api_op_DeleteImpersonationRole.go", "api_op_DeleteMailboxPermissions.go", "api_op_DeleteMobileDeviceAccessOverride.go", "api_op_DeleteMobileDeviceAccessRule.go", "api_op_DeleteOrganization.go", + "api_op_DeletePersonalAccessToken.go", "api_op_DeleteResource.go", "api_op_DeleteRetentionPolicy.go", "api_op_DeleteUser.go", @@ -38,6 +42,7 @@ "api_op_DescribeEmailMonitoringConfiguration.go", "api_op_DescribeEntity.go", "api_op_DescribeGroup.go", + "api_op_DescribeIdentityProviderConfiguration.go", "api_op_DescribeInboundDmarcSettings.go", "api_op_DescribeMailboxExportJob.go", "api_op_DescribeOrganization.go", @@ -53,6 +58,7 @@ "api_op_GetMailboxDetails.go", "api_op_GetMobileDeviceAccessEffect.go", "api_op_GetMobileDeviceAccessOverride.go", + "api_op_GetPersonalAccessTokenMetadata.go", "api_op_ListAccessControlRules.go", "api_op_ListAliases.go", "api_op_ListAvailabilityConfigurations.go", @@ -66,12 +72,14 @@ "api_op_ListMobileDeviceAccessOverrides.go", "api_op_ListMobileDeviceAccessRules.go", "api_op_ListOrganizations.go", + "api_op_ListPersonalAccessTokens.go", "api_op_ListResourceDelegates.go", "api_op_ListResources.go", "api_op_ListTagsForResource.go", "api_op_ListUsers.go", "api_op_PutAccessControlRule.go", "api_op_PutEmailMonitoringConfiguration.go", + "api_op_PutIdentityProviderConfiguration.go", "api_op_PutInboundDmarcSettings.go", "api_op_PutMailboxPermissions.go", "api_op_PutMobileDeviceAccessOverride.go", diff --git a/service/workmail/serializers.go b/service/workmail/serializers.go index d21345762e9..5cfc4f2a441 100644 --- a/service/workmail/serializers.go +++ b/service/workmail/serializers.go @@ -443,6 +443,67 @@ func (m *awsAwsjson11_serializeOpCreateGroup) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateIdentityCenterApplication struct { +} + +func (*awsAwsjson11_serializeOpCreateIdentityCenterApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateIdentityCenterApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*CreateIdentityCenterApplicationInput) + _ = 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("WorkMailService.CreateIdentityCenterApplication") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateIdentityCenterApplicationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateImpersonationRole struct { } @@ -1053,6 +1114,128 @@ func (m *awsAwsjson11_serializeOpDeleteGroup) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteIdentityCenterApplication struct { +} + +func (*awsAwsjson11_serializeOpDeleteIdentityCenterApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteIdentityCenterApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteIdentityCenterApplicationInput) + _ = 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("WorkMailService.DeleteIdentityCenterApplication") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteIdentityCenterApplicationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpDeleteIdentityProviderConfiguration struct { +} + +func (*awsAwsjson11_serializeOpDeleteIdentityProviderConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteIdentityProviderConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeleteIdentityProviderConfigurationInput) + _ = 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("WorkMailService.DeleteIdentityProviderConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteIdentityProviderConfigurationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteImpersonationRole struct { } @@ -1358,6 +1541,67 @@ func (m *awsAwsjson11_serializeOpDeleteOrganization) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeletePersonalAccessToken struct { +} + +func (*awsAwsjson11_serializeOpDeletePersonalAccessToken) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeletePersonalAccessToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DeletePersonalAccessTokenInput) + _ = 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("WorkMailService.DeletePersonalAccessToken") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeletePersonalAccessTokenInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteResource struct { } @@ -1846,6 +2090,67 @@ func (m *awsAwsjson11_serializeOpDescribeGroup) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeIdentityProviderConfiguration struct { +} + +func (*awsAwsjson11_serializeOpDescribeIdentityProviderConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeIdentityProviderConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*DescribeIdentityProviderConfigurationInput) + _ = 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("WorkMailService.DescribeIdentityProviderConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeIdentityProviderConfigurationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribeInboundDmarcSettings struct { } @@ -2761,6 +3066,67 @@ func (m *awsAwsjson11_serializeOpGetMobileDeviceAccessOverride) HandleSerialize( return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetPersonalAccessTokenMetadata struct { +} + +func (*awsAwsjson11_serializeOpGetPersonalAccessTokenMetadata) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetPersonalAccessTokenMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*GetPersonalAccessTokenMetadataInput) + _ = 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("WorkMailService.GetPersonalAccessTokenMetadata") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetPersonalAccessTokenMetadataInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListAccessControlRules struct { } @@ -3252,11 +3618,72 @@ func (m *awsAwsjson11_serializeOpListMailboxExportJobs) HandleSerialize(ctx cont type awsAwsjson11_serializeOpListMailboxPermissions struct { } -func (*awsAwsjson11_serializeOpListMailboxPermissions) ID() string { +func (*awsAwsjson11_serializeOpListMailboxPermissions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*ListMailboxPermissionsInput) + _ = 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("WorkMailService.ListMailboxPermissions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListMailboxPermissionsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListMailDomains struct { +} + +func (*awsAwsjson11_serializeOpListMailDomains) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListMailDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3268,7 +3695,7 @@ func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMailboxPermissionsInput) + input, ok := in.Parameters.(*ListMailDomainsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3289,10 +3716,10 @@ func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailboxPermissions") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailDomains") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMailboxPermissionsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListMailDomainsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3310,14 +3737,14 @@ func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListMailDomains struct { +type awsAwsjson11_serializeOpListMobileDeviceAccessOverrides struct { } -func (*awsAwsjson11_serializeOpListMailDomains) ID() string { +func (*awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMailDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3329,7 +3756,7 @@ func (m *awsAwsjson11_serializeOpListMailDomains) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMailDomainsInput) + input, ok := in.Parameters.(*ListMobileDeviceAccessOverridesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3350,10 +3777,10 @@ func (m *awsAwsjson11_serializeOpListMailDomains) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailDomains") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMobileDeviceAccessOverrides") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMailDomainsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListMobileDeviceAccessOverridesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3371,14 +3798,14 @@ func (m *awsAwsjson11_serializeOpListMailDomains) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListMobileDeviceAccessOverrides struct { +type awsAwsjson11_serializeOpListMobileDeviceAccessRules struct { } -func (*awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) ID() string { +func (*awsAwsjson11_serializeOpListMobileDeviceAccessRules) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListMobileDeviceAccessRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3390,7 +3817,7 @@ func (m *awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) HandleSerializ return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMobileDeviceAccessOverridesInput) + input, ok := in.Parameters.(*ListMobileDeviceAccessRulesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3411,10 +3838,10 @@ func (m *awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) HandleSerializ return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMobileDeviceAccessOverrides") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMobileDeviceAccessRules") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMobileDeviceAccessOverridesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListMobileDeviceAccessRulesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3432,14 +3859,14 @@ func (m *awsAwsjson11_serializeOpListMobileDeviceAccessOverrides) HandleSerializ return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListMobileDeviceAccessRules struct { +type awsAwsjson11_serializeOpListOrganizations struct { } -func (*awsAwsjson11_serializeOpListMobileDeviceAccessRules) ID() string { +func (*awsAwsjson11_serializeOpListOrganizations) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMobileDeviceAccessRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3451,7 +3878,7 @@ func (m *awsAwsjson11_serializeOpListMobileDeviceAccessRules) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMobileDeviceAccessRulesInput) + input, ok := in.Parameters.(*ListOrganizationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3472,10 +3899,10 @@ func (m *awsAwsjson11_serializeOpListMobileDeviceAccessRules) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMobileDeviceAccessRules") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListOrganizations") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMobileDeviceAccessRulesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListOrganizationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3493,14 +3920,14 @@ func (m *awsAwsjson11_serializeOpListMobileDeviceAccessRules) HandleSerialize(ct return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListOrganizations struct { +type awsAwsjson11_serializeOpListPersonalAccessTokens struct { } -func (*awsAwsjson11_serializeOpListOrganizations) ID() string { +func (*awsAwsjson11_serializeOpListPersonalAccessTokens) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListPersonalAccessTokens) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3512,7 +3939,7 @@ func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListOrganizationsInput) + input, ok := in.Parameters.(*ListPersonalAccessTokensInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3533,10 +3960,10 @@ func (m *awsAwsjson11_serializeOpListOrganizations) 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("WorkMailService.ListOrganizations") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListPersonalAccessTokens") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListOrganizationsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListPersonalAccessTokensInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3920,6 +4347,67 @@ func (m *awsAwsjson11_serializeOpPutEmailMonitoringConfiguration) HandleSerializ return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpPutIdentityProviderConfiguration struct { +} + +func (*awsAwsjson11_serializeOpPutIdentityProviderConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutIdentityProviderConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + 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.(*PutIdentityProviderConfigurationInput) + _ = 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("WorkMailService.PutIdentityProviderConfiguration") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutIdentityProviderConfigurationInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpPutInboundDmarcSettings struct { } @@ -5303,6 +5791,23 @@ func awsAwsjson11_serializeDocumentFolderConfigurations(v []types.FolderConfigur return nil } +func awsAwsjson11_serializeDocumentIdentityCenterConfiguration(v *types.IdentityCenterConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationArn != nil { + ok := object.Key("ApplicationArn") + ok.String(*v.ApplicationArn) + } + + if v.InstanceArn != nil { + ok := object.Key("InstanceArn") + ok.String(*v.InstanceArn) + } + + return nil +} + func awsAwsjson11_serializeDocumentImpersonationRoleIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5456,6 +5961,11 @@ func awsAwsjson11_serializeDocumentListUsersFilters(v *types.ListUsersFilters, v ok.String(*v.DisplayNamePrefix) } + if v.IdentityProviderUserIdPrefix != nil { + ok := object.Key("IdentityProviderUserIdPrefix") + ok.String(*v.IdentityProviderUserIdPrefix) + } + if v.PrimaryEmailPrefix != nil { ok := object.Key("PrimaryEmailPrefix") ok.String(*v.PrimaryEmailPrefix) @@ -5485,6 +5995,23 @@ func awsAwsjson11_serializeDocumentPermissionValues(v []types.PermissionType, va return nil } +func awsAwsjson11_serializeDocumentPersonalAccessTokenConfiguration(v *types.PersonalAccessTokenConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LifetimeInDays != nil { + ok := object.Key("LifetimeInDays") + ok.Integer(*v.LifetimeInDays) + } + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + return nil +} + func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5711,6 +6238,28 @@ func awsAwsjson11_serializeOpDocumentCreateGroupInput(v *CreateGroupInput, value return nil } +func awsAwsjson11_serializeOpDocumentCreateIdentityCenterApplicationInput(v *CreateIdentityCenterApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.InstanceArn != nil { + ok := object.Key("InstanceArn") + ok.String(*v.InstanceArn) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateImpersonationRoleInput(v *CreateImpersonationRoleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5928,6 +6477,11 @@ func awsAwsjson11_serializeOpDocumentCreateUserInput(v *CreateUserInput, value s ok.Boolean(v.HiddenFromGlobalAddressList) } + if v.IdentityProviderUserId != nil { + ok := object.Key("IdentityProviderUserId") + ok.String(*v.IdentityProviderUserId) + } + if v.LastName != nil { ok := object.Key("LastName") ok.String(*v.LastName) @@ -6041,6 +6595,30 @@ func awsAwsjson11_serializeOpDocumentDeleteGroupInput(v *DeleteGroupInput, value return nil } +func awsAwsjson11_serializeOpDocumentDeleteIdentityCenterApplicationInput(v *DeleteIdentityCenterApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationArn != nil { + ok := object.Key("ApplicationArn") + ok.String(*v.ApplicationArn) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteIdentityProviderConfigurationInput(v *DeleteIdentityProviderConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteImpersonationRoleInput(v *DeleteImpersonationRoleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6133,6 +6711,11 @@ func awsAwsjson11_serializeOpDocumentDeleteOrganizationInput(v *DeleteOrganizati ok.Boolean(v.DeleteDirectory) } + if v.DeleteIdentityCenterApplication { + ok := object.Key("DeleteIdentityCenterApplication") + ok.Boolean(v.DeleteIdentityCenterApplication) + } + if v.ForceDelete { ok := object.Key("ForceDelete") ok.Boolean(v.ForceDelete) @@ -6146,6 +6729,23 @@ func awsAwsjson11_serializeOpDocumentDeleteOrganizationInput(v *DeleteOrganizati return nil } +func awsAwsjson11_serializeOpDocumentDeletePersonalAccessTokenInput(v *DeletePersonalAccessTokenInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.PersonalAccessTokenId != nil { + ok := object.Key("PersonalAccessTokenId") + ok.String(*v.PersonalAccessTokenId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteResourceInput(v *DeleteResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6277,6 +6877,18 @@ func awsAwsjson11_serializeOpDocumentDescribeGroupInput(v *DescribeGroupInput, v return nil } +func awsAwsjson11_serializeOpDocumentDescribeIdentityProviderConfigurationInput(v *DescribeIdentityProviderConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeInboundDmarcSettingsInput(v *DescribeInboundDmarcSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6567,6 +7179,23 @@ func awsAwsjson11_serializeOpDocumentGetMobileDeviceAccessOverrideInput(v *GetMo return nil } +func awsAwsjson11_serializeOpDocumentGetPersonalAccessTokenMetadataInput(v *GetPersonalAccessTokenMetadataInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.PersonalAccessTokenId != nil { + ok := object.Key("PersonalAccessTokenId") + ok.String(*v.PersonalAccessTokenId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListAccessControlRulesInput(v *ListAccessControlRulesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6872,6 +7501,33 @@ func awsAwsjson11_serializeOpDocumentListOrganizationsInput(v *ListOrganizations return nil } +func awsAwsjson11_serializeOpDocumentListPersonalAccessTokensInput(v *ListPersonalAccessTokensInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.UserId != nil { + ok := object.Key("UserId") + ok.String(*v.UserId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListResourceDelegatesInput(v *ListResourceDelegatesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7074,6 +7730,37 @@ func awsAwsjson11_serializeOpDocumentPutEmailMonitoringConfigurationInput(v *Put return nil } +func awsAwsjson11_serializeOpDocumentPutIdentityProviderConfigurationInput(v *PutIdentityProviderConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AuthenticationMode) > 0 { + ok := object.Key("AuthenticationMode") + ok.String(string(v.AuthenticationMode)) + } + + if v.IdentityCenterConfiguration != nil { + ok := object.Key("IdentityCenterConfiguration") + if err := awsAwsjson11_serializeDocumentIdentityCenterConfiguration(v.IdentityCenterConfiguration, ok); err != nil { + return err + } + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.PersonalAccessTokenConfiguration != nil { + ok := object.Key("PersonalAccessTokenConfiguration") + if err := awsAwsjson11_serializeDocumentPersonalAccessTokenConfiguration(v.PersonalAccessTokenConfiguration, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentPutInboundDmarcSettingsInput(v *PutInboundDmarcSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7692,6 +8379,11 @@ func awsAwsjson11_serializeOpDocumentUpdateUserInput(v *UpdateUserInput, value s ok.Boolean(*v.HiddenFromGlobalAddressList) } + if v.IdentityProviderUserId != nil { + ok := object.Key("IdentityProviderUserId") + ok.String(*v.IdentityProviderUserId) + } + if v.Initials != nil { ok := object.Key("Initials") ok.String(*v.Initials) diff --git a/service/workmail/snapshot/api_op_CreateIdentityCenterApplication.go.snap b/service/workmail/snapshot/api_op_CreateIdentityCenterApplication.go.snap new file mode 100644 index 00000000000..a294e1b639b --- /dev/null +++ b/service/workmail/snapshot/api_op_CreateIdentityCenterApplication.go.snap @@ -0,0 +1,42 @@ +CreateIdentityCenterApplication + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot/api_op_DeleteIdentityCenterApplication.go.snap b/service/workmail/snapshot/api_op_DeleteIdentityCenterApplication.go.snap new file mode 100644 index 00000000000..880d628298e --- /dev/null +++ b/service/workmail/snapshot/api_op_DeleteIdentityCenterApplication.go.snap @@ -0,0 +1,41 @@ +DeleteIdentityCenterApplication + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot/api_op_DeleteIdentityProviderConfiguration.go.snap b/service/workmail/snapshot/api_op_DeleteIdentityProviderConfiguration.go.snap new file mode 100644 index 00000000000..5d78446bfed --- /dev/null +++ b/service/workmail/snapshot/api_op_DeleteIdentityProviderConfiguration.go.snap @@ -0,0 +1,41 @@ +DeleteIdentityProviderConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot/api_op_DeletePersonalAccessToken.go.snap b/service/workmail/snapshot/api_op_DeletePersonalAccessToken.go.snap new file mode 100644 index 00000000000..0f961e1591b --- /dev/null +++ b/service/workmail/snapshot/api_op_DeletePersonalAccessToken.go.snap @@ -0,0 +1,41 @@ +DeletePersonalAccessToken + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot/api_op_DescribeIdentityProviderConfiguration.go.snap b/service/workmail/snapshot/api_op_DescribeIdentityProviderConfiguration.go.snap new file mode 100644 index 00000000000..2883d4e670a --- /dev/null +++ b/service/workmail/snapshot/api_op_DescribeIdentityProviderConfiguration.go.snap @@ -0,0 +1,41 @@ +DescribeIdentityProviderConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot/api_op_GetPersonalAccessTokenMetadata.go.snap b/service/workmail/snapshot/api_op_GetPersonalAccessTokenMetadata.go.snap new file mode 100644 index 00000000000..a7c57b8ea7b --- /dev/null +++ b/service/workmail/snapshot/api_op_GetPersonalAccessTokenMetadata.go.snap @@ -0,0 +1,41 @@ +GetPersonalAccessTokenMetadata + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot/api_op_ListPersonalAccessTokens.go.snap b/service/workmail/snapshot/api_op_ListPersonalAccessTokens.go.snap new file mode 100644 index 00000000000..ef132930f15 --- /dev/null +++ b/service/workmail/snapshot/api_op_ListPersonalAccessTokens.go.snap @@ -0,0 +1,41 @@ +ListPersonalAccessTokens + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot/api_op_PutIdentityProviderConfiguration.go.snap b/service/workmail/snapshot/api_op_PutIdentityProviderConfiguration.go.snap new file mode 100644 index 00000000000..2d981b90d6c --- /dev/null +++ b/service/workmail/snapshot/api_op_PutIdentityProviderConfiguration.go.snap @@ -0,0 +1,41 @@ +PutIdentityProviderConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/workmail/snapshot_test.go b/service/workmail/snapshot_test.go index 68e095833fd..67541d02a6d 100644 --- a/service/workmail/snapshot_test.go +++ b/service/workmail/snapshot_test.go @@ -146,6 +146,18 @@ func TestCheckSnapshot_CreateGroup(t *testing.T) { } } +func TestCheckSnapshot_CreateIdentityCenterApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateIdentityCenterApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateIdentityCenterApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateImpersonationRole(t *testing.T) { svc := New(Options{}) _, err := svc.CreateImpersonationRole(context.Background(), nil, func(o *Options) { @@ -266,6 +278,30 @@ func TestCheckSnapshot_DeleteGroup(t *testing.T) { } } +func TestCheckSnapshot_DeleteIdentityCenterApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteIdentityCenterApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteIdentityCenterApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteIdentityProviderConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteIdentityProviderConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteIdentityProviderConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteImpersonationRole(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteImpersonationRole(context.Background(), nil, func(o *Options) { @@ -326,6 +362,18 @@ func TestCheckSnapshot_DeleteOrganization(t *testing.T) { } } +func TestCheckSnapshot_DeletePersonalAccessToken(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeletePersonalAccessToken(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeletePersonalAccessToken") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteResource(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteResource(context.Background(), nil, func(o *Options) { @@ -422,6 +470,18 @@ func TestCheckSnapshot_DescribeGroup(t *testing.T) { } } +func TestCheckSnapshot_DescribeIdentityProviderConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeIdentityProviderConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeIdentityProviderConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeInboundDmarcSettings(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeInboundDmarcSettings(context.Background(), nil, func(o *Options) { @@ -602,6 +662,18 @@ func TestCheckSnapshot_GetMobileDeviceAccessOverride(t *testing.T) { } } +func TestCheckSnapshot_GetPersonalAccessTokenMetadata(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPersonalAccessTokenMetadata(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetPersonalAccessTokenMetadata") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListAccessControlRules(t *testing.T) { svc := New(Options{}) _, err := svc.ListAccessControlRules(context.Background(), nil, func(o *Options) { @@ -758,6 +830,18 @@ func TestCheckSnapshot_ListOrganizations(t *testing.T) { } } +func TestCheckSnapshot_ListPersonalAccessTokens(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPersonalAccessTokens(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListPersonalAccessTokens") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListResourceDelegates(t *testing.T) { svc := New(Options{}) _, err := svc.ListResourceDelegates(context.Background(), nil, func(o *Options) { @@ -830,6 +914,18 @@ func TestCheckSnapshot_PutEmailMonitoringConfiguration(t *testing.T) { } } +func TestCheckSnapshot_PutIdentityProviderConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutIdentityProviderConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutIdentityProviderConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_PutInboundDmarcSettings(t *testing.T) { svc := New(Options{}) _, err := svc.PutInboundDmarcSettings(context.Background(), nil, func(o *Options) { @@ -1153,6 +1249,18 @@ func TestUpdateSnapshot_CreateGroup(t *testing.T) { } } +func TestUpdateSnapshot_CreateIdentityCenterApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateIdentityCenterApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateIdentityCenterApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateImpersonationRole(t *testing.T) { svc := New(Options{}) _, err := svc.CreateImpersonationRole(context.Background(), nil, func(o *Options) { @@ -1273,6 +1381,30 @@ func TestUpdateSnapshot_DeleteGroup(t *testing.T) { } } +func TestUpdateSnapshot_DeleteIdentityCenterApplication(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteIdentityCenterApplication(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteIdentityCenterApplication") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteIdentityProviderConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteIdentityProviderConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteIdentityProviderConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteImpersonationRole(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteImpersonationRole(context.Background(), nil, func(o *Options) { @@ -1333,6 +1465,18 @@ func TestUpdateSnapshot_DeleteOrganization(t *testing.T) { } } +func TestUpdateSnapshot_DeletePersonalAccessToken(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeletePersonalAccessToken(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeletePersonalAccessToken") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteResource(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteResource(context.Background(), nil, func(o *Options) { @@ -1429,6 +1573,18 @@ func TestUpdateSnapshot_DescribeGroup(t *testing.T) { } } +func TestUpdateSnapshot_DescribeIdentityProviderConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeIdentityProviderConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeIdentityProviderConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeInboundDmarcSettings(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeInboundDmarcSettings(context.Background(), nil, func(o *Options) { @@ -1609,6 +1765,18 @@ func TestUpdateSnapshot_GetMobileDeviceAccessOverride(t *testing.T) { } } +func TestUpdateSnapshot_GetPersonalAccessTokenMetadata(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPersonalAccessTokenMetadata(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetPersonalAccessTokenMetadata") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListAccessControlRules(t *testing.T) { svc := New(Options{}) _, err := svc.ListAccessControlRules(context.Background(), nil, func(o *Options) { @@ -1765,6 +1933,18 @@ func TestUpdateSnapshot_ListOrganizations(t *testing.T) { } } +func TestUpdateSnapshot_ListPersonalAccessTokens(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPersonalAccessTokens(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListPersonalAccessTokens") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListResourceDelegates(t *testing.T) { svc := New(Options{}) _, err := svc.ListResourceDelegates(context.Background(), nil, func(o *Options) { @@ -1837,6 +2017,18 @@ func TestUpdateSnapshot_PutEmailMonitoringConfiguration(t *testing.T) { } } +func TestUpdateSnapshot_PutIdentityProviderConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutIdentityProviderConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutIdentityProviderConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_PutInboundDmarcSettings(t *testing.T) { svc := New(Options{}) _, err := svc.PutInboundDmarcSettings(context.Background(), nil, func(o *Options) { diff --git a/service/workmail/types/enums.go b/service/workmail/types/enums.go index af3f6a5340d..c415c179e92 100644 --- a/service/workmail/types/enums.go +++ b/service/workmail/types/enums.go @@ -147,6 +147,26 @@ func (FolderName) Values() []FolderName { } } +type IdentityProviderAuthenticationMode string + +// Enum values for IdentityProviderAuthenticationMode +const ( + IdentityProviderAuthenticationModeIdentityProviderOnly IdentityProviderAuthenticationMode = "IDENTITY_PROVIDER_ONLY" + IdentityProviderAuthenticationModeIdentityProviderAndDirectory IdentityProviderAuthenticationMode = "IDENTITY_PROVIDER_AND_DIRECTORY" +) + +// Values returns all known values for IdentityProviderAuthenticationMode. 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 (IdentityProviderAuthenticationMode) Values() []IdentityProviderAuthenticationMode { + return []IdentityProviderAuthenticationMode{ + "IDENTITY_PROVIDER_ONLY", + "IDENTITY_PROVIDER_AND_DIRECTORY", + } +} + type ImpersonationRoleType string // Enum values for ImpersonationRoleType @@ -249,6 +269,26 @@ func (PermissionType) Values() []PermissionType { } } +type PersonalAccessTokenConfigurationStatus string + +// Enum values for PersonalAccessTokenConfigurationStatus +const ( + PersonalAccessTokenConfigurationStatusActive PersonalAccessTokenConfigurationStatus = "ACTIVE" + PersonalAccessTokenConfigurationStatusInactive PersonalAccessTokenConfigurationStatus = "INACTIVE" +) + +// Values returns all known values for PersonalAccessTokenConfigurationStatus. +// 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 (PersonalAccessTokenConfigurationStatus) Values() []PersonalAccessTokenConfigurationStatus { + return []PersonalAccessTokenConfigurationStatus{ + "ACTIVE", + "INACTIVE", + } +} + type ResourceType string // Enum values for ResourceType diff --git a/service/workmail/types/types.go b/service/workmail/types/types.go index efd4a8ecaac..46d3d76eb81 100644 --- a/service/workmail/types/types.go +++ b/service/workmail/types/types.go @@ -228,6 +228,24 @@ type GroupIdentifier struct { noSmithyDocumentSerde } +// The IAM Identity Center configuration. +type IdentityCenterConfiguration struct { + + // The Amazon Resource Name (ARN) of IAMIdentity Center Application for WorkMail. + // Must be created by the WorkMail API, see CreateIdentityCenterApplication. + // + // This member is required. + ApplicationArn *string + + // The Amazon Resource Name (ARN) of the of IAM Identity Center instance. Must be + // in the same AWS account and region as WorkMail organization. + // + // This member is required. + InstanceArn *string + + noSmithyDocumentSerde +} + // The impersonation rule that matched the input. type ImpersonationMatchedRule struct { @@ -354,6 +372,9 @@ type ListUsersFilters struct { // Filters only users with the provided display name prefix. DisplayNamePrefix *string + // Filters only users with the ID from the IAM Identity Center. + IdentityProviderUserIdPrefix *string + // Filters only users with the provided email prefix. PrimaryEmailPrefix *string @@ -574,6 +595,56 @@ type Permission struct { noSmithyDocumentSerde } +// Displays the Personal Access Token status. +type PersonalAccessTokenConfiguration struct { + + // The status of the Personal Access Token allowed for the organization. + // + // - Active - Mailbox users can login to the web application and choose Settings + // to see the new Personal Access Tokens page to create and delete the Personal + // Access Tokens. Mailbox users can use the Personal Access Tokens to set up + // mailbox connection from desktop or mobile email clients. + // + // - Inactive - Personal Access Tokens are disabled for your organization. + // Mailbox users can’t create, list, or delete Personal Access Tokens and can’t use + // them to connect to their mailboxes from desktop or mobile email clients. + // + // This member is required. + Status PersonalAccessTokenConfigurationStatus + + // The validity of the Personal Access Token status in days. + LifetimeInDays *int32 + + noSmithyDocumentSerde +} + +// The summary of the Personal Access Token. +type PersonalAccessTokenSummary struct { + + // The date when the Personal Access Token was created. + DateCreated *time.Time + + // The date when the Personal Access Token was last used. + DateLastUsed *time.Time + + // The date when the Personal Access Token will expire. + ExpiresTime *time.Time + + // The name of the Personal Access Token. + Name *string + + // The ID of the Personal Access Token. + PersonalAccessTokenId *string + + // Lists all the Personal Access Token permissions for a mailbox. + Scopes []string + + // The user ID of the WorkMail user associated with the Personal Access Token. + UserId *string + + noSmithyDocumentSerde +} + // Describes an EWS based availability provider when returned from the service. It // does not contain the password of the endpoint. type RedactedEwsAvailabilityProvider struct { @@ -651,6 +722,16 @@ type User struct { // The identifier of the user. Id *string + // Identity store ID from the IAM Identity Center. If this parameter is empty it + // will be updated automatically when the user logs in for the first time to the + // mailbox associated with WorkMail. + IdentityProviderIdentityStoreId *string + + // User ID from the IAM Identity Center. If this parameter is empty it will be + // updated automatically when the user logs in for the first time to the mailbox + // associated with WorkMail. + IdentityProviderUserId *string + // The name of the user. Name *string diff --git a/service/workmail/validators.go b/service/workmail/validators.go index 238d8c0f0d9..31c1b1194a3 100644 --- a/service/workmail/validators.go +++ b/service/workmail/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCreateGroup) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateIdentityCenterApplication struct { +} + +func (*validateOpCreateIdentityCenterApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateIdentityCenterApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateIdentityCenterApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateIdentityCenterApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateImpersonationRole struct { } @@ -350,6 +370,46 @@ func (m *validateOpDeleteGroup) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDeleteIdentityCenterApplication struct { +} + +func (*validateOpDeleteIdentityCenterApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIdentityCenterApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIdentityCenterApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIdentityCenterApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteIdentityProviderConfiguration struct { +} + +func (*validateOpDeleteIdentityProviderConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIdentityProviderConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIdentityProviderConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIdentityProviderConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteImpersonationRole struct { } @@ -450,6 +510,26 @@ func (m *validateOpDeleteOrganization) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDeletePersonalAccessToken struct { +} + +func (*validateOpDeletePersonalAccessToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePersonalAccessToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePersonalAccessTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePersonalAccessTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteResource struct { } @@ -610,6 +690,26 @@ func (m *validateOpDescribeGroup) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDescribeIdentityProviderConfiguration struct { +} + +func (*validateOpDescribeIdentityProviderConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeIdentityProviderConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeIdentityProviderConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeIdentityProviderConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeInboundDmarcSettings struct { } @@ -910,6 +1010,26 @@ func (m *validateOpGetMobileDeviceAccessOverride) HandleInitialize(ctx context.C return next.HandleInitialize(ctx, in) } +type validateOpGetPersonalAccessTokenMetadata struct { +} + +func (*validateOpGetPersonalAccessTokenMetadata) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPersonalAccessTokenMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPersonalAccessTokenMetadataInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPersonalAccessTokenMetadataInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAccessControlRules struct { } @@ -1150,6 +1270,26 @@ func (m *validateOpListMobileDeviceAccessRules) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpListPersonalAccessTokens struct { +} + +func (*validateOpListPersonalAccessTokens) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListPersonalAccessTokens) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListPersonalAccessTokensInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListPersonalAccessTokensInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListResourceDelegates struct { } @@ -1270,6 +1410,26 @@ func (m *validateOpPutEmailMonitoringConfiguration) HandleInitialize(ctx context return next.HandleInitialize(ctx, in) } +type validateOpPutIdentityProviderConfiguration struct { +} + +func (*validateOpPutIdentityProviderConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutIdentityProviderConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutIdentityProviderConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutIdentityProviderConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutInboundDmarcSettings struct { } @@ -1698,6 +1858,10 @@ func addOpCreateGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateGroup{}, middleware.After) } +func addOpCreateIdentityCenterApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateIdentityCenterApplication{}, middleware.After) +} + func addOpCreateImpersonationRoleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateImpersonationRole{}, middleware.After) } @@ -1738,6 +1902,14 @@ func addOpDeleteGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteGroup{}, middleware.After) } +func addOpDeleteIdentityCenterApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIdentityCenterApplication{}, middleware.After) +} + +func addOpDeleteIdentityProviderConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIdentityProviderConfiguration{}, middleware.After) +} + func addOpDeleteImpersonationRoleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteImpersonationRole{}, middleware.After) } @@ -1758,6 +1930,10 @@ func addOpDeleteOrganizationValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDeleteOrganization{}, middleware.After) } +func addOpDeletePersonalAccessTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePersonalAccessToken{}, middleware.After) +} + func addOpDeleteResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteResource{}, middleware.After) } @@ -1790,6 +1966,10 @@ func addOpDescribeGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeGroup{}, middleware.After) } +func addOpDescribeIdentityProviderConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeIdentityProviderConfiguration{}, middleware.After) +} + func addOpDescribeInboundDmarcSettingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeInboundDmarcSettings{}, middleware.After) } @@ -1850,6 +2030,10 @@ func addOpGetMobileDeviceAccessOverrideValidationMiddleware(stack *middleware.St return stack.Initialize.Add(&validateOpGetMobileDeviceAccessOverride{}, middleware.After) } +func addOpGetPersonalAccessTokenMetadataValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPersonalAccessTokenMetadata{}, middleware.After) +} + func addOpListAccessControlRulesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAccessControlRules{}, middleware.After) } @@ -1898,6 +2082,10 @@ func addOpListMobileDeviceAccessRulesValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpListMobileDeviceAccessRules{}, middleware.After) } +func addOpListPersonalAccessTokensValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListPersonalAccessTokens{}, middleware.After) +} + func addOpListResourceDelegatesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListResourceDelegates{}, middleware.After) } @@ -1922,6 +2110,10 @@ func addOpPutEmailMonitoringConfigurationValidationMiddleware(stack *middleware. return stack.Initialize.Add(&validateOpPutEmailMonitoringConfiguration{}, middleware.After) } +func addOpPutIdentityProviderConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutIdentityProviderConfiguration{}, middleware.After) +} + func addOpPutInboundDmarcSettingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutInboundDmarcSettings{}, middleware.After) } @@ -2090,6 +2282,24 @@ func validateFolderConfigurations(v []types.FolderConfiguration) error { } } +func validateIdentityCenterConfiguration(v *types.IdentityCenterConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IdentityCenterConfiguration"} + if v.InstanceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceArn")) + } + if v.ApplicationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateImpersonationRule(v *types.ImpersonationRule) error { if v == nil { return nil @@ -2140,6 +2350,21 @@ func validateLambdaAvailabilityProvider(v *types.LambdaAvailabilityProvider) err } } +func validatePersonalAccessTokenConfiguration(v *types.PersonalAccessTokenConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PersonalAccessTokenConfiguration"} + if len(v.Status) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Status")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -2323,6 +2548,24 @@ func validateOpCreateGroupInput(v *CreateGroupInput) error { } } +func validateOpCreateIdentityCenterApplicationInput(v *CreateIdentityCenterApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateIdentityCenterApplicationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.InstanceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateImpersonationRoleInput(v *CreateImpersonationRoleInput) error { if v == nil { return nil @@ -2524,6 +2767,36 @@ func validateOpDeleteGroupInput(v *DeleteGroupInput) error { } } +func validateOpDeleteIdentityCenterApplicationInput(v *DeleteIdentityCenterApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIdentityCenterApplicationInput"} + if v.ApplicationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteIdentityProviderConfigurationInput(v *DeleteIdentityProviderConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIdentityProviderConfigurationInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteImpersonationRoleInput(v *DeleteImpersonationRoleInput) error { if v == nil { return nil @@ -2617,6 +2890,24 @@ func validateOpDeleteOrganizationInput(v *DeleteOrganizationInput) error { } } +func validateOpDeletePersonalAccessTokenInput(v *DeletePersonalAccessTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePersonalAccessTokenInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.PersonalAccessTokenId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PersonalAccessTokenId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteResourceInput(v *DeleteResourceInput) error { if v == nil { return nil @@ -2758,6 +3049,21 @@ func validateOpDescribeGroupInput(v *DescribeGroupInput) error { } } +func validateOpDescribeIdentityProviderConfigurationInput(v *DescribeIdentityProviderConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeIdentityProviderConfigurationInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeInboundDmarcSettingsInput(v *DescribeInboundDmarcSettingsInput) error { if v == nil { return nil @@ -3031,6 +3337,24 @@ func validateOpGetMobileDeviceAccessOverrideInput(v *GetMobileDeviceAccessOverri } } +func validateOpGetPersonalAccessTokenMetadataInput(v *GetPersonalAccessTokenMetadataInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPersonalAccessTokenMetadataInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.PersonalAccessTokenId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PersonalAccessTokenId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAccessControlRulesInput(v *ListAccessControlRulesInput) error { if v == nil { return nil @@ -3223,6 +3547,21 @@ func validateOpListMobileDeviceAccessRulesInput(v *ListMobileDeviceAccessRulesIn } } +func validateOpListPersonalAccessTokensInput(v *ListPersonalAccessTokensInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListPersonalAccessTokensInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListResourceDelegatesInput(v *ListResourceDelegatesInput) error { if v == nil { return nil @@ -3331,6 +3670,38 @@ func validateOpPutEmailMonitoringConfigurationInput(v *PutEmailMonitoringConfigu } } +func validateOpPutIdentityProviderConfigurationInput(v *PutIdentityProviderConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutIdentityProviderConfigurationInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if len(v.AuthenticationMode) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AuthenticationMode")) + } + if v.IdentityCenterConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdentityCenterConfiguration")) + } else if v.IdentityCenterConfiguration != nil { + if err := validateIdentityCenterConfiguration(v.IdentityCenterConfiguration); err != nil { + invalidParams.AddNested("IdentityCenterConfiguration", err.(smithy.InvalidParamsError)) + } + } + if v.PersonalAccessTokenConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("PersonalAccessTokenConfiguration")) + } else if v.PersonalAccessTokenConfiguration != nil { + if err := validatePersonalAccessTokenConfiguration(v.PersonalAccessTokenConfiguration); err != nil { + invalidParams.AddNested("PersonalAccessTokenConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutInboundDmarcSettingsInput(v *PutInboundDmarcSettingsInput) error { if v == nil { return nil