diff --git a/internal/protocoltest/awsrestjson/api_client.go b/internal/protocoltest/awsrestjson/api_client.go index 16ebfe822b7..13c8ecc39d6 100644 --- a/internal/protocoltest/awsrestjson/api_client.go +++ b/internal/protocoltest/awsrestjson/api_client.go @@ -94,6 +94,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/internal/protocoltest/awsrestjson/endpoints.go b/internal/protocoltest/awsrestjson/endpoints.go index b6f0c0daa0f..84633f31bb2 100644 --- a/internal/protocoltest/awsrestjson/endpoints.go +++ b/internal/protocoltest/awsrestjson/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/ec2query/api_client.go b/internal/protocoltest/ec2query/api_client.go index 041ee2f27e7..e468314b8d5 100644 --- a/internal/protocoltest/ec2query/api_client.go +++ b/internal/protocoltest/ec2query/api_client.go @@ -94,6 +94,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/internal/protocoltest/ec2query/endpoints.go b/internal/protocoltest/ec2query/endpoints.go index 7510962c2c8..e064c912f00 100644 --- a/internal/protocoltest/ec2query/endpoints.go +++ b/internal/protocoltest/ec2query/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/jsonrpc/api_client.go b/internal/protocoltest/jsonrpc/api_client.go index 0a87f47fbd8..0f8b7d8830c 100644 --- a/internal/protocoltest/jsonrpc/api_client.go +++ b/internal/protocoltest/jsonrpc/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/internal/protocoltest/jsonrpc/endpoints.go b/internal/protocoltest/jsonrpc/endpoints.go index 4de075ad284..ae60cf9ac87 100644 --- a/internal/protocoltest/jsonrpc/endpoints.go +++ b/internal/protocoltest/jsonrpc/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/jsonrpc10/api_client.go b/internal/protocoltest/jsonrpc10/api_client.go index 1a6d05f47bc..63ffaac86fb 100644 --- a/internal/protocoltest/jsonrpc10/api_client.go +++ b/internal/protocoltest/jsonrpc10/api_client.go @@ -86,6 +86,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/internal/protocoltest/jsonrpc10/endpoints.go b/internal/protocoltest/jsonrpc10/endpoints.go index 97c5fb3694d..5f40c732fd1 100644 --- a/internal/protocoltest/jsonrpc10/endpoints.go +++ b/internal/protocoltest/jsonrpc10/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/query/api_client.go b/internal/protocoltest/query/api_client.go index 7db67f2df60..1bb17435c38 100644 --- a/internal/protocoltest/query/api_client.go +++ b/internal/protocoltest/query/api_client.go @@ -94,6 +94,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/internal/protocoltest/query/endpoints.go b/internal/protocoltest/query/endpoints.go index 55f9c3d2ba8..3fcfb9184f7 100644 --- a/internal/protocoltest/query/endpoints.go +++ b/internal/protocoltest/query/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/restxml/api_client.go b/internal/protocoltest/restxml/api_client.go index 4286af6dc97..4bcc09d4828 100644 --- a/internal/protocoltest/restxml/api_client.go +++ b/internal/protocoltest/restxml/api_client.go @@ -94,6 +94,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/internal/protocoltest/restxml/endpoints.go b/internal/protocoltest/restxml/endpoints.go index 4677e65b467..66d5dc280d4 100644 --- a/internal/protocoltest/restxml/endpoints.go +++ b/internal/protocoltest/restxml/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/restxmlwithnamespace/api_client.go b/internal/protocoltest/restxmlwithnamespace/api_client.go index d3ee31c4b04..326c1b0161b 100644 --- a/internal/protocoltest/restxmlwithnamespace/api_client.go +++ b/internal/protocoltest/restxmlwithnamespace/api_client.go @@ -86,6 +86,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/internal/protocoltest/restxmlwithnamespace/endpoints.go b/internal/protocoltest/restxmlwithnamespace/endpoints.go index 2076a292c8a..2b0e9549e76 100644 --- a/internal/protocoltest/restxmlwithnamespace/endpoints.go +++ b/internal/protocoltest/restxmlwithnamespace/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/accessanalyzer/api_client.go b/service/accessanalyzer/api_client.go index 1bc602f290b..d44b76d25d3 100644 --- a/service/accessanalyzer/api_client.go +++ b/service/accessanalyzer/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/accessanalyzer/endpoints.go b/service/accessanalyzer/endpoints.go index e8a02a6129a..18e4dc0d6f9 100644 --- a/service/accessanalyzer/endpoints.go +++ b/service/accessanalyzer/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/acm/api_client.go b/service/acm/api_client.go index 7d64d5dc24b..04cc0fe5b82 100644 --- a/service/acm/api_client.go +++ b/service/acm/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/acm/endpoints.go b/service/acm/endpoints.go index 11ad63cc4ed..9217d816ff0 100644 --- a/service/acm/endpoints.go +++ b/service/acm/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/acmpca/api_client.go b/service/acmpca/api_client.go index c6016bf0534..598aa1dd3bc 100644 --- a/service/acmpca/api_client.go +++ b/service/acmpca/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/acmpca/endpoints.go b/service/acmpca/endpoints.go index 5cdef8cf24e..dad7614d909 100644 --- a/service/acmpca/endpoints.go +++ b/service/acmpca/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/alexaforbusiness/api_client.go b/service/alexaforbusiness/api_client.go index 3c66faaf427..27eeb5c5bfc 100644 --- a/service/alexaforbusiness/api_client.go +++ b/service/alexaforbusiness/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/alexaforbusiness/endpoints.go b/service/alexaforbusiness/endpoints.go index c70c5d095e9..a1d910de81b 100644 --- a/service/alexaforbusiness/endpoints.go +++ b/service/alexaforbusiness/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/amplify/api_client.go b/service/amplify/api_client.go index 3e5ae18e187..8b18e64e42f 100644 --- a/service/amplify/api_client.go +++ b/service/amplify/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/amplify/endpoints.go b/service/amplify/endpoints.go index 471b8eb5fea..97580168e34 100644 --- a/service/amplify/endpoints.go +++ b/service/amplify/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/apigateway/api_client.go b/service/apigateway/api_client.go index 437d4d7ea6c..80bbe4fb4c8 100644 --- a/service/apigateway/api_client.go +++ b/service/apigateway/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/apigateway/endpoints.go b/service/apigateway/endpoints.go index 05ec7b64431..be0d9e2705a 100644 --- a/service/apigateway/endpoints.go +++ b/service/apigateway/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/apigatewaymanagementapi/api_client.go b/service/apigatewaymanagementapi/api_client.go index 793ada3808d..cb83011c09b 100644 --- a/service/apigatewaymanagementapi/api_client.go +++ b/service/apigatewaymanagementapi/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/apigatewaymanagementapi/endpoints.go b/service/apigatewaymanagementapi/endpoints.go index 898adce1b79..2449a59c7c5 100644 --- a/service/apigatewaymanagementapi/endpoints.go +++ b/service/apigatewaymanagementapi/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/apigatewayv2/api_client.go b/service/apigatewayv2/api_client.go index a78a7b1e6b4..0eafaf08d9a 100644 --- a/service/apigatewayv2/api_client.go +++ b/service/apigatewayv2/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/apigatewayv2/endpoints.go b/service/apigatewayv2/endpoints.go index 84bd914d096..daaae50fb3a 100644 --- a/service/apigatewayv2/endpoints.go +++ b/service/apigatewayv2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appconfig/api_client.go b/service/appconfig/api_client.go index 2fdc14d90cb..049da78c40a 100644 --- a/service/appconfig/api_client.go +++ b/service/appconfig/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/appconfig/endpoints.go b/service/appconfig/endpoints.go index 8be660e1a7a..1add5a1e476 100644 --- a/service/appconfig/endpoints.go +++ b/service/appconfig/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appflow/api_client.go b/service/appflow/api_client.go index a4e95020d53..39fae209483 100644 --- a/service/appflow/api_client.go +++ b/service/appflow/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/appflow/endpoints.go b/service/appflow/endpoints.go index d6755a7e1a6..cf57f17b8b0 100644 --- a/service/appflow/endpoints.go +++ b/service/appflow/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appintegrations/api_client.go b/service/appintegrations/api_client.go index 0058a50d95c..a6c65dc7b5c 100644 --- a/service/appintegrations/api_client.go +++ b/service/appintegrations/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/appintegrations/endpoints.go b/service/appintegrations/endpoints.go index d15fc413267..9e5f20ea4fa 100644 --- a/service/appintegrations/endpoints.go +++ b/service/appintegrations/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/applicationautoscaling/api_client.go b/service/applicationautoscaling/api_client.go index dffa9a5ac23..c1fc5bca5f5 100644 --- a/service/applicationautoscaling/api_client.go +++ b/service/applicationautoscaling/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/applicationautoscaling/endpoints.go b/service/applicationautoscaling/endpoints.go index 4511ba40abc..aa941d3d068 100644 --- a/service/applicationautoscaling/endpoints.go +++ b/service/applicationautoscaling/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/applicationdiscoveryservice/api_client.go b/service/applicationdiscoveryservice/api_client.go index 037d9d14b27..d815e902ebc 100644 --- a/service/applicationdiscoveryservice/api_client.go +++ b/service/applicationdiscoveryservice/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/applicationdiscoveryservice/endpoints.go b/service/applicationdiscoveryservice/endpoints.go index acd3e234d9d..a03070d0d6e 100644 --- a/service/applicationdiscoveryservice/endpoints.go +++ b/service/applicationdiscoveryservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/applicationinsights/api_client.go b/service/applicationinsights/api_client.go index 128cec4e001..f331b4a1c0f 100644 --- a/service/applicationinsights/api_client.go +++ b/service/applicationinsights/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/applicationinsights/endpoints.go b/service/applicationinsights/endpoints.go index 998c8f1a448..2ad33fcc381 100644 --- a/service/applicationinsights/endpoints.go +++ b/service/applicationinsights/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appmesh/api_client.go b/service/appmesh/api_client.go index a238a6fbf79..03c2635187b 100644 --- a/service/appmesh/api_client.go +++ b/service/appmesh/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/appmesh/endpoints.go b/service/appmesh/endpoints.go index 5803c5ba41f..cbaabb56490 100644 --- a/service/appmesh/endpoints.go +++ b/service/appmesh/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appstream/api_client.go b/service/appstream/api_client.go index 3577b968350..74f02c60547 100644 --- a/service/appstream/api_client.go +++ b/service/appstream/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/appstream/endpoints.go b/service/appstream/endpoints.go index fb520ff5ec9..42710c6c191 100644 --- a/service/appstream/endpoints.go +++ b/service/appstream/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appsync/api_client.go b/service/appsync/api_client.go index 4ff8df833e1..899957b1ff6 100644 --- a/service/appsync/api_client.go +++ b/service/appsync/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/appsync/endpoints.go b/service/appsync/endpoints.go index d1bba344cac..56ea3ff9421 100644 --- a/service/appsync/endpoints.go +++ b/service/appsync/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/athena/api_client.go b/service/athena/api_client.go index 6cac0d23da0..5e6ff66a488 100644 --- a/service/athena/api_client.go +++ b/service/athena/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/athena/endpoints.go b/service/athena/endpoints.go index 949b824546c..61cb5b948d7 100644 --- a/service/athena/endpoints.go +++ b/service/athena/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/auditmanager/api_client.go b/service/auditmanager/api_client.go index ac12a9dfe32..3a5b591fba2 100644 --- a/service/auditmanager/api_client.go +++ b/service/auditmanager/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/auditmanager/endpoints.go b/service/auditmanager/endpoints.go index d21db54a840..a428ae7fbda 100644 --- a/service/auditmanager/endpoints.go +++ b/service/auditmanager/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/autoscaling/api_client.go b/service/autoscaling/api_client.go index caf34f7d2e9..7687507c5ca 100644 --- a/service/autoscaling/api_client.go +++ b/service/autoscaling/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/autoscaling/endpoints.go b/service/autoscaling/endpoints.go index b7cf1ad6046..f6be1871f48 100644 --- a/service/autoscaling/endpoints.go +++ b/service/autoscaling/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/autoscalingplans/api_client.go b/service/autoscalingplans/api_client.go index 91d415efe6e..a31583b23af 100644 --- a/service/autoscalingplans/api_client.go +++ b/service/autoscalingplans/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/autoscalingplans/endpoints.go b/service/autoscalingplans/endpoints.go index c3f7302dd2f..9a7f857f615 100644 --- a/service/autoscalingplans/endpoints.go +++ b/service/autoscalingplans/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/backup/api_client.go b/service/backup/api_client.go index 380d92fcc9b..45300c1c534 100644 --- a/service/backup/api_client.go +++ b/service/backup/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/backup/endpoints.go b/service/backup/endpoints.go index 4676724b7af..a214f8b6030 100644 --- a/service/backup/endpoints.go +++ b/service/backup/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/batch/api_client.go b/service/batch/api_client.go index 1902df89f48..f6ff92d2247 100644 --- a/service/batch/api_client.go +++ b/service/batch/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/batch/endpoints.go b/service/batch/endpoints.go index 20c5479bd61..19a0fd4fd51 100644 --- a/service/batch/endpoints.go +++ b/service/batch/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/braket/api_client.go b/service/braket/api_client.go index 0c47194d5d2..1ef80c8b4a8 100644 --- a/service/braket/api_client.go +++ b/service/braket/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/braket/endpoints.go b/service/braket/endpoints.go index 728216b41d1..924ee84cf52 100644 --- a/service/braket/endpoints.go +++ b/service/braket/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/budgets/api_client.go b/service/budgets/api_client.go index 1aa792c4545..13f69d98995 100644 --- a/service/budgets/api_client.go +++ b/service/budgets/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/budgets/endpoints.go b/service/budgets/endpoints.go index 2ba1187c536..a14f97dc4f3 100644 --- a/service/budgets/endpoints.go +++ b/service/budgets/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/chime/api_client.go b/service/chime/api_client.go index 95795d12754..af21642675c 100644 --- a/service/chime/api_client.go +++ b/service/chime/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/chime/endpoints.go b/service/chime/endpoints.go index 606cd3ad5db..3e22240e52a 100644 --- a/service/chime/endpoints.go +++ b/service/chime/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloud9/api_client.go b/service/cloud9/api_client.go index 554231b5fda..957d13feba7 100644 --- a/service/cloud9/api_client.go +++ b/service/cloud9/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloud9/endpoints.go b/service/cloud9/endpoints.go index b7a76e17c96..f8e812f736c 100644 --- a/service/cloud9/endpoints.go +++ b/service/cloud9/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/clouddirectory/api_client.go b/service/clouddirectory/api_client.go index 9b33e36eaf4..f131599c8ae 100644 --- a/service/clouddirectory/api_client.go +++ b/service/clouddirectory/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/clouddirectory/endpoints.go b/service/clouddirectory/endpoints.go index b43652e3b31..79e5be35abb 100644 --- a/service/clouddirectory/endpoints.go +++ b/service/clouddirectory/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudformation/api_client.go b/service/cloudformation/api_client.go index 2a4f7c7545b..6b3e1989fea 100644 --- a/service/cloudformation/api_client.go +++ b/service/cloudformation/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudformation/endpoints.go b/service/cloudformation/endpoints.go index 9ac183a2c9a..4b98f6d0d51 100644 --- a/service/cloudformation/endpoints.go +++ b/service/cloudformation/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudfront/api_client.go b/service/cloudfront/api_client.go index 78c402e4176..23b8765521d 100644 --- a/service/cloudfront/api_client.go +++ b/service/cloudfront/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudfront/endpoints.go b/service/cloudfront/endpoints.go index c2a4d81f0b0..df18118f437 100644 --- a/service/cloudfront/endpoints.go +++ b/service/cloudfront/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudhsm/api_client.go b/service/cloudhsm/api_client.go index b8c371e1055..a46e231307d 100644 --- a/service/cloudhsm/api_client.go +++ b/service/cloudhsm/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudhsm/endpoints.go b/service/cloudhsm/endpoints.go index e3e4c08721e..b38ed590091 100644 --- a/service/cloudhsm/endpoints.go +++ b/service/cloudhsm/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudhsmv2/api_client.go b/service/cloudhsmv2/api_client.go index 23250086c03..d81a4d64050 100644 --- a/service/cloudhsmv2/api_client.go +++ b/service/cloudhsmv2/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudhsmv2/endpoints.go b/service/cloudhsmv2/endpoints.go index 0d48d6f0865..18cd577818d 100644 --- a/service/cloudhsmv2/endpoints.go +++ b/service/cloudhsmv2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudsearch/api_client.go b/service/cloudsearch/api_client.go index 76544a527a4..d0c84d03999 100644 --- a/service/cloudsearch/api_client.go +++ b/service/cloudsearch/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudsearch/endpoints.go b/service/cloudsearch/endpoints.go index 5e0146e28dd..1d07418b9d2 100644 --- a/service/cloudsearch/endpoints.go +++ b/service/cloudsearch/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudsearchdomain/api_client.go b/service/cloudsearchdomain/api_client.go index c0696947022..1b2744f9bbc 100644 --- a/service/cloudsearchdomain/api_client.go +++ b/service/cloudsearchdomain/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudsearchdomain/endpoints.go b/service/cloudsearchdomain/endpoints.go index 3e550bd1adf..490de181bbf 100644 --- a/service/cloudsearchdomain/endpoints.go +++ b/service/cloudsearchdomain/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudtrail/api_client.go b/service/cloudtrail/api_client.go index 8778a73c19a..737aaa8a361 100644 --- a/service/cloudtrail/api_client.go +++ b/service/cloudtrail/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudtrail/endpoints.go b/service/cloudtrail/endpoints.go index 2e59cb930a4..817c69014b6 100644 --- a/service/cloudtrail/endpoints.go +++ b/service/cloudtrail/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudwatch/api_client.go b/service/cloudwatch/api_client.go index 08bfee18e08..65763a92745 100644 --- a/service/cloudwatch/api_client.go +++ b/service/cloudwatch/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudwatch/endpoints.go b/service/cloudwatch/endpoints.go index db3249479a6..0224af1c0c2 100644 --- a/service/cloudwatch/endpoints.go +++ b/service/cloudwatch/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudwatchevents/api_client.go b/service/cloudwatchevents/api_client.go index c05967fa809..5b3a189e4cb 100644 --- a/service/cloudwatchevents/api_client.go +++ b/service/cloudwatchevents/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudwatchevents/endpoints.go b/service/cloudwatchevents/endpoints.go index 674df490b66..3b9402f359e 100644 --- a/service/cloudwatchevents/endpoints.go +++ b/service/cloudwatchevents/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudwatchlogs/api_client.go b/service/cloudwatchlogs/api_client.go index b2e11835f39..011546ec34c 100644 --- a/service/cloudwatchlogs/api_client.go +++ b/service/cloudwatchlogs/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cloudwatchlogs/endpoints.go b/service/cloudwatchlogs/endpoints.go index c4c5325fb27..804630c55b2 100644 --- a/service/cloudwatchlogs/endpoints.go +++ b/service/cloudwatchlogs/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codeartifact/api_client.go b/service/codeartifact/api_client.go index 5a09e1cb26d..cfe355e7f9b 100644 --- a/service/codeartifact/api_client.go +++ b/service/codeartifact/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codeartifact/endpoints.go b/service/codeartifact/endpoints.go index ff44de3c64f..245a0334443 100644 --- a/service/codeartifact/endpoints.go +++ b/service/codeartifact/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codebuild/api_client.go b/service/codebuild/api_client.go index de8474295ad..bf232c75abe 100644 --- a/service/codebuild/api_client.go +++ b/service/codebuild/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codebuild/endpoints.go b/service/codebuild/endpoints.go index e410c4920f9..07ce290c147 100644 --- a/service/codebuild/endpoints.go +++ b/service/codebuild/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codecommit/api_client.go b/service/codecommit/api_client.go index 885cfdde811..8c3103c85a2 100644 --- a/service/codecommit/api_client.go +++ b/service/codecommit/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codecommit/endpoints.go b/service/codecommit/endpoints.go index da6362b0814..4c5763274d8 100644 --- a/service/codecommit/endpoints.go +++ b/service/codecommit/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codedeploy/api_client.go b/service/codedeploy/api_client.go index 8a5e95738c3..71dfbff3642 100644 --- a/service/codedeploy/api_client.go +++ b/service/codedeploy/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codedeploy/endpoints.go b/service/codedeploy/endpoints.go index 6319683ac44..df6f32130b7 100644 --- a/service/codedeploy/endpoints.go +++ b/service/codedeploy/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codeguruprofiler/api_client.go b/service/codeguruprofiler/api_client.go index d01bdd2ea3d..06f75822f57 100644 --- a/service/codeguruprofiler/api_client.go +++ b/service/codeguruprofiler/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codeguruprofiler/endpoints.go b/service/codeguruprofiler/endpoints.go index c47dc48ce22..8212a079f2f 100644 --- a/service/codeguruprofiler/endpoints.go +++ b/service/codeguruprofiler/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codegurureviewer/api_client.go b/service/codegurureviewer/api_client.go index 014c04c5a7f..025aced2ea8 100644 --- a/service/codegurureviewer/api_client.go +++ b/service/codegurureviewer/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codegurureviewer/endpoints.go b/service/codegurureviewer/endpoints.go index 4d01f9c8680..fef3a734d1f 100644 --- a/service/codegurureviewer/endpoints.go +++ b/service/codegurureviewer/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codepipeline/api_client.go b/service/codepipeline/api_client.go index 93d5a723ba4..6dab9c2f7aa 100644 --- a/service/codepipeline/api_client.go +++ b/service/codepipeline/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codepipeline/endpoints.go b/service/codepipeline/endpoints.go index a31b0d82fcf..7ccc081408e 100644 --- a/service/codepipeline/endpoints.go +++ b/service/codepipeline/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codestar/api_client.go b/service/codestar/api_client.go index 39ce3ed3b8f..fd7fd34689c 100644 --- a/service/codestar/api_client.go +++ b/service/codestar/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codestar/endpoints.go b/service/codestar/endpoints.go index 2c9416788bf..528b1e61a8c 100644 --- a/service/codestar/endpoints.go +++ b/service/codestar/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codestarconnections/api_client.go b/service/codestarconnections/api_client.go index 5d9c5120404..ebd82d29b04 100644 --- a/service/codestarconnections/api_client.go +++ b/service/codestarconnections/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codestarconnections/endpoints.go b/service/codestarconnections/endpoints.go index 46273265920..15b03c14a33 100644 --- a/service/codestarconnections/endpoints.go +++ b/service/codestarconnections/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codestarnotifications/api_client.go b/service/codestarnotifications/api_client.go index 6b5aaafcb91..799b153c97d 100644 --- a/service/codestarnotifications/api_client.go +++ b/service/codestarnotifications/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/codestarnotifications/endpoints.go b/service/codestarnotifications/endpoints.go index ed77276572a..927524fcbdc 100644 --- a/service/codestarnotifications/endpoints.go +++ b/service/codestarnotifications/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cognitoidentity/api_client.go b/service/cognitoidentity/api_client.go index e6a068bd924..fd156fb74c5 100644 --- a/service/cognitoidentity/api_client.go +++ b/service/cognitoidentity/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cognitoidentity/endpoints.go b/service/cognitoidentity/endpoints.go index bb2a4493135..8341583f2fc 100644 --- a/service/cognitoidentity/endpoints.go +++ b/service/cognitoidentity/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cognitoidentityprovider/api_client.go b/service/cognitoidentityprovider/api_client.go index f0edb5c241e..a6b2cfdfa7c 100644 --- a/service/cognitoidentityprovider/api_client.go +++ b/service/cognitoidentityprovider/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cognitoidentityprovider/endpoints.go b/service/cognitoidentityprovider/endpoints.go index 66365c33050..aefdfffdad4 100644 --- a/service/cognitoidentityprovider/endpoints.go +++ b/service/cognitoidentityprovider/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cognitosync/api_client.go b/service/cognitosync/api_client.go index 0a089fbff2b..29217a19eb6 100644 --- a/service/cognitosync/api_client.go +++ b/service/cognitosync/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/cognitosync/endpoints.go b/service/cognitosync/endpoints.go index daf89411df9..1d87658268a 100644 --- a/service/cognitosync/endpoints.go +++ b/service/cognitosync/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/comprehend/api_client.go b/service/comprehend/api_client.go index e7df968c4e7..fcbf72987ab 100644 --- a/service/comprehend/api_client.go +++ b/service/comprehend/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/comprehend/endpoints.go b/service/comprehend/endpoints.go index 44dfe7c7997..fa4878843b2 100644 --- a/service/comprehend/endpoints.go +++ b/service/comprehend/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/comprehendmedical/api_client.go b/service/comprehendmedical/api_client.go index ede5b331c57..76babdce0c0 100644 --- a/service/comprehendmedical/api_client.go +++ b/service/comprehendmedical/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/comprehendmedical/endpoints.go b/service/comprehendmedical/endpoints.go index cf1b71ebd84..cd87c685829 100644 --- a/service/comprehendmedical/endpoints.go +++ b/service/comprehendmedical/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/computeoptimizer/api_client.go b/service/computeoptimizer/api_client.go index 9f0e768029b..862a3dfe441 100644 --- a/service/computeoptimizer/api_client.go +++ b/service/computeoptimizer/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/computeoptimizer/endpoints.go b/service/computeoptimizer/endpoints.go index 6599e73fce9..ac1b9d9973a 100644 --- a/service/computeoptimizer/endpoints.go +++ b/service/computeoptimizer/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/configservice/api_client.go b/service/configservice/api_client.go index 2403f20d0ad..37755d5b326 100644 --- a/service/configservice/api_client.go +++ b/service/configservice/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/configservice/endpoints.go b/service/configservice/endpoints.go index af9b15b5af7..6b974f1d979 100644 --- a/service/configservice/endpoints.go +++ b/service/configservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/connect/api_client.go b/service/connect/api_client.go index 0a5d42a1771..aa4d4d28d95 100644 --- a/service/connect/api_client.go +++ b/service/connect/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/connect/endpoints.go b/service/connect/endpoints.go index 6108faaccd0..2689bfe99f6 100644 --- a/service/connect/endpoints.go +++ b/service/connect/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/connectcontactlens/api_client.go b/service/connectcontactlens/api_client.go index c92dbdbaf76..790d972273b 100644 --- a/service/connectcontactlens/api_client.go +++ b/service/connectcontactlens/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/connectcontactlens/endpoints.go b/service/connectcontactlens/endpoints.go index 7028f3d4b6a..35cade35fdc 100644 --- a/service/connectcontactlens/endpoints.go +++ b/service/connectcontactlens/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/connectparticipant/api_client.go b/service/connectparticipant/api_client.go index a8ac2e03df0..cd8b35b24f9 100644 --- a/service/connectparticipant/api_client.go +++ b/service/connectparticipant/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/connectparticipant/endpoints.go b/service/connectparticipant/endpoints.go index 50d19ea7eea..1f26ccc9ec9 100644 --- a/service/connectparticipant/endpoints.go +++ b/service/connectparticipant/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/costandusagereportservice/api_client.go b/service/costandusagereportservice/api_client.go index 03c7aa97fa2..0d53e1c0315 100644 --- a/service/costandusagereportservice/api_client.go +++ b/service/costandusagereportservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/costandusagereportservice/endpoints.go b/service/costandusagereportservice/endpoints.go index 029c330bb01..6436fd7808d 100644 --- a/service/costandusagereportservice/endpoints.go +++ b/service/costandusagereportservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/costexplorer/api_client.go b/service/costexplorer/api_client.go index d20852a738c..588f6b91855 100644 --- a/service/costexplorer/api_client.go +++ b/service/costexplorer/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/costexplorer/endpoints.go b/service/costexplorer/endpoints.go index 70ac85dc41f..f54a1da96c4 100644 --- a/service/costexplorer/endpoints.go +++ b/service/costexplorer/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/customerprofiles/api_client.go b/service/customerprofiles/api_client.go index 2597c1309e3..04b0d9a7c09 100644 --- a/service/customerprofiles/api_client.go +++ b/service/customerprofiles/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/customerprofiles/endpoints.go b/service/customerprofiles/endpoints.go index 3eb6c5b8b27..2f85e7fbbea 100644 --- a/service/customerprofiles/endpoints.go +++ b/service/customerprofiles/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/databasemigrationservice/api_client.go b/service/databasemigrationservice/api_client.go index b629c3eb843..c11cb02c826 100644 --- a/service/databasemigrationservice/api_client.go +++ b/service/databasemigrationservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/databasemigrationservice/endpoints.go b/service/databasemigrationservice/endpoints.go index 7501964a8b5..be6f9b1de16 100644 --- a/service/databasemigrationservice/endpoints.go +++ b/service/databasemigrationservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/databrew/api_client.go b/service/databrew/api_client.go index 0e4f2eb9700..2cf9a61fe24 100644 --- a/service/databrew/api_client.go +++ b/service/databrew/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/databrew/endpoints.go b/service/databrew/endpoints.go index bc44e87b2c3..07c720d451d 100644 --- a/service/databrew/endpoints.go +++ b/service/databrew/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dataexchange/api_client.go b/service/dataexchange/api_client.go index dca907bb822..25f3990b56c 100644 --- a/service/dataexchange/api_client.go +++ b/service/dataexchange/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/dataexchange/endpoints.go b/service/dataexchange/endpoints.go index 08a626f9582..6fec4543b92 100644 --- a/service/dataexchange/endpoints.go +++ b/service/dataexchange/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/datapipeline/api_client.go b/service/datapipeline/api_client.go index a31033c2751..dfcbc303086 100644 --- a/service/datapipeline/api_client.go +++ b/service/datapipeline/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/datapipeline/endpoints.go b/service/datapipeline/endpoints.go index 31703a2be4d..e5ffeaa3ceb 100644 --- a/service/datapipeline/endpoints.go +++ b/service/datapipeline/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/datasync/api_client.go b/service/datasync/api_client.go index 5720e359b87..c7eca38a892 100644 --- a/service/datasync/api_client.go +++ b/service/datasync/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/datasync/endpoints.go b/service/datasync/endpoints.go index 4d77b08d6f9..c59064ebcdb 100644 --- a/service/datasync/endpoints.go +++ b/service/datasync/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dax/api_client.go b/service/dax/api_client.go index f7d51187177..b50727f4bb2 100644 --- a/service/dax/api_client.go +++ b/service/dax/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/dax/endpoints.go b/service/dax/endpoints.go index 2cf3d6c0fc3..b899e930a00 100644 --- a/service/dax/endpoints.go +++ b/service/dax/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/detective/api_client.go b/service/detective/api_client.go index 37285c27dcb..cc2d59157be 100644 --- a/service/detective/api_client.go +++ b/service/detective/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/detective/endpoints.go b/service/detective/endpoints.go index 5d7c0032ba8..e4e9bee6f82 100644 --- a/service/detective/endpoints.go +++ b/service/detective/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/devicefarm/api_client.go b/service/devicefarm/api_client.go index 6a36126eaad..84bb63e39fb 100644 --- a/service/devicefarm/api_client.go +++ b/service/devicefarm/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/devicefarm/endpoints.go b/service/devicefarm/endpoints.go index 077e2003265..93b1cbd1b42 100644 --- a/service/devicefarm/endpoints.go +++ b/service/devicefarm/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/devopsguru/api_client.go b/service/devopsguru/api_client.go index 12cb6454392..ab0e40b118c 100644 --- a/service/devopsguru/api_client.go +++ b/service/devopsguru/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/devopsguru/endpoints.go b/service/devopsguru/endpoints.go index 4d50403b2e5..835a600f091 100644 --- a/service/devopsguru/endpoints.go +++ b/service/devopsguru/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/directconnect/api_client.go b/service/directconnect/api_client.go index 6ba35a2df54..098f4dbdce8 100644 --- a/service/directconnect/api_client.go +++ b/service/directconnect/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/directconnect/endpoints.go b/service/directconnect/endpoints.go index 21645040c13..f4c5a800663 100644 --- a/service/directconnect/endpoints.go +++ b/service/directconnect/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/directoryservice/api_client.go b/service/directoryservice/api_client.go index e190a11b7cf..fadfdbd528e 100644 --- a/service/directoryservice/api_client.go +++ b/service/directoryservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/directoryservice/endpoints.go b/service/directoryservice/endpoints.go index 439ff874946..8a093ac993b 100644 --- a/service/directoryservice/endpoints.go +++ b/service/directoryservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dlm/api_client.go b/service/dlm/api_client.go index 01ebf22d19e..5cb3048732a 100644 --- a/service/dlm/api_client.go +++ b/service/dlm/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/dlm/endpoints.go b/service/dlm/endpoints.go index ea7cf70e861..4ff007aab3c 100644 --- a/service/dlm/endpoints.go +++ b/service/dlm/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/docdb/api_client.go b/service/docdb/api_client.go index d82aabec1d1..9da3a32600a 100644 --- a/service/docdb/api_client.go +++ b/service/docdb/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/docdb/endpoints.go b/service/docdb/endpoints.go index 793a57cabcb..72ed4ca31a2 100644 --- a/service/docdb/endpoints.go +++ b/service/docdb/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dynamodb/api_client.go b/service/dynamodb/api_client.go index eabb2c43747..e7b5d784493 100644 --- a/service/dynamodb/api_client.go +++ b/service/dynamodb/api_client.go @@ -114,6 +114,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/dynamodb/endpoints.go b/service/dynamodb/endpoints.go index 9e59c2b5dff..8f4f8e7d106 100644 --- a/service/dynamodb/endpoints.go +++ b/service/dynamodb/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dynamodbstreams/api_client.go b/service/dynamodbstreams/api_client.go index f0ceee602e3..04d96d6fbff 100644 --- a/service/dynamodbstreams/api_client.go +++ b/service/dynamodbstreams/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/dynamodbstreams/endpoints.go b/service/dynamodbstreams/endpoints.go index 7d11463edc9..d2b8088e586 100644 --- a/service/dynamodbstreams/endpoints.go +++ b/service/dynamodbstreams/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ebs/api_client.go b/service/ebs/api_client.go index 5e952cd3967..d7ca0af8f2d 100644 --- a/service/ebs/api_client.go +++ b/service/ebs/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ebs/endpoints.go b/service/ebs/endpoints.go index dda0e4ea122..98065e5734a 100644 --- a/service/ebs/endpoints.go +++ b/service/ebs/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ec2/api_client.go b/service/ec2/api_client.go index 02b561bf7e9..f78ce44000a 100644 --- a/service/ec2/api_client.go +++ b/service/ec2/api_client.go @@ -107,6 +107,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ec2/endpoints.go b/service/ec2/endpoints.go index 188001e2a6b..4dcfb5096af 100644 --- a/service/ec2/endpoints.go +++ b/service/ec2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ec2instanceconnect/api_client.go b/service/ec2instanceconnect/api_client.go index b388e4da78e..fc280045f46 100644 --- a/service/ec2instanceconnect/api_client.go +++ b/service/ec2instanceconnect/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ec2instanceconnect/endpoints.go b/service/ec2instanceconnect/endpoints.go index f70587551ca..3f02a680ea3 100644 --- a/service/ec2instanceconnect/endpoints.go +++ b/service/ec2instanceconnect/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ecr/api_client.go b/service/ecr/api_client.go index a09b74f5ff0..2fd8ef09e70 100644 --- a/service/ecr/api_client.go +++ b/service/ecr/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ecr/endpoints.go b/service/ecr/endpoints.go index 178f60fe1fd..f64f4036e06 100644 --- a/service/ecr/endpoints.go +++ b/service/ecr/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ecrpublic/api_client.go b/service/ecrpublic/api_client.go index 0f4c9e50374..1896c5b9205 100644 --- a/service/ecrpublic/api_client.go +++ b/service/ecrpublic/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ecrpublic/endpoints.go b/service/ecrpublic/endpoints.go index 4c4fda1732b..ddb18ec0215 100644 --- a/service/ecrpublic/endpoints.go +++ b/service/ecrpublic/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ecs/api_client.go b/service/ecs/api_client.go index 322b23ffde9..5b54917cb78 100644 --- a/service/ecs/api_client.go +++ b/service/ecs/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ecs/endpoints.go b/service/ecs/endpoints.go index f83a82a6bbc..281a5e99e92 100644 --- a/service/ecs/endpoints.go +++ b/service/ecs/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/efs/api_client.go b/service/efs/api_client.go index a9d8f81f3b5..439ebf83e53 100644 --- a/service/efs/api_client.go +++ b/service/efs/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/efs/endpoints.go b/service/efs/endpoints.go index cd6339caf9d..58b370e17f5 100644 --- a/service/efs/endpoints.go +++ b/service/efs/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/eks/api_client.go b/service/eks/api_client.go index 06e1e626100..28ab386ef00 100644 --- a/service/eks/api_client.go +++ b/service/eks/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/eks/endpoints.go b/service/eks/endpoints.go index b153cf84d8d..933bb5137af 100644 --- a/service/eks/endpoints.go +++ b/service/eks/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticache/api_client.go b/service/elasticache/api_client.go index 3b7192d1271..1318001c2c5 100644 --- a/service/elasticache/api_client.go +++ b/service/elasticache/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/elasticache/endpoints.go b/service/elasticache/endpoints.go index 4080b0d3c36..76792737572 100644 --- a/service/elasticache/endpoints.go +++ b/service/elasticache/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticbeanstalk/api_client.go b/service/elasticbeanstalk/api_client.go index af76722e171..25e3d85c410 100644 --- a/service/elasticbeanstalk/api_client.go +++ b/service/elasticbeanstalk/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/elasticbeanstalk/endpoints.go b/service/elasticbeanstalk/endpoints.go index 549063384c9..c998583d874 100644 --- a/service/elasticbeanstalk/endpoints.go +++ b/service/elasticbeanstalk/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticinference/api_client.go b/service/elasticinference/api_client.go index 785c9f568af..fd215aa634e 100644 --- a/service/elasticinference/api_client.go +++ b/service/elasticinference/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/elasticinference/endpoints.go b/service/elasticinference/endpoints.go index 345e814b308..a70676703b4 100644 --- a/service/elasticinference/endpoints.go +++ b/service/elasticinference/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticloadbalancing/api_client.go b/service/elasticloadbalancing/api_client.go index dca97783003..3e40aabba6d 100644 --- a/service/elasticloadbalancing/api_client.go +++ b/service/elasticloadbalancing/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/elasticloadbalancing/endpoints.go b/service/elasticloadbalancing/endpoints.go index de0b7f83f20..048186923f0 100644 --- a/service/elasticloadbalancing/endpoints.go +++ b/service/elasticloadbalancing/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticloadbalancingv2/api_client.go b/service/elasticloadbalancingv2/api_client.go index 4ffd965b72d..02992e90376 100644 --- a/service/elasticloadbalancingv2/api_client.go +++ b/service/elasticloadbalancingv2/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/elasticloadbalancingv2/endpoints.go b/service/elasticloadbalancingv2/endpoints.go index 31a3b7f71ed..bf3ca6cd999 100644 --- a/service/elasticloadbalancingv2/endpoints.go +++ b/service/elasticloadbalancingv2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticsearchservice/api_client.go b/service/elasticsearchservice/api_client.go index 649294a19e3..98d7d5e3246 100644 --- a/service/elasticsearchservice/api_client.go +++ b/service/elasticsearchservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/elasticsearchservice/endpoints.go b/service/elasticsearchservice/endpoints.go index 506fd87ee47..27069031ba2 100644 --- a/service/elasticsearchservice/endpoints.go +++ b/service/elasticsearchservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elastictranscoder/api_client.go b/service/elastictranscoder/api_client.go index 132269bd344..1276da0f735 100644 --- a/service/elastictranscoder/api_client.go +++ b/service/elastictranscoder/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/elastictranscoder/endpoints.go b/service/elastictranscoder/endpoints.go index fc6dae7cda5..08e43baff50 100644 --- a/service/elastictranscoder/endpoints.go +++ b/service/elastictranscoder/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/emr/api_client.go b/service/emr/api_client.go index fa3bb809923..53317deb54e 100644 --- a/service/emr/api_client.go +++ b/service/emr/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/emr/endpoints.go b/service/emr/endpoints.go index a03911e51eb..bdf27bc5792 100644 --- a/service/emr/endpoints.go +++ b/service/emr/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/emrcontainers/api_client.go b/service/emrcontainers/api_client.go index 0b4b43d71e8..7bfc7358ed7 100644 --- a/service/emrcontainers/api_client.go +++ b/service/emrcontainers/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/emrcontainers/endpoints.go b/service/emrcontainers/endpoints.go index 4d94a64ba28..c0a663b5324 100644 --- a/service/emrcontainers/endpoints.go +++ b/service/emrcontainers/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/eventbridge/api_client.go b/service/eventbridge/api_client.go index a03c3a84b71..329338f00d7 100644 --- a/service/eventbridge/api_client.go +++ b/service/eventbridge/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/eventbridge/endpoints.go b/service/eventbridge/endpoints.go index 572aca75a75..b3bcef4202e 100644 --- a/service/eventbridge/endpoints.go +++ b/service/eventbridge/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/firehose/api_client.go b/service/firehose/api_client.go index 89a97c4c00b..80f6f543822 100644 --- a/service/firehose/api_client.go +++ b/service/firehose/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/firehose/endpoints.go b/service/firehose/endpoints.go index b5389a24744..2ad2b3d8116 100644 --- a/service/firehose/endpoints.go +++ b/service/firehose/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/fms/api_client.go b/service/fms/api_client.go index f16bc812cab..48cfdf2e28e 100644 --- a/service/fms/api_client.go +++ b/service/fms/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/fms/endpoints.go b/service/fms/endpoints.go index 463aeb74d75..3c64f2a5161 100644 --- a/service/fms/endpoints.go +++ b/service/fms/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/forecast/api_client.go b/service/forecast/api_client.go index 8a8c04c71f3..a0101620922 100644 --- a/service/forecast/api_client.go +++ b/service/forecast/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/forecast/endpoints.go b/service/forecast/endpoints.go index fe723b20175..59d34819bdc 100644 --- a/service/forecast/endpoints.go +++ b/service/forecast/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/forecastquery/api_client.go b/service/forecastquery/api_client.go index eb6305b8986..ad4372a28b5 100644 --- a/service/forecastquery/api_client.go +++ b/service/forecastquery/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/forecastquery/endpoints.go b/service/forecastquery/endpoints.go index 255e85da488..928d76de532 100644 --- a/service/forecastquery/endpoints.go +++ b/service/forecastquery/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/frauddetector/api_client.go b/service/frauddetector/api_client.go index 55970243571..bf3aad73436 100644 --- a/service/frauddetector/api_client.go +++ b/service/frauddetector/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/frauddetector/endpoints.go b/service/frauddetector/endpoints.go index a2a1e7474a8..eb288cc611c 100644 --- a/service/frauddetector/endpoints.go +++ b/service/frauddetector/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/fsx/api_client.go b/service/fsx/api_client.go index 0d1b1418313..51397217b72 100644 --- a/service/fsx/api_client.go +++ b/service/fsx/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/fsx/endpoints.go b/service/fsx/endpoints.go index 6e7093cec8e..676357894f1 100644 --- a/service/fsx/endpoints.go +++ b/service/fsx/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/gamelift/api_client.go b/service/gamelift/api_client.go index fe7d0516bd3..d17d0244423 100644 --- a/service/gamelift/api_client.go +++ b/service/gamelift/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/gamelift/endpoints.go b/service/gamelift/endpoints.go index 81c458a0f83..1c3e073e37e 100644 --- a/service/gamelift/endpoints.go +++ b/service/gamelift/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/glacier/api_client.go b/service/glacier/api_client.go index 738016586c4..163155c1f26 100644 --- a/service/glacier/api_client.go +++ b/service/glacier/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/glacier/endpoints.go b/service/glacier/endpoints.go index 43697fa9870..a447cae6fff 100644 --- a/service/glacier/endpoints.go +++ b/service/glacier/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/globalaccelerator/api_client.go b/service/globalaccelerator/api_client.go index 7249875090b..d880f99eab9 100644 --- a/service/globalaccelerator/api_client.go +++ b/service/globalaccelerator/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/globalaccelerator/endpoints.go b/service/globalaccelerator/endpoints.go index 3b5e446dc3d..aec4b43b79d 100644 --- a/service/globalaccelerator/endpoints.go +++ b/service/globalaccelerator/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/glue/api_client.go b/service/glue/api_client.go index 0fa7a187a9f..d2be3a211f6 100644 --- a/service/glue/api_client.go +++ b/service/glue/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/glue/endpoints.go b/service/glue/endpoints.go index ecf3df3166b..345a578d2f2 100644 --- a/service/glue/endpoints.go +++ b/service/glue/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/greengrass/api_client.go b/service/greengrass/api_client.go index e707be70511..ca51a192678 100644 --- a/service/greengrass/api_client.go +++ b/service/greengrass/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/greengrass/endpoints.go b/service/greengrass/endpoints.go index dc1a2df8d42..9c1500b5944 100644 --- a/service/greengrass/endpoints.go +++ b/service/greengrass/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/greengrassv2/api_client.go b/service/greengrassv2/api_client.go index b2e04ed8f9d..1383d5c6980 100644 --- a/service/greengrassv2/api_client.go +++ b/service/greengrassv2/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/greengrassv2/endpoints.go b/service/greengrassv2/endpoints.go index 1c2fb9a1188..f323faadb68 100644 --- a/service/greengrassv2/endpoints.go +++ b/service/greengrassv2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/groundstation/api_client.go b/service/groundstation/api_client.go index c74564e2532..d68cdfca81e 100644 --- a/service/groundstation/api_client.go +++ b/service/groundstation/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/groundstation/endpoints.go b/service/groundstation/endpoints.go index cad34b9a127..20cdc8bcddf 100644 --- a/service/groundstation/endpoints.go +++ b/service/groundstation/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/guardduty/api_client.go b/service/guardduty/api_client.go index 9b67b2d77ba..36a1c7bc780 100644 --- a/service/guardduty/api_client.go +++ b/service/guardduty/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/guardduty/endpoints.go b/service/guardduty/endpoints.go index ec51f23d567..3912de5b3ae 100644 --- a/service/guardduty/endpoints.go +++ b/service/guardduty/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/health/api_client.go b/service/health/api_client.go index dadc4f85c33..29c71d97952 100644 --- a/service/health/api_client.go +++ b/service/health/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/health/endpoints.go b/service/health/endpoints.go index aa6b7a5024e..b7fd07b546d 100644 --- a/service/health/endpoints.go +++ b/service/health/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/healthlake/api_client.go b/service/healthlake/api_client.go index 63f0195e871..a573474beac 100644 --- a/service/healthlake/api_client.go +++ b/service/healthlake/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/healthlake/endpoints.go b/service/healthlake/endpoints.go index b4d41a45bca..b662253c2c1 100644 --- a/service/healthlake/endpoints.go +++ b/service/healthlake/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/honeycode/api_client.go b/service/honeycode/api_client.go index 6258892e16f..7338d84c14d 100644 --- a/service/honeycode/api_client.go +++ b/service/honeycode/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/honeycode/endpoints.go b/service/honeycode/endpoints.go index 643d426dc62..6a7ace2dec9 100644 --- a/service/honeycode/endpoints.go +++ b/service/honeycode/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iam/api_client.go b/service/iam/api_client.go index 1f5407003cf..3789070ee89 100644 --- a/service/iam/api_client.go +++ b/service/iam/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iam/endpoints.go b/service/iam/endpoints.go index a50a2de4fe2..5c4798bd014 100644 --- a/service/iam/endpoints.go +++ b/service/iam/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/identitystore/api_client.go b/service/identitystore/api_client.go index ae02b210be1..b7227bf5a15 100644 --- a/service/identitystore/api_client.go +++ b/service/identitystore/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/identitystore/endpoints.go b/service/identitystore/endpoints.go index 50139eb61ef..904d93e455c 100644 --- a/service/identitystore/endpoints.go +++ b/service/identitystore/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/imagebuilder/api_client.go b/service/imagebuilder/api_client.go index 143b697855b..efc275e0134 100644 --- a/service/imagebuilder/api_client.go +++ b/service/imagebuilder/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/imagebuilder/endpoints.go b/service/imagebuilder/endpoints.go index 5e5284a32be..2e9132f3ee1 100644 --- a/service/imagebuilder/endpoints.go +++ b/service/imagebuilder/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/inspector/api_client.go b/service/inspector/api_client.go index 5ad08eb2efa..09e15443264 100644 --- a/service/inspector/api_client.go +++ b/service/inspector/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/inspector/endpoints.go b/service/inspector/endpoints.go index 093381cdbf2..0faf0d6b91b 100644 --- a/service/inspector/endpoints.go +++ b/service/inspector/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/internal/accept-encoding/go.sum b/service/internal/accept-encoding/go.sum index daae852e5a0..95a5585587e 100644 --- a/service/internal/accept-encoding/go.sum +++ b/service/internal/accept-encoding/go.sum @@ -1,5 +1,3 @@ -github.com/aws/smithy-go v0.5.1-0.20210115041537-09631dea532e h1:CBuNt8z4Dh3Vf1q5BgoJgAidIDS585A/f/gpaGO45yk= -github.com/aws/smithy-go v0.5.1-0.20210115041537-09631dea532e/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.0.0 h1:hkhcRKG9rJ4Fn+RbfXY7Tz7b3ITLDyolBnLLBhwbg/c= github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= diff --git a/service/internal/benchmark/go.mod b/service/internal/benchmark/go.mod index 07492a9a912..edf3ed21263 100644 --- a/service/internal/benchmark/go.mod +++ b/service/internal/benchmark/go.mod @@ -8,7 +8,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/dynamodb v1.0.0 github.com/aws/aws-sdk-go-v2/service/lexruntimeservice v1.0.0 github.com/aws/smithy-go v1.0.0 - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0 ) replace github.com/aws/aws-sdk-go-v2 => ../../../ diff --git a/service/internal/benchmark/go.sum b/service/internal/benchmark/go.sum index 7c0432f4377..df02aef89bd 100644 --- a/service/internal/benchmark/go.sum +++ b/service/internal/benchmark/go.sum @@ -1,7 +1,5 @@ github.com/aws/aws-sdk-go v1.34.33 h1:ymkFm0rNPEOlgjyX3ojEd4zqzW6kGICBkqWs7LqgHtU= github.com/aws/aws-sdk-go v1.34.33/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= -github.com/aws/smithy-go v0.5.1-0.20210115041537-09631dea532e h1:CBuNt8z4Dh3Vf1q5BgoJgAidIDS585A/f/gpaGO45yk= -github.com/aws/smithy-go v0.5.1-0.20210115041537-09631dea532e/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.0.0 h1:hkhcRKG9rJ4Fn+RbfXY7Tz7b3ITLDyolBnLLBhwbg/c= github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= diff --git a/service/internal/integrationtest/go.mod b/service/internal/integrationtest/go.mod index 2fdd6fc42d2..1740ecfb9ca 100644 --- a/service/internal/integrationtest/go.mod +++ b/service/internal/integrationtest/go.mod @@ -86,11 +86,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/workspaces v1.0.0 github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 - github.com/aws/aws-sdk-go-v2/credentials v1.0.0 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.0 - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0 - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0 - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.0 ) go 1.15 diff --git a/service/internal/integrationtest/go.sum b/service/internal/integrationtest/go.sum index 720b68089bf..9b99314a45e 100644 --- a/service/internal/integrationtest/go.sum +++ b/service/internal/integrationtest/go.sum @@ -1,5 +1,3 @@ -github.com/aws/smithy-go v0.5.1-0.20210115041537-09631dea532e h1:CBuNt8z4Dh3Vf1q5BgoJgAidIDS585A/f/gpaGO45yk= -github.com/aws/smithy-go v0.5.1-0.20210115041537-09631dea532e/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.0.0 h1:hkhcRKG9rJ4Fn+RbfXY7Tz7b3ITLDyolBnLLBhwbg/c= github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= diff --git a/service/iot/api_client.go b/service/iot/api_client.go index 63400a03731..db7bf5ef1c5 100644 --- a/service/iot/api_client.go +++ b/service/iot/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iot/endpoints.go b/service/iot/endpoints.go index 84004bd45c5..4eabfd14ca7 100644 --- a/service/iot/endpoints.go +++ b/service/iot/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iot1clickdevicesservice/api_client.go b/service/iot1clickdevicesservice/api_client.go index ba9166f1f78..cb5c77b48ae 100644 --- a/service/iot1clickdevicesservice/api_client.go +++ b/service/iot1clickdevicesservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iot1clickdevicesservice/endpoints.go b/service/iot1clickdevicesservice/endpoints.go index 51f02e8c17e..61b2790d123 100644 --- a/service/iot1clickdevicesservice/endpoints.go +++ b/service/iot1clickdevicesservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iot1clickprojects/api_client.go b/service/iot1clickprojects/api_client.go index bbda6708ec5..a281a9f7edb 100644 --- a/service/iot1clickprojects/api_client.go +++ b/service/iot1clickprojects/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iot1clickprojects/endpoints.go b/service/iot1clickprojects/endpoints.go index 3f7023bfb61..68cf43f27f4 100644 --- a/service/iot1clickprojects/endpoints.go +++ b/service/iot1clickprojects/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotanalytics/api_client.go b/service/iotanalytics/api_client.go index 5fe35935ff3..728e32f2d7f 100644 --- a/service/iotanalytics/api_client.go +++ b/service/iotanalytics/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotanalytics/endpoints.go b/service/iotanalytics/endpoints.go index 7559e7100fc..ec2071e6156 100644 --- a/service/iotanalytics/endpoints.go +++ b/service/iotanalytics/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotdataplane/api_client.go b/service/iotdataplane/api_client.go index c005d67597e..ba0d8773f7a 100644 --- a/service/iotdataplane/api_client.go +++ b/service/iotdataplane/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotdataplane/endpoints.go b/service/iotdataplane/endpoints.go index 24c628afb9d..a487dbd309d 100644 --- a/service/iotdataplane/endpoints.go +++ b/service/iotdataplane/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotdeviceadvisor/api_client.go b/service/iotdeviceadvisor/api_client.go index 386341325bf..3725c10be4b 100644 --- a/service/iotdeviceadvisor/api_client.go +++ b/service/iotdeviceadvisor/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotdeviceadvisor/endpoints.go b/service/iotdeviceadvisor/endpoints.go index 31f63a1c071..7b05be15868 100644 --- a/service/iotdeviceadvisor/endpoints.go +++ b/service/iotdeviceadvisor/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotevents/api_client.go b/service/iotevents/api_client.go index d1ba54bc819..ee75cd0409c 100644 --- a/service/iotevents/api_client.go +++ b/service/iotevents/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotevents/endpoints.go b/service/iotevents/endpoints.go index 9590eaf8139..4c498de8028 100644 --- a/service/iotevents/endpoints.go +++ b/service/iotevents/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ioteventsdata/api_client.go b/service/ioteventsdata/api_client.go index 1c0d92cf8d6..a26b9e3992c 100644 --- a/service/ioteventsdata/api_client.go +++ b/service/ioteventsdata/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ioteventsdata/endpoints.go b/service/ioteventsdata/endpoints.go index 30682dfcde5..aa407254f11 100644 --- a/service/ioteventsdata/endpoints.go +++ b/service/ioteventsdata/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotfleethub/api_client.go b/service/iotfleethub/api_client.go index 2f346e8106d..ac73df7c324 100644 --- a/service/iotfleethub/api_client.go +++ b/service/iotfleethub/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotfleethub/endpoints.go b/service/iotfleethub/endpoints.go index 953eb6bfc30..dc8a0b700cb 100644 --- a/service/iotfleethub/endpoints.go +++ b/service/iotfleethub/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotjobsdataplane/api_client.go b/service/iotjobsdataplane/api_client.go index a427a013d27..05bcd5447fc 100644 --- a/service/iotjobsdataplane/api_client.go +++ b/service/iotjobsdataplane/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotjobsdataplane/endpoints.go b/service/iotjobsdataplane/endpoints.go index ba47efe4e62..50157e04679 100644 --- a/service/iotjobsdataplane/endpoints.go +++ b/service/iotjobsdataplane/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotsecuretunneling/api_client.go b/service/iotsecuretunneling/api_client.go index 07f6c94aa27..e53caad6fd1 100644 --- a/service/iotsecuretunneling/api_client.go +++ b/service/iotsecuretunneling/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotsecuretunneling/endpoints.go b/service/iotsecuretunneling/endpoints.go index 3bfe311e146..45611259133 100644 --- a/service/iotsecuretunneling/endpoints.go +++ b/service/iotsecuretunneling/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotsitewise/api_client.go b/service/iotsitewise/api_client.go index c604e6b9da5..6e2c8650062 100644 --- a/service/iotsitewise/api_client.go +++ b/service/iotsitewise/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotsitewise/endpoints.go b/service/iotsitewise/endpoints.go index 269b5298d50..d12abd08636 100644 --- a/service/iotsitewise/endpoints.go +++ b/service/iotsitewise/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotthingsgraph/api_client.go b/service/iotthingsgraph/api_client.go index 89ba158b9de..b67f90bc0d4 100644 --- a/service/iotthingsgraph/api_client.go +++ b/service/iotthingsgraph/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotthingsgraph/endpoints.go b/service/iotthingsgraph/endpoints.go index f0f3bfecaa9..971af671be8 100644 --- a/service/iotthingsgraph/endpoints.go +++ b/service/iotthingsgraph/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotwireless/api_client.go b/service/iotwireless/api_client.go index f60fd055733..5049be32796 100644 --- a/service/iotwireless/api_client.go +++ b/service/iotwireless/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/iotwireless/endpoints.go b/service/iotwireless/endpoints.go index 300d585d4e8..392f9866642 100644 --- a/service/iotwireless/endpoints.go +++ b/service/iotwireless/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ivs/api_client.go b/service/ivs/api_client.go index d27d3b1b74b..c0e749abaf3 100644 --- a/service/ivs/api_client.go +++ b/service/ivs/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ivs/endpoints.go b/service/ivs/endpoints.go index f890590c55c..0d42ae77dc4 100644 --- a/service/ivs/endpoints.go +++ b/service/ivs/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kafka/api_client.go b/service/kafka/api_client.go index 1561ecb99e3..f403fbbfea4 100644 --- a/service/kafka/api_client.go +++ b/service/kafka/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kafka/endpoints.go b/service/kafka/endpoints.go index c6e264f49c8..b8ed4dffa41 100644 --- a/service/kafka/endpoints.go +++ b/service/kafka/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kendra/api_client.go b/service/kendra/api_client.go index 96d20c8de9e..6f36617f734 100644 --- a/service/kendra/api_client.go +++ b/service/kendra/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kendra/endpoints.go b/service/kendra/endpoints.go index 33d810eae29..9c2ad9ec43f 100644 --- a/service/kendra/endpoints.go +++ b/service/kendra/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesis/api_client.go b/service/kinesis/api_client.go index 56946d0d575..0f7afa6b8dc 100644 --- a/service/kinesis/api_client.go +++ b/service/kinesis/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kinesis/endpoints.go b/service/kinesis/endpoints.go index 7d6d60b8e89..057ab2509dd 100644 --- a/service/kinesis/endpoints.go +++ b/service/kinesis/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisanalytics/api_client.go b/service/kinesisanalytics/api_client.go index 6663ccbc122..e5721101c0f 100644 --- a/service/kinesisanalytics/api_client.go +++ b/service/kinesisanalytics/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kinesisanalytics/endpoints.go b/service/kinesisanalytics/endpoints.go index fcee3f779f5..475538a450c 100644 --- a/service/kinesisanalytics/endpoints.go +++ b/service/kinesisanalytics/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisanalyticsv2/api_client.go b/service/kinesisanalyticsv2/api_client.go index a28be3731ac..79a12b4aa0b 100644 --- a/service/kinesisanalyticsv2/api_client.go +++ b/service/kinesisanalyticsv2/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kinesisanalyticsv2/endpoints.go b/service/kinesisanalyticsv2/endpoints.go index 0a9fe81e6f8..90adca6c81a 100644 --- a/service/kinesisanalyticsv2/endpoints.go +++ b/service/kinesisanalyticsv2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideo/api_client.go b/service/kinesisvideo/api_client.go index 0ebb6149d94..f7394873eb9 100644 --- a/service/kinesisvideo/api_client.go +++ b/service/kinesisvideo/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kinesisvideo/endpoints.go b/service/kinesisvideo/endpoints.go index 89fdc332317..4e6b6e369bb 100644 --- a/service/kinesisvideo/endpoints.go +++ b/service/kinesisvideo/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideoarchivedmedia/api_client.go b/service/kinesisvideoarchivedmedia/api_client.go index fe16ddc92af..ca10c26e3eb 100644 --- a/service/kinesisvideoarchivedmedia/api_client.go +++ b/service/kinesisvideoarchivedmedia/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kinesisvideoarchivedmedia/endpoints.go b/service/kinesisvideoarchivedmedia/endpoints.go index e711e65d248..084e70ffda9 100644 --- a/service/kinesisvideoarchivedmedia/endpoints.go +++ b/service/kinesisvideoarchivedmedia/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideomedia/api_client.go b/service/kinesisvideomedia/api_client.go index 642d490d9dd..b49dda06bb6 100644 --- a/service/kinesisvideomedia/api_client.go +++ b/service/kinesisvideomedia/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kinesisvideomedia/endpoints.go b/service/kinesisvideomedia/endpoints.go index d450c1f47ec..d7234885df6 100644 --- a/service/kinesisvideomedia/endpoints.go +++ b/service/kinesisvideomedia/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideosignaling/api_client.go b/service/kinesisvideosignaling/api_client.go index 34a369a9040..f88f7ce0917 100644 --- a/service/kinesisvideosignaling/api_client.go +++ b/service/kinesisvideosignaling/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kinesisvideosignaling/endpoints.go b/service/kinesisvideosignaling/endpoints.go index c29569cbc63..a8b1acf639e 100644 --- a/service/kinesisvideosignaling/endpoints.go +++ b/service/kinesisvideosignaling/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kms/api_client.go b/service/kms/api_client.go index dc7acb352b9..054a780ef18 100644 --- a/service/kms/api_client.go +++ b/service/kms/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/kms/endpoints.go b/service/kms/endpoints.go index 6b1cc156061..786c078155e 100644 --- a/service/kms/endpoints.go +++ b/service/kms/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lakeformation/api_client.go b/service/lakeformation/api_client.go index 43df2ffbe33..ededcf06703 100644 --- a/service/lakeformation/api_client.go +++ b/service/lakeformation/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/lakeformation/endpoints.go b/service/lakeformation/endpoints.go index b8ade67bfd6..5a36af1f210 100644 --- a/service/lakeformation/endpoints.go +++ b/service/lakeformation/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lambda/api_client.go b/service/lambda/api_client.go index 57e5d7650ab..308eb448cd9 100644 --- a/service/lambda/api_client.go +++ b/service/lambda/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/lambda/endpoints.go b/service/lambda/endpoints.go index d84b120626a..28d783f0415 100644 --- a/service/lambda/endpoints.go +++ b/service/lambda/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lexmodelbuildingservice/api_client.go b/service/lexmodelbuildingservice/api_client.go index f3f729f3507..93b919ce3b7 100644 --- a/service/lexmodelbuildingservice/api_client.go +++ b/service/lexmodelbuildingservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/lexmodelbuildingservice/endpoints.go b/service/lexmodelbuildingservice/endpoints.go index ec0755359bb..26f90aef9f1 100644 --- a/service/lexmodelbuildingservice/endpoints.go +++ b/service/lexmodelbuildingservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lexruntimeservice/api_client.go b/service/lexruntimeservice/api_client.go index 6f5569c6cc5..10261e4d9be 100644 --- a/service/lexruntimeservice/api_client.go +++ b/service/lexruntimeservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/lexruntimeservice/endpoints.go b/service/lexruntimeservice/endpoints.go index bf3046b811d..5798f9f29bf 100644 --- a/service/lexruntimeservice/endpoints.go +++ b/service/lexruntimeservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/licensemanager/api_client.go b/service/licensemanager/api_client.go index bd4af2478df..73368e089fd 100644 --- a/service/licensemanager/api_client.go +++ b/service/licensemanager/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/licensemanager/endpoints.go b/service/licensemanager/endpoints.go index 33081a7ae40..2270de33cd4 100644 --- a/service/licensemanager/endpoints.go +++ b/service/licensemanager/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lightsail/api_client.go b/service/lightsail/api_client.go index 7c849b2e0b6..d485e972f6e 100644 --- a/service/lightsail/api_client.go +++ b/service/lightsail/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/lightsail/endpoints.go b/service/lightsail/endpoints.go index dfa63152edd..c784564a099 100644 --- a/service/lightsail/endpoints.go +++ b/service/lightsail/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lookoutvision/api_client.go b/service/lookoutvision/api_client.go index eb87d916dd8..922a5bde8f1 100644 --- a/service/lookoutvision/api_client.go +++ b/service/lookoutvision/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/lookoutvision/endpoints.go b/service/lookoutvision/endpoints.go index d2fd7ab5e35..361ec796dfb 100644 --- a/service/lookoutvision/endpoints.go +++ b/service/lookoutvision/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/machinelearning/api_client.go b/service/machinelearning/api_client.go index f78c4217f47..4124c72d43f 100644 --- a/service/machinelearning/api_client.go +++ b/service/machinelearning/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/machinelearning/endpoints.go b/service/machinelearning/endpoints.go index db0554da0dc..f61f92ea94c 100644 --- a/service/machinelearning/endpoints.go +++ b/service/machinelearning/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/macie/api_client.go b/service/macie/api_client.go index edfd28e7b30..df9fee43d9e 100644 --- a/service/macie/api_client.go +++ b/service/macie/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/macie/endpoints.go b/service/macie/endpoints.go index 68ceb0dcb05..901adfcae2d 100644 --- a/service/macie/endpoints.go +++ b/service/macie/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/macie2/api_client.go b/service/macie2/api_client.go index 5d1026aaffb..c512cd25021 100644 --- a/service/macie2/api_client.go +++ b/service/macie2/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/macie2/endpoints.go b/service/macie2/endpoints.go index cfe2b5dc7d4..711a88e5afe 100644 --- a/service/macie2/endpoints.go +++ b/service/macie2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/managedblockchain/api_client.go b/service/managedblockchain/api_client.go index 3111dcad021..bfbe2cd9faf 100644 --- a/service/managedblockchain/api_client.go +++ b/service/managedblockchain/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/managedblockchain/endpoints.go b/service/managedblockchain/endpoints.go index 22569f7ebd8..5b3bca24ace 100644 --- a/service/managedblockchain/endpoints.go +++ b/service/managedblockchain/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplacecatalog/api_client.go b/service/marketplacecatalog/api_client.go index 1c21502a3ba..fde973598dc 100644 --- a/service/marketplacecatalog/api_client.go +++ b/service/marketplacecatalog/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/marketplacecatalog/endpoints.go b/service/marketplacecatalog/endpoints.go index 63457e0d553..684eb467c88 100644 --- a/service/marketplacecatalog/endpoints.go +++ b/service/marketplacecatalog/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplacecommerceanalytics/api_client.go b/service/marketplacecommerceanalytics/api_client.go index 8bbfe4722dd..86c20cede07 100644 --- a/service/marketplacecommerceanalytics/api_client.go +++ b/service/marketplacecommerceanalytics/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/marketplacecommerceanalytics/endpoints.go b/service/marketplacecommerceanalytics/endpoints.go index 8c599f2dfdf..b768b93ee35 100644 --- a/service/marketplacecommerceanalytics/endpoints.go +++ b/service/marketplacecommerceanalytics/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplaceentitlementservice/api_client.go b/service/marketplaceentitlementservice/api_client.go index 90ffed2a45b..e0dd060a353 100644 --- a/service/marketplaceentitlementservice/api_client.go +++ b/service/marketplaceentitlementservice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/marketplaceentitlementservice/endpoints.go b/service/marketplaceentitlementservice/endpoints.go index 4053f1fba86..8eb6300be67 100644 --- a/service/marketplaceentitlementservice/endpoints.go +++ b/service/marketplaceentitlementservice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplacemetering/api_client.go b/service/marketplacemetering/api_client.go index ec678e9248d..baf267b8181 100644 --- a/service/marketplacemetering/api_client.go +++ b/service/marketplacemetering/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/marketplacemetering/endpoints.go b/service/marketplacemetering/endpoints.go index f9f95ea34d4..c170b011bb1 100644 --- a/service/marketplacemetering/endpoints.go +++ b/service/marketplacemetering/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediaconnect/api_client.go b/service/mediaconnect/api_client.go index f72a0fe5af3..f4fb19a6f08 100644 --- a/service/mediaconnect/api_client.go +++ b/service/mediaconnect/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mediaconnect/endpoints.go b/service/mediaconnect/endpoints.go index 8806c8dc1ba..64d7f03a084 100644 --- a/service/mediaconnect/endpoints.go +++ b/service/mediaconnect/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediaconvert/api_client.go b/service/mediaconvert/api_client.go index e0f0bbe1e06..e92a4c04089 100644 --- a/service/mediaconvert/api_client.go +++ b/service/mediaconvert/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mediaconvert/endpoints.go b/service/mediaconvert/endpoints.go index db60e5b3063..c2ddf1eb662 100644 --- a/service/mediaconvert/endpoints.go +++ b/service/mediaconvert/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/medialive/api_client.go b/service/medialive/api_client.go index 7eb71dc7c34..1fd474092de 100644 --- a/service/medialive/api_client.go +++ b/service/medialive/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/medialive/endpoints.go b/service/medialive/endpoints.go index e2d38dbde5a..3c195b11a2d 100644 --- a/service/medialive/endpoints.go +++ b/service/medialive/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediapackage/api_client.go b/service/mediapackage/api_client.go index d521e6291da..fee981300e6 100644 --- a/service/mediapackage/api_client.go +++ b/service/mediapackage/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mediapackage/endpoints.go b/service/mediapackage/endpoints.go index c914271233d..5d0db09fad6 100644 --- a/service/mediapackage/endpoints.go +++ b/service/mediapackage/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediapackagevod/api_client.go b/service/mediapackagevod/api_client.go index 900d2080365..b27504fc6ad 100644 --- a/service/mediapackagevod/api_client.go +++ b/service/mediapackagevod/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mediapackagevod/endpoints.go b/service/mediapackagevod/endpoints.go index 5cca0fbb802..3b9b508d99e 100644 --- a/service/mediapackagevod/endpoints.go +++ b/service/mediapackagevod/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediastore/api_client.go b/service/mediastore/api_client.go index d709a98fb2c..2d9f82fa619 100644 --- a/service/mediastore/api_client.go +++ b/service/mediastore/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mediastore/endpoints.go b/service/mediastore/endpoints.go index f38738dcebd..991bbc6b387 100644 --- a/service/mediastore/endpoints.go +++ b/service/mediastore/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediastoredata/api_client.go b/service/mediastoredata/api_client.go index f70b4a521b0..a83d9fba7c3 100644 --- a/service/mediastoredata/api_client.go +++ b/service/mediastoredata/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mediastoredata/endpoints.go b/service/mediastoredata/endpoints.go index 9ec002e8b4d..3f6bda16fe9 100644 --- a/service/mediastoredata/endpoints.go +++ b/service/mediastoredata/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediatailor/api_client.go b/service/mediatailor/api_client.go index df40bb54d62..4a2dba8f292 100644 --- a/service/mediatailor/api_client.go +++ b/service/mediatailor/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mediatailor/endpoints.go b/service/mediatailor/endpoints.go index 6d29bc2749f..cd1b7f772af 100644 --- a/service/mediatailor/endpoints.go +++ b/service/mediatailor/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/migrationhub/api_client.go b/service/migrationhub/api_client.go index f1e387b1b5d..0878dbc4791 100644 --- a/service/migrationhub/api_client.go +++ b/service/migrationhub/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/migrationhub/endpoints.go b/service/migrationhub/endpoints.go index 642e9ca8beb..922f06e2954 100644 --- a/service/migrationhub/endpoints.go +++ b/service/migrationhub/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/migrationhubconfig/api_client.go b/service/migrationhubconfig/api_client.go index 12e6d52c17b..9d69f5643cd 100644 --- a/service/migrationhubconfig/api_client.go +++ b/service/migrationhubconfig/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/migrationhubconfig/endpoints.go b/service/migrationhubconfig/endpoints.go index a0967466e57..aa42dd8f15b 100644 --- a/service/migrationhubconfig/endpoints.go +++ b/service/migrationhubconfig/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mobile/api_client.go b/service/mobile/api_client.go index 87e5cc045b7..7c5028a83c8 100644 --- a/service/mobile/api_client.go +++ b/service/mobile/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mobile/endpoints.go b/service/mobile/endpoints.go index 5986bb29762..b50a255dc47 100644 --- a/service/mobile/endpoints.go +++ b/service/mobile/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mq/api_client.go b/service/mq/api_client.go index 73f416e8ccb..8210434afc4 100644 --- a/service/mq/api_client.go +++ b/service/mq/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mq/endpoints.go b/service/mq/endpoints.go index b6a69500500..717c31ef73a 100644 --- a/service/mq/endpoints.go +++ b/service/mq/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mturk/api_client.go b/service/mturk/api_client.go index 186c435ae8a..34860b5b09a 100644 --- a/service/mturk/api_client.go +++ b/service/mturk/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/mturk/endpoints.go b/service/mturk/endpoints.go index 608dd960efc..5d8a82133dd 100644 --- a/service/mturk/endpoints.go +++ b/service/mturk/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/neptune/api_client.go b/service/neptune/api_client.go index eb36fc4e31e..44f2d8f9c69 100644 --- a/service/neptune/api_client.go +++ b/service/neptune/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/neptune/endpoints.go b/service/neptune/endpoints.go index ced601f60fe..774bae5035c 100644 --- a/service/neptune/endpoints.go +++ b/service/neptune/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/networkfirewall/api_client.go b/service/networkfirewall/api_client.go index 85851229eb5..e952f41e2d2 100644 --- a/service/networkfirewall/api_client.go +++ b/service/networkfirewall/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/networkfirewall/endpoints.go b/service/networkfirewall/endpoints.go index 12534b8d40b..c12bcb7992e 100644 --- a/service/networkfirewall/endpoints.go +++ b/service/networkfirewall/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/networkmanager/api_client.go b/service/networkmanager/api_client.go index 3b406955e02..87f1a6d92ef 100644 --- a/service/networkmanager/api_client.go +++ b/service/networkmanager/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/networkmanager/endpoints.go b/service/networkmanager/endpoints.go index cc3d0adcd30..b05c5e2fee3 100644 --- a/service/networkmanager/endpoints.go +++ b/service/networkmanager/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/opsworks/api_client.go b/service/opsworks/api_client.go index 725bade473b..83513bd6965 100644 --- a/service/opsworks/api_client.go +++ b/service/opsworks/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/opsworks/endpoints.go b/service/opsworks/endpoints.go index 366732ca4e2..a3b55109e50 100644 --- a/service/opsworks/endpoints.go +++ b/service/opsworks/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/opsworkscm/api_client.go b/service/opsworkscm/api_client.go index debab567a37..e821b0cd71d 100644 --- a/service/opsworkscm/api_client.go +++ b/service/opsworkscm/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/opsworkscm/endpoints.go b/service/opsworkscm/endpoints.go index e3e576ff541..a199af36010 100644 --- a/service/opsworkscm/endpoints.go +++ b/service/opsworkscm/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/organizations/api_client.go b/service/organizations/api_client.go index 07a40eed9c8..a691b786fdd 100644 --- a/service/organizations/api_client.go +++ b/service/organizations/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/organizations/endpoints.go b/service/organizations/endpoints.go index 88e04b11f5f..3e9ed752ab9 100644 --- a/service/organizations/endpoints.go +++ b/service/organizations/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/outposts/api_client.go b/service/outposts/api_client.go index 9ffba41aea6..f9d232a2479 100644 --- a/service/outposts/api_client.go +++ b/service/outposts/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/outposts/endpoints.go b/service/outposts/endpoints.go index 3547de0f134..c795c7f5777 100644 --- a/service/outposts/endpoints.go +++ b/service/outposts/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/personalize/api_client.go b/service/personalize/api_client.go index adfa4709bc2..3b9c776a284 100644 --- a/service/personalize/api_client.go +++ b/service/personalize/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/personalize/endpoints.go b/service/personalize/endpoints.go index c33fae8ccf4..9792619679d 100644 --- a/service/personalize/endpoints.go +++ b/service/personalize/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/personalizeevents/api_client.go b/service/personalizeevents/api_client.go index 3100c944009..d91d9a046f0 100644 --- a/service/personalizeevents/api_client.go +++ b/service/personalizeevents/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/personalizeevents/endpoints.go b/service/personalizeevents/endpoints.go index c0da78a69ae..025e1028a23 100644 --- a/service/personalizeevents/endpoints.go +++ b/service/personalizeevents/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/personalizeruntime/api_client.go b/service/personalizeruntime/api_client.go index 9684a39e76d..28697994cdd 100644 --- a/service/personalizeruntime/api_client.go +++ b/service/personalizeruntime/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/personalizeruntime/endpoints.go b/service/personalizeruntime/endpoints.go index 478865092cc..5f56b8408ad 100644 --- a/service/personalizeruntime/endpoints.go +++ b/service/personalizeruntime/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pi/api_client.go b/service/pi/api_client.go index 51606bbbcb0..204dacf18d5 100644 --- a/service/pi/api_client.go +++ b/service/pi/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/pi/endpoints.go b/service/pi/endpoints.go index 62ff6ef04f7..e470f9fee1f 100644 --- a/service/pi/endpoints.go +++ b/service/pi/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pinpoint/api_client.go b/service/pinpoint/api_client.go index 2e4c7ff80a1..ef7eb69bda4 100644 --- a/service/pinpoint/api_client.go +++ b/service/pinpoint/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/pinpoint/endpoints.go b/service/pinpoint/endpoints.go index 3ab651a0707..ca3e5211519 100644 --- a/service/pinpoint/endpoints.go +++ b/service/pinpoint/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pinpointemail/api_client.go b/service/pinpointemail/api_client.go index fa0bb45328d..82013687acf 100644 --- a/service/pinpointemail/api_client.go +++ b/service/pinpointemail/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/pinpointemail/endpoints.go b/service/pinpointemail/endpoints.go index 791669e9883..dfe9f8ce974 100644 --- a/service/pinpointemail/endpoints.go +++ b/service/pinpointemail/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pinpointsmsvoice/api_client.go b/service/pinpointsmsvoice/api_client.go index 9d529374600..61342eb2adf 100644 --- a/service/pinpointsmsvoice/api_client.go +++ b/service/pinpointsmsvoice/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/pinpointsmsvoice/endpoints.go b/service/pinpointsmsvoice/endpoints.go index 3bdf93a8b8e..7c80ec9c67d 100644 --- a/service/pinpointsmsvoice/endpoints.go +++ b/service/pinpointsmsvoice/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/polly/api_client.go b/service/polly/api_client.go index f22e9afa6a7..c3a943db07b 100644 --- a/service/polly/api_client.go +++ b/service/polly/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/polly/endpoints.go b/service/polly/endpoints.go index 6f24c9b56e7..519dd304c5c 100644 --- a/service/polly/endpoints.go +++ b/service/polly/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pricing/api_client.go b/service/pricing/api_client.go index 851472c8c91..f9f4bae224e 100644 --- a/service/pricing/api_client.go +++ b/service/pricing/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/pricing/endpoints.go b/service/pricing/endpoints.go index 75aabbc18b0..b7829f2ee05 100644 --- a/service/pricing/endpoints.go +++ b/service/pricing/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/qldb/api_client.go b/service/qldb/api_client.go index 49c51bd9678..4d74fc0b44c 100644 --- a/service/qldb/api_client.go +++ b/service/qldb/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/qldb/endpoints.go b/service/qldb/endpoints.go index e69ec616609..fda0128d013 100644 --- a/service/qldb/endpoints.go +++ b/service/qldb/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/qldbsession/api_client.go b/service/qldbsession/api_client.go index 1c75713a417..0d3a4bd339d 100644 --- a/service/qldbsession/api_client.go +++ b/service/qldbsession/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/qldbsession/endpoints.go b/service/qldbsession/endpoints.go index a5c38c722d6..940e8ff1762 100644 --- a/service/qldbsession/endpoints.go +++ b/service/qldbsession/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/quicksight/api_client.go b/service/quicksight/api_client.go index e74549ecb29..bee93d044da 100644 --- a/service/quicksight/api_client.go +++ b/service/quicksight/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/quicksight/endpoints.go b/service/quicksight/endpoints.go index 30a06d3312a..bcd37c7f49d 100644 --- a/service/quicksight/endpoints.go +++ b/service/quicksight/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ram/api_client.go b/service/ram/api_client.go index 37e3f2261d0..0a8f821c217 100644 --- a/service/ram/api_client.go +++ b/service/ram/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ram/endpoints.go b/service/ram/endpoints.go index 98c809aba22..29c7c876edf 100644 --- a/service/ram/endpoints.go +++ b/service/ram/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/rds/api_client.go b/service/rds/api_client.go index 8aeb353c0c5..230eb960450 100644 --- a/service/rds/api_client.go +++ b/service/rds/api_client.go @@ -99,6 +99,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/rds/endpoints.go b/service/rds/endpoints.go index bddd68f0393..bc97d0cb03d 100644 --- a/service/rds/endpoints.go +++ b/service/rds/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/rdsdata/api_client.go b/service/rdsdata/api_client.go index fdab854f533..0a0a1023052 100644 --- a/service/rdsdata/api_client.go +++ b/service/rdsdata/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/rdsdata/endpoints.go b/service/rdsdata/endpoints.go index 02b4d4c73ab..fcfe02a0dc9 100644 --- a/service/rdsdata/endpoints.go +++ b/service/rdsdata/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/redshift/api_client.go b/service/redshift/api_client.go index c6d2f0f8629..59483ff02e5 100644 --- a/service/redshift/api_client.go +++ b/service/redshift/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/redshift/endpoints.go b/service/redshift/endpoints.go index d44d71e668a..4fe2400c466 100644 --- a/service/redshift/endpoints.go +++ b/service/redshift/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/redshiftdata/api_client.go b/service/redshiftdata/api_client.go index 7556c2f5a2b..3d578caca77 100644 --- a/service/redshiftdata/api_client.go +++ b/service/redshiftdata/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/redshiftdata/endpoints.go b/service/redshiftdata/endpoints.go index 93cff17be61..b9d456fa3e2 100644 --- a/service/redshiftdata/endpoints.go +++ b/service/redshiftdata/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/rekognition/api_client.go b/service/rekognition/api_client.go index 8594bf9f9ed..2b265ae88ca 100644 --- a/service/rekognition/api_client.go +++ b/service/rekognition/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/rekognition/endpoints.go b/service/rekognition/endpoints.go index 1251262bec8..8ceba6b0943 100644 --- a/service/rekognition/endpoints.go +++ b/service/rekognition/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/resourcegroups/api_client.go b/service/resourcegroups/api_client.go index 956777fe170..a4b2d671cf9 100644 --- a/service/resourcegroups/api_client.go +++ b/service/resourcegroups/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/resourcegroups/endpoints.go b/service/resourcegroups/endpoints.go index a5d147431be..79424c9975c 100644 --- a/service/resourcegroups/endpoints.go +++ b/service/resourcegroups/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/resourcegroupstaggingapi/api_client.go b/service/resourcegroupstaggingapi/api_client.go index cdd773ac2bf..28073220a3a 100644 --- a/service/resourcegroupstaggingapi/api_client.go +++ b/service/resourcegroupstaggingapi/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/resourcegroupstaggingapi/endpoints.go b/service/resourcegroupstaggingapi/endpoints.go index 181bb2ad135..1b8f87df849 100644 --- a/service/resourcegroupstaggingapi/endpoints.go +++ b/service/resourcegroupstaggingapi/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/robomaker/api_client.go b/service/robomaker/api_client.go index 76254bb2167..cbd23fffe53 100644 --- a/service/robomaker/api_client.go +++ b/service/robomaker/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/robomaker/endpoints.go b/service/robomaker/endpoints.go index 39b55fa58ca..4c8e07eb771 100644 --- a/service/robomaker/endpoints.go +++ b/service/robomaker/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/route53/api_client.go b/service/route53/api_client.go index dde8deb7890..4c8651312b8 100644 --- a/service/route53/api_client.go +++ b/service/route53/api_client.go @@ -98,6 +98,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/route53/endpoints.go b/service/route53/endpoints.go index c07aed6f037..8cae4163148 100644 --- a/service/route53/endpoints.go +++ b/service/route53/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/route53domains/api_client.go b/service/route53domains/api_client.go index e056599facb..151970909b4 100644 --- a/service/route53domains/api_client.go +++ b/service/route53domains/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/route53domains/endpoints.go b/service/route53domains/endpoints.go index 452a463c376..77ea347a4aa 100644 --- a/service/route53domains/endpoints.go +++ b/service/route53domains/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/route53resolver/api_client.go b/service/route53resolver/api_client.go index aba54f62817..4aad872fedd 100644 --- a/service/route53resolver/api_client.go +++ b/service/route53resolver/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/route53resolver/endpoints.go b/service/route53resolver/endpoints.go index 417cf7ab134..e62e90afaa1 100644 --- a/service/route53resolver/endpoints.go +++ b/service/route53resolver/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/s3/api_client.go b/service/s3/api_client.go index 9bab861bedc..3fad5be9d48 100644 --- a/service/s3/api_client.go +++ b/service/s3/api_client.go @@ -122,6 +122,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/s3/endpoints.go b/service/s3/endpoints.go index d3925dc4068..b1a4948f2d6 100644 --- a/service/s3/endpoints.go +++ b/service/s3/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/s3/internal/configtesting/go.mod b/service/s3/internal/configtesting/go.mod index ce9761afc5c..2e40f6960a5 100644 --- a/service/s3/internal/configtesting/go.mod +++ b/service/s3/internal/configtesting/go.mod @@ -5,11 +5,6 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2/config v1.0.0 github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.0 - github.com/aws/aws-sdk-go-v2 v1.0.0 - github.com/aws/aws-sdk-go-v2/credentials v1.0.0 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.0 - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0 - github.com/aws/aws-sdk-go-v2/service/sts v1.0.0 ) replace ( diff --git a/service/s3control/api_client.go b/service/s3control/api_client.go index 71cdc251a01..3ab98af644f 100644 --- a/service/s3control/api_client.go +++ b/service/s3control/api_client.go @@ -112,6 +112,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/s3control/endpoints.go b/service/s3control/endpoints.go index 48151e42ce7..4e1b72a5329 100644 --- a/service/s3control/endpoints.go +++ b/service/s3control/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/s3outposts/api_client.go b/service/s3outposts/api_client.go index 98bfd1d32ac..80c08dc369e 100644 --- a/service/s3outposts/api_client.go +++ b/service/s3outposts/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/s3outposts/endpoints.go b/service/s3outposts/endpoints.go index 77db4a09cec..8751dc510ac 100644 --- a/service/s3outposts/endpoints.go +++ b/service/s3outposts/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemaker/api_client.go b/service/sagemaker/api_client.go index 2080c9690f0..dd98b9f5a7f 100644 --- a/service/sagemaker/api_client.go +++ b/service/sagemaker/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sagemaker/endpoints.go b/service/sagemaker/endpoints.go index 8a45dd69670..fdc8f6999b4 100644 --- a/service/sagemaker/endpoints.go +++ b/service/sagemaker/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakera2iruntime/api_client.go b/service/sagemakera2iruntime/api_client.go index 795888d6051..f7fba6fd4e2 100644 --- a/service/sagemakera2iruntime/api_client.go +++ b/service/sagemakera2iruntime/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sagemakera2iruntime/endpoints.go b/service/sagemakera2iruntime/endpoints.go index 5d5156c5ebf..9fc93ddc050 100644 --- a/service/sagemakera2iruntime/endpoints.go +++ b/service/sagemakera2iruntime/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakeredge/api_client.go b/service/sagemakeredge/api_client.go index 47df439a2e7..a02dbaaff3c 100644 --- a/service/sagemakeredge/api_client.go +++ b/service/sagemakeredge/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sagemakeredge/endpoints.go b/service/sagemakeredge/endpoints.go index a010544a283..ec29522043b 100644 --- a/service/sagemakeredge/endpoints.go +++ b/service/sagemakeredge/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakerfeaturestoreruntime/api_client.go b/service/sagemakerfeaturestoreruntime/api_client.go index aab03c425df..de84c3c2115 100644 --- a/service/sagemakerfeaturestoreruntime/api_client.go +++ b/service/sagemakerfeaturestoreruntime/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sagemakerfeaturestoreruntime/endpoints.go b/service/sagemakerfeaturestoreruntime/endpoints.go index e185d506044..1e50cdf0e40 100644 --- a/service/sagemakerfeaturestoreruntime/endpoints.go +++ b/service/sagemakerfeaturestoreruntime/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakerruntime/api_client.go b/service/sagemakerruntime/api_client.go index 2d605adc7ca..162d83f50e9 100644 --- a/service/sagemakerruntime/api_client.go +++ b/service/sagemakerruntime/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sagemakerruntime/endpoints.go b/service/sagemakerruntime/endpoints.go index 141bf3fe912..33b853668c9 100644 --- a/service/sagemakerruntime/endpoints.go +++ b/service/sagemakerruntime/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/savingsplans/api_client.go b/service/savingsplans/api_client.go index 3d1b59fd388..cd43aebaeb2 100644 --- a/service/savingsplans/api_client.go +++ b/service/savingsplans/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/savingsplans/endpoints.go b/service/savingsplans/endpoints.go index 0405b2c3d34..12ded9e01a1 100644 --- a/service/savingsplans/endpoints.go +++ b/service/savingsplans/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/schemas/api_client.go b/service/schemas/api_client.go index f2cbbfd9ea0..411fd28f0ad 100644 --- a/service/schemas/api_client.go +++ b/service/schemas/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/schemas/endpoints.go b/service/schemas/endpoints.go index 0cec00fafef..77858a0e371 100644 --- a/service/schemas/endpoints.go +++ b/service/schemas/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/secretsmanager/api_client.go b/service/secretsmanager/api_client.go index 6d1186da01d..175fa99d59d 100644 --- a/service/secretsmanager/api_client.go +++ b/service/secretsmanager/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/secretsmanager/endpoints.go b/service/secretsmanager/endpoints.go index 65033f9d2dd..a99a652c4f8 100644 --- a/service/secretsmanager/endpoints.go +++ b/service/secretsmanager/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/securityhub/api_client.go b/service/securityhub/api_client.go index 743377d28c3..9f8925e8bc9 100644 --- a/service/securityhub/api_client.go +++ b/service/securityhub/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/securityhub/endpoints.go b/service/securityhub/endpoints.go index 22a3c068dd8..059f2d55d2a 100644 --- a/service/securityhub/endpoints.go +++ b/service/securityhub/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/serverlessapplicationrepository/api_client.go b/service/serverlessapplicationrepository/api_client.go index 84aff2cd42b..5b9ffddef37 100644 --- a/service/serverlessapplicationrepository/api_client.go +++ b/service/serverlessapplicationrepository/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/serverlessapplicationrepository/endpoints.go b/service/serverlessapplicationrepository/endpoints.go index 7af58fe788e..92c95fd0d1a 100644 --- a/service/serverlessapplicationrepository/endpoints.go +++ b/service/serverlessapplicationrepository/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicecatalog/api_client.go b/service/servicecatalog/api_client.go index 56881f6439b..f05ac6448a9 100644 --- a/service/servicecatalog/api_client.go +++ b/service/servicecatalog/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/servicecatalog/endpoints.go b/service/servicecatalog/endpoints.go index caf0a854855..35f9f995a85 100644 --- a/service/servicecatalog/endpoints.go +++ b/service/servicecatalog/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicecatalogappregistry/api_client.go b/service/servicecatalogappregistry/api_client.go index 27c619756bd..4c1175d4986 100644 --- a/service/servicecatalogappregistry/api_client.go +++ b/service/servicecatalogappregistry/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/servicecatalogappregistry/endpoints.go b/service/servicecatalogappregistry/endpoints.go index 20a8e25ff4e..635af6e3ee8 100644 --- a/service/servicecatalogappregistry/endpoints.go +++ b/service/servicecatalogappregistry/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicediscovery/api_client.go b/service/servicediscovery/api_client.go index 2acb52a67d0..510a423d691 100644 --- a/service/servicediscovery/api_client.go +++ b/service/servicediscovery/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/servicediscovery/endpoints.go b/service/servicediscovery/endpoints.go index 323bfdb071b..61cd26b8168 100644 --- a/service/servicediscovery/endpoints.go +++ b/service/servicediscovery/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicequotas/api_client.go b/service/servicequotas/api_client.go index b0e0d87a53d..e260350ac2d 100644 --- a/service/servicequotas/api_client.go +++ b/service/servicequotas/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/servicequotas/endpoints.go b/service/servicequotas/endpoints.go index afcdad94bc6..92da3d9f851 100644 --- a/service/servicequotas/endpoints.go +++ b/service/servicequotas/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ses/api_client.go b/service/ses/api_client.go index 0d4d88fb093..bf32a25d9ec 100644 --- a/service/ses/api_client.go +++ b/service/ses/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ses/endpoints.go b/service/ses/endpoints.go index e8862b2cf87..186b1116c5e 100644 --- a/service/ses/endpoints.go +++ b/service/ses/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sesv2/api_client.go b/service/sesv2/api_client.go index a522372d798..a2f66991986 100644 --- a/service/sesv2/api_client.go +++ b/service/sesv2/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sesv2/endpoints.go b/service/sesv2/endpoints.go index 91881f5b5e2..84e57c030ce 100644 --- a/service/sesv2/endpoints.go +++ b/service/sesv2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sfn/api_client.go b/service/sfn/api_client.go index a72ce7c6e6a..dad099402fc 100644 --- a/service/sfn/api_client.go +++ b/service/sfn/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sfn/endpoints.go b/service/sfn/endpoints.go index bad865f4504..d48898222c8 100644 --- a/service/sfn/endpoints.go +++ b/service/sfn/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/shield/api_client.go b/service/shield/api_client.go index a0ae3ba75c2..0d941093884 100644 --- a/service/shield/api_client.go +++ b/service/shield/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/shield/endpoints.go b/service/shield/endpoints.go index 14adf6637e0..00776b94aea 100644 --- a/service/shield/endpoints.go +++ b/service/shield/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/signer/api_client.go b/service/signer/api_client.go index a3d6b731b66..d818fb7102e 100644 --- a/service/signer/api_client.go +++ b/service/signer/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/signer/endpoints.go b/service/signer/endpoints.go index 4256f9466b0..e0fe970f57e 100644 --- a/service/signer/endpoints.go +++ b/service/signer/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sms/api_client.go b/service/sms/api_client.go index ba2088079a4..d02e0e332a1 100644 --- a/service/sms/api_client.go +++ b/service/sms/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sms/endpoints.go b/service/sms/endpoints.go index 9b5d3919c4d..eed6975b306 100644 --- a/service/sms/endpoints.go +++ b/service/sms/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/snowball/api_client.go b/service/snowball/api_client.go index a68372b34af..c6febf8060f 100644 --- a/service/snowball/api_client.go +++ b/service/snowball/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/snowball/endpoints.go b/service/snowball/endpoints.go index 6dfb4b160a9..563977be733 100644 --- a/service/snowball/endpoints.go +++ b/service/snowball/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sns/api_client.go b/service/sns/api_client.go index 64471fd34a6..c90c8031e10 100644 --- a/service/sns/api_client.go +++ b/service/sns/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sns/endpoints.go b/service/sns/endpoints.go index bfb1087547f..bd82c40beb4 100644 --- a/service/sns/endpoints.go +++ b/service/sns/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sqs/api_client.go b/service/sqs/api_client.go index 356f29dc93e..dfd642141f1 100644 --- a/service/sqs/api_client.go +++ b/service/sqs/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sqs/endpoints.go b/service/sqs/endpoints.go index ef6de2f48b6..bc50fe884db 100644 --- a/service/sqs/endpoints.go +++ b/service/sqs/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ssm/api_client.go b/service/ssm/api_client.go index 6455e063c5d..b7c9748e84e 100644 --- a/service/ssm/api_client.go +++ b/service/ssm/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ssm/endpoints.go b/service/ssm/endpoints.go index cfe7627770a..600d8af2f84 100644 --- a/service/ssm/endpoints.go +++ b/service/ssm/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sso/api_client.go b/service/sso/api_client.go index 416e98ae8e1..b435c591c3a 100644 --- a/service/sso/api_client.go +++ b/service/sso/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sso/endpoints.go b/service/sso/endpoints.go index e37df53983e..b01114004dd 100644 --- a/service/sso/endpoints.go +++ b/service/sso/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ssoadmin/api_client.go b/service/ssoadmin/api_client.go index 77ec565b047..f2975d9e0f7 100644 --- a/service/ssoadmin/api_client.go +++ b/service/ssoadmin/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ssoadmin/endpoints.go b/service/ssoadmin/endpoints.go index fdeccf11d25..759d3703dce 100644 --- a/service/ssoadmin/endpoints.go +++ b/service/ssoadmin/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ssooidc/api_client.go b/service/ssooidc/api_client.go index d007c02a17a..f919dd2c485 100644 --- a/service/ssooidc/api_client.go +++ b/service/ssooidc/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/ssooidc/endpoints.go b/service/ssooidc/endpoints.go index d57d55ce07c..9e9bbe95f27 100644 --- a/service/ssooidc/endpoints.go +++ b/service/ssooidc/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/storagegateway/api_client.go b/service/storagegateway/api_client.go index 577add9b265..f7d75a84a17 100644 --- a/service/storagegateway/api_client.go +++ b/service/storagegateway/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/storagegateway/endpoints.go b/service/storagegateway/endpoints.go index 8f8bde81273..50ac8a67e66 100644 --- a/service/storagegateway/endpoints.go +++ b/service/storagegateway/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sts/api_client.go b/service/sts/api_client.go index 6858e15b657..0d67082f5d2 100644 --- a/service/sts/api_client.go +++ b/service/sts/api_client.go @@ -99,6 +99,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/sts/endpoints.go b/service/sts/endpoints.go index 2b464ef6d63..ebdf8fac861 100644 --- a/service/sts/endpoints.go +++ b/service/sts/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/support/api_client.go b/service/support/api_client.go index 938f915f7b0..96918123709 100644 --- a/service/support/api_client.go +++ b/service/support/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/support/endpoints.go b/service/support/endpoints.go index 8b1e13fee21..220c33edc38 100644 --- a/service/support/endpoints.go +++ b/service/support/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/swf/api_client.go b/service/swf/api_client.go index c2a9a4395a3..e9eacd86435 100644 --- a/service/swf/api_client.go +++ b/service/swf/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/swf/endpoints.go b/service/swf/endpoints.go index 0d7f9665d82..48deb227a36 100644 --- a/service/swf/endpoints.go +++ b/service/swf/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/synthetics/api_client.go b/service/synthetics/api_client.go index 653b10c8e4f..000de7c8ae2 100644 --- a/service/synthetics/api_client.go +++ b/service/synthetics/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/synthetics/endpoints.go b/service/synthetics/endpoints.go index 1bf8860dca5..ca60adbce28 100644 --- a/service/synthetics/endpoints.go +++ b/service/synthetics/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/textract/api_client.go b/service/textract/api_client.go index 23a4dfa34bd..b1ce36b211a 100644 --- a/service/textract/api_client.go +++ b/service/textract/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/textract/endpoints.go b/service/textract/endpoints.go index e002957923c..90e7774a2d8 100644 --- a/service/textract/endpoints.go +++ b/service/textract/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/timestreamquery/api_client.go b/service/timestreamquery/api_client.go index 96e19564479..1dc71d768ad 100644 --- a/service/timestreamquery/api_client.go +++ b/service/timestreamquery/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/timestreamquery/endpoints.go b/service/timestreamquery/endpoints.go index 174c08d2a8b..1b860681499 100644 --- a/service/timestreamquery/endpoints.go +++ b/service/timestreamquery/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/timestreamwrite/api_client.go b/service/timestreamwrite/api_client.go index e0e24802846..e36698cfadb 100644 --- a/service/timestreamwrite/api_client.go +++ b/service/timestreamwrite/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/timestreamwrite/endpoints.go b/service/timestreamwrite/endpoints.go index 88373d4e40e..a83db424399 100644 --- a/service/timestreamwrite/endpoints.go +++ b/service/timestreamwrite/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/transcribe/api_client.go b/service/transcribe/api_client.go index e97035c2f38..e9b9fab1ff1 100644 --- a/service/transcribe/api_client.go +++ b/service/transcribe/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/transcribe/endpoints.go b/service/transcribe/endpoints.go index 87a14e4dfbf..73b8ee4d263 100644 --- a/service/transcribe/endpoints.go +++ b/service/transcribe/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/transfer/api_client.go b/service/transfer/api_client.go index 30253c4a479..bbb5a471243 100644 --- a/service/transfer/api_client.go +++ b/service/transfer/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/transfer/endpoints.go b/service/transfer/endpoints.go index 8cfe7e123c3..ccbf2244798 100644 --- a/service/transfer/endpoints.go +++ b/service/transfer/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/translate/api_client.go b/service/translate/api_client.go index 6fbfa6224c6..296c7e5a605 100644 --- a/service/translate/api_client.go +++ b/service/translate/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/translate/endpoints.go b/service/translate/endpoints.go index fc92f72d51c..ab87122f18b 100644 --- a/service/translate/endpoints.go +++ b/service/translate/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/waf/api_client.go b/service/waf/api_client.go index 596cc9dc955..fb4bd586bea 100644 --- a/service/waf/api_client.go +++ b/service/waf/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/waf/endpoints.go b/service/waf/endpoints.go index c3085cbdafa..676c37e80a0 100644 --- a/service/waf/endpoints.go +++ b/service/waf/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/wafregional/api_client.go b/service/wafregional/api_client.go index 942197ca6c3..fd345706268 100644 --- a/service/wafregional/api_client.go +++ b/service/wafregional/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/wafregional/endpoints.go b/service/wafregional/endpoints.go index 3f2b7dafdf1..49ce18cb7f4 100644 --- a/service/wafregional/endpoints.go +++ b/service/wafregional/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/wafv2/api_client.go b/service/wafv2/api_client.go index 6bdd0e395fd..5f0b370f0a3 100644 --- a/service/wafv2/api_client.go +++ b/service/wafv2/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/wafv2/endpoints.go b/service/wafv2/endpoints.go index 3fb80242647..125e6c2fde2 100644 --- a/service/wafv2/endpoints.go +++ b/service/wafv2/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/wellarchitected/api_client.go b/service/wellarchitected/api_client.go index 3409d4b9071..e2a08ec8471 100644 --- a/service/wellarchitected/api_client.go +++ b/service/wellarchitected/api_client.go @@ -105,6 +105,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/wellarchitected/endpoints.go b/service/wellarchitected/endpoints.go index d0af428dd37..b252c3775b1 100644 --- a/service/wellarchitected/endpoints.go +++ b/service/wellarchitected/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workdocs/api_client.go b/service/workdocs/api_client.go index 18c86ec46e8..190eca47cdd 100644 --- a/service/workdocs/api_client.go +++ b/service/workdocs/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/workdocs/endpoints.go b/service/workdocs/endpoints.go index 7e2e07e5471..20f54b446ef 100644 --- a/service/workdocs/endpoints.go +++ b/service/workdocs/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/worklink/api_client.go b/service/worklink/api_client.go index a1890c66a82..4b5121b1880 100644 --- a/service/worklink/api_client.go +++ b/service/worklink/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/worklink/endpoints.go b/service/worklink/endpoints.go index 2e626481ebc..694c7ae7e6c 100644 --- a/service/worklink/endpoints.go +++ b/service/worklink/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workmail/api_client.go b/service/workmail/api_client.go index cc11ef90657..8840d182991 100644 --- a/service/workmail/api_client.go +++ b/service/workmail/api_client.go @@ -104,6 +104,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/workmail/endpoints.go b/service/workmail/endpoints.go index 53e2164a898..40e877c41dd 100644 --- a/service/workmail/endpoints.go +++ b/service/workmail/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workmailmessageflow/api_client.go b/service/workmailmessageflow/api_client.go index 852e6aeeb4f..7ffb5b7fde6 100644 --- a/service/workmailmessageflow/api_client.go +++ b/service/workmailmessageflow/api_client.go @@ -97,6 +97,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/workmailmessageflow/endpoints.go b/service/workmailmessageflow/endpoints.go index 750da0deb64..86fec46abe5 100644 --- a/service/workmailmessageflow/endpoints.go +++ b/service/workmailmessageflow/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workspaces/api_client.go b/service/workspaces/api_client.go index d11d6cb2048..ecc99dbaff9 100644 --- a/service/workspaces/api_client.go +++ b/service/workspaces/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/workspaces/endpoints.go b/service/workspaces/endpoints.go index 66ed54902b6..2ff64bd51da 100644 --- a/service/workspaces/endpoints.go +++ b/service/workspaces/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/xray/api_client.go b/service/xray/api_client.go index de8414dad1d..e8529b45869 100644 --- a/service/xray/api_client.go +++ b/service/xray/api_client.go @@ -96,6 +96,14 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + type HTTPClient interface { Do(*http.Request) (*http.Response, error) } diff --git a/service/xray/endpoints.go b/service/xray/endpoints.go index 16eecde4e15..cff3ac839c3 100644 --- a/service/xray/endpoints.go +++ b/service/xray/endpoints.go @@ -45,6 +45,26 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region. You can provide functional options to configure +// endpoint values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions