From 096c09e8a86721fb696fe825f41c5690db0728f4 Mon Sep 17 00:00:00 2001 From: Luc Talatinian <102624213+lucix-aws@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:22:57 -0500 Subject: [PATCH] fix plumbing for event streams and endpoint discovery (#2362) --- aws/signer/v4/middleware.go | 2 +- .../aws/go/codegen/AwsEventStreamUtils.java | 61 ++++++++---- .../codegen/EndpointDiscoveryGenerator.java | 8 +- .../auth/IgnoreAnonymousCredentials.java | 11 ++- .../protocoltest/awsrestjson/api_client.go | 2 - internal/protocoltest/awsrestjson/options.go | 6 -- internal/protocoltest/ec2query/api_client.go | 2 - internal/protocoltest/ec2query/options.go | 6 -- internal/protocoltest/jsonrpc10/api_client.go | 2 - internal/protocoltest/jsonrpc10/options.go | 6 -- internal/protocoltest/query/api_client.go | 2 - internal/protocoltest/query/options.go | 6 -- internal/protocoltest/restxml/api_client.go | 2 - internal/protocoltest/restxml/options.go | 6 -- .../restxmlwithnamespace/api_client.go | 2 - .../restxmlwithnamespace/options.go | 6 -- .../internal/customizations/unit_test.go | 7 ++ service/codecatalyst/api_client.go | 2 - service/codecatalyst/options.go | 6 -- service/dynamodb/api_op_BatchGetItem.go | 7 +- service/dynamodb/api_op_BatchWriteItem.go | 7 +- service/dynamodb/api_op_CreateBackup.go | 7 +- service/dynamodb/api_op_CreateGlobalTable.go | 7 +- service/dynamodb/api_op_CreateTable.go | 7 +- service/dynamodb/api_op_DeleteBackup.go | 7 +- service/dynamodb/api_op_DeleteItem.go | 7 +- service/dynamodb/api_op_DeleteTable.go | 7 +- service/dynamodb/api_op_DescribeBackup.go | 7 +- .../api_op_DescribeContinuousBackups.go | 7 +- .../dynamodb/api_op_DescribeGlobalTable.go | 7 +- .../api_op_DescribeGlobalTableSettings.go | 7 +- ..._op_DescribeKinesisStreamingDestination.go | 7 +- service/dynamodb/api_op_DescribeLimits.go | 7 +- service/dynamodb/api_op_DescribeTable.go | 7 +- service/dynamodb/api_op_DescribeTimeToLive.go | 7 +- ...i_op_DisableKinesisStreamingDestination.go | 7 +- ...pi_op_EnableKinesisStreamingDestination.go | 7 +- service/dynamodb/api_op_GetItem.go | 7 +- service/dynamodb/api_op_ListBackups.go | 7 +- service/dynamodb/api_op_ListGlobalTables.go | 7 +- service/dynamodb/api_op_ListTables.go | 7 +- service/dynamodb/api_op_ListTagsOfResource.go | 7 +- service/dynamodb/api_op_PutItem.go | 7 +- service/dynamodb/api_op_Query.go | 7 +- .../dynamodb/api_op_RestoreTableFromBackup.go | 7 +- .../api_op_RestoreTableToPointInTime.go | 7 +- service/dynamodb/api_op_Scan.go | 7 +- service/dynamodb/api_op_TagResource.go | 7 +- service/dynamodb/api_op_TransactGetItems.go | 7 +- service/dynamodb/api_op_TransactWriteItems.go | 7 +- service/dynamodb/api_op_UntagResource.go | 7 +- .../api_op_UpdateContinuousBackups.go | 7 +- service/dynamodb/api_op_UpdateGlobalTable.go | 7 +- .../api_op_UpdateGlobalTableSettings.go | 7 +- service/dynamodb/api_op_UpdateItem.go | 7 +- service/dynamodb/api_op_UpdateTable.go | 7 +- service/dynamodb/api_op_UpdateTimeToLive.go | 7 +- .../ec2/internal/customizations/unit_test.go | 7 ++ .../internal/endpoint-discovery/middleware.go | 44 ++++----- service/lexruntimev2/eventstream.go | 34 +++++-- .../customizations/custom_error_deser_test.go | 7 ++ service/timestreamquery/api_op_CancelQuery.go | 7 +- .../api_op_CreateScheduledQuery.go | 7 +- .../api_op_DeleteScheduledQuery.go | 7 +- .../api_op_DescribeScheduledQuery.go | 7 +- .../api_op_ExecuteScheduledQuery.go | 7 +- .../api_op_ListScheduledQueries.go | 7 +- .../api_op_ListTagsForResource.go | 7 +- .../timestreamquery/api_op_PrepareQuery.go | 7 +- service/timestreamquery/api_op_Query.go | 7 +- service/timestreamquery/api_op_TagResource.go | 7 +- .../timestreamquery/api_op_UntagResource.go | 7 +- .../api_op_UpdateScheduledQuery.go | 7 +- .../api_op_CreateBatchLoadTask.go | 7 +- .../timestreamwrite/api_op_CreateDatabase.go | 7 +- service/timestreamwrite/api_op_CreateTable.go | 7 +- .../timestreamwrite/api_op_DeleteDatabase.go | 7 +- service/timestreamwrite/api_op_DeleteTable.go | 7 +- .../api_op_DescribeBatchLoadTask.go | 7 +- .../api_op_DescribeDatabase.go | 7 +- .../timestreamwrite/api_op_DescribeTable.go | 7 +- .../api_op_ListBatchLoadTasks.go | 7 +- .../timestreamwrite/api_op_ListDatabases.go | 7 +- service/timestreamwrite/api_op_ListTables.go | 7 +- .../api_op_ListTagsForResource.go | 7 +- .../api_op_ResumeBatchLoadTask.go | 7 +- service/timestreamwrite/api_op_TagResource.go | 7 +- .../timestreamwrite/api_op_UntagResource.go | 7 +- .../timestreamwrite/api_op_UpdateDatabase.go | 7 +- service/timestreamwrite/api_op_UpdateTable.go | 7 +- .../timestreamwrite/api_op_WriteRecords.go | 7 +- service/transcribestreaming/eventstream.go | 98 +++++++++++++++---- 92 files changed, 477 insertions(+), 334 deletions(-) diff --git a/aws/signer/v4/middleware.go b/aws/signer/v4/middleware.go index 084e784249a..4b19444b048 100644 --- a/aws/signer/v4/middleware.go +++ b/aws/signer/v4/middleware.go @@ -319,7 +319,7 @@ type streamingEventsPayload struct{} // AddStreamingEventsPayload adds the streamingEventsPayload middleware to the stack. func AddStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&streamingEventsPayload{}, middleware.After) + return stack.Finalize.Add(&streamingEventsPayload{}, middleware.Before) } func (s *streamingEventsPayload) ID() string { diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEventStreamUtils.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEventStreamUtils.java index 4bfcb062b5b..c1ea9accacc 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEventStreamUtils.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEventStreamUtils.java @@ -13,10 +13,12 @@ import software.amazon.smithy.go.codegen.GoEventStreamIndex; import software.amazon.smithy.go.codegen.GoSettings; import software.amazon.smithy.go.codegen.GoStackStepMiddlewareGenerator; +import software.amazon.smithy.go.codegen.GoStdlibTypes; import software.amazon.smithy.go.codegen.GoValueAccessUtils; import software.amazon.smithy.go.codegen.GoWriter; import software.amazon.smithy.go.codegen.MiddlewareIdentifier; import software.amazon.smithy.go.codegen.SmithyGoDependency; +import software.amazon.smithy.go.codegen.SmithyGoTypes; import software.amazon.smithy.go.codegen.SymbolUtils; import software.amazon.smithy.go.codegen.integration.ProtocolGenerator.GenerationContext; import software.amazon.smithy.go.codegen.knowledge.GoPointableIndex; @@ -42,6 +44,7 @@ import software.amazon.smithy.model.traits.EventHeaderTrait; import software.amazon.smithy.model.traits.EventPayloadTrait; import software.amazon.smithy.model.traits.HttpTrait; +import software.amazon.smithy.utils.MapUtils; import software.amazon.smithy.utils.StringUtils; public final class AwsEventStreamUtils { @@ -306,26 +309,46 @@ defer func() { """, getEventStreamApiSymbol("ApplyHTTPTransportFixes")) .write(""); - w.write(""" - requestSignature, err := $T(request.Request) - if err != nil { - return out, metadata, $T("failed to get event stream seed signature: %v", err) + w.writeGoTemplate(""" + requestSignature, err := $getSignature:T(request.Request) + if err != nil { + return out, metadata, $errorf:T("failed to get event stream seed signature: %v", err) + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, $errorf:T("no identity") + } + + creds, ok := identity.($credentialsAdapter:P) + if !ok { + return out, metadata, $errorf:T("identity is not sigv4 credentials") + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, $errorf:T("no resolved auth scheme") + } + + name, ok := $getSigningName:T(&rscheme.SignerProperties) + if !ok { + return out, metadata, $errorf:T("no sigv4 signing name") } - """, getSignedRequestSignature, errorf).write("") - .openBlock("signer := $T(", ")", getSymbol("NewStreamSigner", - AwsGoDependency.AWS_SIGNER_V4, false), () -> w - .write(""" - $T(ctx), - $T(ctx), - $T(ctx), - requestSignature, - """, getSymbol("GetSigningCredentials", - AwsGoDependency.AWS_MIDDLEWARE, false), - getSymbol("GetSigningName", - AwsGoDependency.AWS_MIDDLEWARE, false), - getSymbol("GetSigningRegion", - AwsGoDependency.AWS_MIDDLEWARE, false) - )).write(""); + + region, ok := $getSigningRegion:T(&rscheme.SignerProperties) + if !ok { + return out, metadata, $errorf:T("no sigv4 signing region") + } + + signer := v4.NewStreamSigner(creds.Credentials, name, region, requestSignature) + """, + MapUtils.of( + "getSignature", getSignedRequestSignature, + "errorf", GoStdlibTypes.Fmt.Errorf, + "credentialsAdapter", SdkGoTypes.Internal.Auth.Smithy.CredentialsAdapter, + "getSigningName", SmithyGoTypes.Transport.Http.GetSigV4SigningName, + "getSigningRegion", SmithyGoTypes.Transport.Http.GetSigV4SigningRegion + )); var events = inputInfo.get().getEventStreamTarget().asUnionShape() .get(); diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointDiscoveryGenerator.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointDiscoveryGenerator.java index 7d7dd4b95f5..0f424b1ea63 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointDiscoveryGenerator.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointDiscoveryGenerator.java @@ -16,6 +16,7 @@ import software.amazon.smithy.go.codegen.GoWriter; import software.amazon.smithy.go.codegen.SmithyGoDependency; import software.amazon.smithy.go.codegen.SymbolUtils; +import software.amazon.smithy.go.codegen.endpoints.EndpointMiddlewareGenerator; import software.amazon.smithy.go.codegen.integration.ClientMember; import software.amazon.smithy.go.codegen.integration.ClientMemberResolver; import software.amazon.smithy.go.codegen.integration.ConfigField; @@ -169,9 +170,9 @@ private static void generateAddDiscoverEndpointMiddleware( writer.addUseImports(SmithyGoDependency.SMITHY_MIDDLEWARE); String closeBlock = String.format("}, \"%s\", middleware.After)", - EndpointGenerator.MIDDLEWARE_NAME); + EndpointMiddlewareGenerator.MIDDLEWARE_ID); - writer.openBlock("return stack.Serialize.Insert(&$T{", closeBlock, DISCOVERY_MIDDLEWARE, () -> { + writer.openBlock("return stack.Finalize.Insert(&$T{", closeBlock, DISCOVERY_MIDDLEWARE, () -> { writer.openBlock("Options: []func($P){", "},", DISCOVERY_ENDPOINT_OPTIONS, () -> { writer.openBlock("func (opt $P) {", "},", DISCOVERY_ENDPOINT_OPTIONS, () -> { writer.write("opt.$L = o.EndpointOptions.$L", DISABLE_HTTPS, DISABLE_HTTPS); @@ -328,9 +329,10 @@ private static void generateFetchDiscoveredEndpointFunction( writer.addUseImports(SmithyGoDependency.CONTEXT); writer.openBlock( - "func (c *Client) $L(ctx context.Context, input interface{}, optFns ...func($P)) ($T, error) {", "}", + "func (c *Client) $L(ctx context.Context, optFns ...func($P)) ($T, error) {", "}", fetchDiscoveredEndpointFuncName, DISCOVERY_ENDPOINT_OPTIONS, DISCOVERY_ENDPOINT_WEIGHTED_ADDRESS, () -> { + writer.write("input := getOperationInput(ctx)"); writer.write("in, ok := input.($P)", symbolProvider.toSymbol(inputShape)); writer.openBlock("if !ok {", "}", () -> { writer.addUseImports(SmithyGoDependency.FMT); diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/IgnoreAnonymousCredentials.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/IgnoreAnonymousCredentials.java index 8e498393e12..e30f879c23c 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/IgnoreAnonymousCredentials.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/auth/IgnoreAnonymousCredentials.java @@ -16,6 +16,7 @@ package software.amazon.smithy.aws.go.codegen.customization.auth; import software.amazon.smithy.aws.go.codegen.SdkGoTypes; +import software.amazon.smithy.aws.traits.auth.SigV4Trait; import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.go.codegen.GoDelegator; import software.amazon.smithy.go.codegen.GoSettings; @@ -24,6 +25,7 @@ import software.amazon.smithy.go.codegen.integration.GoIntegration; import software.amazon.smithy.go.codegen.integration.RuntimeClientPlugin; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.utils.ListUtils; import java.util.List; @@ -42,10 +44,15 @@ public class IgnoreAnonymousCredentials implements GoIntegration { .resolver(buildPackageSymbol("ignoreAnonymousAuth")) .build(); + private static boolean hasCredentials(Model model, ServiceShape service) { + return service.hasTrait(SigV4Trait.class) || service.hasTrait(SigV4Trait.class); + } + @Override public List getClientPlugins() { return ListUtils.of( RuntimeClientPlugin.builder() + .servicePredicate(IgnoreAnonymousCredentials::hasCredentials) .addConfigFieldResolver(IGNORE_ANONYMOUS_AUTH) .build() ); @@ -55,7 +62,9 @@ public List getClientPlugins() { public void writeAdditionalFiles( GoSettings settings, Model model, SymbolProvider symbolProvider, GoDelegator goDelegator ) { - goDelegator.useFileWriter("options.go", settings.getModuleName(), generateResolver()); + if (hasCredentials(model, settings.getService(model))) { + goDelegator.useFileWriter("options.go", settings.getModuleName(), generateResolver()); + } } private GoWriter.Writable generateResolver() { diff --git a/internal/protocoltest/awsrestjson/api_client.go b/internal/protocoltest/awsrestjson/api_client.go index 339eeddd9d4..bd5fb8c2581 100644 --- a/internal/protocoltest/awsrestjson/api_client.go +++ b/internal/protocoltest/awsrestjson/api_client.go @@ -56,8 +56,6 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - ignoreAnonymousAuth(&options) - client := &Client{ options: options, } diff --git a/internal/protocoltest/awsrestjson/options.go b/internal/protocoltest/awsrestjson/options.go index e032f040067..52222eef1a6 100644 --- a/internal/protocoltest/awsrestjson/options.go +++ b/internal/protocoltest/awsrestjson/options.go @@ -153,9 +153,3 @@ func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { o.EndpointResolverV2 = v } } - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/internal/protocoltest/ec2query/api_client.go b/internal/protocoltest/ec2query/api_client.go index 7584a10e294..da6ed74b49b 100644 --- a/internal/protocoltest/ec2query/api_client.go +++ b/internal/protocoltest/ec2query/api_client.go @@ -56,8 +56,6 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - ignoreAnonymousAuth(&options) - client := &Client{ options: options, } diff --git a/internal/protocoltest/ec2query/options.go b/internal/protocoltest/ec2query/options.go index 6f47a958749..28519d9971a 100644 --- a/internal/protocoltest/ec2query/options.go +++ b/internal/protocoltest/ec2query/options.go @@ -153,9 +153,3 @@ func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { o.EndpointResolverV2 = v } } - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/internal/protocoltest/jsonrpc10/api_client.go b/internal/protocoltest/jsonrpc10/api_client.go index b20ef7559bf..60cba3625e1 100644 --- a/internal/protocoltest/jsonrpc10/api_client.go +++ b/internal/protocoltest/jsonrpc10/api_client.go @@ -52,8 +52,6 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - ignoreAnonymousAuth(&options) - client := &Client{ options: options, } diff --git a/internal/protocoltest/jsonrpc10/options.go b/internal/protocoltest/jsonrpc10/options.go index ce0c911faf1..48c6c62e654 100644 --- a/internal/protocoltest/jsonrpc10/options.go +++ b/internal/protocoltest/jsonrpc10/options.go @@ -149,9 +149,3 @@ func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { o.EndpointResolverV2 = v } } - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/internal/protocoltest/query/api_client.go b/internal/protocoltest/query/api_client.go index 7967b494f1c..603970c8373 100644 --- a/internal/protocoltest/query/api_client.go +++ b/internal/protocoltest/query/api_client.go @@ -56,8 +56,6 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - ignoreAnonymousAuth(&options) - client := &Client{ options: options, } diff --git a/internal/protocoltest/query/options.go b/internal/protocoltest/query/options.go index 643f4751360..03d34b92ed1 100644 --- a/internal/protocoltest/query/options.go +++ b/internal/protocoltest/query/options.go @@ -153,9 +153,3 @@ func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { o.EndpointResolverV2 = v } } - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/internal/protocoltest/restxml/api_client.go b/internal/protocoltest/restxml/api_client.go index 2303c8679fb..c52e758ee7d 100644 --- a/internal/protocoltest/restxml/api_client.go +++ b/internal/protocoltest/restxml/api_client.go @@ -56,8 +56,6 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - ignoreAnonymousAuth(&options) - client := &Client{ options: options, } diff --git a/internal/protocoltest/restxml/options.go b/internal/protocoltest/restxml/options.go index 1c8b14e0cbb..ebab9939b6e 100644 --- a/internal/protocoltest/restxml/options.go +++ b/internal/protocoltest/restxml/options.go @@ -153,9 +153,3 @@ func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { o.EndpointResolverV2 = v } } - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/internal/protocoltest/restxmlwithnamespace/api_client.go b/internal/protocoltest/restxmlwithnamespace/api_client.go index 23d33c4ebf6..a872804681a 100644 --- a/internal/protocoltest/restxmlwithnamespace/api_client.go +++ b/internal/protocoltest/restxmlwithnamespace/api_client.go @@ -52,8 +52,6 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - ignoreAnonymousAuth(&options) - client := &Client{ options: options, } diff --git a/internal/protocoltest/restxmlwithnamespace/options.go b/internal/protocoltest/restxmlwithnamespace/options.go index 2ed14e1edbe..6c4330ac06c 100644 --- a/internal/protocoltest/restxmlwithnamespace/options.go +++ b/internal/protocoltest/restxmlwithnamespace/options.go @@ -149,9 +149,3 @@ func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { o.EndpointResolverV2 = v } } - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/service/apigateway/internal/customizations/unit_test.go b/service/apigateway/internal/customizations/unit_test.go index 86eb219b3d0..0d9c100c72d 100644 --- a/service/apigateway/internal/customizations/unit_test.go +++ b/service/apigateway/internal/customizations/unit_test.go @@ -54,6 +54,7 @@ func Test_EmptyResponse(t *testing.T) { Retryer: func() aws.Retryer { return aws.NopRetryer{} }, + Credentials: &fakeCredentials{}, } client := apigateway.NewFromConfig(cfg) @@ -79,3 +80,9 @@ func Test_EmptyResponse(t *testing.T) { }) } } + +type fakeCredentials struct{} + +func (*fakeCredentials) Retrieve(_ context.Context) (aws.Credentials, error) { + return aws.Credentials{}, nil +} diff --git a/service/codecatalyst/api_client.go b/service/codecatalyst/api_client.go index 31881cb912e..e93acb702cc 100644 --- a/service/codecatalyst/api_client.go +++ b/service/codecatalyst/api_client.go @@ -57,8 +57,6 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - ignoreAnonymousAuth(&options) - client := &Client{ options: options, } diff --git a/service/codecatalyst/options.go b/service/codecatalyst/options.go index 39a52490793..f741ff482cd 100644 --- a/service/codecatalyst/options.go +++ b/service/codecatalyst/options.go @@ -159,9 +159,3 @@ func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { o.EndpointResolverV2 = v } } - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/service/dynamodb/api_op_BatchGetItem.go b/service/dynamodb/api_op_BatchGetItem.go index ed0c1b84453..2cd44f71344 100644 --- a/service/dynamodb/api_op_BatchGetItem.go +++ b/service/dynamodb/api_op_BatchGetItem.go @@ -256,7 +256,7 @@ func (c *Client) addOperationBatchGetItemMiddlewares(stack *middleware.Stack, op } func addOpBatchGetItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -266,10 +266,11 @@ func addOpBatchGetItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Opti DiscoverOperation: c.fetchOpBatchGetItemDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpBatchGetItemDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpBatchGetItemDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*BatchGetItemInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_BatchWriteItem.go b/service/dynamodb/api_op_BatchWriteItem.go index 76b6ebae186..01569a15826 100644 --- a/service/dynamodb/api_op_BatchWriteItem.go +++ b/service/dynamodb/api_op_BatchWriteItem.go @@ -274,7 +274,7 @@ func (c *Client) addOperationBatchWriteItemMiddlewares(stack *middleware.Stack, } func addOpBatchWriteItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -284,10 +284,11 @@ func addOpBatchWriteItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Op DiscoverOperation: c.fetchOpBatchWriteItemDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpBatchWriteItemDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpBatchWriteItemDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*BatchWriteItemInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_CreateBackup.go b/service/dynamodb/api_op_CreateBackup.go index 64fddb66038..73115570dbf 100644 --- a/service/dynamodb/api_op_CreateBackup.go +++ b/service/dynamodb/api_op_CreateBackup.go @@ -161,7 +161,7 @@ func (c *Client) addOperationCreateBackupMiddlewares(stack *middleware.Stack, op } func addOpCreateBackupDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -171,10 +171,11 @@ func addOpCreateBackupDiscoverEndpointMiddleware(stack *middleware.Stack, o Opti DiscoverOperation: c.fetchOpCreateBackupDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCreateBackupDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCreateBackupDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CreateBackupInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_CreateGlobalTable.go b/service/dynamodb/api_op_CreateGlobalTable.go index 30fe4c43952..4e7d48b7786 100644 --- a/service/dynamodb/api_op_CreateGlobalTable.go +++ b/service/dynamodb/api_op_CreateGlobalTable.go @@ -180,7 +180,7 @@ func (c *Client) addOperationCreateGlobalTableMiddlewares(stack *middleware.Stac } func addOpCreateGlobalTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -190,10 +190,11 @@ func addOpCreateGlobalTableDiscoverEndpointMiddleware(stack *middleware.Stack, o DiscoverOperation: c.fetchOpCreateGlobalTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCreateGlobalTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCreateGlobalTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CreateGlobalTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_CreateTable.go b/service/dynamodb/api_op_CreateTable.go index 1d93a3d6624..2688198b8a7 100644 --- a/service/dynamodb/api_op_CreateTable.go +++ b/service/dynamodb/api_op_CreateTable.go @@ -281,7 +281,7 @@ func (c *Client) addOperationCreateTableMiddlewares(stack *middleware.Stack, opt } func addOpCreateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -291,10 +291,11 @@ func addOpCreateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpCreateTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCreateTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCreateTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CreateTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DeleteBackup.go b/service/dynamodb/api_op_DeleteBackup.go index 33d971c09a6..9e2e2382e1f 100644 --- a/service/dynamodb/api_op_DeleteBackup.go +++ b/service/dynamodb/api_op_DeleteBackup.go @@ -140,7 +140,7 @@ func (c *Client) addOperationDeleteBackupMiddlewares(stack *middleware.Stack, op } func addOpDeleteBackupDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -150,10 +150,11 @@ func addOpDeleteBackupDiscoverEndpointMiddleware(stack *middleware.Stack, o Opti DiscoverOperation: c.fetchOpDeleteBackupDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDeleteBackupDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDeleteBackupDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DeleteBackupInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DeleteItem.go b/service/dynamodb/api_op_DeleteItem.go index a76e208e51e..2f4cb0447c9 100644 --- a/service/dynamodb/api_op_DeleteItem.go +++ b/service/dynamodb/api_op_DeleteItem.go @@ -276,7 +276,7 @@ func (c *Client) addOperationDeleteItemMiddlewares(stack *middleware.Stack, opti } func addOpDeleteItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -286,10 +286,11 @@ func addOpDeleteItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Option DiscoverOperation: c.fetchOpDeleteItemDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDeleteItemDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDeleteItemDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DeleteItemInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DeleteTable.go b/service/dynamodb/api_op_DeleteTable.go index 4bb7d0507b4..4d4887ade42 100644 --- a/service/dynamodb/api_op_DeleteTable.go +++ b/service/dynamodb/api_op_DeleteTable.go @@ -155,7 +155,7 @@ func (c *Client) addOperationDeleteTableMiddlewares(stack *middleware.Stack, opt } func addOpDeleteTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -165,10 +165,11 @@ func addOpDeleteTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpDeleteTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDeleteTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDeleteTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DeleteTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeBackup.go b/service/dynamodb/api_op_DescribeBackup.go index 3d072daf2de..4d8df37a8e4 100644 --- a/service/dynamodb/api_op_DescribeBackup.go +++ b/service/dynamodb/api_op_DescribeBackup.go @@ -140,7 +140,7 @@ func (c *Client) addOperationDescribeBackupMiddlewares(stack *middleware.Stack, } func addOpDescribeBackupDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -150,10 +150,11 @@ func addOpDescribeBackupDiscoverEndpointMiddleware(stack *middleware.Stack, o Op DiscoverOperation: c.fetchOpDescribeBackupDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeBackupDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeBackupDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeBackupInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeContinuousBackups.go b/service/dynamodb/api_op_DescribeContinuousBackups.go index 132be46c123..a8c8a551c9a 100644 --- a/service/dynamodb/api_op_DescribeContinuousBackups.go +++ b/service/dynamodb/api_op_DescribeContinuousBackups.go @@ -149,7 +149,7 @@ func (c *Client) addOperationDescribeContinuousBackupsMiddlewares(stack *middlew } func addOpDescribeContinuousBackupsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -159,10 +159,11 @@ func addOpDescribeContinuousBackupsDiscoverEndpointMiddleware(stack *middleware. DiscoverOperation: c.fetchOpDescribeContinuousBackupsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeContinuousBackupsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeContinuousBackupsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeContinuousBackupsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeGlobalTable.go b/service/dynamodb/api_op_DescribeGlobalTable.go index df0b4c85c64..cc19679a267 100644 --- a/service/dynamodb/api_op_DescribeGlobalTable.go +++ b/service/dynamodb/api_op_DescribeGlobalTable.go @@ -147,7 +147,7 @@ func (c *Client) addOperationDescribeGlobalTableMiddlewares(stack *middleware.St } func addOpDescribeGlobalTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -157,10 +157,11 @@ func addOpDescribeGlobalTableDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpDescribeGlobalTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeGlobalTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeGlobalTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeGlobalTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeGlobalTableSettings.go b/service/dynamodb/api_op_DescribeGlobalTableSettings.go index 6b245ee2afe..d82dd82b413 100644 --- a/service/dynamodb/api_op_DescribeGlobalTableSettings.go +++ b/service/dynamodb/api_op_DescribeGlobalTableSettings.go @@ -150,7 +150,7 @@ func (c *Client) addOperationDescribeGlobalTableSettingsMiddlewares(stack *middl } func addOpDescribeGlobalTableSettingsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -160,10 +160,11 @@ func addOpDescribeGlobalTableSettingsDiscoverEndpointMiddleware(stack *middlewar DiscoverOperation: c.fetchOpDescribeGlobalTableSettingsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeGlobalTableSettingsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeGlobalTableSettingsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeGlobalTableSettingsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go b/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go index 7ca1edf05c5..81dbdeb841c 100644 --- a/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go +++ b/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go @@ -142,7 +142,7 @@ func (c *Client) addOperationDescribeKinesisStreamingDestinationMiddlewares(stac } func addOpDescribeKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -152,10 +152,11 @@ func addOpDescribeKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *m DiscoverOperation: c.fetchOpDescribeKinesisStreamingDestinationDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeKinesisStreamingDestinationDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeKinesisStreamingDestinationDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeKinesisStreamingDestinationInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeLimits.go b/service/dynamodb/api_op_DescribeLimits.go index 5f7d150b3f1..89753aa12d1 100644 --- a/service/dynamodb/api_op_DescribeLimits.go +++ b/service/dynamodb/api_op_DescribeLimits.go @@ -183,7 +183,7 @@ func (c *Client) addOperationDescribeLimitsMiddlewares(stack *middleware.Stack, } func addOpDescribeLimitsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -193,10 +193,11 @@ func addOpDescribeLimitsDiscoverEndpointMiddleware(stack *middleware.Stack, o Op DiscoverOperation: c.fetchOpDescribeLimitsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeLimitsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeLimitsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeLimitsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeTable.go b/service/dynamodb/api_op_DescribeTable.go index 28229403d73..5b7bc648663 100644 --- a/service/dynamodb/api_op_DescribeTable.go +++ b/service/dynamodb/api_op_DescribeTable.go @@ -153,7 +153,7 @@ func (c *Client) addOperationDescribeTableMiddlewares(stack *middleware.Stack, o } func addOpDescribeTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -163,10 +163,11 @@ func addOpDescribeTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Opt DiscoverOperation: c.fetchOpDescribeTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DescribeTimeToLive.go b/service/dynamodb/api_op_DescribeTimeToLive.go index a422200fac8..1dd79dc1323 100644 --- a/service/dynamodb/api_op_DescribeTimeToLive.go +++ b/service/dynamodb/api_op_DescribeTimeToLive.go @@ -139,7 +139,7 @@ func (c *Client) addOperationDescribeTimeToLiveMiddlewares(stack *middleware.Sta } func addOpDescribeTimeToLiveDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -149,10 +149,11 @@ func addOpDescribeTimeToLiveDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpDescribeTimeToLiveDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeTimeToLiveDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeTimeToLiveDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeTimeToLiveInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_DisableKinesisStreamingDestination.go b/service/dynamodb/api_op_DisableKinesisStreamingDestination.go index b00f70600cb..67ea0f2ea6b 100644 --- a/service/dynamodb/api_op_DisableKinesisStreamingDestination.go +++ b/service/dynamodb/api_op_DisableKinesisStreamingDestination.go @@ -151,7 +151,7 @@ func (c *Client) addOperationDisableKinesisStreamingDestinationMiddlewares(stack } func addOpDisableKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -161,10 +161,11 @@ func addOpDisableKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *mi DiscoverOperation: c.fetchOpDisableKinesisStreamingDestinationDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDisableKinesisStreamingDestinationDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDisableKinesisStreamingDestinationDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DisableKinesisStreamingDestinationInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_EnableKinesisStreamingDestination.go b/service/dynamodb/api_op_EnableKinesisStreamingDestination.go index 1a408d6ef6a..74784c52cf0 100644 --- a/service/dynamodb/api_op_EnableKinesisStreamingDestination.go +++ b/service/dynamodb/api_op_EnableKinesisStreamingDestination.go @@ -153,7 +153,7 @@ func (c *Client) addOperationEnableKinesisStreamingDestinationMiddlewares(stack } func addOpEnableKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -163,10 +163,11 @@ func addOpEnableKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *mid DiscoverOperation: c.fetchOpEnableKinesisStreamingDestinationDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpEnableKinesisStreamingDestinationDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpEnableKinesisStreamingDestinationDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*EnableKinesisStreamingDestinationInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_GetItem.go b/service/dynamodb/api_op_GetItem.go index 07351c98430..df6595e8ce9 100644 --- a/service/dynamodb/api_op_GetItem.go +++ b/service/dynamodb/api_op_GetItem.go @@ -220,7 +220,7 @@ func (c *Client) addOperationGetItemMiddlewares(stack *middleware.Stack, options } func addOpGetItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -230,10 +230,11 @@ func addOpGetItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, DiscoverOperation: c.fetchOpGetItemDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpGetItemDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpGetItemDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*GetItemInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_ListBackups.go b/service/dynamodb/api_op_ListBackups.go index 52b0812698a..5d7f269a761 100644 --- a/service/dynamodb/api_op_ListBackups.go +++ b/service/dynamodb/api_op_ListBackups.go @@ -180,7 +180,7 @@ func (c *Client) addOperationListBackupsMiddlewares(stack *middleware.Stack, opt } func addOpListBackupsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -190,10 +190,11 @@ func addOpListBackupsDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpListBackupsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListBackupsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListBackupsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListBackupsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_ListGlobalTables.go b/service/dynamodb/api_op_ListGlobalTables.go index 070c70eb171..c3e07f76d08 100644 --- a/service/dynamodb/api_op_ListGlobalTables.go +++ b/service/dynamodb/api_op_ListGlobalTables.go @@ -155,7 +155,7 @@ func (c *Client) addOperationListGlobalTablesMiddlewares(stack *middleware.Stack } func addOpListGlobalTablesDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -165,10 +165,11 @@ func addOpListGlobalTablesDiscoverEndpointMiddleware(stack *middleware.Stack, o DiscoverOperation: c.fetchOpListGlobalTablesDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListGlobalTablesDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListGlobalTablesDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListGlobalTablesInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_ListTables.go b/service/dynamodb/api_op_ListTables.go index 9a41df0c902..1bcfe6f4c41 100644 --- a/service/dynamodb/api_op_ListTables.go +++ b/service/dynamodb/api_op_ListTables.go @@ -154,7 +154,7 @@ func (c *Client) addOperationListTablesMiddlewares(stack *middleware.Stack, opti } func addOpListTablesDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -164,10 +164,11 @@ func addOpListTablesDiscoverEndpointMiddleware(stack *middleware.Stack, o Option DiscoverOperation: c.fetchOpListTablesDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListTablesDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListTablesDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListTablesInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_ListTagsOfResource.go b/service/dynamodb/api_op_ListTagsOfResource.go index 261d2914bab..6f92cc2e412 100644 --- a/service/dynamodb/api_op_ListTagsOfResource.go +++ b/service/dynamodb/api_op_ListTagsOfResource.go @@ -152,7 +152,7 @@ func (c *Client) addOperationListTagsOfResourceMiddlewares(stack *middleware.Sta } func addOpListTagsOfResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -162,10 +162,11 @@ func addOpListTagsOfResourceDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpListTagsOfResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListTagsOfResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListTagsOfResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListTagsOfResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_PutItem.go b/service/dynamodb/api_op_PutItem.go index 5e0b34bc7de..fb61bdbedbc 100644 --- a/service/dynamodb/api_op_PutItem.go +++ b/service/dynamodb/api_op_PutItem.go @@ -295,7 +295,7 @@ func (c *Client) addOperationPutItemMiddlewares(stack *middleware.Stack, options } func addOpPutItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -305,10 +305,11 @@ func addOpPutItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, DiscoverOperation: c.fetchOpPutItemDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpPutItemDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpPutItemDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*PutItemInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_Query.go b/service/dynamodb/api_op_Query.go index ee8b7e01085..7a974b4efff 100644 --- a/service/dynamodb/api_op_Query.go +++ b/service/dynamodb/api_op_Query.go @@ -430,7 +430,7 @@ func (c *Client) addOperationQueryMiddlewares(stack *middleware.Stack, options O } func addOpQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -440,10 +440,11 @@ func addOpQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c DiscoverOperation: c.fetchOpQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*QueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_RestoreTableFromBackup.go b/service/dynamodb/api_op_RestoreTableFromBackup.go index a173e2bca76..fe3d9178814 100644 --- a/service/dynamodb/api_op_RestoreTableFromBackup.go +++ b/service/dynamodb/api_op_RestoreTableFromBackup.go @@ -172,7 +172,7 @@ func (c *Client) addOperationRestoreTableFromBackupMiddlewares(stack *middleware } func addOpRestoreTableFromBackupDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -182,10 +182,11 @@ func addOpRestoreTableFromBackupDiscoverEndpointMiddleware(stack *middleware.Sta DiscoverOperation: c.fetchOpRestoreTableFromBackupDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpRestoreTableFromBackupDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpRestoreTableFromBackupDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*RestoreTableFromBackupInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_RestoreTableToPointInTime.go b/service/dynamodb/api_op_RestoreTableToPointInTime.go index 6caabd0f1c6..cda6519fbe1 100644 --- a/service/dynamodb/api_op_RestoreTableToPointInTime.go +++ b/service/dynamodb/api_op_RestoreTableToPointInTime.go @@ -194,7 +194,7 @@ func (c *Client) addOperationRestoreTableToPointInTimeMiddlewares(stack *middlew } func addOpRestoreTableToPointInTimeDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -204,10 +204,11 @@ func addOpRestoreTableToPointInTimeDiscoverEndpointMiddleware(stack *middleware. DiscoverOperation: c.fetchOpRestoreTableToPointInTimeDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpRestoreTableToPointInTimeDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpRestoreTableToPointInTimeDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*RestoreTableToPointInTimeInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_Scan.go b/service/dynamodb/api_op_Scan.go index 5e56e41ceae..baea197ce34 100644 --- a/service/dynamodb/api_op_Scan.go +++ b/service/dynamodb/api_op_Scan.go @@ -379,7 +379,7 @@ func (c *Client) addOperationScanMiddlewares(stack *middleware.Stack, options Op } func addOpScanDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -389,10 +389,11 @@ func addOpScanDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c * DiscoverOperation: c.fetchOpScanDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpScanDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpScanDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ScanInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_TagResource.go b/service/dynamodb/api_op_TagResource.go index bfa370125bf..96549a798da 100644 --- a/service/dynamodb/api_op_TagResource.go +++ b/service/dynamodb/api_op_TagResource.go @@ -146,7 +146,7 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt } func addOpTagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -156,10 +156,11 @@ func addOpTagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpTagResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpTagResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpTagResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*TagResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_TransactGetItems.go b/service/dynamodb/api_op_TransactGetItems.go index a81b9f512b4..064311ce6a8 100644 --- a/service/dynamodb/api_op_TransactGetItems.go +++ b/service/dynamodb/api_op_TransactGetItems.go @@ -169,7 +169,7 @@ func (c *Client) addOperationTransactGetItemsMiddlewares(stack *middleware.Stack } func addOpTransactGetItemsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -179,10 +179,11 @@ func addOpTransactGetItemsDiscoverEndpointMiddleware(stack *middleware.Stack, o DiscoverOperation: c.fetchOpTransactGetItemsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpTransactGetItemsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpTransactGetItemsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*TransactGetItemsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_TransactWriteItems.go b/service/dynamodb/api_op_TransactWriteItems.go index 99e6386f2af..18f74fbbef5 100644 --- a/service/dynamodb/api_op_TransactWriteItems.go +++ b/service/dynamodb/api_op_TransactWriteItems.go @@ -226,7 +226,7 @@ func (c *Client) addOperationTransactWriteItemsMiddlewares(stack *middleware.Sta } func addOpTransactWriteItemsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -236,10 +236,11 @@ func addOpTransactWriteItemsDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpTransactWriteItemsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpTransactWriteItemsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpTransactWriteItemsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*TransactWriteItemsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_UntagResource.go b/service/dynamodb/api_op_UntagResource.go index bf2e156f17a..67ebd3c4671 100644 --- a/service/dynamodb/api_op_UntagResource.go +++ b/service/dynamodb/api_op_UntagResource.go @@ -144,7 +144,7 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o } func addOpUntagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -154,10 +154,11 @@ func addOpUntagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Opt DiscoverOperation: c.fetchOpUntagResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUntagResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUntagResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UntagResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_UpdateContinuousBackups.go b/service/dynamodb/api_op_UpdateContinuousBackups.go index d26f6a09726..92b6eb9fa33 100644 --- a/service/dynamodb/api_op_UpdateContinuousBackups.go +++ b/service/dynamodb/api_op_UpdateContinuousBackups.go @@ -153,7 +153,7 @@ func (c *Client) addOperationUpdateContinuousBackupsMiddlewares(stack *middlewar } func addOpUpdateContinuousBackupsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -163,10 +163,11 @@ func addOpUpdateContinuousBackupsDiscoverEndpointMiddleware(stack *middleware.St DiscoverOperation: c.fetchOpUpdateContinuousBackupsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateContinuousBackupsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateContinuousBackupsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateContinuousBackupsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_UpdateGlobalTable.go b/service/dynamodb/api_op_UpdateGlobalTable.go index fddffbdaf12..951600088ad 100644 --- a/service/dynamodb/api_op_UpdateGlobalTable.go +++ b/service/dynamodb/api_op_UpdateGlobalTable.go @@ -166,7 +166,7 @@ func (c *Client) addOperationUpdateGlobalTableMiddlewares(stack *middleware.Stac } func addOpUpdateGlobalTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -176,10 +176,11 @@ func addOpUpdateGlobalTableDiscoverEndpointMiddleware(stack *middleware.Stack, o DiscoverOperation: c.fetchOpUpdateGlobalTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateGlobalTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateGlobalTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateGlobalTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_UpdateGlobalTableSettings.go b/service/dynamodb/api_op_UpdateGlobalTableSettings.go index 4ad442798b5..2fa225e7f41 100644 --- a/service/dynamodb/api_op_UpdateGlobalTableSettings.go +++ b/service/dynamodb/api_op_UpdateGlobalTableSettings.go @@ -175,7 +175,7 @@ func (c *Client) addOperationUpdateGlobalTableSettingsMiddlewares(stack *middlew } func addOpUpdateGlobalTableSettingsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -185,10 +185,11 @@ func addOpUpdateGlobalTableSettingsDiscoverEndpointMiddleware(stack *middleware. DiscoverOperation: c.fetchOpUpdateGlobalTableSettingsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateGlobalTableSettingsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateGlobalTableSettingsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateGlobalTableSettingsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_UpdateItem.go b/service/dynamodb/api_op_UpdateItem.go index e2b327b3e34..eef7727a1b1 100644 --- a/service/dynamodb/api_op_UpdateItem.go +++ b/service/dynamodb/api_op_UpdateItem.go @@ -338,7 +338,7 @@ func (c *Client) addOperationUpdateItemMiddlewares(stack *middleware.Stack, opti } func addOpUpdateItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -348,10 +348,11 @@ func addOpUpdateItemDiscoverEndpointMiddleware(stack *middleware.Stack, o Option DiscoverOperation: c.fetchOpUpdateItemDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateItemDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateItemDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateItemInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_UpdateTable.go b/service/dynamodb/api_op_UpdateTable.go index 0e3c8ea56a3..310a1a2c4f0 100644 --- a/service/dynamodb/api_op_UpdateTable.go +++ b/service/dynamodb/api_op_UpdateTable.go @@ -207,7 +207,7 @@ func (c *Client) addOperationUpdateTableMiddlewares(stack *middleware.Stack, opt } func addOpUpdateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -217,10 +217,11 @@ func addOpUpdateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpUpdateTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/dynamodb/api_op_UpdateTimeToLive.go b/service/dynamodb/api_op_UpdateTimeToLive.go index 89f83ee1c45..9c0142d9826 100644 --- a/service/dynamodb/api_op_UpdateTimeToLive.go +++ b/service/dynamodb/api_op_UpdateTimeToLive.go @@ -163,7 +163,7 @@ func (c *Client) addOperationUpdateTimeToLiveMiddlewares(stack *middleware.Stack } func addOpUpdateTimeToLiveDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -173,10 +173,11 @@ func addOpUpdateTimeToLiveDiscoverEndpointMiddleware(stack *middleware.Stack, o DiscoverOperation: c.fetchOpUpdateTimeToLiveDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: false, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateTimeToLiveDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateTimeToLiveDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateTimeToLiveInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/ec2/internal/customizations/unit_test.go b/service/ec2/internal/customizations/unit_test.go index d222779b5ef..5ee6e66e07c 100644 --- a/service/ec2/internal/customizations/unit_test.go +++ b/service/ec2/internal/customizations/unit_test.go @@ -54,6 +54,7 @@ func Test_EmptyResponse(t *testing.T) { Retryer: func() aws.Retryer { return aws.NopRetryer{} }, + Credentials: &fakeCredentials{}, } client := ec2.NewFromConfig(cfg) @@ -82,3 +83,9 @@ func Test_EmptyResponse(t *testing.T) { }) } } + +type fakeCredentials struct{} + +func (*fakeCredentials) Retrieve(_ context.Context) (aws.Credentials, error) { + return aws.Credentials{}, nil +} diff --git a/service/internal/endpoint-discovery/middleware.go b/service/internal/endpoint-discovery/middleware.go index 2e986d991d9..882dd3475d8 100644 --- a/service/internal/endpoint-discovery/middleware.go +++ b/service/internal/endpoint-discovery/middleware.go @@ -28,7 +28,7 @@ type DiscoverEndpointOptions struct { Logger logging.Logger } -// DiscoverEndpoint is a serialize step middleware used to discover endpoint +// DiscoverEndpoint is a finalize step middleware used to discover endpoint // for an API operation. type DiscoverEndpoint struct { @@ -38,7 +38,7 @@ type DiscoverEndpoint struct { // DiscoverOperation represents the endpoint discovery operation that // returns an Endpoint or error. - DiscoverOperation func(ctx context.Context, input interface{}, options ...func(*DiscoverEndpointOptions)) (WeightedAddress, error) + DiscoverOperation func(ctx context.Context, options ...func(*DiscoverEndpointOptions)) (WeightedAddress, error) // EndpointDiscoveryEnableState represents the customer configuration for endpoint // discovery feature. @@ -54,50 +54,46 @@ func (*DiscoverEndpoint) ID() string { return "DiscoverEndpoint" } -// HandleSerialize is the serialize step function handler that must be placed after -// "ResolveEndpoint" middleware, but before "OperationSerializer" middleware. -func (d *DiscoverEndpoint) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) (out middleware.SerializeOutput, metadata middleware.Metadata, err error) { - // if endpoint discovery is explicitly disabled, skip this workflow +// HandleFinalize performs endpoint discovery and updates the request host with +// the result. +// +// The resolved host from this procedure MUST override that of modeled endpoint +// resolution and middleware should be ordered accordingly. +func (d *DiscoverEndpoint) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) (out middleware.FinalizeOutput, metadata middleware.Metadata, err error) { if d.EndpointDiscoveryEnableState == aws.EndpointDiscoveryDisabled { - return next.HandleSerialize(ctx, in) + return next.HandleFinalize(ctx, in) } - // if operation does not require endpoint discovery, and endpoint discovery is not explicitly enabled, - // skip this workflow if !d.EndpointDiscoveryRequired && d.EndpointDiscoveryEnableState != aws.EndpointDiscoveryEnabled { - return next.HandleSerialize(ctx, in) + return next.HandleFinalize(ctx, in) } - // when custom endpoint is provided if es := awsmiddleware.GetEndpointSource(ctx); es == aws.EndpointSourceCustom { - // error if endpoint discovery was explicitly enabled if d.EndpointDiscoveryEnableState == aws.EndpointDiscoveryEnabled { - return middleware.SerializeOutput{}, middleware.Metadata{}, + return middleware.FinalizeOutput{}, middleware.Metadata{}, fmt.Errorf("Invalid configuration: endpoint discovery is enabled, but a custom endpoint is provided") } - // else skip this workflow - return next.HandleSerialize(ctx, in) + return next.HandleFinalize(ctx, in) } - // fetch address using discover operation - weightedAddress, err := d.DiscoverOperation(ctx, in.Parameters, d.Options...) + weightedAddress, err := d.DiscoverOperation(ctx, d.Options...) if err != nil { - return middleware.SerializeOutput{}, middleware.Metadata{}, err + return middleware.FinalizeOutput{}, middleware.Metadata{}, err } req, ok := in.Request.(*smithyhttp.Request) if !ok { - return middleware.SerializeOutput{}, middleware.Metadata{}, + return middleware.FinalizeOutput{}, middleware.Metadata{}, fmt.Errorf("expected request to be of type *smithyhttp.Request, got %T", in.Request) } if weightedAddress.URL != nil { - // assign discovered endpoint to request url - req.URL = weightedAddress.URL + // we only want the host, normal endpoint resolution can include path/query + req.URL.Host = weightedAddress.URL.Host } - return next.HandleSerialize(ctx, in) + return next.HandleFinalize(ctx, in) } diff --git a/service/lexruntimev2/eventstream.go b/service/lexruntimev2/eventstream.go index 2a37aaa68e8..3c66abf93f1 100644 --- a/service/lexruntimev2/eventstream.go +++ b/service/lexruntimev2/eventstream.go @@ -7,10 +7,10 @@ import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream" "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" "github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" @@ -417,12 +417,32 @@ func (m *awsRestjson1_deserializeOpEventStreamStartConversation) HandleDeseriali return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err) } - signer := v4.NewStreamSigner( - awsmiddleware.GetSigningCredentials(ctx), - awsmiddleware.GetSigningName(ctx), - awsmiddleware.GetSigningRegion(ctx), - requestSignature, - ) + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + creds, ok := identity.(*internalauthsmithy.CredentialsAdapter) + if !ok { + return out, metadata, fmt.Errorf("identity is not sigv4 credentials") + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + name, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing name") + } + + region, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing region") + } + + signer := v4.NewStreamSigner(creds.Credentials, name, region, requestSignature) eventWriter := newStartConversationRequestEventStreamWriter( eventstreamapi.GetInputStreamWriter(ctx), diff --git a/service/route53/internal/customizations/custom_error_deser_test.go b/service/route53/internal/customizations/custom_error_deser_test.go index 4e269fbdfec..da0ba97218a 100644 --- a/service/route53/internal/customizations/custom_error_deser_test.go +++ b/service/route53/internal/customizations/custom_error_deser_test.go @@ -83,6 +83,7 @@ func TestCustomErrorDeserialization(t *testing.T) { Retryer: func() aws.Retryer { return aws.NopRetryer{} }, + Credentials: &fakeCredentials{}, }) resp, err := svc.ChangeResourceRecordSets(context.Background(), &route53.ChangeResourceRecordSetsInput{ ChangeBatch: &types.ChangeBatch{ @@ -123,3 +124,9 @@ func TestCustomErrorDeserialization(t *testing.T) { }) } } + +type fakeCredentials struct{} + +func (*fakeCredentials) Retrieve(_ context.Context) (aws.Credentials, error) { + return aws.Credentials{}, nil +} diff --git a/service/timestreamquery/api_op_CancelQuery.go b/service/timestreamquery/api_op_CancelQuery.go index 6a3a970391a..98e46a3a975 100644 --- a/service/timestreamquery/api_op_CancelQuery.go +++ b/service/timestreamquery/api_op_CancelQuery.go @@ -139,7 +139,7 @@ func (c *Client) addOperationCancelQueryMiddlewares(stack *middleware.Stack, opt } func addOpCancelQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -150,10 +150,11 @@ func addOpCancelQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpCancelQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCancelQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCancelQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CancelQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_CreateScheduledQuery.go b/service/timestreamquery/api_op_CreateScheduledQuery.go index 339b1f60f57..fd40eff1a7d 100644 --- a/service/timestreamquery/api_op_CreateScheduledQuery.go +++ b/service/timestreamquery/api_op_CreateScheduledQuery.go @@ -203,7 +203,7 @@ func (c *Client) addOperationCreateScheduledQueryMiddlewares(stack *middleware.S } func addOpCreateScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -214,10 +214,11 @@ func addOpCreateScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack DiscoverOperation: c.fetchOpCreateScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCreateScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCreateScheduledQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CreateScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_DeleteScheduledQuery.go b/service/timestreamquery/api_op_DeleteScheduledQuery.go index bafb42fe1ae..ae720bd477e 100644 --- a/service/timestreamquery/api_op_DeleteScheduledQuery.go +++ b/service/timestreamquery/api_op_DeleteScheduledQuery.go @@ -128,7 +128,7 @@ func (c *Client) addOperationDeleteScheduledQueryMiddlewares(stack *middleware.S } func addOpDeleteScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -139,10 +139,11 @@ func addOpDeleteScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack DiscoverOperation: c.fetchOpDeleteScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDeleteScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDeleteScheduledQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DeleteScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_DescribeScheduledQuery.go b/service/timestreamquery/api_op_DescribeScheduledQuery.go index 752ec3b9e80..57b1d59ae06 100644 --- a/service/timestreamquery/api_op_DescribeScheduledQuery.go +++ b/service/timestreamquery/api_op_DescribeScheduledQuery.go @@ -135,7 +135,7 @@ func (c *Client) addOperationDescribeScheduledQueryMiddlewares(stack *middleware } func addOpDescribeScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -146,10 +146,11 @@ func addOpDescribeScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Sta DiscoverOperation: c.fetchOpDescribeScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeScheduledQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_ExecuteScheduledQuery.go b/service/timestreamquery/api_op_ExecuteScheduledQuery.go index 24fb18674cc..44e15465ace 100644 --- a/service/timestreamquery/api_op_ExecuteScheduledQuery.go +++ b/service/timestreamquery/api_op_ExecuteScheduledQuery.go @@ -140,7 +140,7 @@ func (c *Client) addOperationExecuteScheduledQueryMiddlewares(stack *middleware. } func addOpExecuteScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -151,10 +151,11 @@ func addOpExecuteScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stac DiscoverOperation: c.fetchOpExecuteScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpExecuteScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpExecuteScheduledQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ExecuteScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_ListScheduledQueries.go b/service/timestreamquery/api_op_ListScheduledQueries.go index cfecb7a79a1..198c26c8116 100644 --- a/service/timestreamquery/api_op_ListScheduledQueries.go +++ b/service/timestreamquery/api_op_ListScheduledQueries.go @@ -141,7 +141,7 @@ func (c *Client) addOperationListScheduledQueriesMiddlewares(stack *middleware.S } func addOpListScheduledQueriesDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -152,10 +152,11 @@ func addOpListScheduledQueriesDiscoverEndpointMiddleware(stack *middleware.Stack DiscoverOperation: c.fetchOpListScheduledQueriesDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListScheduledQueriesDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListScheduledQueriesDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListScheduledQueriesInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_ListTagsForResource.go b/service/timestreamquery/api_op_ListTagsForResource.go index 4098e6fb3b4..d84eec33b4f 100644 --- a/service/timestreamquery/api_op_ListTagsForResource.go +++ b/service/timestreamquery/api_op_ListTagsForResource.go @@ -146,7 +146,7 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St } func addOpListTagsForResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -157,10 +157,11 @@ func addOpListTagsForResourceDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpListTagsForResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListTagsForResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListTagsForResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListTagsForResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_PrepareQuery.go b/service/timestreamquery/api_op_PrepareQuery.go index 03778fa97bb..ba6052d50c7 100644 --- a/service/timestreamquery/api_op_PrepareQuery.go +++ b/service/timestreamquery/api_op_PrepareQuery.go @@ -154,7 +154,7 @@ func (c *Client) addOperationPrepareQueryMiddlewares(stack *middleware.Stack, op } func addOpPrepareQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -165,10 +165,11 @@ func addOpPrepareQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Opti DiscoverOperation: c.fetchOpPrepareQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpPrepareQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpPrepareQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*PrepareQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_Query.go b/service/timestreamquery/api_op_Query.go index e69a148bd16..39c4a4e9952 100644 --- a/service/timestreamquery/api_op_Query.go +++ b/service/timestreamquery/api_op_Query.go @@ -223,7 +223,7 @@ func (c *Client) addOperationQueryMiddlewares(stack *middleware.Stack, options O } func addOpQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -234,10 +234,11 @@ func addOpQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c DiscoverOperation: c.fetchOpQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*QueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_TagResource.go b/service/timestreamquery/api_op_TagResource.go index 45633222d81..bf3b17a2b55 100644 --- a/service/timestreamquery/api_op_TagResource.go +++ b/service/timestreamquery/api_op_TagResource.go @@ -137,7 +137,7 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt } func addOpTagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -148,10 +148,11 @@ func addOpTagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpTagResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpTagResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpTagResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*TagResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_UntagResource.go b/service/timestreamquery/api_op_UntagResource.go index 8d8d05d4f51..8e5af2c54ed 100644 --- a/service/timestreamquery/api_op_UntagResource.go +++ b/service/timestreamquery/api_op_UntagResource.go @@ -135,7 +135,7 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o } func addOpUntagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -146,10 +146,11 @@ func addOpUntagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Opt DiscoverOperation: c.fetchOpUntagResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUntagResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUntagResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UntagResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamquery/api_op_UpdateScheduledQuery.go b/service/timestreamquery/api_op_UpdateScheduledQuery.go index f7990affa45..c56ac180026 100644 --- a/service/timestreamquery/api_op_UpdateScheduledQuery.go +++ b/service/timestreamquery/api_op_UpdateScheduledQuery.go @@ -134,7 +134,7 @@ func (c *Client) addOperationUpdateScheduledQueryMiddlewares(stack *middleware.S } func addOpUpdateScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -145,10 +145,11 @@ func addOpUpdateScheduledQueryDiscoverEndpointMiddleware(stack *middleware.Stack DiscoverOperation: c.fetchOpUpdateScheduledQueryDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateScheduledQueryDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateScheduledQueryDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateScheduledQueryInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_CreateBatchLoadTask.go b/service/timestreamwrite/api_op_CreateBatchLoadTask.go index 752bae52207..2313de53004 100644 --- a/service/timestreamwrite/api_op_CreateBatchLoadTask.go +++ b/service/timestreamwrite/api_op_CreateBatchLoadTask.go @@ -172,7 +172,7 @@ func (c *Client) addOperationCreateBatchLoadTaskMiddlewares(stack *middleware.St } func addOpCreateBatchLoadTaskDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -183,10 +183,11 @@ func addOpCreateBatchLoadTaskDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpCreateBatchLoadTaskDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCreateBatchLoadTaskDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCreateBatchLoadTaskDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CreateBatchLoadTaskInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_CreateDatabase.go b/service/timestreamwrite/api_op_CreateDatabase.go index 42360a4a6ea..eb555ee40d0 100644 --- a/service/timestreamwrite/api_op_CreateDatabase.go +++ b/service/timestreamwrite/api_op_CreateDatabase.go @@ -147,7 +147,7 @@ func (c *Client) addOperationCreateDatabaseMiddlewares(stack *middleware.Stack, } func addOpCreateDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -158,10 +158,11 @@ func addOpCreateDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o Op DiscoverOperation: c.fetchOpCreateDatabaseDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCreateDatabaseDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCreateDatabaseDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CreateDatabaseInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_CreateTable.go b/service/timestreamwrite/api_op_CreateTable.go index 683d446149c..9fa486b95f5 100644 --- a/service/timestreamwrite/api_op_CreateTable.go +++ b/service/timestreamwrite/api_op_CreateTable.go @@ -158,7 +158,7 @@ func (c *Client) addOperationCreateTableMiddlewares(stack *middleware.Stack, opt } func addOpCreateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -169,10 +169,11 @@ func addOpCreateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpCreateTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpCreateTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpCreateTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*CreateTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_DeleteDatabase.go b/service/timestreamwrite/api_op_DeleteDatabase.go index 862cc1d9595..0bcf70799cd 100644 --- a/service/timestreamwrite/api_op_DeleteDatabase.go +++ b/service/timestreamwrite/api_op_DeleteDatabase.go @@ -134,7 +134,7 @@ func (c *Client) addOperationDeleteDatabaseMiddlewares(stack *middleware.Stack, } func addOpDeleteDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -145,10 +145,11 @@ func addOpDeleteDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o Op DiscoverOperation: c.fetchOpDeleteDatabaseDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDeleteDatabaseDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDeleteDatabaseDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DeleteDatabaseInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_DeleteTable.go b/service/timestreamwrite/api_op_DeleteTable.go index 9f4922029d8..137d94d59c3 100644 --- a/service/timestreamwrite/api_op_DeleteTable.go +++ b/service/timestreamwrite/api_op_DeleteTable.go @@ -138,7 +138,7 @@ func (c *Client) addOperationDeleteTableMiddlewares(stack *middleware.Stack, opt } func addOpDeleteTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -149,10 +149,11 @@ func addOpDeleteTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpDeleteTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDeleteTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDeleteTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DeleteTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_DescribeBatchLoadTask.go b/service/timestreamwrite/api_op_DescribeBatchLoadTask.go index 9cd73e854a6..bfc1fca5169 100644 --- a/service/timestreamwrite/api_op_DescribeBatchLoadTask.go +++ b/service/timestreamwrite/api_op_DescribeBatchLoadTask.go @@ -138,7 +138,7 @@ func (c *Client) addOperationDescribeBatchLoadTaskMiddlewares(stack *middleware. } func addOpDescribeBatchLoadTaskDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -149,10 +149,11 @@ func addOpDescribeBatchLoadTaskDiscoverEndpointMiddleware(stack *middleware.Stac DiscoverOperation: c.fetchOpDescribeBatchLoadTaskDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeBatchLoadTaskDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeBatchLoadTaskDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeBatchLoadTaskInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_DescribeDatabase.go b/service/timestreamwrite/api_op_DescribeDatabase.go index 5b599e74ad7..d1d1356e0fe 100644 --- a/service/timestreamwrite/api_op_DescribeDatabase.go +++ b/service/timestreamwrite/api_op_DescribeDatabase.go @@ -137,7 +137,7 @@ func (c *Client) addOperationDescribeDatabaseMiddlewares(stack *middleware.Stack } func addOpDescribeDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -148,10 +148,11 @@ func addOpDescribeDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o DiscoverOperation: c.fetchOpDescribeDatabaseDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeDatabaseDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeDatabaseDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeDatabaseInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_DescribeTable.go b/service/timestreamwrite/api_op_DescribeTable.go index f8ac124d168..37bc96087d1 100644 --- a/service/timestreamwrite/api_op_DescribeTable.go +++ b/service/timestreamwrite/api_op_DescribeTable.go @@ -142,7 +142,7 @@ func (c *Client) addOperationDescribeTableMiddlewares(stack *middleware.Stack, o } func addOpDescribeTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -153,10 +153,11 @@ func addOpDescribeTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Opt DiscoverOperation: c.fetchOpDescribeTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpDescribeTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpDescribeTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*DescribeTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_ListBatchLoadTasks.go b/service/timestreamwrite/api_op_ListBatchLoadTasks.go index 642ac726148..e9385c48ac5 100644 --- a/service/timestreamwrite/api_op_ListBatchLoadTasks.go +++ b/service/timestreamwrite/api_op_ListBatchLoadTasks.go @@ -144,7 +144,7 @@ func (c *Client) addOperationListBatchLoadTasksMiddlewares(stack *middleware.Sta } func addOpListBatchLoadTasksDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -155,10 +155,11 @@ func addOpListBatchLoadTasksDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpListBatchLoadTasksDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListBatchLoadTasksDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListBatchLoadTasksDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListBatchLoadTasksInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_ListDatabases.go b/service/timestreamwrite/api_op_ListDatabases.go index 677b9d40f09..f056dfc4ce4 100644 --- a/service/timestreamwrite/api_op_ListDatabases.go +++ b/service/timestreamwrite/api_op_ListDatabases.go @@ -140,7 +140,7 @@ func (c *Client) addOperationListDatabasesMiddlewares(stack *middleware.Stack, o } func addOpListDatabasesDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -151,10 +151,11 @@ func addOpListDatabasesDiscoverEndpointMiddleware(stack *middleware.Stack, o Opt DiscoverOperation: c.fetchOpListDatabasesDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListDatabasesDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListDatabasesDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListDatabasesInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_ListTables.go b/service/timestreamwrite/api_op_ListTables.go index e92009ea89f..2a6846c87af 100644 --- a/service/timestreamwrite/api_op_ListTables.go +++ b/service/timestreamwrite/api_op_ListTables.go @@ -144,7 +144,7 @@ func (c *Client) addOperationListTablesMiddlewares(stack *middleware.Stack, opti } func addOpListTablesDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -155,10 +155,11 @@ func addOpListTablesDiscoverEndpointMiddleware(stack *middleware.Stack, o Option DiscoverOperation: c.fetchOpListTablesDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListTablesDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListTablesDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListTablesInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_ListTagsForResource.go b/service/timestreamwrite/api_op_ListTagsForResource.go index c17ead35bde..383ea9525a3 100644 --- a/service/timestreamwrite/api_op_ListTagsForResource.go +++ b/service/timestreamwrite/api_op_ListTagsForResource.go @@ -134,7 +134,7 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St } func addOpListTagsForResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -145,10 +145,11 @@ func addOpListTagsForResourceDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpListTagsForResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpListTagsForResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpListTagsForResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ListTagsForResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_ResumeBatchLoadTask.go b/service/timestreamwrite/api_op_ResumeBatchLoadTask.go index 0efef907c7b..b35ddf54d9b 100644 --- a/service/timestreamwrite/api_op_ResumeBatchLoadTask.go +++ b/service/timestreamwrite/api_op_ResumeBatchLoadTask.go @@ -127,7 +127,7 @@ func (c *Client) addOperationResumeBatchLoadTaskMiddlewares(stack *middleware.St } func addOpResumeBatchLoadTaskDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -138,10 +138,11 @@ func addOpResumeBatchLoadTaskDiscoverEndpointMiddleware(stack *middleware.Stack, DiscoverOperation: c.fetchOpResumeBatchLoadTaskDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpResumeBatchLoadTaskDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpResumeBatchLoadTaskDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*ResumeBatchLoadTaskInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_TagResource.go b/service/timestreamwrite/api_op_TagResource.go index 7c66472ccef..e98bf9d5494 100644 --- a/service/timestreamwrite/api_op_TagResource.go +++ b/service/timestreamwrite/api_op_TagResource.go @@ -137,7 +137,7 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt } func addOpTagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -148,10 +148,11 @@ func addOpTagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpTagResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpTagResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpTagResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*TagResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_UntagResource.go b/service/timestreamwrite/api_op_UntagResource.go index 4d2dac6e6c0..e5196178238 100644 --- a/service/timestreamwrite/api_op_UntagResource.go +++ b/service/timestreamwrite/api_op_UntagResource.go @@ -135,7 +135,7 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o } func addOpUntagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -146,10 +146,11 @@ func addOpUntagResourceDiscoverEndpointMiddleware(stack *middleware.Stack, o Opt DiscoverOperation: c.fetchOpUntagResourceDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUntagResourceDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUntagResourceDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UntagResourceInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_UpdateDatabase.go b/service/timestreamwrite/api_op_UpdateDatabase.go index 2d999bb2e6e..69fe3db2d7e 100644 --- a/service/timestreamwrite/api_op_UpdateDatabase.go +++ b/service/timestreamwrite/api_op_UpdateDatabase.go @@ -152,7 +152,7 @@ func (c *Client) addOperationUpdateDatabaseMiddlewares(stack *middleware.Stack, } func addOpUpdateDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -163,10 +163,11 @@ func addOpUpdateDatabaseDiscoverEndpointMiddleware(stack *middleware.Stack, o Op DiscoverOperation: c.fetchOpUpdateDatabaseDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateDatabaseDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateDatabaseDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateDatabaseInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_UpdateTable.go b/service/timestreamwrite/api_op_UpdateTable.go index ef057ae71e9..5b34b5d609a 100644 --- a/service/timestreamwrite/api_op_UpdateTable.go +++ b/service/timestreamwrite/api_op_UpdateTable.go @@ -154,7 +154,7 @@ func (c *Client) addOperationUpdateTableMiddlewares(stack *middleware.Stack, opt } func addOpUpdateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -165,10 +165,11 @@ func addOpUpdateTableDiscoverEndpointMiddleware(stack *middleware.Stack, o Optio DiscoverOperation: c.fetchOpUpdateTableDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpUpdateTableDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpUpdateTableDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*UpdateTableInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/timestreamwrite/api_op_WriteRecords.go b/service/timestreamwrite/api_op_WriteRecords.go index b5cb9ad1615..83617e7e484 100644 --- a/service/timestreamwrite/api_op_WriteRecords.go +++ b/service/timestreamwrite/api_op_WriteRecords.go @@ -185,7 +185,7 @@ func (c *Client) addOperationWriteRecordsMiddlewares(stack *middleware.Stack, op } func addOpWriteRecordsDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { - return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ + return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS @@ -196,10 +196,11 @@ func addOpWriteRecordsDiscoverEndpointMiddleware(stack *middleware.Stack, o Opti DiscoverOperation: c.fetchOpWriteRecordsDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, - }, "ResolveEndpoint", middleware.After) + }, "ResolveEndpointV2", middleware.After) } -func (c *Client) fetchOpWriteRecordsDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { +func (c *Client) fetchOpWriteRecordsDiscoverEndpoint(ctx context.Context, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { + input := getOperationInput(ctx) in, ok := input.(*WriteRecordsInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) diff --git a/service/transcribestreaming/eventstream.go b/service/transcribestreaming/eventstream.go index 94d65225d56..9b54d8bfb99 100644 --- a/service/transcribestreaming/eventstream.go +++ b/service/transcribestreaming/eventstream.go @@ -7,10 +7,10 @@ import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream" "github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" "github.com/aws/aws-sdk-go-v2/service/transcribestreaming/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" @@ -692,12 +692,32 @@ func (m *awsRestjson1_deserializeOpEventStreamStartCallAnalyticsStreamTranscript return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err) } - signer := v4.NewStreamSigner( - awsmiddleware.GetSigningCredentials(ctx), - awsmiddleware.GetSigningName(ctx), - awsmiddleware.GetSigningRegion(ctx), - requestSignature, - ) + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + creds, ok := identity.(*internalauthsmithy.CredentialsAdapter) + if !ok { + return out, metadata, fmt.Errorf("identity is not sigv4 credentials") + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + name, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing name") + } + + region, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing region") + } + + signer := v4.NewStreamSigner(creds.Credentials, name, region, requestSignature) eventWriter := newAudioStreamWriter( eventstreamapi.GetInputStreamWriter(ctx), @@ -813,12 +833,32 @@ func (m *awsRestjson1_deserializeOpEventStreamStartMedicalStreamTranscription) H return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err) } - signer := v4.NewStreamSigner( - awsmiddleware.GetSigningCredentials(ctx), - awsmiddleware.GetSigningName(ctx), - awsmiddleware.GetSigningRegion(ctx), - requestSignature, - ) + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + creds, ok := identity.(*internalauthsmithy.CredentialsAdapter) + if !ok { + return out, metadata, fmt.Errorf("identity is not sigv4 credentials") + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + name, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing name") + } + + region, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing region") + } + + signer := v4.NewStreamSigner(creds.Credentials, name, region, requestSignature) eventWriter := newAudioStreamWriter( eventstreamapi.GetInputStreamWriter(ctx), @@ -934,12 +974,32 @@ func (m *awsRestjson1_deserializeOpEventStreamStartStreamTranscription) HandleDe return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err) } - signer := v4.NewStreamSigner( - awsmiddleware.GetSigningCredentials(ctx), - awsmiddleware.GetSigningName(ctx), - awsmiddleware.GetSigningRegion(ctx), - requestSignature, - ) + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + creds, ok := identity.(*internalauthsmithy.CredentialsAdapter) + if !ok { + return out, metadata, fmt.Errorf("identity is not sigv4 credentials") + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + name, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing name") + } + + region, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties) + if !ok { + return out, metadata, fmt.Errorf("no sigv4 signing region") + } + + signer := v4.NewStreamSigner(creds.Credentials, name, region, requestSignature) eventWriter := newAudioStreamWriter( eventstreamapi.GetInputStreamWriter(ctx),