diff --git a/.changelog/0790da34336941248b6dfe534128c706.json b/.changelog/0790da34336941248b6dfe534128c706.json new file mode 100644 index 00000000000..91ccc7c399d --- /dev/null +++ b/.changelog/0790da34336941248b6dfe534128c706.json @@ -0,0 +1,8 @@ +{ + "id": "0790da34-3369-4124-8b6d-fe534128c706", + "type": "feature", + "description": "Amazon Bedrock Knowledge Bases now supports using application inference profiles to increase throughput and improve resilience.", + "modules": [ + "service/bedrockagent" + ] +} \ No newline at end of file diff --git a/.changelog/5aa88137279f4ff0a6e06078941cde89.json b/.changelog/5aa88137279f4ff0a6e06078941cde89.json new file mode 100644 index 00000000000..56c616991a6 --- /dev/null +++ b/.changelog/5aa88137279f4ff0a6e06078941cde89.json @@ -0,0 +1,8 @@ +{ + "id": "5aa88137-279f-4ff0-a6e0-6078941cde89", + "type": "feature", + "description": "This release introduces an improvement in PutLogEvents", + "modules": [ + "service/cloudwatchlogs" + ] +} \ No newline at end of file diff --git a/.changelog/7a29a2ddd020438c83027067f3a6846f.json b/.changelog/7a29a2ddd020438c83027067f3a6846f.json new file mode 100644 index 00000000000..82c1e205cba --- /dev/null +++ b/.changelog/7a29a2ddd020438c83027067f3a6846f.json @@ -0,0 +1,8 @@ +{ + "id": "7a29a2dd-d020-438c-8302-7067f3a6846f", + "type": "feature", + "description": "Amazon DocumentDB Elastic Clusters adds support for pending maintenance actions feature with APIs GetPendingMaintenanceAction, ListPendingMaintenanceActions and ApplyPendingMaintenanceAction", + "modules": [ + "service/docdbelastic" + ] +} \ No newline at end of file diff --git a/.changelog/89c5bee88806411e9394da44776b6ba6.json b/.changelog/89c5bee88806411e9394da44776b6ba6.json new file mode 100644 index 00000000000..20c7acf5c25 --- /dev/null +++ b/.changelog/89c5bee88806411e9394da44776b6ba6.json @@ -0,0 +1,8 @@ +{ + "id": "89c5bee8-8806-411e-9394-da44776b6ba6", + "type": "feature", + "description": "Add support for supplemental tax registrations via these new APIs: PutSupplementalTaxRegistration, ListSupplementalTaxRegistrations, and DeleteSupplementalTaxRegistration.", + "modules": [ + "service/taxsettings" + ] +} \ 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 bc3fe2a8426..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.47" +const goModuleVersion = "1.15.13" diff --git a/internal/protocoltest/awsrestjson/snapshot/api_op_MalformedContentTypeWithoutBodyEmptyInput.go.snap b/internal/protocoltest/awsrestjson/snapshot/api_op_MalformedContentTypeWithoutBodyEmptyInput.go.snap new file mode 100644 index 00000000000..71353594463 --- /dev/null +++ b/internal/protocoltest/awsrestjson/snapshot/api_op_MalformedContentTypeWithoutBodyEmptyInput.go.snap @@ -0,0 +1,40 @@ +MalformedContentTypeWithoutBodyEmptyInput + 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/internal/protocoltest/awsrestjson/snapshot/api_op_ResponseCodeHttpFallback.go.snap b/internal/protocoltest/awsrestjson/snapshot/api_op_ResponseCodeHttpFallback.go.snap new file mode 100644 index 00000000000..504146093bf --- /dev/null +++ b/internal/protocoltest/awsrestjson/snapshot/api_op_ResponseCodeHttpFallback.go.snap @@ -0,0 +1,40 @@ +ResponseCodeHttpFallback + 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/internal/protocoltest/awsrestjson/snapshot/api_op_ResponseCodeRequired.go.snap b/internal/protocoltest/awsrestjson/snapshot/api_op_ResponseCodeRequired.go.snap new file mode 100644 index 00000000000..56558e11e51 --- /dev/null +++ b/internal/protocoltest/awsrestjson/snapshot/api_op_ResponseCodeRequired.go.snap @@ -0,0 +1,40 @@ +ResponseCodeRequired + 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/internal/protocoltest/awsrestjson/snapshot/api_op_TestGetNoInputNoPayload.go.snap b/internal/protocoltest/awsrestjson/snapshot/api_op_TestGetNoInputNoPayload.go.snap new file mode 100644 index 00000000000..fac3b4278ec --- /dev/null +++ b/internal/protocoltest/awsrestjson/snapshot/api_op_TestGetNoInputNoPayload.go.snap @@ -0,0 +1,40 @@ +TestGetNoInputNoPayload + 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/internal/protocoltest/awsrestjson/snapshot/api_op_TestGetNoPayload.go.snap b/internal/protocoltest/awsrestjson/snapshot/api_op_TestGetNoPayload.go.snap new file mode 100644 index 00000000000..cb0b2e8c399 --- /dev/null +++ b/internal/protocoltest/awsrestjson/snapshot/api_op_TestGetNoPayload.go.snap @@ -0,0 +1,40 @@ +TestGetNoPayload + 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/internal/protocoltest/awsrestjson/snapshot/api_op_TestPostNoInputNoPayload.go.snap b/internal/protocoltest/awsrestjson/snapshot/api_op_TestPostNoInputNoPayload.go.snap new file mode 100644 index 00000000000..e4e8f7514d1 --- /dev/null +++ b/internal/protocoltest/awsrestjson/snapshot/api_op_TestPostNoInputNoPayload.go.snap @@ -0,0 +1,40 @@ +TestPostNoInputNoPayload + 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/internal/protocoltest/awsrestjson/snapshot/api_op_TestPostNoPayload.go.snap b/internal/protocoltest/awsrestjson/snapshot/api_op_TestPostNoPayload.go.snap new file mode 100644 index 00000000000..aeaec16301d --- /dev/null +++ b/internal/protocoltest/awsrestjson/snapshot/api_op_TestPostNoPayload.go.snap @@ -0,0 +1,40 @@ +TestPostNoPayload + 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/internal/protocoltest/jsonrpc/snapshot/api_op_JsonIntEnums.go.snap b/internal/protocoltest/jsonrpc/snapshot/api_op_JsonIntEnums.go.snap new file mode 100644 index 00000000000..ffd156b2859 --- /dev/null +++ b/internal/protocoltest/jsonrpc/snapshot/api_op_JsonIntEnums.go.snap @@ -0,0 +1,40 @@ +JsonIntEnums + 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/internal/protocoltest/jsonrpc10/snapshot/api_op_OperationWithRequiredMembersWithDefaults.go.snap b/internal/protocoltest/jsonrpc10/snapshot/api_op_OperationWithRequiredMembersWithDefaults.go.snap new file mode 100644 index 00000000000..74ac7c27d13 --- /dev/null +++ b/internal/protocoltest/jsonrpc10/snapshot/api_op_OperationWithRequiredMembersWithDefaults.go.snap @@ -0,0 +1,40 @@ +OperationWithRequiredMembersWithDefaults + 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/internal/protocoltest/restxml/snapshot/api_op_NestedXmlMapWithXmlName.go.snap b/internal/protocoltest/restxml/snapshot/api_op_NestedXmlMapWithXmlName.go.snap new file mode 100644 index 00000000000..2dd35c8ecd3 --- /dev/null +++ b/internal/protocoltest/restxml/snapshot/api_op_NestedXmlMapWithXmlName.go.snap @@ -0,0 +1,40 @@ +NestedXmlMapWithXmlName + 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/bedrockagent/types/types.go b/service/bedrockagent/types/types.go index aca4b9980b3..1e9934297fd 100644 --- a/service/bedrockagent/types/types.go +++ b/service/bedrockagent/types/types.go @@ -3329,8 +3329,8 @@ type VectorIngestionConfiguration struct { // knowledge base. type VectorKnowledgeBaseConfiguration struct { - // The Amazon Resource Name (ARN) of the model used to create vector embeddings - // for the knowledge base. + // The Amazon Resource Name (ARN) of the model or inference profile used to create + // vector embeddings for the knowledge base. // // This member is required. EmbeddingModelArn *string diff --git a/service/docdbelastic/api_op_ApplyPendingMaintenanceAction.go b/service/docdbelastic/api_op_ApplyPendingMaintenanceAction.go new file mode 100644 index 00000000000..e48998656bb --- /dev/null +++ b/service/docdbelastic/api_op_ApplyPendingMaintenanceAction.go @@ -0,0 +1,187 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package docdbelastic + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/docdbelastic/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The type of pending maintenance action to be applied to the resource. +func (c *Client) ApplyPendingMaintenanceAction(ctx context.Context, params *ApplyPendingMaintenanceActionInput, optFns ...func(*Options)) (*ApplyPendingMaintenanceActionOutput, error) { + if params == nil { + params = &ApplyPendingMaintenanceActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ApplyPendingMaintenanceAction", params, optFns, c.addOperationApplyPendingMaintenanceActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ApplyPendingMaintenanceActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ApplyPendingMaintenanceActionInput struct { + + // The pending maintenance action to apply to the resource. + // + // Valid actions are: + // + // - ENGINE_UPDATE + // + // - ENGINE_UPGRADE + // + // - SECURITY_UPDATE + // + // - OS_UPDATE + // + // - MASTER_USER_PASSWORD_UPDATE + // + // This member is required. + ApplyAction *string + + // A value that specifies the type of opt-in request, or undoes an opt-in request. + // An opt-in request of type IMMEDIATE can't be undone. + // + // This member is required. + OptInType types.OptInType + + // The Amazon DocumentDB Amazon Resource Name (ARN) of the resource to which the + // pending maintenance action applies. + // + // This member is required. + ResourceArn *string + + // A specific date to apply the pending maintenance action. Required if + // opt-in-type is APPLY_ON . Format: yyyy/MM/dd HH:mm-yyyy/MM/dd HH:mm + ApplyOn *string + + noSmithyDocumentSerde +} + +type ApplyPendingMaintenanceActionOutput struct { + + // The output of the pending maintenance action being applied. + // + // This member is required. + ResourcePendingMaintenanceAction *types.ResourcePendingMaintenanceAction + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationApplyPendingMaintenanceActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpApplyPendingMaintenanceAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpApplyPendingMaintenanceAction{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ApplyPendingMaintenanceAction"); 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 = addOpApplyPendingMaintenanceActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opApplyPendingMaintenanceAction(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_opApplyPendingMaintenanceAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ApplyPendingMaintenanceAction", + } +} diff --git a/service/docdbelastic/api_op_GetPendingMaintenanceAction.go b/service/docdbelastic/api_op_GetPendingMaintenanceAction.go new file mode 100644 index 00000000000..3a8b0e1c090 --- /dev/null +++ b/service/docdbelastic/api_op_GetPendingMaintenanceAction.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package docdbelastic + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/docdbelastic/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves all maintenance actions that are pending. +func (c *Client) GetPendingMaintenanceAction(ctx context.Context, params *GetPendingMaintenanceActionInput, optFns ...func(*Options)) (*GetPendingMaintenanceActionOutput, error) { + if params == nil { + params = &GetPendingMaintenanceActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPendingMaintenanceAction", params, optFns, c.addOperationGetPendingMaintenanceActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPendingMaintenanceActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPendingMaintenanceActionInput struct { + + // Retrieves pending maintenance actions for a specific Amazon Resource Name (ARN). + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type GetPendingMaintenanceActionOutput struct { + + // Provides information about a pending maintenance action for a resource. + // + // This member is required. + ResourcePendingMaintenanceAction *types.ResourcePendingMaintenanceAction + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPendingMaintenanceActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPendingMaintenanceAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPendingMaintenanceAction{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPendingMaintenanceAction"); 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 = addOpGetPendingMaintenanceActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPendingMaintenanceAction(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_opGetPendingMaintenanceAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetPendingMaintenanceAction", + } +} diff --git a/service/docdbelastic/api_op_ListPendingMaintenanceActions.go b/service/docdbelastic/api_op_ListPendingMaintenanceActions.go new file mode 100644 index 00000000000..d8f0f8d6e55 --- /dev/null +++ b/service/docdbelastic/api_op_ListPendingMaintenanceActions.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package docdbelastic + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/docdbelastic/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of all maintenance actions that are pending. +func (c *Client) ListPendingMaintenanceActions(ctx context.Context, params *ListPendingMaintenanceActionsInput, optFns ...func(*Options)) (*ListPendingMaintenanceActionsOutput, error) { + if params == nil { + params = &ListPendingMaintenanceActionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPendingMaintenanceActions", params, optFns, c.addOperationListPendingMaintenanceActionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPendingMaintenanceActionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPendingMaintenanceActionsInput struct { + + // The maximum number of results to include in the response. If more records exist + // than the specified maxResults value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. + MaxResults *int32 + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by maxResults . + NextToken *string + + noSmithyDocumentSerde +} + +type ListPendingMaintenanceActionsOutput struct { + + // Provides information about a pending maintenance action for a resource. + // + // This member is required. + ResourcePendingMaintenanceActions []types.ResourcePendingMaintenanceAction + + // An optional pagination token provided by a previous request. If this parameter + // is displayed, the responses will include only records beyond the marker, up to + // the value specified by maxResults . + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPendingMaintenanceActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPendingMaintenanceActions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPendingMaintenanceActions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListPendingMaintenanceActions"); 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_opListPendingMaintenanceActions(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 +} + +// ListPendingMaintenanceActionsPaginatorOptions is the paginator options for +// ListPendingMaintenanceActions +type ListPendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of results to include in the response. If more records exist + // than the specified maxResults value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. + 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 +} + +// ListPendingMaintenanceActionsPaginator is a paginator for +// ListPendingMaintenanceActions +type ListPendingMaintenanceActionsPaginator struct { + options ListPendingMaintenanceActionsPaginatorOptions + client ListPendingMaintenanceActionsAPIClient + params *ListPendingMaintenanceActionsInput + nextToken *string + firstPage bool +} + +// NewListPendingMaintenanceActionsPaginator returns a new +// ListPendingMaintenanceActionsPaginator +func NewListPendingMaintenanceActionsPaginator(client ListPendingMaintenanceActionsAPIClient, params *ListPendingMaintenanceActionsInput, optFns ...func(*ListPendingMaintenanceActionsPaginatorOptions)) *ListPendingMaintenanceActionsPaginator { + if params == nil { + params = &ListPendingMaintenanceActionsInput{} + } + + options := ListPendingMaintenanceActionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPendingMaintenanceActionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPendingMaintenanceActions page. +func (p *ListPendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPendingMaintenanceActionsOutput, 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.ListPendingMaintenanceActions(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 +} + +// ListPendingMaintenanceActionsAPIClient is a client that implements the +// ListPendingMaintenanceActions operation. +type ListPendingMaintenanceActionsAPIClient interface { + ListPendingMaintenanceActions(context.Context, *ListPendingMaintenanceActionsInput, ...func(*Options)) (*ListPendingMaintenanceActionsOutput, error) +} + +var _ ListPendingMaintenanceActionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListPendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListPendingMaintenanceActions", + } +} diff --git a/service/docdbelastic/deserializers.go b/service/docdbelastic/deserializers.go index b2335cd9807..da3ba4c0158 100644 --- a/service/docdbelastic/deserializers.go +++ b/service/docdbelastic/deserializers.go @@ -30,6 +30,173 @@ func deserializeS3Expires(v string) (*time.Time, error) { return &t, nil } +type awsRestjson1_deserializeOpApplyPendingMaintenanceAction struct { +} + +func (*awsRestjson1_deserializeOpApplyPendingMaintenanceAction) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpApplyPendingMaintenanceAction) HandleDeserialize(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_deserializeOpErrorApplyPendingMaintenanceAction(response, &metadata) + } + output := &ApplyPendingMaintenanceActionOutput{} + 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_deserializeOpDocumentApplyPendingMaintenanceActionOutput(&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_deserializeOpErrorApplyPendingMaintenanceAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentApplyPendingMaintenanceActionOutput(v **ApplyPendingMaintenanceActionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ApplyPendingMaintenanceActionOutput + if *v == nil { + sv = &ApplyPendingMaintenanceActionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "resourcePendingMaintenanceAction": + if err := awsRestjson1_deserializeDocumentResourcePendingMaintenanceAction(&sv.ResourcePendingMaintenanceAction, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCopyClusterSnapshot struct { } @@ -896,9 +1063,337 @@ func (m *awsRestjson1_deserializeOpGetCluster) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetCluster(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetCluster(response, &metadata) + } + output := &GetClusterOutput{} + 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_deserializeOpDocumentGetClusterOutput(&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_deserializeOpErrorGetCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetClusterOutput(v **GetClusterOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetClusterOutput + if *v == nil { + sv = &GetClusterOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cluster": + if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetClusterSnapshot struct { +} + +func (*awsRestjson1_deserializeOpGetClusterSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetClusterSnapshot) HandleDeserialize(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_deserializeOpErrorGetClusterSnapshot(response, &metadata) + } + output := &GetClusterSnapshotOutput{} + 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_deserializeOpDocumentGetClusterSnapshotOutput(&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_deserializeOpErrorGetClusterSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetClusterSnapshotOutput(v **GetClusterSnapshotOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetClusterSnapshotOutput + if *v == nil { + sv = &GetClusterSnapshotOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "snapshot": + if err := awsRestjson1_deserializeDocumentClusterSnapshot(&sv.Snapshot, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetPendingMaintenanceAction struct { +} + +func (*awsRestjson1_deserializeOpGetPendingMaintenanceAction) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetPendingMaintenanceAction) HandleDeserialize(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_deserializeOpErrorGetPendingMaintenanceAction(response, &metadata) } - output := &GetClusterOutput{} + output := &GetPendingMaintenanceActionOutput{} out.Result = output var buff [1024]byte @@ -919,7 +1414,7 @@ func (m *awsRestjson1_deserializeOpGetCluster) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetClusterOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPendingMaintenanceActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -933,7 +1428,7 @@ func (m *awsRestjson1_deserializeOpGetCluster) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPendingMaintenanceAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -977,6 +1472,9 @@ func awsRestjson1_deserializeOpErrorGetCluster(response *smithyhttp.Response, me case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -999,7 +1497,7 @@ func awsRestjson1_deserializeOpErrorGetCluster(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetClusterOutput(v **GetClusterOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPendingMaintenanceActionOutput(v **GetPendingMaintenanceActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1012,17 +1510,17 @@ func awsRestjson1_deserializeOpDocumentGetClusterOutput(v **GetClusterOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetClusterOutput + var sv *GetPendingMaintenanceActionOutput if *v == nil { - sv = &GetClusterOutput{} + sv = &GetPendingMaintenanceActionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { + case "resourcePendingMaintenanceAction": + if err := awsRestjson1_deserializeDocumentResourcePendingMaintenanceAction(&sv.ResourcePendingMaintenanceAction, value); err != nil { return err } @@ -1035,14 +1533,14 @@ func awsRestjson1_deserializeOpDocumentGetClusterOutput(v **GetClusterOutput, va return nil } -type awsRestjson1_deserializeOpGetClusterSnapshot struct { +type awsRestjson1_deserializeOpListClusters struct { } -func (*awsRestjson1_deserializeOpGetClusterSnapshot) ID() string { +func (*awsRestjson1_deserializeOpListClusters) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetClusterSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1060,9 +1558,9 @@ func (m *awsRestjson1_deserializeOpGetClusterSnapshot) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetClusterSnapshot(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListClusters(response, &metadata) } - output := &GetClusterSnapshotOutput{} + output := &ListClustersOutput{} out.Result = output var buff [1024]byte @@ -1083,7 +1581,7 @@ func (m *awsRestjson1_deserializeOpGetClusterSnapshot) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetClusterSnapshotOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListClustersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1097,7 +1595,7 @@ func (m *awsRestjson1_deserializeOpGetClusterSnapshot) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetClusterSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1144,9 +1642,6 @@ func awsRestjson1_deserializeOpErrorGetClusterSnapshot(response *smithyhttp.Resp case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -1163,7 +1658,7 @@ func awsRestjson1_deserializeOpErrorGetClusterSnapshot(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetClusterSnapshotOutput(v **GetClusterSnapshotOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1176,20 +1671,29 @@ func awsRestjson1_deserializeOpDocumentGetClusterSnapshotOutput(v **GetClusterSn return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetClusterSnapshotOutput + var sv *ListClustersOutput if *v == nil { - sv = &GetClusterSnapshotOutput{} + sv = &ListClustersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "snapshot": - if err := awsRestjson1_deserializeDocumentClusterSnapshot(&sv.Snapshot, value); err != nil { + case "clusters": + if err := awsRestjson1_deserializeDocumentClusterList(&sv.Clusters, 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 @@ -1199,14 +1703,14 @@ func awsRestjson1_deserializeOpDocumentGetClusterSnapshotOutput(v **GetClusterSn return nil } -type awsRestjson1_deserializeOpListClusters struct { +type awsRestjson1_deserializeOpListClusterSnapshots struct { } -func (*awsRestjson1_deserializeOpListClusters) ID() string { +func (*awsRestjson1_deserializeOpListClusterSnapshots) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListClusterSnapshots) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1224,9 +1728,9 @@ func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListClusters(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListClusterSnapshots(response, &metadata) } - output := &ListClustersOutput{} + output := &ListClusterSnapshotsOutput{} out.Result = output var buff [1024]byte @@ -1247,7 +1751,7 @@ func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListClustersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListClusterSnapshotsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1261,7 +1765,7 @@ func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListClusterSnapshots(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1324,7 +1828,7 @@ func awsRestjson1_deserializeOpErrorListClusters(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListClusterSnapshotsOutput(v **ListClusterSnapshotsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1337,20 +1841,15 @@ func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListClustersOutput + var sv *ListClusterSnapshotsOutput if *v == nil { - sv = &ListClustersOutput{} + sv = &ListClusterSnapshotsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clusters": - if err := awsRestjson1_deserializeDocumentClusterList(&sv.Clusters, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -1360,6 +1859,11 @@ func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput sv.NextToken = ptr.String(jtv) } + case "snapshots": + if err := awsRestjson1_deserializeDocumentClusterSnapshotList(&sv.Snapshots, value); err != nil { + return err + } + default: _, _ = key, value @@ -1369,14 +1873,14 @@ func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput return nil } -type awsRestjson1_deserializeOpListClusterSnapshots struct { +type awsRestjson1_deserializeOpListPendingMaintenanceActions struct { } -func (*awsRestjson1_deserializeOpListClusterSnapshots) ID() string { +func (*awsRestjson1_deserializeOpListPendingMaintenanceActions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListClusterSnapshots) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPendingMaintenanceActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1394,9 +1898,9 @@ func (m *awsRestjson1_deserializeOpListClusterSnapshots) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListClusterSnapshots(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPendingMaintenanceActions(response, &metadata) } - output := &ListClusterSnapshotsOutput{} + output := &ListPendingMaintenanceActionsOutput{} out.Result = output var buff [1024]byte @@ -1417,7 +1921,7 @@ func (m *awsRestjson1_deserializeOpListClusterSnapshots) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListClusterSnapshotsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPendingMaintenanceActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1431,7 +1935,7 @@ func (m *awsRestjson1_deserializeOpListClusterSnapshots) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListClusterSnapshots(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPendingMaintenanceActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1494,7 +1998,7 @@ func awsRestjson1_deserializeOpErrorListClusterSnapshots(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListClusterSnapshotsOutput(v **ListClusterSnapshotsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPendingMaintenanceActionsOutput(v **ListPendingMaintenanceActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1507,9 +2011,9 @@ func awsRestjson1_deserializeOpDocumentListClusterSnapshotsOutput(v **ListCluste return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListClusterSnapshotsOutput + var sv *ListPendingMaintenanceActionsOutput if *v == nil { - sv = &ListClusterSnapshotsOutput{} + sv = &ListPendingMaintenanceActionsOutput{} } else { sv = *v } @@ -1525,8 +2029,8 @@ func awsRestjson1_deserializeOpDocumentListClusterSnapshotsOutput(v **ListCluste sv.NextToken = ptr.String(jtv) } - case "snapshots": - if err := awsRestjson1_deserializeDocumentClusterSnapshotList(&sv.Snapshots, value); err != nil { + case "resourcePendingMaintenanceActions": + if err := awsRestjson1_deserializeDocumentResourcePendingMaintenanceActionList(&sv.ResourcePendingMaintenanceActions, value); err != nil { return err } @@ -3481,6 +3985,125 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS return nil } +func awsRestjson1_deserializeDocumentPendingMaintenanceActionDetails(v **types.PendingMaintenanceActionDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PendingMaintenanceActionDetails + if *v == nil { + sv = &types.PendingMaintenanceActionDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Action = ptr.String(jtv) + } + + case "autoAppliedAfterDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AutoAppliedAfterDate = ptr.String(jtv) + } + + case "currentApplyDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CurrentApplyDate = ptr.String(jtv) + } + + 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 "forcedApplyDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ForcedApplyDate = ptr.String(jtv) + } + + case "optInStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OptInStatus = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPendingMaintenanceActionDetailsList(v *[]types.PendingMaintenanceActionDetails, 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.PendingMaintenanceActionDetails + if *v == nil { + cv = []types.PendingMaintenanceActionDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PendingMaintenanceActionDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentPendingMaintenanceActionDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3539,6 +4162,85 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsRestjson1_deserializeDocumentResourcePendingMaintenanceAction(v **types.ResourcePendingMaintenanceAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourcePendingMaintenanceAction + if *v == nil { + sv = &types.ResourcePendingMaintenanceAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "pendingMaintenanceActionDetails": + if err := awsRestjson1_deserializeDocumentPendingMaintenanceActionDetailsList(&sv.PendingMaintenanceActionDetails, value); err != nil { + return err + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourcePendingMaintenanceActionList(v *[]types.ResourcePendingMaintenanceAction, 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.ResourcePendingMaintenanceAction + if *v == nil { + cv = []types.ResourcePendingMaintenanceAction{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourcePendingMaintenanceAction + destAddr := &col + if err := awsRestjson1_deserializeDocumentResourcePendingMaintenanceAction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/docdbelastic/generated.json b/service/docdbelastic/generated.json index 8dc24063c14..5f5050dbcc1 100644 --- a/service/docdbelastic/generated.json +++ b/service/docdbelastic/generated.json @@ -8,6 +8,7 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_ApplyPendingMaintenanceAction.go", "api_op_CopyClusterSnapshot.go", "api_op_CreateCluster.go", "api_op_CreateClusterSnapshot.go", @@ -15,8 +16,10 @@ "api_op_DeleteClusterSnapshot.go", "api_op_GetCluster.go", "api_op_GetClusterSnapshot.go", + "api_op_GetPendingMaintenanceAction.go", "api_op_ListClusterSnapshots.go", "api_op_ListClusters.go", + "api_op_ListPendingMaintenanceActions.go", "api_op_ListTagsForResource.go", "api_op_RestoreClusterFromSnapshot.go", "api_op_StartCluster.go", diff --git a/service/docdbelastic/serializers.go b/service/docdbelastic/serializers.go index 2e9cab41bf0..8157780e643 100644 --- a/service/docdbelastic/serializers.go +++ b/service/docdbelastic/serializers.go @@ -14,6 +14,102 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpApplyPendingMaintenanceAction struct { +} + +func (*awsRestjson1_serializeOpApplyPendingMaintenanceAction) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpApplyPendingMaintenanceAction) 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.(*ApplyPendingMaintenanceActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/pending-action") + 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_serializeOpDocumentApplyPendingMaintenanceActionInput(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_serializeOpHttpBindingsApplyPendingMaintenanceActionInput(v *ApplyPendingMaintenanceActionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentApplyPendingMaintenanceActionInput(v *ApplyPendingMaintenanceActionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplyAction != nil { + ok := object.Key("applyAction") + ok.String(*v.ApplyAction) + } + + if v.ApplyOn != nil { + ok := object.Key("applyOn") + ok.String(*v.ApplyOn) + } + + if len(v.OptInType) > 0 { + ok := object.Key("optInType") + ok.String(string(v.OptInType)) + } + + if v.ResourceArn != nil { + ok := object.Key("resourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + type awsRestjson1_serializeOpCopyClusterSnapshot struct { } @@ -659,6 +755,77 @@ func awsRestjson1_serializeOpHttpBindingsGetClusterSnapshotInput(v *GetClusterSn return nil } +type awsRestjson1_serializeOpGetPendingMaintenanceAction struct { +} + +func (*awsRestjson1_serializeOpGetPendingMaintenanceAction) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetPendingMaintenanceAction) 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.(*GetPendingMaintenanceActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/pending-action/{resourceArn}") + 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_serializeOpHttpBindingsGetPendingMaintenanceActionInput(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_serializeOpHttpBindingsGetPendingMaintenanceActionInput(v *GetPendingMaintenanceActionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListClusters struct { } @@ -807,6 +974,76 @@ func awsRestjson1_serializeOpHttpBindingsListClusterSnapshotsInput(v *ListCluste return nil } +type awsRestjson1_serializeOpListPendingMaintenanceActions struct { +} + +func (*awsRestjson1_serializeOpListPendingMaintenanceActions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPendingMaintenanceActions) 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.(*ListPendingMaintenanceActionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/pending-actions") + 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_serializeOpHttpBindingsListPendingMaintenanceActionsInput(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_serializeOpHttpBindingsListPendingMaintenanceActionsInput(v *ListPendingMaintenanceActionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListTagsForResource struct { } diff --git a/service/docdbelastic/snapshot/api_op_ApplyPendingMaintenanceAction.go.snap b/service/docdbelastic/snapshot/api_op_ApplyPendingMaintenanceAction.go.snap new file mode 100644 index 00000000000..92a1949b76e --- /dev/null +++ b/service/docdbelastic/snapshot/api_op_ApplyPendingMaintenanceAction.go.snap @@ -0,0 +1,41 @@ +ApplyPendingMaintenanceAction + 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/docdbelastic/snapshot/api_op_GetPendingMaintenanceAction.go.snap b/service/docdbelastic/snapshot/api_op_GetPendingMaintenanceAction.go.snap new file mode 100644 index 00000000000..f3cf18cb584 --- /dev/null +++ b/service/docdbelastic/snapshot/api_op_GetPendingMaintenanceAction.go.snap @@ -0,0 +1,41 @@ +GetPendingMaintenanceAction + 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/docdbelastic/snapshot/api_op_ListPendingMaintenanceActions.go.snap b/service/docdbelastic/snapshot/api_op_ListPendingMaintenanceActions.go.snap new file mode 100644 index 00000000000..4aedce94275 --- /dev/null +++ b/service/docdbelastic/snapshot/api_op_ListPendingMaintenanceActions.go.snap @@ -0,0 +1,40 @@ +ListPendingMaintenanceActions + 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/docdbelastic/snapshot_test.go b/service/docdbelastic/snapshot_test.go index 72a2fc587fe..5069736fc2d 100644 --- a/service/docdbelastic/snapshot_test.go +++ b/service/docdbelastic/snapshot_test.go @@ -62,6 +62,18 @@ func testSnapshot(stack *middleware.Stack, operation string) error { } return snapshotOK{} } +func TestCheckSnapshot_ApplyPendingMaintenanceAction(t *testing.T) { + svc := New(Options{}) + _, err := svc.ApplyPendingMaintenanceAction(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ApplyPendingMaintenanceAction") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CopyClusterSnapshot(t *testing.T) { svc := New(Options{}) _, err := svc.CopyClusterSnapshot(context.Background(), nil, func(o *Options) { @@ -146,6 +158,18 @@ func TestCheckSnapshot_GetClusterSnapshot(t *testing.T) { } } +func TestCheckSnapshot_GetPendingMaintenanceAction(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPendingMaintenanceAction(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetPendingMaintenanceAction") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListClusters(t *testing.T) { svc := New(Options{}) _, err := svc.ListClusters(context.Background(), nil, func(o *Options) { @@ -170,6 +194,18 @@ func TestCheckSnapshot_ListClusterSnapshots(t *testing.T) { } } +func TestCheckSnapshot_ListPendingMaintenanceActions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPendingMaintenanceActions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListPendingMaintenanceActions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -253,6 +289,18 @@ func TestCheckSnapshot_UpdateCluster(t *testing.T) { t.Fatal(err) } } +func TestUpdateSnapshot_ApplyPendingMaintenanceAction(t *testing.T) { + svc := New(Options{}) + _, err := svc.ApplyPendingMaintenanceAction(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ApplyPendingMaintenanceAction") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CopyClusterSnapshot(t *testing.T) { svc := New(Options{}) _, err := svc.CopyClusterSnapshot(context.Background(), nil, func(o *Options) { @@ -337,6 +385,18 @@ func TestUpdateSnapshot_GetClusterSnapshot(t *testing.T) { } } +func TestUpdateSnapshot_GetPendingMaintenanceAction(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPendingMaintenanceAction(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetPendingMaintenanceAction") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListClusters(t *testing.T) { svc := New(Options{}) _, err := svc.ListClusters(context.Background(), nil, func(o *Options) { @@ -361,6 +421,18 @@ func TestUpdateSnapshot_ListClusterSnapshots(t *testing.T) { } } +func TestUpdateSnapshot_ListPendingMaintenanceActions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListPendingMaintenanceActions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListPendingMaintenanceActions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { diff --git a/service/docdbelastic/types/enums.go b/service/docdbelastic/types/enums.go index 4f840616c80..672da4dbb5d 100644 --- a/service/docdbelastic/types/enums.go +++ b/service/docdbelastic/types/enums.go @@ -21,6 +21,29 @@ func (Auth) Values() []Auth { } } +type OptInType string + +// Enum values for OptInType +const ( + OptInTypeImmediate OptInType = "IMMEDIATE" + OptInTypeNextMaintenance OptInType = "NEXT_MAINTENANCE" + OptInTypeApplyOn OptInType = "APPLY_ON" + OptInTypeUndoOptIn OptInType = "UNDO_OPT_IN" +) + +// Values returns all known values for OptInType. 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 (OptInType) Values() []OptInType { + return []OptInType{ + "IMMEDIATE", + "NEXT_MAINTENANCE", + "APPLY_ON", + "UNDO_OPT_IN", + } +} + type SnapshotType string // Enum values for SnapshotType @@ -44,25 +67,27 @@ type Status string // Enum values for Status const ( - StatusCreating Status = "CREATING" - StatusActive Status = "ACTIVE" - StatusDeleting Status = "DELETING" - StatusUpdating Status = "UPDATING" - StatusVpcEndpointLimitExceeded Status = "VPC_ENDPOINT_LIMIT_EXCEEDED" - StatusIpAddressLimitExceeded Status = "IP_ADDRESS_LIMIT_EXCEEDED" - StatusInvalidSecurityGroupId Status = "INVALID_SECURITY_GROUP_ID" - StatusInvalidSubnetId Status = "INVALID_SUBNET_ID" - StatusInaccessibleEncryptionCreds Status = "INACCESSIBLE_ENCRYPTION_CREDS" - StatusInaccessibleSecretArn Status = "INACCESSIBLE_SECRET_ARN" - StatusInaccessibleVpcEndpoint Status = "INACCESSIBLE_VPC_ENDPOINT" - StatusIncompatibleNetwork Status = "INCOMPATIBLE_NETWORK" - StatusMerging Status = "MERGING" - StatusModifying Status = "MODIFYING" - StatusSplitting Status = "SPLITTING" - StatusCopying Status = "COPYING" - StatusStarting Status = "STARTING" - StatusStopping Status = "STOPPING" - StatusStopped Status = "STOPPED" + StatusCreating Status = "CREATING" + StatusActive Status = "ACTIVE" + StatusDeleting Status = "DELETING" + StatusUpdating Status = "UPDATING" + StatusVpcEndpointLimitExceeded Status = "VPC_ENDPOINT_LIMIT_EXCEEDED" + StatusIpAddressLimitExceeded Status = "IP_ADDRESS_LIMIT_EXCEEDED" + StatusInvalidSecurityGroupId Status = "INVALID_SECURITY_GROUP_ID" + StatusInvalidSubnetId Status = "INVALID_SUBNET_ID" + StatusInaccessibleEncryptionCreds Status = "INACCESSIBLE_ENCRYPTION_CREDS" + StatusInaccessibleSecretArn Status = "INACCESSIBLE_SECRET_ARN" + StatusInaccessibleVpcEndpoint Status = "INACCESSIBLE_VPC_ENDPOINT" + StatusIncompatibleNetwork Status = "INCOMPATIBLE_NETWORK" + StatusMerging Status = "MERGING" + StatusModifying Status = "MODIFYING" + StatusSplitting Status = "SPLITTING" + StatusCopying Status = "COPYING" + StatusStarting Status = "STARTING" + StatusStopping Status = "STOPPING" + StatusStopped Status = "STOPPED" + StatusMaintenance Status = "MAINTENANCE" + StatusInaccessibleEncryptionCredentialsRecoverable Status = "INACCESSIBLE_ENCRYPTION_CREDENTIALS_RECOVERABLE" ) // Values returns all known values for Status. Note that this can be expanded in @@ -90,6 +115,8 @@ func (Status) Values() []Status { "STARTING", "STOPPING", "STOPPED", + "MAINTENANCE", + "INACCESSIBLE_ENCRYPTION_CREDENTIALS_RECOVERABLE", } } diff --git a/service/docdbelastic/types/types.go b/service/docdbelastic/types/types.go index 6c7f01e081f..e8d01978656 100644 --- a/service/docdbelastic/types/types.go +++ b/service/docdbelastic/types/types.go @@ -224,6 +224,52 @@ type ClusterSnapshotInList struct { noSmithyDocumentSerde } +// Retrieves the details of maintenance actions that are pending. +type PendingMaintenanceActionDetails struct { + + // Displays the specific action of a pending maintenance action. + // + // This member is required. + Action *string + + // Displays the date of the maintenance window when the action is applied. The + // maintenance action is applied to the resource during its first maintenance + // window after this date. If this date is specified, any NEXT_MAINTENANCE optInType + // requests are ignored. + AutoAppliedAfterDate *string + + // Displays the effective date when the pending maintenance action is applied to + // the resource. + CurrentApplyDate *string + + // Displays a description providing more detail about the maintenance action. + Description *string + + // Displays the date when the maintenance action is automatically applied. The + // maintenance action is applied to the resource on this date regardless of the + // maintenance window for the resource. If this date is specified, any IMMEDIATE + // optInType requests are ignored. + ForcedApplyDate *string + + // Displays the type of optInType request that has been received for the resource. + OptInStatus *string + + noSmithyDocumentSerde +} + +// Provides information about a pending maintenance action for a resource. +type ResourcePendingMaintenanceAction struct { + + // Provides information about a pending maintenance action for a resource. + PendingMaintenanceActionDetails []PendingMaintenanceActionDetails + + // The Amazon DocumentDB Amazon Resource Name (ARN) of the resource to which the + // pending maintenance action applies. + ResourceArn *string + + noSmithyDocumentSerde +} + // The name of the shard. type Shard struct { diff --git a/service/docdbelastic/validators.go b/service/docdbelastic/validators.go index b911f6e6a81..da67bc58423 100644 --- a/service/docdbelastic/validators.go +++ b/service/docdbelastic/validators.go @@ -9,6 +9,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpApplyPendingMaintenanceAction struct { +} + +func (*validateOpApplyPendingMaintenanceAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpApplyPendingMaintenanceAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ApplyPendingMaintenanceActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpApplyPendingMaintenanceActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCopyClusterSnapshot struct { } @@ -149,6 +169,26 @@ func (m *validateOpGetClusterSnapshot) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetPendingMaintenanceAction struct { +} + +func (*validateOpGetPendingMaintenanceAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPendingMaintenanceAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPendingMaintenanceActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPendingMaintenanceActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -289,6 +329,10 @@ func (m *validateOpUpdateCluster) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +func addOpApplyPendingMaintenanceActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpApplyPendingMaintenanceAction{}, middleware.After) +} + func addOpCopyClusterSnapshotValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCopyClusterSnapshot{}, middleware.After) } @@ -317,6 +361,10 @@ func addOpGetClusterSnapshotValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetClusterSnapshot{}, middleware.After) } +func addOpGetPendingMaintenanceActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPendingMaintenanceAction{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -345,6 +393,27 @@ func addOpUpdateClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateCluster{}, middleware.After) } +func validateOpApplyPendingMaintenanceActionInput(v *ApplyPendingMaintenanceActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ApplyPendingMaintenanceActionInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.ApplyAction == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplyAction")) + } + if len(v.OptInType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("OptInType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCopyClusterSnapshotInput(v *CopyClusterSnapshotInput) error { if v == nil { return nil @@ -471,6 +540,21 @@ func validateOpGetClusterSnapshotInput(v *GetClusterSnapshotInput) error { } } +func validateOpGetPendingMaintenanceActionInput(v *GetPendingMaintenanceActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPendingMaintenanceActionInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil diff --git a/service/rekognition/internal/endpoints/endpoints.go b/service/rekognition/internal/endpoints/endpoints.go index a43bf5722c2..bfcc08ca15f 100644 --- a/service/rekognition/internal/endpoints/endpoints.go +++ b/service/rekognition/internal/endpoints/endpoints.go @@ -175,6 +175,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, diff --git a/service/taxsettings/api_op_BatchPutTaxRegistration.go b/service/taxsettings/api_op_BatchPutTaxRegistration.go index d30459e1680..b4923573df9 100644 --- a/service/taxsettings/api_op_BatchPutTaxRegistration.go +++ b/service/taxsettings/api_op_BatchPutTaxRegistration.go @@ -48,24 +48,32 @@ import ( // // Malaysia // -// - If you use this operation to set a tax registration number (TRN) in -// Malaysia, only resellers with a valid sales and service tax (SST) number are -// required to provide tax registration information. +// - The sector valid values are Business and Individual . +// +// - RegistrationType valid values are NRIC for individual, and TIN and sales and +// service tax (SST) for Business. +// +// - For individual, you can specify the taxInformationNumber in +// MalaysiaAdditionalInfo with NRIC type, and a valid MyKad or NRIC number. +// +// - For business, you must specify a businessRegistrationNumber in +// MalaysiaAdditionalInfo with a TIN type and tax identification number. // -// - By using this API operation to set a TRN in Malaysia, Amazon Web Services -// will regard you as self-declaring that you're an authorized business reseller -// registered with the Royal Malaysia Customs Department (RMCD) and have a valid +// - For business resellers, you must specify a businessRegistrationNumber and +// taxInformationNumber in MalaysiaAdditionalInfo with a sales and service tax +// (SST) type and a valid SST number. +// +// - For business resellers with service codes, you must specify +// businessRegistrationNumber , taxInformationNumber , and distinct +// serviceTaxCodes in MalaysiaAdditionalInfo with a SST type and valid sales and +// service tax (SST) number. By using this API operation, Amazon Web Services +// registers your self-declaration that you’re an authorized business reseller +// registered with the Royal Malaysia Customs Department (RMCD), and have a valid // SST number. // // - Amazon Web Services reserves the right to seek additional information // and/or take other actions to support your self-declaration as appropriate. // -// - If you're not a reseller of Amazon Web Services, we don't recommend that -// you use this operation to set the TRN in Malaysia. -// -// - Only use this API operation to upload the TRNs for accounts through which -// you're reselling Amazon Web Services. -// // - Amazon Web Services is currently registered under the following service tax // codes. You must include at least one of the service tax codes in the service tax // code strings to declare yourself as an authorized registered business reseller. diff --git a/service/taxsettings/api_op_DeleteSupplementalTaxRegistration.go b/service/taxsettings/api_op_DeleteSupplementalTaxRegistration.go new file mode 100644 index 00000000000..8e3ad3e0107 --- /dev/null +++ b/service/taxsettings/api_op_DeleteSupplementalTaxRegistration.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +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 supplemental tax registration for a single account. +func (c *Client) DeleteSupplementalTaxRegistration(ctx context.Context, params *DeleteSupplementalTaxRegistrationInput, optFns ...func(*Options)) (*DeleteSupplementalTaxRegistrationOutput, error) { + if params == nil { + params = &DeleteSupplementalTaxRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSupplementalTaxRegistration", params, optFns, c.addOperationDeleteSupplementalTaxRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSupplementalTaxRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSupplementalTaxRegistrationInput struct { + + // The unique authority Id for the supplemental TRN information that needs to be + // deleted. + // + // This member is required. + AuthorityId *string + + noSmithyDocumentSerde +} + +type DeleteSupplementalTaxRegistrationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSupplementalTaxRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSupplementalTaxRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSupplementalTaxRegistration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSupplementalTaxRegistration"); 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 = addOpDeleteSupplementalTaxRegistrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSupplementalTaxRegistration(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_opDeleteSupplementalTaxRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteSupplementalTaxRegistration", + } +} diff --git a/service/taxsettings/api_op_ListSupplementalTaxRegistrations.go b/service/taxsettings/api_op_ListSupplementalTaxRegistrations.go new file mode 100644 index 00000000000..5de48c27b04 --- /dev/null +++ b/service/taxsettings/api_op_ListSupplementalTaxRegistrations.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves supplemental tax registrations for a single account. +func (c *Client) ListSupplementalTaxRegistrations(ctx context.Context, params *ListSupplementalTaxRegistrationsInput, optFns ...func(*Options)) (*ListSupplementalTaxRegistrationsOutput, error) { + if params == nil { + params = &ListSupplementalTaxRegistrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSupplementalTaxRegistrations", params, optFns, c.addOperationListSupplementalTaxRegistrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSupplementalTaxRegistrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSupplementalTaxRegistrationsInput struct { + + // The number of taxRegistrations results you want in one response. + MaxResults *int32 + + // The token to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSupplementalTaxRegistrationsOutput struct { + + // The list of supplemental tax registrations. + // + // This member is required. + TaxRegistrations []types.SupplementalTaxRegistration + + // The token to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSupplementalTaxRegistrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSupplementalTaxRegistrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSupplementalTaxRegistrations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSupplementalTaxRegistrations"); 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_opListSupplementalTaxRegistrations(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 +} + +// ListSupplementalTaxRegistrationsPaginatorOptions is the paginator options for +// ListSupplementalTaxRegistrations +type ListSupplementalTaxRegistrationsPaginatorOptions struct { + // The number of taxRegistrations results you want in one 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 +} + +// ListSupplementalTaxRegistrationsPaginator is a paginator for +// ListSupplementalTaxRegistrations +type ListSupplementalTaxRegistrationsPaginator struct { + options ListSupplementalTaxRegistrationsPaginatorOptions + client ListSupplementalTaxRegistrationsAPIClient + params *ListSupplementalTaxRegistrationsInput + nextToken *string + firstPage bool +} + +// NewListSupplementalTaxRegistrationsPaginator returns a new +// ListSupplementalTaxRegistrationsPaginator +func NewListSupplementalTaxRegistrationsPaginator(client ListSupplementalTaxRegistrationsAPIClient, params *ListSupplementalTaxRegistrationsInput, optFns ...func(*ListSupplementalTaxRegistrationsPaginatorOptions)) *ListSupplementalTaxRegistrationsPaginator { + if params == nil { + params = &ListSupplementalTaxRegistrationsInput{} + } + + options := ListSupplementalTaxRegistrationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSupplementalTaxRegistrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSupplementalTaxRegistrationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSupplementalTaxRegistrations page. +func (p *ListSupplementalTaxRegistrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSupplementalTaxRegistrationsOutput, 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.ListSupplementalTaxRegistrations(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 +} + +// ListSupplementalTaxRegistrationsAPIClient is a client that implements the +// ListSupplementalTaxRegistrations operation. +type ListSupplementalTaxRegistrationsAPIClient interface { + ListSupplementalTaxRegistrations(context.Context, *ListSupplementalTaxRegistrationsInput, ...func(*Options)) (*ListSupplementalTaxRegistrationsOutput, error) +} + +var _ ListSupplementalTaxRegistrationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListSupplementalTaxRegistrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListSupplementalTaxRegistrations", + } +} diff --git a/service/taxsettings/api_op_PutSupplementalTaxRegistration.go b/service/taxsettings/api_op_PutSupplementalTaxRegistration.go new file mode 100644 index 00000000000..2193ff8f8df --- /dev/null +++ b/service/taxsettings/api_op_PutSupplementalTaxRegistration.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/taxsettings/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stores supplemental tax registration for a single account. +func (c *Client) PutSupplementalTaxRegistration(ctx context.Context, params *PutSupplementalTaxRegistrationInput, optFns ...func(*Options)) (*PutSupplementalTaxRegistrationOutput, error) { + if params == nil { + params = &PutSupplementalTaxRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutSupplementalTaxRegistration", params, optFns, c.addOperationPutSupplementalTaxRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutSupplementalTaxRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutSupplementalTaxRegistrationInput struct { + + // The supplemental TRN information that will be stored for the caller account + // ID. + // + // This member is required. + TaxRegistrationEntry *types.SupplementalTaxRegistrationEntry + + noSmithyDocumentSerde +} + +type PutSupplementalTaxRegistrationOutput struct { + + // Unique authority ID for the supplemental TRN information that was stored. + // + // This member is required. + AuthorityId *string + + // The status of the supplemental TRN stored in the system after processing. + // Based on the validation occurring on the TRN, the status can be Verified , + // Pending , Rejected , or Deleted . + // + // This member is required. + Status types.TaxRegistrationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutSupplementalTaxRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSupplementalTaxRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSupplementalTaxRegistration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutSupplementalTaxRegistration"); 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 = addOpPutSupplementalTaxRegistrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSupplementalTaxRegistration(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_opPutSupplementalTaxRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutSupplementalTaxRegistration", + } +} diff --git a/service/taxsettings/api_op_PutTaxRegistration.go b/service/taxsettings/api_op_PutTaxRegistration.go index 183a4633261..89c76181fa3 100644 --- a/service/taxsettings/api_op_PutTaxRegistration.go +++ b/service/taxsettings/api_op_PutTaxRegistration.go @@ -46,24 +46,32 @@ import ( // // Malaysia // -// - If you use this operation to set a tax registration number (TRN) in -// Malaysia, only resellers with a valid sales and service tax (SST) number are -// required to provide tax registration information. +// - The sector valid values are Business and Individual . +// +// - RegistrationType valid values are NRIC for individual, and TIN and sales and +// service tax (SST) for Business. +// +// - For individual, you can specify the taxInformationNumber in +// MalaysiaAdditionalInfo with NRIC type, and a valid MyKad or NRIC number. +// +// - For business, you must specify a businessRegistrationNumber in +// MalaysiaAdditionalInfo with a TIN type and tax identification number. // -// - By using this API operation to set a TRN in Malaysia, Amazon Web Services -// will regard you as self-declaring that you're an authorized business reseller -// registered with the Royal Malaysia Customs Department (RMCD) and have a valid +// - For business resellers, you must specify a businessRegistrationNumber and +// taxInformationNumber in MalaysiaAdditionalInfo with a sales and service tax +// (SST) type and a valid SST number. +// +// - For business resellers with service codes, you must specify +// businessRegistrationNumber , taxInformationNumber , and distinct +// serviceTaxCodes in MalaysiaAdditionalInfo with a SST type and valid sales and +// service tax (SST) number. By using this API operation, Amazon Web Services +// registers your self-declaration that you’re an authorized business reseller +// registered with the Royal Malaysia Customs Department (RMCD), and have a valid // SST number. // // - Amazon Web Services reserves the right to seek additional information // and/or take other actions to support your self-declaration as appropriate. // -// - If you're not a reseller of Amazon Web Services, we don't recommend that -// you use this operation to set the TRN in Malaysia. -// -// - Only use this API operation to upload the TRNs for accounts through which -// you're reselling Amazon Web Services. -// // - Amazon Web Services is currently registered under the following service tax // codes. You must include at least one of the service tax codes in the service tax // code strings to declare yourself as an authorized registered business reseller. diff --git a/service/taxsettings/deserializers.go b/service/taxsettings/deserializers.go index bf0a5e7e56b..e0a5cbabbbf 100644 --- a/service/taxsettings/deserializers.go +++ b/service/taxsettings/deserializers.go @@ -354,6 +354,103 @@ func awsRestjson1_deserializeOpDocumentBatchPutTaxRegistrationOutput(v **BatchPu return nil } +type awsRestjson1_deserializeOpDeleteSupplementalTaxRegistration struct { +} + +func (*awsRestjson1_deserializeOpDeleteSupplementalTaxRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSupplementalTaxRegistration) HandleDeserialize(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_deserializeOpErrorDeleteSupplementalTaxRegistration(response, &metadata) + } + output := &DeleteSupplementalTaxRegistrationOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSupplementalTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteTaxRegistration struct { } @@ -381,14 +478,297 @@ func (m *awsRestjson1_deserializeOpDeleteTaxRegistration) HandleDeserialize(ctx if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteTaxRegistration(response, &metadata) } - output := &DeleteTaxRegistrationOutput{} - out.Result = output + output := &DeleteTaxRegistrationOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetTaxRegistration struct { +} + +func (*awsRestjson1_deserializeOpGetTaxRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTaxRegistration) HandleDeserialize(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_deserializeOpErrorGetTaxRegistration(response, &metadata) + } + output := &GetTaxRegistrationOutput{} + 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_deserializeOpDocumentGetTaxRegistrationOutput(&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_deserializeOpErrorGetTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentGetTaxRegistrationOutput(v **GetTaxRegistrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTaxRegistrationOutput + if *v == nil { + sv = &GetTaxRegistrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taxRegistration": + if err := awsRestjson1_deserializeDocumentTaxRegistration(&sv.TaxRegistration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetTaxRegistrationDocument struct { +} + +func (*awsRestjson1_deserializeOpGetTaxRegistrationDocument) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTaxRegistrationDocument) HandleDeserialize(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_deserializeOpErrorGetTaxRegistrationDocument(response, &metadata) + } + output := &GetTaxRegistrationDocumentOutput{} + 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_deserializeOpDocumentGetTaxRegistrationDocumentOutput(&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_deserializeOpErrorDeleteTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetTaxRegistrationDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -429,15 +809,9 @@ func awsRestjson1_deserializeOpErrorDeleteTaxRegistration(response *smithyhttp.R } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -451,14 +825,54 @@ func awsRestjson1_deserializeOpErrorDeleteTaxRegistration(response *smithyhttp.R } } -type awsRestjson1_deserializeOpGetTaxRegistration struct { +func awsRestjson1_deserializeOpDocumentGetTaxRegistrationDocumentOutput(v **GetTaxRegistrationDocumentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTaxRegistrationDocumentOutput + if *v == nil { + sv = &GetTaxRegistrationDocumentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destinationFilePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationFilePath to be of type string, got %T instead", value) + } + sv.DestinationFilePath = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpGetTaxRegistration) ID() string { +type awsRestjson1_deserializeOpListSupplementalTaxRegistrations struct { +} + +func (*awsRestjson1_deserializeOpListSupplementalTaxRegistrations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetTaxRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSupplementalTaxRegistrations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -476,9 +890,9 @@ func (m *awsRestjson1_deserializeOpGetTaxRegistration) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetTaxRegistration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSupplementalTaxRegistrations(response, &metadata) } - output := &GetTaxRegistrationOutput{} + output := &ListSupplementalTaxRegistrationsOutput{} out.Result = output var buff [1024]byte @@ -499,7 +913,7 @@ func (m *awsRestjson1_deserializeOpGetTaxRegistration) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetTaxRegistrationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSupplementalTaxRegistrationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -513,7 +927,7 @@ func (m *awsRestjson1_deserializeOpGetTaxRegistration) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSupplementalTaxRegistrations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -573,7 +987,7 @@ func awsRestjson1_deserializeOpErrorGetTaxRegistration(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetTaxRegistrationOutput(v **GetTaxRegistrationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSupplementalTaxRegistrationsOutput(v **ListSupplementalTaxRegistrationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -586,17 +1000,26 @@ func awsRestjson1_deserializeOpDocumentGetTaxRegistrationOutput(v **GetTaxRegist return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetTaxRegistrationOutput + var sv *ListSupplementalTaxRegistrationsOutput if *v == nil { - sv = &GetTaxRegistrationOutput{} + sv = &ListSupplementalTaxRegistrationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "taxRegistration": - if err := awsRestjson1_deserializeDocumentTaxRegistration(&sv.TaxRegistration, value); err != nil { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "taxRegistrations": + if err := awsRestjson1_deserializeDocumentSupplementalTaxRegistrationList(&sv.TaxRegistrations, value); err != nil { return err } @@ -609,14 +1032,14 @@ func awsRestjson1_deserializeOpDocumentGetTaxRegistrationOutput(v **GetTaxRegist return nil } -type awsRestjson1_deserializeOpGetTaxRegistrationDocument struct { +type awsRestjson1_deserializeOpListTaxRegistrations struct { } -func (*awsRestjson1_deserializeOpGetTaxRegistrationDocument) ID() string { +func (*awsRestjson1_deserializeOpListTaxRegistrations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetTaxRegistrationDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTaxRegistrations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -634,9 +1057,9 @@ func (m *awsRestjson1_deserializeOpGetTaxRegistrationDocument) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetTaxRegistrationDocument(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTaxRegistrations(response, &metadata) } - output := &GetTaxRegistrationDocumentOutput{} + output := &ListTaxRegistrationsOutput{} out.Result = output var buff [1024]byte @@ -657,7 +1080,7 @@ func (m *awsRestjson1_deserializeOpGetTaxRegistrationDocument) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetTaxRegistrationDocumentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTaxRegistrationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -671,7 +1094,7 @@ func (m *awsRestjson1_deserializeOpGetTaxRegistrationDocument) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetTaxRegistrationDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTaxRegistrations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -715,6 +1138,9 @@ func awsRestjson1_deserializeOpErrorGetTaxRegistrationDocument(response *smithyh case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -728,7 +1154,7 @@ func awsRestjson1_deserializeOpErrorGetTaxRegistrationDocument(response *smithyh } } -func awsRestjson1_deserializeOpDocumentGetTaxRegistrationDocumentOutput(v **GetTaxRegistrationDocumentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTaxRegistrationsOutput(v **ListTaxRegistrationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -741,22 +1167,27 @@ func awsRestjson1_deserializeOpDocumentGetTaxRegistrationDocumentOutput(v **GetT return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetTaxRegistrationDocumentOutput + var sv *ListTaxRegistrationsOutput if *v == nil { - sv = &GetTaxRegistrationDocumentOutput{} + sv = &ListTaxRegistrationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "destinationFilePath": + case "accountDetails": + if err := awsRestjson1_deserializeDocumentAccountDetailsList(&sv.AccountDetails, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DestinationFilePath to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationTokenString to be of type string, got %T instead", value) } - sv.DestinationFilePath = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -768,14 +1199,14 @@ func awsRestjson1_deserializeOpDocumentGetTaxRegistrationDocumentOutput(v **GetT return nil } -type awsRestjson1_deserializeOpListTaxRegistrations struct { +type awsRestjson1_deserializeOpPutSupplementalTaxRegistration struct { } -func (*awsRestjson1_deserializeOpListTaxRegistrations) ID() string { +func (*awsRestjson1_deserializeOpPutSupplementalTaxRegistration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTaxRegistrations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutSupplementalTaxRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -793,9 +1224,9 @@ func (m *awsRestjson1_deserializeOpListTaxRegistrations) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTaxRegistrations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutSupplementalTaxRegistration(response, &metadata) } - output := &ListTaxRegistrationsOutput{} + output := &PutSupplementalTaxRegistrationOutput{} out.Result = output var buff [1024]byte @@ -816,7 +1247,7 @@ func (m *awsRestjson1_deserializeOpListTaxRegistrations) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTaxRegistrationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutSupplementalTaxRegistrationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -830,7 +1261,7 @@ func (m *awsRestjson1_deserializeOpListTaxRegistrations) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTaxRegistrations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutSupplementalTaxRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -871,12 +1302,12 @@ func awsRestjson1_deserializeOpErrorListTaxRegistrations(response *smithyhttp.Re } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) @@ -890,7 +1321,7 @@ func awsRestjson1_deserializeOpErrorListTaxRegistrations(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListTaxRegistrationsOutput(v **ListTaxRegistrationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutSupplementalTaxRegistrationOutput(v **PutSupplementalTaxRegistrationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -903,27 +1334,31 @@ func awsRestjson1_deserializeOpDocumentListTaxRegistrationsOutput(v **ListTaxReg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTaxRegistrationsOutput + var sv *PutSupplementalTaxRegistrationOutput if *v == nil { - sv = &ListTaxRegistrationsOutput{} + sv = &PutSupplementalTaxRegistrationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "accountDetails": - if err := awsRestjson1_deserializeDocumentAccountDetailsList(&sv.AccountDetails, value); err != nil { - return err + case "authorityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AuthorityId = ptr.String(jtv) } - case "nextToken": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationTokenString to be of type string, got %T instead", value) + return fmt.Errorf("expected TaxRegistrationStatus to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Status = types.TaxRegistrationStatus(jtv) } default: @@ -2392,11 +2827,29 @@ func awsRestjson1_deserializeDocumentMalaysiaAdditionalInfo(v **types.MalaysiaAd for key, value := range shape { switch key { + case "businessRegistrationNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BusinessRegistrationNumber to be of type string, got %T instead", value) + } + sv.BusinessRegistrationNumber = ptr.String(jtv) + } + case "serviceTaxCodes": if err := awsRestjson1_deserializeDocumentMalaysiaServiceTaxCodesList(&sv.ServiceTaxCodes, value); err != nil { return err } + case "taxInformationNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxInformationNumber to be of type string, got %T instead", value) + } + sv.TaxInformationNumber = ptr.String(jtv) + } + default: _, _ = key, value @@ -2718,6 +3171,121 @@ func awsRestjson1_deserializeDocumentSpainAdditionalInfo(v **types.SpainAddition return nil } +func awsRestjson1_deserializeDocumentSupplementalTaxRegistration(v **types.SupplementalTaxRegistration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SupplementalTaxRegistration + if *v == nil { + sv = &types.SupplementalTaxRegistration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "authorityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AuthorityId = ptr.String(jtv) + } + + case "legalName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LegalName to be of type string, got %T instead", value) + } + sv.LegalName = ptr.String(jtv) + } + + case "registrationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegistrationId to be of type string, got %T instead", value) + } + sv.RegistrationId = ptr.String(jtv) + } + + case "registrationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SupplementalTaxRegistrationType to be of type string, got %T instead", value) + } + sv.RegistrationType = types.SupplementalTaxRegistrationType(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaxRegistrationStatus to be of type string, got %T instead", value) + } + sv.Status = types.TaxRegistrationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSupplementalTaxRegistrationList(v *[]types.SupplementalTaxRegistration, 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.SupplementalTaxRegistration + if *v == nil { + cv = []types.SupplementalTaxRegistration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SupplementalTaxRegistration + destAddr := &col + if err := awsRestjson1_deserializeDocumentSupplementalTaxRegistration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTaxDocumentMetadata(v **types.TaxDocumentMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/taxsettings/generated.json b/service/taxsettings/generated.json index bfe4c8c8457..1810f5d9b8b 100644 --- a/service/taxsettings/generated.json +++ b/service/taxsettings/generated.json @@ -10,10 +10,13 @@ "api_client_test.go", "api_op_BatchDeleteTaxRegistration.go", "api_op_BatchPutTaxRegistration.go", + "api_op_DeleteSupplementalTaxRegistration.go", "api_op_DeleteTaxRegistration.go", "api_op_GetTaxRegistration.go", "api_op_GetTaxRegistrationDocument.go", + "api_op_ListSupplementalTaxRegistrations.go", "api_op_ListTaxRegistrations.go", + "api_op_PutSupplementalTaxRegistration.go", "api_op_PutTaxRegistration.go", "auth.go", "deserializers.go", diff --git a/service/taxsettings/serializers.go b/service/taxsettings/serializers.go index 3608535cd6b..600fd81af33 100644 --- a/service/taxsettings/serializers.go +++ b/service/taxsettings/serializers.go @@ -188,6 +188,87 @@ func awsRestjson1_serializeOpDocumentBatchPutTaxRegistrationInput(v *BatchPutTax return nil } +type awsRestjson1_serializeOpDeleteSupplementalTaxRegistration struct { +} + +func (*awsRestjson1_serializeOpDeleteSupplementalTaxRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSupplementalTaxRegistration) 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.(*DeleteSupplementalTaxRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteSupplementalTaxRegistration") + 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_serializeOpDocumentDeleteSupplementalTaxRegistrationInput(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_serializeOpHttpBindingsDeleteSupplementalTaxRegistrationInput(v *DeleteSupplementalTaxRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteSupplementalTaxRegistrationInput(v *DeleteSupplementalTaxRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AuthorityId != nil { + ok := object.Key("authorityId") + ok.String(*v.AuthorityId) + } + + return nil +} + type awsRestjson1_serializeOpDeleteTaxRegistration struct { } @@ -440,6 +521,92 @@ func awsRestjson1_serializeOpDocumentGetTaxRegistrationDocumentInput(v *GetTaxRe return nil } +type awsRestjson1_serializeOpListSupplementalTaxRegistrations struct { +} + +func (*awsRestjson1_serializeOpListSupplementalTaxRegistrations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSupplementalTaxRegistrations) 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.(*ListSupplementalTaxRegistrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListSupplementalTaxRegistrations") + 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_serializeOpDocumentListSupplementalTaxRegistrationsInput(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_serializeOpHttpBindingsListSupplementalTaxRegistrationsInput(v *ListSupplementalTaxRegistrationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListSupplementalTaxRegistrationsInput(v *ListSupplementalTaxRegistrationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListTaxRegistrations struct { } @@ -526,6 +693,89 @@ func awsRestjson1_serializeOpDocumentListTaxRegistrationsInput(v *ListTaxRegistr return nil } +type awsRestjson1_serializeOpPutSupplementalTaxRegistration struct { +} + +func (*awsRestjson1_serializeOpPutSupplementalTaxRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutSupplementalTaxRegistration) 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.(*PutSupplementalTaxRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/PutSupplementalTaxRegistration") + 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_serializeOpDocumentPutSupplementalTaxRegistrationInput(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_serializeOpHttpBindingsPutSupplementalTaxRegistrationInput(v *PutSupplementalTaxRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutSupplementalTaxRegistrationInput(v *PutSupplementalTaxRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TaxRegistrationEntry != nil { + ok := object.Key("taxRegistrationEntry") + if err := awsRestjson1_serializeDocumentSupplementalTaxRegistrationEntry(v.TaxRegistrationEntry, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpPutTaxRegistration struct { } @@ -905,6 +1155,11 @@ func awsRestjson1_serializeDocumentMalaysiaAdditionalInfo(v *types.MalaysiaAddit object := value.Object() defer object.Close() + if v.BusinessRegistrationNumber != nil { + ok := object.Key("businessRegistrationNumber") + ok.String(*v.BusinessRegistrationNumber) + } + if v.ServiceTaxCodes != nil { ok := object.Key("serviceTaxCodes") if err := awsRestjson1_serializeDocumentMalaysiaServiceTaxCodesList(v.ServiceTaxCodes, ok); err != nil { @@ -912,6 +1167,11 @@ func awsRestjson1_serializeDocumentMalaysiaAdditionalInfo(v *types.MalaysiaAddit } } + if v.TaxInformationNumber != nil { + ok := object.Key("taxInformationNumber") + ok.String(*v.TaxInformationNumber) + } + return nil } @@ -1018,6 +1278,35 @@ func awsRestjson1_serializeDocumentSpainAdditionalInfo(v *types.SpainAdditionalI return nil } +func awsRestjson1_serializeDocumentSupplementalTaxRegistrationEntry(v *types.SupplementalTaxRegistrationEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Address != nil { + ok := object.Key("address") + if err := awsRestjson1_serializeDocumentAddress(v.Address, ok); err != nil { + return err + } + } + + if v.LegalName != nil { + ok := object.Key("legalName") + ok.String(*v.LegalName) + } + + if v.RegistrationId != nil { + ok := object.Key("registrationId") + ok.String(*v.RegistrationId) + } + + if len(v.RegistrationType) > 0 { + ok := object.Key("registrationType") + ok.String(string(v.RegistrationType)) + } + + return nil +} + func awsRestjson1_serializeDocumentTaxDocumentMetadata(v *types.TaxDocumentMetadata, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/taxsettings/snapshot/api_op_DeleteSupplementalTaxRegistration.go.snap b/service/taxsettings/snapshot/api_op_DeleteSupplementalTaxRegistration.go.snap new file mode 100644 index 00000000000..af826e0b4d4 --- /dev/null +++ b/service/taxsettings/snapshot/api_op_DeleteSupplementalTaxRegistration.go.snap @@ -0,0 +1,41 @@ +DeleteSupplementalTaxRegistration + 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/taxsettings/snapshot/api_op_ListSupplementalTaxRegistrations.go.snap b/service/taxsettings/snapshot/api_op_ListSupplementalTaxRegistrations.go.snap new file mode 100644 index 00000000000..857a4716851 --- /dev/null +++ b/service/taxsettings/snapshot/api_op_ListSupplementalTaxRegistrations.go.snap @@ -0,0 +1,40 @@ +ListSupplementalTaxRegistrations + 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/taxsettings/snapshot/api_op_PutSupplementalTaxRegistration.go.snap b/service/taxsettings/snapshot/api_op_PutSupplementalTaxRegistration.go.snap new file mode 100644 index 00000000000..6ca4c4d3a06 --- /dev/null +++ b/service/taxsettings/snapshot/api_op_PutSupplementalTaxRegistration.go.snap @@ -0,0 +1,41 @@ +PutSupplementalTaxRegistration + 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/taxsettings/snapshot_test.go b/service/taxsettings/snapshot_test.go index 045d7743d68..6143f2f1fa2 100644 --- a/service/taxsettings/snapshot_test.go +++ b/service/taxsettings/snapshot_test.go @@ -86,6 +86,18 @@ func TestCheckSnapshot_BatchPutTaxRegistration(t *testing.T) { } } +func TestCheckSnapshot_DeleteSupplementalTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteSupplementalTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteSupplementalTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteTaxRegistration(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteTaxRegistration(context.Background(), nil, func(o *Options) { @@ -122,6 +134,18 @@ func TestCheckSnapshot_GetTaxRegistrationDocument(t *testing.T) { } } +func TestCheckSnapshot_ListSupplementalTaxRegistrations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListSupplementalTaxRegistrations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListSupplementalTaxRegistrations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTaxRegistrations(t *testing.T) { svc := New(Options{}) _, err := svc.ListTaxRegistrations(context.Background(), nil, func(o *Options) { @@ -134,6 +158,18 @@ func TestCheckSnapshot_ListTaxRegistrations(t *testing.T) { } } +func TestCheckSnapshot_PutSupplementalTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutSupplementalTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutSupplementalTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_PutTaxRegistration(t *testing.T) { svc := New(Options{}) _, err := svc.PutTaxRegistration(context.Background(), nil, func(o *Options) { @@ -169,6 +205,18 @@ func TestUpdateSnapshot_BatchPutTaxRegistration(t *testing.T) { } } +func TestUpdateSnapshot_DeleteSupplementalTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteSupplementalTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteSupplementalTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteTaxRegistration(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteTaxRegistration(context.Background(), nil, func(o *Options) { @@ -205,6 +253,18 @@ func TestUpdateSnapshot_GetTaxRegistrationDocument(t *testing.T) { } } +func TestUpdateSnapshot_ListSupplementalTaxRegistrations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListSupplementalTaxRegistrations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListSupplementalTaxRegistrations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTaxRegistrations(t *testing.T) { svc := New(Options{}) _, err := svc.ListTaxRegistrations(context.Background(), nil, func(o *Options) { @@ -217,6 +277,18 @@ func TestUpdateSnapshot_ListTaxRegistrations(t *testing.T) { } } +func TestUpdateSnapshot_PutSupplementalTaxRegistration(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutSupplementalTaxRegistration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutSupplementalTaxRegistration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_PutTaxRegistration(t *testing.T) { svc := New(Options{}) _, err := svc.PutTaxRegistration(context.Background(), nil, func(o *Options) { diff --git a/service/taxsettings/types/enums.go b/service/taxsettings/types/enums.go index b7693589a8c..6903248b054 100644 --- a/service/taxsettings/types/enums.go +++ b/service/taxsettings/types/enums.go @@ -194,6 +194,24 @@ func (Sector) Values() []Sector { } } +type SupplementalTaxRegistrationType string + +// Enum values for SupplementalTaxRegistrationType +const ( + SupplementalTaxRegistrationTypeVat SupplementalTaxRegistrationType = "VAT" +) + +// Values returns all known values for SupplementalTaxRegistrationType. 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 (SupplementalTaxRegistrationType) Values() []SupplementalTaxRegistrationType { + return []SupplementalTaxRegistrationType{ + "VAT", + } +} + type TaxRegistrationNumberType string // Enum values for TaxRegistrationNumberType @@ -245,6 +263,8 @@ const ( TaxRegistrationTypeCpf TaxRegistrationType = "CPF" TaxRegistrationTypeCnpj TaxRegistrationType = "CNPJ" TaxRegistrationTypeSst TaxRegistrationType = "SST" + TaxRegistrationTypeTin TaxRegistrationType = "TIN" + TaxRegistrationTypeNric TaxRegistrationType = "NRIC" ) // Values returns all known values for TaxRegistrationType. Note that this can be @@ -258,6 +278,8 @@ func (TaxRegistrationType) Values() []TaxRegistrationType { "CPF", "CNPJ", "SST", + "TIN", + "NRIC", } } diff --git a/service/taxsettings/types/types.go b/service/taxsettings/types/types.go index 6e1e49fcc59..7afa6345cfb 100644 --- a/service/taxsettings/types/types.go +++ b/service/taxsettings/types/types.go @@ -201,7 +201,9 @@ type Address struct { // you set a TRN in Brazil, use districtOrCounty for the neighborhood name. DistrictOrCounty *string - // The state, region, or province that the address is located. + // The state, region, or province that the address is located. This field is only + // required for Canada, India, United Arab Emirates, Romania, and Brazil (CPF). It + // is optional for all other countries. // // If this is required for tax settings, use the same name as shown on the Tax // Settings page. @@ -280,9 +282,9 @@ type CanadaAdditionalInfo struct { CanadaQuebecSalesTaxNumber *string // Manitoba Retail Sales Tax ID number. Customers purchasing Amazon Web Services - // for resale in Manitoba must provide a valid Retail Sales Tax ID number for - // Manitoba. Leave this blank if you do not have a Retail Sales Tax ID number in - // Manitoba or are not purchasing Amazon Web Services for resale. + // services for resale in Manitoba must provide a valid Retail Sales Tax ID number + // for Manitoba. Leave this blank if you do not have a Retail Sales Tax ID number + // in Manitoba or are not purchasing Amazon Web Services services for resale. CanadaRetailSalesTaxNumber *string // The value for this parameter must be true if the provincialSalesTaxId value is @@ -432,11 +434,43 @@ type KenyaAdditionalInfo struct { // Additional tax information associated with your TRN in Malaysia. type MalaysiaAdditionalInfo struct { - // List of service tax codes for your TRN in Malaysia. + // The tax registration number (TRN) in Malaysia. // - // This member is required. + // For individual, you can specify the taxInformationNumber in + // MalaysiaAdditionalInfo with NRIC type, and a valid MyKad or NRIC number. For + // business, you must specify a businessRegistrationNumber in + // MalaysiaAdditionalInfo with a TIN type and tax identification number. For + // business resellers, you must specify a businessRegistrationNumber and + // taxInformationNumber in MalaysiaAdditionalInfo with a sales and service tax + // (SST) type and a valid SST number. + // + // For business resellers with service codes, you must specify + // businessRegistrationNumber , taxInformationNumber , and distinct serviceTaxCodes + // in MalaysiaAdditionalInfo with a SST type and valid sales and service tax (SST) + // number. By using this API operation, Amazon Web Services registers your + // self-declaration that you’re an authorized business reseller registered with the + // Royal Malaysia Customs Department (RMCD), and have a valid SST number. + BusinessRegistrationNumber *string + + // List of service tax codes for your TRN in Malaysia. ServiceTaxCodes []MalaysiaServiceTaxCode + // The tax information number in Malaysia. + // + // For individual, you can specify the taxInformationNumber in + // MalaysiaAdditionalInfo with NRIC type, and a valid MyKad or NRIC number. For + // business resellers, you must specify a businessRegistrationNumber and + // taxInformationNumber in MalaysiaAdditionalInfo with a sales and service tax + // (SST) type and a valid SST number. + // + // For business resellers with service codes, you must specify + // businessRegistrationNumber , taxInformationNumber , and distinct serviceTaxCodes + // in MalaysiaAdditionalInfo with a SST type and valid sales and service tax (SST) + // number. By using this API operation, Amazon Web Services registers your + // self-declaration that you’re an authorized business reseller registered with the + // Royal Malaysia Customs Department (RMCD), and have a valid SST number. + TaxInformationNumber *string + noSmithyDocumentSerde } @@ -526,6 +560,70 @@ type SpainAdditionalInfo struct { noSmithyDocumentSerde } +// Supplemental TRN details. +type SupplementalTaxRegistration struct { + + // The details of the address associated with the TRN information. + // + // This member is required. + Address *Address + + // Unique authority ID for the supplemental TRN. + // + // This member is required. + AuthorityId *string + + // The legal name associated with your TRN registration. + // + // This member is required. + LegalName *string + + // The supplemental TRN unique identifier. + // + // This member is required. + RegistrationId *string + + // Type of supplemental TRN. Currently, this can only be VAT. + // + // This member is required. + RegistrationType SupplementalTaxRegistrationType + + // The status of your TRN. + // + // This member is required. + Status TaxRegistrationStatus + + noSmithyDocumentSerde +} + +// The supplemental TRN information to provide when adding or updating a +// +// supplemental TRN. +type SupplementalTaxRegistrationEntry struct { + + // The details of the address associated with the TRN information. + // + // This member is required. + Address *Address + + // The legal name associated with your TRN registration. + // + // This member is required. + LegalName *string + + // The supplemental TRN unique identifier. + // + // This member is required. + RegistrationId *string + + // Type of supplemental TRN. Currently, this can only be VAT. + // + // This member is required. + RegistrationType SupplementalTaxRegistrationType + + noSmithyDocumentSerde +} + // The metadata for your tax document. type TaxDocumentMetadata struct { diff --git a/service/taxsettings/validators.go b/service/taxsettings/validators.go index da65ad34e14..3f484b80f7b 100644 --- a/service/taxsettings/validators.go +++ b/service/taxsettings/validators.go @@ -50,6 +50,26 @@ func (m *validateOpBatchPutTaxRegistration) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpDeleteSupplementalTaxRegistration struct { +} + +func (*validateOpDeleteSupplementalTaxRegistration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSupplementalTaxRegistration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSupplementalTaxRegistrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSupplementalTaxRegistrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetTaxRegistrationDocument struct { } @@ -70,6 +90,26 @@ func (m *validateOpGetTaxRegistrationDocument) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpPutSupplementalTaxRegistration struct { +} + +func (*validateOpPutSupplementalTaxRegistration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutSupplementalTaxRegistration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutSupplementalTaxRegistrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutSupplementalTaxRegistrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutTaxRegistration struct { } @@ -98,10 +138,18 @@ func addOpBatchPutTaxRegistrationValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpBatchPutTaxRegistration{}, middleware.After) } +func addOpDeleteSupplementalTaxRegistrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSupplementalTaxRegistration{}, middleware.After) +} + func addOpGetTaxRegistrationDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTaxRegistrationDocument{}, middleware.After) } +func addOpPutSupplementalTaxRegistrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutSupplementalTaxRegistration{}, middleware.After) +} + func addOpPutTaxRegistrationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutTaxRegistration{}, middleware.After) } @@ -111,11 +159,6 @@ func validateAdditionalInfoRequest(v *types.AdditionalInfoRequest) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "AdditionalInfoRequest"} - if v.MalaysiaAdditionalInfo != nil { - if err := validateMalaysiaAdditionalInfo(v.MalaysiaAdditionalInfo); err != nil { - invalidParams.AddNested("MalaysiaAdditionalInfo", err.(smithy.InvalidParamsError)) - } - } if v.IsraelAdditionalInfo != nil { if err := validateIsraelAdditionalInfo(v.IsraelAdditionalInfo); err != nil { invalidParams.AddNested("IsraelAdditionalInfo", err.(smithy.InvalidParamsError)) @@ -265,21 +308,6 @@ func validateKenyaAdditionalInfo(v *types.KenyaAdditionalInfo) error { } } -func validateMalaysiaAdditionalInfo(v *types.MalaysiaAdditionalInfo) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "MalaysiaAdditionalInfo"} - if v.ServiceTaxCodes == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceTaxCodes")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateRomaniaAdditionalInfo(v *types.RomaniaAdditionalInfo) error { if v == nil { return nil @@ -349,6 +377,34 @@ func validateSpainAdditionalInfo(v *types.SpainAdditionalInfo) error { } } +func validateSupplementalTaxRegistrationEntry(v *types.SupplementalTaxRegistrationEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SupplementalTaxRegistrationEntry"} + if v.RegistrationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationId")) + } + if len(v.RegistrationType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationType")) + } + if v.LegalName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LegalName")) + } + if v.Address == nil { + invalidParams.Add(smithy.NewErrParamRequired("Address")) + } else if v.Address != nil { + if err := validateAddress(v.Address); err != nil { + invalidParams.AddNested("Address", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTaxDocumentMetadata(v *types.TaxDocumentMetadata) error { if v == nil { return nil @@ -505,6 +561,21 @@ func validateOpBatchPutTaxRegistrationInput(v *BatchPutTaxRegistrationInput) err } } +func validateOpDeleteSupplementalTaxRegistrationInput(v *DeleteSupplementalTaxRegistrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSupplementalTaxRegistrationInput"} + if v.AuthorityId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AuthorityId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetTaxRegistrationDocumentInput(v *GetTaxRegistrationDocumentInput) error { if v == nil { return nil @@ -531,6 +602,25 @@ func validateOpGetTaxRegistrationDocumentInput(v *GetTaxRegistrationDocumentInpu } } +func validateOpPutSupplementalTaxRegistrationInput(v *PutSupplementalTaxRegistrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutSupplementalTaxRegistrationInput"} + if v.TaxRegistrationEntry == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaxRegistrationEntry")) + } else if v.TaxRegistrationEntry != nil { + if err := validateSupplementalTaxRegistrationEntry(v.TaxRegistrationEntry); err != nil { + invalidParams.AddNested("TaxRegistrationEntry", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutTaxRegistrationInput(v *PutTaxRegistrationInput) error { if v == nil { return nil