From 5764f5c5eabe5734189f43f674271cbffac355f6 Mon Sep 17 00:00:00 2001 From: Tianyi Wang Date: Tue, 6 Feb 2024 16:30:07 -0500 Subject: [PATCH] restore dynamodb model and service --- codegen/sdk-codegen/aws-models/dynamodb.json | 182 +---------- service/dynamodb/api_client.go | 19 +- ...i_op_DisableKinesisStreamingDestination.go | 6 - ...pi_op_EnableKinesisStreamingDestination.go | 6 - service/dynamodb/auth.go | 8 +- service/dynamodb/deserializers.go | 285 ------------------ service/dynamodb/endpoints.go | 8 +- service/dynamodb/generated.json | 1 - service/dynamodb/options.go | 4 - service/dynamodb/serializers.go | 117 ------- service/dynamodb/types/enums.go | 21 -- service/dynamodb/types/types.go | 27 +- service/dynamodb/validators.go | 42 --- 13 files changed, 19 insertions(+), 707 deletions(-) diff --git a/codegen/sdk-codegen/aws-models/dynamodb.json b/codegen/sdk-codegen/aws-models/dynamodb.json index 29015a76316..c47b042f527 100644 --- a/codegen/sdk-codegen/aws-models/dynamodb.json +++ b/codegen/sdk-codegen/aws-models/dynamodb.json @@ -25,35 +25,10 @@ { "id": "Service", "namespace": "*" - }, - { - "id": "RuleSetAwsBuiltIn.AWS::Auth::AccountId", - "namespace": "*" - }, - { - "id": "RuleSetParameter.TestCase.Unused", - "namespace": "*" } ] }, "shapes": { - "com.amazonaws.dynamodb#ApproximateCreationDateTimePrecision": { - "type": "enum", - "members": { - "MILLISECOND": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "MILLISECOND" - } - }, - "MICROSECOND": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "MICROSECOND" - } - } - } - }, "com.amazonaws.dynamodb#ArchivalReason": { "type": "string" }, @@ -3500,12 +3475,6 @@ "traits": { "smithy.api#enumValue": "ENABLE_FAILED" } - }, - "UPDATING": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "UPDATING" - } } } }, @@ -3710,9 +3679,6 @@ { "target": "com.amazonaws.dynamodb#UpdateItem" }, - { - "target": "com.amazonaws.dynamodb#UpdateKinesisStreamingDestination" - }, { "target": "com.amazonaws.dynamodb#UpdateTable" }, @@ -3747,12 +3713,6 @@ "smithy.rules#endpointRuleSet": { "version": "1.0", "parameters": { - "AccountId": { - "builtIn": "AWS::Auth::AccountId", - "required": false, - "documentation": "The AWS account ID.", - "type": "String" - }, "Region": { "builtIn": "AWS::Region", "required": false, @@ -4831,20 +4791,6 @@ } } }, - "com.amazonaws.dynamodb#EnableKinesisStreamingConfiguration": { - "type": "structure", - "members": { - "ApproximateCreationDateTimePrecision": { - "target": "com.amazonaws.dynamodb#ApproximateCreationDateTimePrecision", - "traits": { - "smithy.api#documentation": "

Toggle for the precision of Kinesis data stream timestamp. The values are either MILLISECOND or MICROSECOND.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

Enables setting the configuration for Kinesis Streaming.

" - } - }, "com.amazonaws.dynamodb#EnableKinesisStreamingDestination": { "type": "operation", "input": { @@ -7013,12 +6959,6 @@ "traits": { "smithy.api#documentation": "

The human-readable string that corresponds to the replica status.

" } - }, - "ApproximateCreationDateTimePrecision": { - "target": "com.amazonaws.dynamodb#ApproximateCreationDateTimePrecision", - "traits": { - "smithy.api#documentation": "

The precision of the Kinesis data stream timestamp. The values are either MILLISECOND or MICROSECOND.

" - } } }, "traits": { @@ -7047,12 +6987,6 @@ "smithy.api#documentation": "

The ARN for a Kinesis data stream.

", "smithy.api#required": {} } - }, - "EnableKinesisStreamingConfiguration": { - "target": "com.amazonaws.dynamodb#EnableKinesisStreamingConfiguration", - "traits": { - "smithy.api#documentation": "

The source for the Kinesis streaming information that is being enabled.

" - } } } }, @@ -7076,12 +7010,6 @@ "traits": { "smithy.api#documentation": "

The current status of the replication.

" } - }, - "EnableKinesisStreamingConfiguration": { - "target": "com.amazonaws.dynamodb#EnableKinesisStreamingConfiguration", - "traits": { - "smithy.api#documentation": "

The destination for the Kinesis streaming information that is being enabled.

" - } } } }, @@ -7849,7 +7777,7 @@ "Statement": { "target": "com.amazonaws.dynamodb#PartiQLStatement", "traits": { - "smithy.api#documentation": "

A PartiQL statement that uses parameters.

", + "smithy.api#documentation": "

A PartiQL statment that uses parameters.

", "smithy.api#required": {} } }, @@ -7867,7 +7795,7 @@ } }, "traits": { - "smithy.api#documentation": "

Represents a PartiQL statement that uses parameters.

" + "smithy.api#documentation": "

Represents a PartiQL statment that uses parameters.

" } }, "com.amazonaws.dynamodb#ParameterizedStatements": { @@ -11815,112 +11743,6 @@ "smithy.api#output": {} } }, - "com.amazonaws.dynamodb#UpdateKinesisStreamingConfiguration": { - "type": "structure", - "members": { - "ApproximateCreationDateTimePrecision": { - "target": "com.amazonaws.dynamodb#ApproximateCreationDateTimePrecision", - "traits": { - "smithy.api#documentation": "

Enables updating the precision of Kinesis data stream timestamp.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

Enables updating the configuration for Kinesis Streaming.

" - } - }, - "com.amazonaws.dynamodb#UpdateKinesisStreamingDestination": { - "type": "operation", - "input": { - "target": "com.amazonaws.dynamodb#UpdateKinesisStreamingDestinationInput" - }, - "output": { - "target": "com.amazonaws.dynamodb#UpdateKinesisStreamingDestinationOutput" - }, - "errors": [ - { - "target": "com.amazonaws.dynamodb#InternalServerError" - }, - { - "target": "com.amazonaws.dynamodb#InvalidEndpointException" - }, - { - "target": "com.amazonaws.dynamodb#LimitExceededException" - }, - { - "target": "com.amazonaws.dynamodb#ResourceInUseException" - }, - { - "target": "com.amazonaws.dynamodb#ResourceNotFoundException" - } - ], - "traits": { - "aws.api#clientDiscoveredEndpoint": { - "required": false - }, - "smithy.api#documentation": "

The command to update the Kinesis stream destination.

" - } - }, - "com.amazonaws.dynamodb#UpdateKinesisStreamingDestinationInput": { - "type": "structure", - "members": { - "TableName": { - "target": "com.amazonaws.dynamodb#TableName", - "traits": { - "smithy.api#documentation": "

The table name for the Kinesis streaming destination input.

", - "smithy.api#required": {} - } - }, - "StreamArn": { - "target": "com.amazonaws.dynamodb#StreamArn", - "traits": { - "smithy.api#documentation": "

The ARN for the Kinesis stream input.

", - "smithy.api#required": {} - } - }, - "UpdateKinesisStreamingConfiguration": { - "target": "com.amazonaws.dynamodb#UpdateKinesisStreamingConfiguration", - "traits": { - "smithy.api#documentation": "

The command to update the Kinesis stream configuration.

" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.dynamodb#UpdateKinesisStreamingDestinationOutput": { - "type": "structure", - "members": { - "TableName": { - "target": "com.amazonaws.dynamodb#TableName", - "traits": { - "smithy.api#documentation": "

The table name for the Kinesis streaming destination output.

" - } - }, - "StreamArn": { - "target": "com.amazonaws.dynamodb#StreamArn", - "traits": { - "smithy.api#documentation": "

The ARN for the Kinesis stream input.

" - } - }, - "DestinationStatus": { - "target": "com.amazonaws.dynamodb#DestinationStatus", - "traits": { - "smithy.api#documentation": "

The status of the attempt to update the Kinesis streaming destination output.

" - } - }, - "UpdateKinesisStreamingConfiguration": { - "target": "com.amazonaws.dynamodb#UpdateKinesisStreamingConfiguration", - "traits": { - "smithy.api#documentation": "

The command to update the Kinesis streaming destination configuration.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, "com.amazonaws.dynamodb#UpdateReplicationGroupMemberAction": { "type": "structure", "members": { diff --git a/service/dynamodb/api_client.go b/service/dynamodb/api_client.go index 5de5404890c..6e54d0328d2 100644 --- a/service/dynamodb/api_client.go +++ b/service/dynamodb/api_client.go @@ -245,16 +245,15 @@ func setResolvedDefaultsMode(o *Options) { // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AccountIDEndpointMode: cfg.AccountIDEndpointMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) diff --git a/service/dynamodb/api_op_DisableKinesisStreamingDestination.go b/service/dynamodb/api_op_DisableKinesisStreamingDestination.go index 61f0972ee73..81b43d04dfe 100644 --- a/service/dynamodb/api_op_DisableKinesisStreamingDestination.go +++ b/service/dynamodb/api_op_DisableKinesisStreamingDestination.go @@ -42,9 +42,6 @@ type DisableKinesisStreamingDestinationInput struct { // This member is required. TableName *string - // The source for the Kinesis streaming information that is being enabled. - EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration - noSmithyDocumentSerde } @@ -53,9 +50,6 @@ type DisableKinesisStreamingDestinationOutput struct { // The current status of the replication. DestinationStatus types.DestinationStatus - // The destination for the Kinesis streaming information that is being enabled. - EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration - // The ARN for the specific Kinesis data stream. StreamArn *string diff --git a/service/dynamodb/api_op_EnableKinesisStreamingDestination.go b/service/dynamodb/api_op_EnableKinesisStreamingDestination.go index 9532e9e42a7..6eee7606b65 100644 --- a/service/dynamodb/api_op_EnableKinesisStreamingDestination.go +++ b/service/dynamodb/api_op_EnableKinesisStreamingDestination.go @@ -44,9 +44,6 @@ type EnableKinesisStreamingDestinationInput struct { // This member is required. TableName *string - // The source for the Kinesis streaming information that is being enabled. - EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration - noSmithyDocumentSerde } @@ -55,9 +52,6 @@ type EnableKinesisStreamingDestinationOutput struct { // The current status of the replication. DestinationStatus types.DestinationStatus - // The destination for the Kinesis streaming information that is being enabled. - EnableKinesisStreamingConfiguration *types.EnableKinesisStreamingConfiguration - // The ARN for the specific Kinesis data stream. StreamArn *string diff --git a/service/dynamodb/auth.go b/service/dynamodb/auth.go index 19ff64081f5..817a2851839 100644 --- a/service/dynamodb/auth.go +++ b/service/dynamodb/auth.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options, _ interface{}) { +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { params.Region = options.Region } @@ -90,12 +90,12 @@ type AuthResolverParameters struct { Region string } -func bindAuthResolverParams(operation string, input interface{}, options Options, ctx context.Context) *AuthResolverParameters { +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { params := &AuthResolverParameters{ Operation: operation, } - bindAuthParamsRegion(params, input, options, ctx) + bindAuthParamsRegion(params, input, options) return params } @@ -145,7 +145,7 @@ func (*resolveAuthSchemeMiddleware) ID() string { func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options, ctx) + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) if err != nil { return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) diff --git a/service/dynamodb/deserializers.go b/service/dynamodb/deserializers.go index 002ce8b9d6c..ccb22609a36 100644 --- a/service/dynamodb/deserializers.go +++ b/service/dynamodb/deserializers.go @@ -6023,129 +6023,6 @@ func awsAwsjson10_deserializeOpErrorUpdateItem(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination struct { -} - -func (*awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson10_deserializeOpUpdateKinesisStreamingDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateKinesisStreamingDestination(response, &metadata) - } - output := &UpdateKinesisStreamingDestinationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson10_deserializeOpDocumentUpdateKinesisStreamingDestinationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson10_deserializeOpErrorUpdateKinesisStreamingDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.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("InternalServerError", errorCode): - return awsAwsjson10_deserializeErrorInternalServerError(response, errorBody) - - case strings.EqualFold("InvalidEndpointException", errorCode): - return awsAwsjson10_deserializeErrorInvalidEndpointException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsAwsjson10_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - type awsAwsjson10_deserializeOpUpdateTable struct { } @@ -9784,46 +9661,6 @@ func awsAwsjson10_deserializeDocumentDuplicateItemException(v **types.DuplicateI return nil } -func awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(v **types.EnableKinesisStreamingConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", 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.EnableKinesisStreamingConfiguration - if *v == nil { - sv = &types.EnableKinesisStreamingConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ApproximateCreationDateTimePrecision": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value) - } - sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson10_deserializeDocumentEndpoint(v **types.Endpoint, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12347,15 +12184,6 @@ func awsAwsjson10_deserializeDocumentKinesisDataStreamDestination(v **types.Kine for key, value := range shape { switch key { - case "ApproximateCreationDateTimePrecision": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value) - } - sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv) - } - case "DestinationStatus": if value != nil { jtv, ok := value.(string) @@ -15659,46 +15487,6 @@ func awsAwsjson10_deserializeDocumentTransactionInProgressException(v **types.Tr return nil } -func awsAwsjson10_deserializeDocumentUpdateKinesisStreamingConfiguration(v **types.UpdateKinesisStreamingConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", 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.UpdateKinesisStreamingConfiguration - if *v == nil { - sv = &types.UpdateKinesisStreamingConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ApproximateCreationDateTimePrecision": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ApproximateCreationDateTimePrecision to be of type string, got %T instead", value) - } - sv.ApproximateCreationDateTimePrecision = types.ApproximateCreationDateTimePrecision(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson10_deserializeDocumentWriteRequest(v **types.WriteRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16745,11 +16533,6 @@ func awsAwsjson10_deserializeOpDocumentDisableKinesisStreamingDestinationOutput( sv.DestinationStatus = types.DestinationStatus(jtv) } - case "EnableKinesisStreamingConfiguration": - if err := awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(&sv.EnableKinesisStreamingConfiguration, value); err != nil { - return err - } - case "StreamArn": if value != nil { jtv, ok := value.(string) @@ -16808,11 +16591,6 @@ func awsAwsjson10_deserializeOpDocumentEnableKinesisStreamingDestinationOutput(v sv.DestinationStatus = types.DestinationStatus(jtv) } - case "EnableKinesisStreamingConfiguration": - if err := awsAwsjson10_deserializeDocumentEnableKinesisStreamingConfiguration(&sv.EnableKinesisStreamingConfiguration, value); err != nil { - return err - } - case "StreamArn": if value != nil { jtv, ok := value.(string) @@ -17929,69 +17707,6 @@ func awsAwsjson10_deserializeOpDocumentUpdateItemOutput(v **UpdateItemOutput, va return nil } -func awsAwsjson10_deserializeOpDocumentUpdateKinesisStreamingDestinationOutput(v **UpdateKinesisStreamingDestinationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateKinesisStreamingDestinationOutput - if *v == nil { - sv = &UpdateKinesisStreamingDestinationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DestinationStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationStatus to be of type string, got %T instead", value) - } - sv.DestinationStatus = types.DestinationStatus(jtv) - } - - case "StreamArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value) - } - sv.StreamArn = ptr.String(jtv) - } - - case "TableName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TableName to be of type string, got %T instead", value) - } - sv.TableName = ptr.String(jtv) - } - - case "UpdateKinesisStreamingConfiguration": - if err := awsAwsjson10_deserializeDocumentUpdateKinesisStreamingConfiguration(&sv.UpdateKinesisStreamingConfiguration, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - func awsAwsjson10_deserializeOpDocumentUpdateTableOutput(v **UpdateTableOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/dynamodb/endpoints.go b/service/dynamodb/endpoints.go index a750cef35aa..2b62d559bc9 100644 --- a/service/dynamodb/endpoints.go +++ b/service/dynamodb/endpoints.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/accountid" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/endpoints" @@ -490,7 +489,7 @@ type endpointParamsBinder interface { bindEndpointParams(*EndpointParameters) } -func bindEndpointParams(input interface{}, options Options, ctx context.Context) *EndpointParameters { +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { params := &EndpointParameters{} params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) @@ -519,9 +518,6 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { return next.HandleFinalize(ctx, in) } - if err := accountid.CheckAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil { - return out, metadata, fmt.Errorf("invalid accountID set: %w", err) - } req, ok := in.Request.(*smithyhttp.Request) if !ok { @@ -532,7 +528,7 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } - params := bindEndpointParams(getOperationInput(ctx), m.options, ctx) + params := bindEndpointParams(getOperationInput(ctx), m.options) endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) if err != nil { return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) diff --git a/service/dynamodb/generated.json b/service/dynamodb/generated.json index 215c30f52ab..7043e391d65 100644 --- a/service/dynamodb/generated.json +++ b/service/dynamodb/generated.json @@ -62,7 +62,6 @@ "api_op_UpdateGlobalTable.go", "api_op_UpdateGlobalTableSettings.go", "api_op_UpdateItem.go", - "api_op_UpdateKinesisStreamingDestination.go", "api_op_UpdateTable.go", "api_op_UpdateTableReplicaAutoScaling.go", "api_op_UpdateTimeToLive.go", diff --git a/service/dynamodb/options.go b/service/dynamodb/options.go index 58dc0d91eec..bf88e3b7635 100644 --- a/service/dynamodb/options.go +++ b/service/dynamodb/options.go @@ -5,7 +5,6 @@ package dynamodb import ( "context" "github.com/aws/aws-sdk-go-v2/aws" - accountidmode "github.com/aws/aws-sdk-go-v2/aws/accountid/mode" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" smithyauth "github.com/aws/smithy-go/auth" @@ -25,9 +24,6 @@ type Options struct { // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error - // Indicates how aws account ID is applied in endpoint2.0 routing - AccountIDEndpointMode accountidmode.AIDMode - // The optional application specific identifier appended to the User-Agent header. AppID string diff --git a/service/dynamodb/serializers.go b/service/dynamodb/serializers.go index 833253c9199..0317bd60ff7 100644 --- a/service/dynamodb/serializers.go +++ b/service/dynamodb/serializers.go @@ -2767,61 +2767,6 @@ func (m *awsAwsjson10_serializeOpUpdateItem) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUpdateKinesisStreamingDestination struct { -} - -func (*awsAwsjson10_serializeOpUpdateKinesisStreamingDestination) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson10_serializeOpUpdateKinesisStreamingDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateKinesisStreamingDestinationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("DynamoDB_20120810.UpdateKinesisStreamingDestination") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUpdateKinesisStreamingDestinationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - return next.HandleSerialize(ctx, in) -} - type awsAwsjson10_serializeOpUpdateTable struct { } @@ -3570,18 +3515,6 @@ func awsAwsjson10_serializeDocumentDeleteRequest(v *types.DeleteRequest, value s return nil } -func awsAwsjson10_serializeDocumentEnableKinesisStreamingConfiguration(v *types.EnableKinesisStreamingConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.ApproximateCreationDateTimePrecision) > 0 { - ok := object.Key("ApproximateCreationDateTimePrecision") - ok.String(string(v.ApproximateCreationDateTimePrecision)) - } - - return nil -} - func awsAwsjson10_serializeDocumentExpectedAttributeMap(v map[string]types.ExpectedAttributeValue, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4910,18 +4843,6 @@ func awsAwsjson10_serializeDocumentUpdateGlobalSecondaryIndexAction(v *types.Upd return nil } -func awsAwsjson10_serializeDocumentUpdateKinesisStreamingConfiguration(v *types.UpdateKinesisStreamingConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.ApproximateCreationDateTimePrecision) > 0 { - ok := object.Key("ApproximateCreationDateTimePrecision") - ok.String(string(v.ApproximateCreationDateTimePrecision)) - } - - return nil -} - func awsAwsjson10_serializeDocumentUpdateReplicationGroupMemberAction(v *types.UpdateReplicationGroupMemberAction, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5422,13 +5343,6 @@ func awsAwsjson10_serializeOpDocumentDisableKinesisStreamingDestinationInput(v * object := value.Object() defer object.Close() - if v.EnableKinesisStreamingConfiguration != nil { - ok := object.Key("EnableKinesisStreamingConfiguration") - if err := awsAwsjson10_serializeDocumentEnableKinesisStreamingConfiguration(v.EnableKinesisStreamingConfiguration, ok); err != nil { - return err - } - } - if v.StreamArn != nil { ok := object.Key("StreamArn") ok.String(*v.StreamArn) @@ -5446,13 +5360,6 @@ func awsAwsjson10_serializeOpDocumentEnableKinesisStreamingDestinationInput(v *E object := value.Object() defer object.Close() - if v.EnableKinesisStreamingConfiguration != nil { - ok := object.Key("EnableKinesisStreamingConfiguration") - if err := awsAwsjson10_serializeDocumentEnableKinesisStreamingConfiguration(v.EnableKinesisStreamingConfiguration, ok); err != nil { - return err - } - } - if v.StreamArn != nil { ok := object.Key("StreamArn") ok.String(*v.StreamArn) @@ -6505,30 +6412,6 @@ func awsAwsjson10_serializeOpDocumentUpdateItemInput(v *UpdateItemInput, value s return nil } -func awsAwsjson10_serializeOpDocumentUpdateKinesisStreamingDestinationInput(v *UpdateKinesisStreamingDestinationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.StreamArn != nil { - ok := object.Key("StreamArn") - ok.String(*v.StreamArn) - } - - if v.TableName != nil { - ok := object.Key("TableName") - ok.String(*v.TableName) - } - - if v.UpdateKinesisStreamingConfiguration != nil { - ok := object.Key("UpdateKinesisStreamingConfiguration") - if err := awsAwsjson10_serializeDocumentUpdateKinesisStreamingConfiguration(v.UpdateKinesisStreamingConfiguration, ok); err != nil { - return err - } - } - - return nil -} - func awsAwsjson10_serializeOpDocumentUpdateTableInput(v *UpdateTableInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/dynamodb/types/enums.go b/service/dynamodb/types/enums.go index ec617f936bd..a603b3406ef 100644 --- a/service/dynamodb/types/enums.go +++ b/service/dynamodb/types/enums.go @@ -2,25 +2,6 @@ package types -type ApproximateCreationDateTimePrecision string - -// Enum values for ApproximateCreationDateTimePrecision -const ( - ApproximateCreationDateTimePrecisionMillisecond ApproximateCreationDateTimePrecision = "MILLISECOND" - ApproximateCreationDateTimePrecisionMicrosecond ApproximateCreationDateTimePrecision = "MICROSECOND" -) - -// Values returns all known values for ApproximateCreationDateTimePrecision. 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 (ApproximateCreationDateTimePrecision) Values() []ApproximateCreationDateTimePrecision { - return []ApproximateCreationDateTimePrecision{ - "MILLISECOND", - "MICROSECOND", - } -} - type AttributeAction string // Enum values for AttributeAction @@ -284,7 +265,6 @@ const ( DestinationStatusDisabling DestinationStatus = "DISABLING" DestinationStatusDisabled DestinationStatus = "DISABLED" DestinationStatusEnableFailed DestinationStatus = "ENABLE_FAILED" - DestinationStatusUpdating DestinationStatus = "UPDATING" ) // Values returns all known values for DestinationStatus. Note that this can be @@ -297,7 +277,6 @@ func (DestinationStatus) Values() []DestinationStatus { "DISABLING", "DISABLED", "ENABLE_FAILED", - "UPDATING", } } diff --git a/service/dynamodb/types/types.go b/service/dynamodb/types/types.go index ce38bd1f41d..037de7ce4c0 100644 --- a/service/dynamodb/types/types.go +++ b/service/dynamodb/types/types.go @@ -975,16 +975,6 @@ type DeleteRequest struct { noSmithyDocumentSerde } -// Enables setting the configuration for Kinesis Streaming. -type EnableKinesisStreamingConfiguration struct { - - // Toggle for the precision of Kinesis data stream timestamp. The values are - // either MILLISECOND or MICROSECOND . - ApproximateCreationDateTimePrecision ApproximateCreationDateTimePrecision - - noSmithyDocumentSerde -} - // An endpoint information details. type Endpoint struct { @@ -1785,10 +1775,6 @@ type KeySchemaElement struct { // Describes a Kinesis data stream destination. type KinesisDataStreamDestination struct { - // The precision of the Kinesis data stream timestamp. The values are either - // MILLISECOND or MICROSECOND . - ApproximateCreationDateTimePrecision ApproximateCreationDateTimePrecision - // The current status of replication. DestinationStatus DestinationStatus @@ -1900,10 +1886,10 @@ type LocalSecondaryIndexInfo struct { noSmithyDocumentSerde } -// Represents a PartiQL statement that uses parameters. +// Represents a PartiQL statment that uses parameters. type ParameterizedStatement struct { - // A PartiQL statement that uses parameters. + // A PartiQL statment that uses parameters. // // This member is required. Statement *string @@ -3030,15 +3016,6 @@ type UpdateGlobalSecondaryIndexAction struct { noSmithyDocumentSerde } -// Enables updating the configuration for Kinesis Streaming. -type UpdateKinesisStreamingConfiguration struct { - - // Enables updating the precision of Kinesis data stream timestamp. - ApproximateCreationDateTimePrecision ApproximateCreationDateTimePrecision - - noSmithyDocumentSerde -} - // Represents a replica to be modified. type UpdateReplicationGroupMemberAction struct { diff --git a/service/dynamodb/validators.go b/service/dynamodb/validators.go index 4762e130283..1c76f46d976 100644 --- a/service/dynamodb/validators.go +++ b/service/dynamodb/validators.go @@ -850,26 +850,6 @@ func (m *validateOpUpdateItem) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } -type validateOpUpdateKinesisStreamingDestination struct { -} - -func (*validateOpUpdateKinesisStreamingDestination) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateKinesisStreamingDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateKinesisStreamingDestinationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateKinesisStreamingDestinationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpUpdateTable struct { } @@ -1098,10 +1078,6 @@ func addOpUpdateItemValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateItem{}, middleware.After) } -func addOpUpdateKinesisStreamingDestinationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateKinesisStreamingDestination{}, middleware.After) -} - func addOpUpdateTableValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateTable{}, middleware.After) } @@ -3255,24 +3231,6 @@ func validateOpUpdateItemInput(v *UpdateItemInput) error { } } -func validateOpUpdateKinesisStreamingDestinationInput(v *UpdateKinesisStreamingDestinationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateKinesisStreamingDestinationInput"} - if v.TableName == nil { - invalidParams.Add(smithy.NewErrParamRequired("TableName")) - } - if v.StreamArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("StreamArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpUpdateTableInput(v *UpdateTableInput) error { if v == nil { return nil