diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AddAwsConfigFields.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AddAwsConfigFields.java index 5f9ad89858e..21dc7653989 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AddAwsConfigFields.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AddAwsConfigFields.java @@ -108,17 +108,6 @@ public class AddAwsConfigFields implements GoIntegration { .build() ); - /** - * Gets the sort order of the customization from -128 to 127, with lowest - * executed first. - * - * @return Returns the sort order, defaults to -50. - */ - @Override - public byte getOrder() { - return -50; - } - private static Symbol getAwsCoreSymbol(String symbolName) { return SymbolUtils.createValueSymbolBuilder(symbolName, AwsGoDependency.AWS_CORE).build(); @@ -139,6 +128,17 @@ private static Symbol getAwsRetrySymbol(String symbolName) { AwsGoDependency.AWS_RETRY).build(); } + /** + * Gets the sort order of the customization from -128 to 127, with lowest + * executed first. + * + * @return Returns the sort order, defaults to -50. + */ + @Override + public byte getOrder() { + return -50; + } + @Override public void writeAdditionalFiles( GoSettings settings, @@ -178,7 +178,8 @@ private void writeHttpClientResolver(GoWriter writer) { writer.openBlock("func $L(o *Options) {", "}", RESOLVE_HTTP_CLIENT, () -> { writer.openBlock("if o.$L != nil {", "}", HTTP_CLIENT_CONFIG_NAME, () -> writer.write("return")); writer.write("o.$L = $T()", HTTP_CLIENT_CONFIG_NAME, - SymbolUtils.createValueSymbolBuilder("NewBuildableClient", AwsGoDependency.AWS_HTTP_TRANSPORT).build()); + SymbolUtils.createValueSymbolBuilder("NewBuildableClient", + AwsGoDependency.AWS_HTTP_TRANSPORT).build()); }); writer.write(""); } @@ -305,6 +306,14 @@ private Builder() { super(); } + /** + * This sets the Config field on Client Options structure. By default this is true. + * If set to false, this field won't be generated on the Client options, but will be used by + * the NewFromConfig (to copy values from the aws config to client options). + * + * @param generatedOnClient bool indicating config field generation on client option structure + * @return + */ public Builder generatedOnClient(boolean generatedOnClient) { this.generatedOnClient = generatedOnClient; return this; @@ -347,6 +356,18 @@ public Builder documentation(String documentation) { super.documentation(documentation); return this; } + + @Override + public Builder withHelper(Boolean withHelper) { + super.withHelper(withHelper); + return this; + } + + @Override + public Builder withHelper() { + super.withHelper(); + return this; + } } } } diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEndpointGenerator.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEndpointGenerator.java index c321d7405a2..cb9f34531ca 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEndpointGenerator.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsEndpointGenerator.java @@ -33,6 +33,7 @@ * Generates an endpoint resolver from endpoints.json. */ public final class AwsEndpointGenerator implements GoIntegration { + public static final String ENDPOINT_RESOLVER_CONFIG_NAME = "EndpointResolver"; @Override public void writeAdditionalFiles( @@ -49,10 +50,11 @@ public List getClientPlugins() { return ListUtils.of(RuntimeClientPlugin.builder() .configFields(SetUtils.of( ConfigField.builder() - .name("EndpointResolver") + .name(ENDPOINT_RESOLVER_CONFIG_NAME) .type(SymbolUtils.createValueSymbolBuilder(EndpointGenerator.RESOLVER_INTERFACE_NAME) .build()) .documentation("The service endpoint resolver.") + .withHelper(true) .build(), ConfigField.builder() .name("EndpointOptions") diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java index d2ec14a0b13..3f4fab63867 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsGoDependency.java @@ -84,6 +84,6 @@ protected static GoDependency module( } private static final class Versions { - private static final String AWS_SDK = "v0.31.1-0.20210108204630-4822f3195720"; + private static final String AWS_SDK = "v1.0.1-0.20210122214637-6cf9ad2f8e2f"; } } diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointGenerator.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointGenerator.java index 91353ce296a..67780b669be 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointGenerator.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/EndpointGenerator.java @@ -53,6 +53,10 @@ public class EndpointGenerator implements Runnable { public static final String CLIENT_CONFIG_RESOLVER = "resolveDefaultEndpointConfiguration"; public static final String RESOLVER_CONSTRUCTOR_NAME = "NewDefaultEndpointResolver"; public static final String AWS_ENDPOINT_RESOLVER_HELPER = "withEndpointResolver"; + private static final String EndpointResolverFromURL = "EndpointResolverFromURL"; + private static final String ENDPOINT_SOURCE_CUSTOM = "EndpointSourceCustom"; + private static final Symbol AWS_ENDPOINT = SymbolUtils.createPointableSymbolBuilder( + "Endpoint", AwsGoDependency.AWS_CORE).build(); private static final int ENDPOINT_MODEL_VERSION = 3; private static final String INTERNAL_ENDPOINT_PACKAGE = "internal/endpoints"; @@ -369,6 +373,28 @@ private void generatePublicResolverTypes(GoWriter writer) { writer.openBlock("if o.EndpointResolver != nil {", "}", () -> writer.write("return")); writer.write("o.EndpointResolver = $L()", RESOLVER_CONSTRUCTOR_NAME); }); + + // Generate EndpointResolverFromURL helper + writer.writeDocs(String.format("%s returns an EndpointResolver configured using the provided endpoint url. " + + "By default, the resolved endpoint resolver uses the client region as signing region, and " + + "the endpoint source is set to EndpointSourceCustom." + + "You can provide functional options to configure endpoint values for the resolved endpoint.", + EndpointResolverFromURL)); + writer.openBlock("func $L(url string, optFns ...func($P)) EndpointResolver {", "}", + EndpointResolverFromURL, AWS_ENDPOINT, () -> { + Symbol customEndpointSource = SymbolUtils.createValueSymbolBuilder( + ENDPOINT_SOURCE_CUSTOM, AwsGoDependency.AWS_CORE + ).build(); + writer.write("e := $T{ URL : url, Source : $T }", AWS_ENDPOINT, customEndpointSource); + writer.write("for _, fn := range optFns { fn(&e) }"); + writer.write(""); + + writer.openBlock("return $T(", ")", resolverFuncSymbol, () -> { + writer.write("func(region string, options $L) ($T, error) {", RESOLVER_OPTIONS, AWS_ENDPOINT); + writer.write("if len(e.SigningRegion) == 0 { e.SigningRegion = region }"); + writer.write("return e, nil },"); + }); + }); } private void writeExternalResolveEndpointImplementation( diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/AwsCustomGoDependency.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/AwsCustomGoDependency.java index ef9d2a99de0..64cf0ac1cd7 100644 --- a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/AwsCustomGoDependency.java +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/AwsCustomGoDependency.java @@ -48,8 +48,8 @@ private AwsCustomGoDependency() { } private static final class Versions { - private static final String INTERNAL_S3SHARED = "v0.4.1-0.20210108204630-4822f3195720"; - private static final String INTERNAL_ACCEPTENCODING = "v0.4.1-0.20210108204630-4822f3195720"; - private static final String INTERNAL_PRESIGNURL = "v0.2.1-0.20210108204630-4822f3195720"; + private static final String INTERNAL_S3SHARED = "v1.0.0"; + private static final String INTERNAL_ACCEPTENCODING = "v1.0.0"; + private static final String INTERNAL_PRESIGNURL = "v1.0.0"; } } diff --git a/config/go.mod b/config/go.mod index 114b3473e11..b7f376d73a2 100644 --- a/config/go.mod +++ b/config/go.mod @@ -3,13 +3,12 @@ module github.com/aws/aws-sdk-go-v2/config go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f 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/sts 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/service/internal/presigned-url v1.0.0 ) replace ( diff --git a/credentials/go.mod b/credentials/go.mod index 5941776e87d..7f1d84595bc 100644 --- a/credentials/go.mod +++ b/credentials/go.mod @@ -3,11 +3,10 @@ module github.com/aws/aws-sdk-go-v2/credentials go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.0 github.com/aws/aws-sdk-go-v2/service/sts v1.0.0 github.com/aws/smithy-go v1.0.0 - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0 ) replace ( diff --git a/example/service/s3/listObjects/go.mod b/example/service/s3/listObjects/go.mod index 26234f463e7..53bf9b1aace 100644 --- a/example/service/s3/listObjects/go.mod +++ b/example/service/s3/listObjects/go.mod @@ -5,13 +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/s3 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/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 - github.com/aws/aws-sdk-go-v2/service/sts v1.0.0 ) replace github.com/aws/aws-sdk-go-v2/config => ../../../../config/ diff --git a/example/service/s3/listObjects/go.sum b/example/service/s3/listObjects/go.sum index 2051d18c301..b66e1d584b9 100644 --- a/example/service/s3/listObjects/go.sum +++ b/example/service/s3/listObjects/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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/feature/dynamodb/attributevalue/go.mod b/feature/dynamodb/attributevalue/go.mod index 66dfe491704..796eb21fb0d 100644 --- a/feature/dynamodb/attributevalue/go.mod +++ b/feature/dynamodb/attributevalue/go.mod @@ -3,11 +3,10 @@ module github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/service/dynamodb v1.0.0 github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.0.0 github.com/google/go-cmp v0.5.4 - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0 ) replace github.com/aws/aws-sdk-go-v2/service/dynamodb => ../../../service/dynamodb/ diff --git a/feature/dynamodb/attributevalue/go.sum b/feature/dynamodb/attributevalue/go.sum index 720b68089bf..9b99314a45e 100644 --- a/feature/dynamodb/attributevalue/go.sum +++ b/feature/dynamodb/attributevalue/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/feature/dynamodb/expression/go.mod b/feature/dynamodb/expression/go.mod index a8ebc83266f..92a37b01cbc 100644 --- a/feature/dynamodb/expression/go.mod +++ b/feature/dynamodb/expression/go.mod @@ -3,11 +3,9 @@ module github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.0.0 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.0.0 - github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.0.0 - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0 ) replace ( diff --git a/feature/dynamodb/expression/go.sum b/feature/dynamodb/expression/go.sum index 4b1acc9fadf..f7ecc3d1c7f 100644 --- a/feature/dynamodb/expression/go.sum +++ b/feature/dynamodb/expression/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/feature/dynamodbstreams/attributevalue/go.mod b/feature/dynamodbstreams/attributevalue/go.mod index 88d47f642fe..2697448b8cd 100644 --- a/feature/dynamodbstreams/attributevalue/go.mod +++ b/feature/dynamodbstreams/attributevalue/go.mod @@ -3,11 +3,10 @@ module github.com/aws/aws-sdk-go-v2/feature/dynamodbstreams/attributevalue go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/service/dynamodb v1.0.0 github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.0.0 github.com/google/go-cmp v0.5.4 - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0 ) replace github.com/aws/aws-sdk-go-v2/service/dynamodb => ../../../service/dynamodb/ diff --git a/feature/dynamodbstreams/attributevalue/go.sum b/feature/dynamodbstreams/attributevalue/go.sum index 4b1acc9fadf..f7ecc3d1c7f 100644 --- a/feature/dynamodbstreams/attributevalue/go.sum +++ b/feature/dynamodbstreams/attributevalue/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/feature/s3/manager/go.mod b/feature/s3/manager/go.mod index e098743a185..d1445097168 100644 --- a/feature/s3/manager/go.mod +++ b/feature/s3/manager/go.mod @@ -3,17 +3,11 @@ module github.com/aws/aws-sdk-go-v2/feature/s3/manager go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/config v1.0.0 github.com/aws/aws-sdk-go-v2/service/s3 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 - github.com/aws/aws-sdk-go-v2/service/sts v1.0.0 ) replace github.com/aws/aws-sdk-go-v2 => ../../../ diff --git a/feature/s3/manager/go.sum b/feature/s3/manager/go.sum index 720b68089bf..9b99314a45e 100644 --- a/feature/s3/manager/go.sum +++ b/feature/s3/manager/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/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..c2b257c1ac4 100644 --- a/internal/protocoltest/awsrestjson/endpoints.go +++ b/internal/protocoltest/awsrestjson/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/awsrestjson/go.mod b/internal/protocoltest/awsrestjson/go.mod index c7eeae1d7fe..2afe0770ad3 100644 --- a/internal/protocoltest/awsrestjson/go.mod +++ b/internal/protocoltest/awsrestjson/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/internal/protocoltest/awsrestjson go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 ) 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..e713b3883d6 100644 --- a/internal/protocoltest/ec2query/endpoints.go +++ b/internal/protocoltest/ec2query/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/ec2query/go.mod b/internal/protocoltest/ec2query/go.mod index 141273487b2..45c3b328701 100644 --- a/internal/protocoltest/ec2query/go.mod +++ b/internal/protocoltest/ec2query/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/internal/protocoltest/ec2query go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 ) 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..02a77830a13 100644 --- a/internal/protocoltest/jsonrpc/endpoints.go +++ b/internal/protocoltest/jsonrpc/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/jsonrpc/go.mod b/internal/protocoltest/jsonrpc/go.mod index 65ebd91ac3a..7e4ee8596c9 100644 --- a/internal/protocoltest/jsonrpc/go.mod +++ b/internal/protocoltest/jsonrpc/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/internal/protocoltest/jsonrpc go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 ) 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..9878e00529c 100644 --- a/internal/protocoltest/jsonrpc10/endpoints.go +++ b/internal/protocoltest/jsonrpc10/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/jsonrpc10/go.mod b/internal/protocoltest/jsonrpc10/go.mod index 4c428f264c6..3aec2b2a6ee 100644 --- a/internal/protocoltest/jsonrpc10/go.mod +++ b/internal/protocoltest/jsonrpc10/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/internal/protocoltest/jsonrpc10 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 ) 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..7de8fd1ea67 100644 --- a/internal/protocoltest/query/endpoints.go +++ b/internal/protocoltest/query/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/query/go.mod b/internal/protocoltest/query/go.mod index 1e5909bfc2f..9ca3a8e82ed 100644 --- a/internal/protocoltest/query/go.mod +++ b/internal/protocoltest/query/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/internal/protocoltest/query go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 ) 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..7033fdb9208 100644 --- a/internal/protocoltest/restxml/endpoints.go +++ b/internal/protocoltest/restxml/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/restxml/go.mod b/internal/protocoltest/restxml/go.mod index 98275bcc20d..ce559637ab4 100644 --- a/internal/protocoltest/restxml/go.mod +++ b/internal/protocoltest/restxml/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/internal/protocoltest/restxml go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 ) 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..fec49f6ce71 100644 --- a/internal/protocoltest/restxmlwithnamespace/endpoints.go +++ b/internal/protocoltest/restxmlwithnamespace/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/internal/protocoltest/restxmlwithnamespace/go.mod b/internal/protocoltest/restxmlwithnamespace/go.mod index f5f01626a43..2dacf1648e3 100644 --- a/internal/protocoltest/restxmlwithnamespace/go.mod +++ b/internal/protocoltest/restxmlwithnamespace/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/internal/protocoltest/restxmlwithnamespace go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/google/go-cmp v0.5.4 ) 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..2e64b3b7325 100644 --- a/service/accessanalyzer/endpoints.go +++ b/service/accessanalyzer/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/accessanalyzer/go.mod b/service/accessanalyzer/go.mod index ad742884106..7d1d21f626d 100644 --- a/service/accessanalyzer/go.mod +++ b/service/accessanalyzer/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/accessanalyzer go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..ea42e77227e 100644 --- a/service/acm/endpoints.go +++ b/service/acm/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/acm/go.mod b/service/acm/go.mod index 1b42f6ec007..0b848fc85de 100644 --- a/service/acm/go.mod +++ b/service/acm/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/acm go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..0b60a5f11d5 100644 --- a/service/acmpca/endpoints.go +++ b/service/acmpca/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/acmpca/go.mod b/service/acmpca/go.mod index 00edbfdef36..a5e94100168 100644 --- a/service/acmpca/go.mod +++ b/service/acmpca/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/acmpca go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..12b0b4d0c58 100644 --- a/service/alexaforbusiness/endpoints.go +++ b/service/alexaforbusiness/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/alexaforbusiness/go.mod b/service/alexaforbusiness/go.mod index 8baeeb83832..329bab5684a 100644 --- a/service/alexaforbusiness/go.mod +++ b/service/alexaforbusiness/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/alexaforbusiness go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..28d78f2b473 100644 --- a/service/amplify/endpoints.go +++ b/service/amplify/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/amplify/go.mod b/service/amplify/go.mod index b1633261e26..ff00d039005 100644 --- a/service/amplify/go.mod +++ b/service/amplify/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/amplify go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..8ef0de692cb 100644 --- a/service/apigateway/endpoints.go +++ b/service/apigateway/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/apigateway/go.mod b/service/apigateway/go.mod index 2081270c5dc..97db2d4c003 100644 --- a/service/apigateway/go.mod +++ b/service/apigateway/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/apigateway go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e1f1cb35ef7 100644 --- a/service/apigatewaymanagementapi/endpoints.go +++ b/service/apigatewaymanagementapi/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/apigatewaymanagementapi/go.mod b/service/apigatewaymanagementapi/go.mod index aba8f8d02b2..bd8570e9708 100644 --- a/service/apigatewaymanagementapi/go.mod +++ b/service/apigatewaymanagementapi/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/apigatewaymanagementapi go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..3ae19bae1d3 100644 --- a/service/apigatewayv2/endpoints.go +++ b/service/apigatewayv2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/apigatewayv2/go.mod b/service/apigatewayv2/go.mod index d855be56885..ce846b8ee04 100644 --- a/service/apigatewayv2/go.mod +++ b/service/apigatewayv2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/apigatewayv2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1544852489b 100644 --- a/service/appconfig/endpoints.go +++ b/service/appconfig/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appconfig/go.mod b/service/appconfig/go.mod index c4913590fb2..f15e3cfc01c 100644 --- a/service/appconfig/go.mod +++ b/service/appconfig/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/appconfig go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..044201200fa 100644 --- a/service/appflow/endpoints.go +++ b/service/appflow/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appflow/go.mod b/service/appflow/go.mod index e3e218e4f64..9d48edf7baa 100644 --- a/service/appflow/go.mod +++ b/service/appflow/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/appflow go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..009aa8a90e2 100644 --- a/service/appintegrations/endpoints.go +++ b/service/appintegrations/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appintegrations/go.mod b/service/appintegrations/go.mod index 259ccc875af..4d9a7d3e8c1 100644 --- a/service/appintegrations/go.mod +++ b/service/appintegrations/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/appintegrations go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..517508552a2 100644 --- a/service/applicationautoscaling/endpoints.go +++ b/service/applicationautoscaling/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/applicationautoscaling/go.mod b/service/applicationautoscaling/go.mod index 75c17d8a127..063765708b1 100644 --- a/service/applicationautoscaling/go.mod +++ b/service/applicationautoscaling/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/applicationautoscaling go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c81534d633a 100644 --- a/service/applicationdiscoveryservice/endpoints.go +++ b/service/applicationdiscoveryservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/applicationdiscoveryservice/go.mod b/service/applicationdiscoveryservice/go.mod index 3213d1d34cc..57eae88851f 100644 --- a/service/applicationdiscoveryservice/go.mod +++ b/service/applicationdiscoveryservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2ac50f36e8d 100644 --- a/service/applicationinsights/endpoints.go +++ b/service/applicationinsights/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/applicationinsights/go.mod b/service/applicationinsights/go.mod index 7c7f34b11c0..edbcfcce56b 100644 --- a/service/applicationinsights/go.mod +++ b/service/applicationinsights/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/applicationinsights go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c3d680306e8 100644 --- a/service/appmesh/endpoints.go +++ b/service/appmesh/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appmesh/go.mod b/service/appmesh/go.mod index b93645fd6e5..301a907b695 100644 --- a/service/appmesh/go.mod +++ b/service/appmesh/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/appmesh go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..0bb708ca78a 100644 --- a/service/appstream/endpoints.go +++ b/service/appstream/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appstream/go.mod b/service/appstream/go.mod index 1748444dc5f..5f7f4788a03 100644 --- a/service/appstream/go.mod +++ b/service/appstream/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/appstream go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..80582290d85 100644 --- a/service/appsync/endpoints.go +++ b/service/appsync/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/appsync/go.mod b/service/appsync/go.mod index ac9955bd9ad..8ac55e60896 100644 --- a/service/appsync/go.mod +++ b/service/appsync/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/appsync go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..58ac47c4fcc 100644 --- a/service/athena/endpoints.go +++ b/service/athena/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/athena/go.mod b/service/athena/go.mod index 0e4af448d05..506366fa1e6 100644 --- a/service/athena/go.mod +++ b/service/athena/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/athena go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e8dd259300e 100644 --- a/service/auditmanager/endpoints.go +++ b/service/auditmanager/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/auditmanager/go.mod b/service/auditmanager/go.mod index fb97dd2dae4..7012eec4d11 100644 --- a/service/auditmanager/go.mod +++ b/service/auditmanager/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/auditmanager go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6ffd570bf2c 100644 --- a/service/autoscaling/endpoints.go +++ b/service/autoscaling/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/autoscaling/go.mod b/service/autoscaling/go.mod index f0e9d030666..d711900b958 100644 --- a/service/autoscaling/go.mod +++ b/service/autoscaling/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/autoscaling go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..631f2caa1ec 100644 --- a/service/autoscalingplans/endpoints.go +++ b/service/autoscalingplans/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/autoscalingplans/go.mod b/service/autoscalingplans/go.mod index 3576f4f1a91..34b62db47f2 100644 --- a/service/autoscalingplans/go.mod +++ b/service/autoscalingplans/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/autoscalingplans go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d33a873fa52 100644 --- a/service/backup/endpoints.go +++ b/service/backup/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/backup/go.mod b/service/backup/go.mod index 48a6f5725d9..43cc7d5c6f0 100644 --- a/service/backup/go.mod +++ b/service/backup/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/backup go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..430af0743f2 100644 --- a/service/batch/endpoints.go +++ b/service/batch/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/batch/go.mod b/service/batch/go.mod index d54e734fdae..c2dc6dc28f4 100644 --- a/service/batch/go.mod +++ b/service/batch/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/batch go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..63cea14f035 100644 --- a/service/braket/endpoints.go +++ b/service/braket/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/braket/go.mod b/service/braket/go.mod index 2417bd97b33..155666572d9 100644 --- a/service/braket/go.mod +++ b/service/braket/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/braket go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..474e4d8b3b5 100644 --- a/service/budgets/endpoints.go +++ b/service/budgets/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/budgets/go.mod b/service/budgets/go.mod index 0383c950f4b..1bb76d98147 100644 --- a/service/budgets/go.mod +++ b/service/budgets/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/budgets go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..7b3ccb7aabb 100644 --- a/service/chime/endpoints.go +++ b/service/chime/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/chime/go.mod b/service/chime/go.mod index f7dd382e090..91298dd1002 100644 --- a/service/chime/go.mod +++ b/service/chime/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/chime go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..8164ffbac42 100644 --- a/service/cloud9/endpoints.go +++ b/service/cloud9/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloud9/go.mod b/service/cloud9/go.mod index 07da29b44aa..6a6d71aa22a 100644 --- a/service/cloud9/go.mod +++ b/service/cloud9/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloud9 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d7079bbd3f4 100644 --- a/service/clouddirectory/endpoints.go +++ b/service/clouddirectory/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/clouddirectory/go.mod b/service/clouddirectory/go.mod index 7285882f3bb..594c8fd1ff3 100644 --- a/service/clouddirectory/go.mod +++ b/service/clouddirectory/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/clouddirectory go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..bc6bd26e80d 100644 --- a/service/cloudformation/endpoints.go +++ b/service/cloudformation/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudformation/go.mod b/service/cloudformation/go.mod index 8b7684d2621..dc2d13a2f3a 100644 --- a/service/cloudformation/go.mod +++ b/service/cloudformation/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudformation go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..63cad6f2ea3 100644 --- a/service/cloudfront/endpoints.go +++ b/service/cloudfront/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudfront/go.mod b/service/cloudfront/go.mod index cd865648c06..dd7bab68aa3 100644 --- a/service/cloudfront/go.mod +++ b/service/cloudfront/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudfront go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..085a0017671 100644 --- a/service/cloudhsm/endpoints.go +++ b/service/cloudhsm/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudhsm/go.mod b/service/cloudhsm/go.mod index 00e7d214bf1..8fb0e21971f 100644 --- a/service/cloudhsm/go.mod +++ b/service/cloudhsm/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudhsm go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..7dca0c0b725 100644 --- a/service/cloudhsmv2/endpoints.go +++ b/service/cloudhsmv2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudhsmv2/go.mod b/service/cloudhsmv2/go.mod index f69550821ab..85b409bd574 100644 --- a/service/cloudhsmv2/go.mod +++ b/service/cloudhsmv2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..506d7c36099 100644 --- a/service/cloudsearch/endpoints.go +++ b/service/cloudsearch/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudsearch/go.mod b/service/cloudsearch/go.mod index f14b80c60f3..e1b14e6f674 100644 --- a/service/cloudsearch/go.mod +++ b/service/cloudsearch/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudsearch go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a99063a1aa6 100644 --- a/service/cloudsearchdomain/endpoints.go +++ b/service/cloudsearchdomain/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudsearchdomain/go.mod b/service/cloudsearchdomain/go.mod index b13d6ce7851..74279efafe9 100644 --- a/service/cloudsearchdomain/go.mod +++ b/service/cloudsearchdomain/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudsearchdomain go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..422a6bb86e3 100644 --- a/service/cloudtrail/endpoints.go +++ b/service/cloudtrail/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudtrail/go.mod b/service/cloudtrail/go.mod index 7d35f885c3d..d448f21ae05 100644 --- a/service/cloudtrail/go.mod +++ b/service/cloudtrail/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudtrail go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2ebb5e79ece 100644 --- a/service/cloudwatch/endpoints.go +++ b/service/cloudwatch/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudwatch/go.mod b/service/cloudwatch/go.mod index f28695b59d1..da6a23c6986 100644 --- a/service/cloudwatch/go.mod +++ b/service/cloudwatch/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudwatch go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..1391ca9e157 100644 --- a/service/cloudwatchevents/endpoints.go +++ b/service/cloudwatchevents/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudwatchevents/go.mod b/service/cloudwatchevents/go.mod index 983f317e231..1038a07de6a 100644 --- a/service/cloudwatchevents/go.mod +++ b/service/cloudwatchevents/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudwatchevents go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..08904eaf739 100644 --- a/service/cloudwatchlogs/endpoints.go +++ b/service/cloudwatchlogs/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cloudwatchlogs/go.mod b/service/cloudwatchlogs/go.mod index 0c14f4f408d..c862c37db32 100644 --- a/service/cloudwatchlogs/go.mod +++ b/service/cloudwatchlogs/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2ba52e78160 100644 --- a/service/codeartifact/endpoints.go +++ b/service/codeartifact/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codeartifact/go.mod b/service/codeartifact/go.mod index 2b6a9c5d08c..16aa3f8a297 100644 --- a/service/codeartifact/go.mod +++ b/service/codeartifact/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codeartifact go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e898f64d25b 100644 --- a/service/codebuild/endpoints.go +++ b/service/codebuild/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codebuild/go.mod b/service/codebuild/go.mod index b866e37b40e..e9d6f815952 100644 --- a/service/codebuild/go.mod +++ b/service/codebuild/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codebuild go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c58df4aec8a 100644 --- a/service/codecommit/endpoints.go +++ b/service/codecommit/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codecommit/go.mod b/service/codecommit/go.mod index cca454812d9..dfa0194a284 100644 --- a/service/codecommit/go.mod +++ b/service/codecommit/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codecommit go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..7bfc1660112 100644 --- a/service/codedeploy/endpoints.go +++ b/service/codedeploy/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codedeploy/go.mod b/service/codedeploy/go.mod index 8977d052916..9fcf0a8dfe0 100644 --- a/service/codedeploy/go.mod +++ b/service/codedeploy/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codedeploy go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..58b94b56119 100644 --- a/service/codeguruprofiler/endpoints.go +++ b/service/codeguruprofiler/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codeguruprofiler/go.mod b/service/codeguruprofiler/go.mod index eabf819d3f4..3acaf08d50b 100644 --- a/service/codeguruprofiler/go.mod +++ b/service/codeguruprofiler/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codeguruprofiler go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..69a02a7e97c 100644 --- a/service/codegurureviewer/endpoints.go +++ b/service/codegurureviewer/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codegurureviewer/go.mod b/service/codegurureviewer/go.mod index e0bd8b799fa..71cfbeedae6 100644 --- a/service/codegurureviewer/go.mod +++ b/service/codegurureviewer/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codegurureviewer go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..9f30714ac61 100644 --- a/service/codepipeline/endpoints.go +++ b/service/codepipeline/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codepipeline/go.mod b/service/codepipeline/go.mod index 7d05d93f558..ed2abc56b29 100644 --- a/service/codepipeline/go.mod +++ b/service/codepipeline/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codepipeline go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..207b4d60a11 100644 --- a/service/codestar/endpoints.go +++ b/service/codestar/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codestar/go.mod b/service/codestar/go.mod index 152a9399509..6a83b6d4f93 100644 --- a/service/codestar/go.mod +++ b/service/codestar/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codestar go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..db182567d4a 100644 --- a/service/codestarconnections/endpoints.go +++ b/service/codestarconnections/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codestarconnections/go.mod b/service/codestarconnections/go.mod index d85eed10beb..0a3e16976a2 100644 --- a/service/codestarconnections/go.mod +++ b/service/codestarconnections/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codestarconnections go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1ddf06bd8af 100644 --- a/service/codestarnotifications/endpoints.go +++ b/service/codestarnotifications/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/codestarnotifications/go.mod b/service/codestarnotifications/go.mod index 50d9ce547d3..9eed3a1786d 100644 --- a/service/codestarnotifications/go.mod +++ b/service/codestarnotifications/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/codestarnotifications go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..3dd50895bff 100644 --- a/service/cognitoidentity/endpoints.go +++ b/service/cognitoidentity/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cognitoidentity/go.mod b/service/cognitoidentity/go.mod index e6c0bab1b16..d0095aa2229 100644 --- a/service/cognitoidentity/go.mod +++ b/service/cognitoidentity/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cognitoidentity go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c422512cb69 100644 --- a/service/cognitoidentityprovider/endpoints.go +++ b/service/cognitoidentityprovider/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cognitoidentityprovider/go.mod b/service/cognitoidentityprovider/go.mod index ecf0e215132..4c42c87c9fe 100644 --- a/service/cognitoidentityprovider/go.mod +++ b/service/cognitoidentityprovider/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1b9a60b1208 100644 --- a/service/cognitosync/endpoints.go +++ b/service/cognitosync/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/cognitosync/go.mod b/service/cognitosync/go.mod index bbc58535134..e45ab47d397 100644 --- a/service/cognitosync/go.mod +++ b/service/cognitosync/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/cognitosync go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1f3288ff1ea 100644 --- a/service/comprehend/endpoints.go +++ b/service/comprehend/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/comprehend/go.mod b/service/comprehend/go.mod index c6571b334ea..504adffee2f 100644 --- a/service/comprehend/go.mod +++ b/service/comprehend/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/comprehend go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a5cb5417fcd 100644 --- a/service/comprehendmedical/endpoints.go +++ b/service/comprehendmedical/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/comprehendmedical/go.mod b/service/comprehendmedical/go.mod index a898522c5c2..b7255e2abdb 100644 --- a/service/comprehendmedical/go.mod +++ b/service/comprehendmedical/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/comprehendmedical go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2b8494d7432 100644 --- a/service/computeoptimizer/endpoints.go +++ b/service/computeoptimizer/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/computeoptimizer/go.mod b/service/computeoptimizer/go.mod index f1fd87e3c85..738040200d6 100644 --- a/service/computeoptimizer/go.mod +++ b/service/computeoptimizer/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/computeoptimizer go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c50df9dfd5c 100644 --- a/service/configservice/endpoints.go +++ b/service/configservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/configservice/go.mod b/service/configservice/go.mod index 8ec5384e246..85469af4cf2 100644 --- a/service/configservice/go.mod +++ b/service/configservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/configservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c9d21e1d025 100644 --- a/service/connect/endpoints.go +++ b/service/connect/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/connect/go.mod b/service/connect/go.mod index 34c0abc34ec..cefbb3d03dd 100644 --- a/service/connect/go.mod +++ b/service/connect/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/connect go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..bd1b50f20e3 100644 --- a/service/connectcontactlens/endpoints.go +++ b/service/connectcontactlens/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/connectcontactlens/go.mod b/service/connectcontactlens/go.mod index 865dea14ba4..25074f9f787 100644 --- a/service/connectcontactlens/go.mod +++ b/service/connectcontactlens/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/connectcontactlens go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a24cd5408b0 100644 --- a/service/connectparticipant/endpoints.go +++ b/service/connectparticipant/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/connectparticipant/go.mod b/service/connectparticipant/go.mod index de630862fa9..7c88395e6ec 100644 --- a/service/connectparticipant/go.mod +++ b/service/connectparticipant/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/connectparticipant go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a6e3e499a83 100644 --- a/service/costandusagereportservice/endpoints.go +++ b/service/costandusagereportservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/costandusagereportservice/go.mod b/service/costandusagereportservice/go.mod index f81d8e8a246..bba7688684d 100644 --- a/service/costandusagereportservice/go.mod +++ b/service/costandusagereportservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/costandusagereportservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a1f14918584 100644 --- a/service/costexplorer/endpoints.go +++ b/service/costexplorer/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/costexplorer/go.mod b/service/costexplorer/go.mod index 02c0ffcb743..d2a430b44cb 100644 --- a/service/costexplorer/go.mod +++ b/service/costexplorer/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/costexplorer go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..93f0574a804 100644 --- a/service/customerprofiles/endpoints.go +++ b/service/customerprofiles/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/customerprofiles/go.mod b/service/customerprofiles/go.mod index 2656586b1db..2bd101f4f5c 100644 --- a/service/customerprofiles/go.mod +++ b/service/customerprofiles/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/customerprofiles go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..176d445b989 100644 --- a/service/databasemigrationservice/endpoints.go +++ b/service/databasemigrationservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/databasemigrationservice/go.mod b/service/databasemigrationservice/go.mod index 84495e69c9e..a252a5355a7 100644 --- a/service/databasemigrationservice/go.mod +++ b/service/databasemigrationservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/databasemigrationservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..2caff69ac84 100644 --- a/service/databrew/endpoints.go +++ b/service/databrew/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/databrew/go.mod b/service/databrew/go.mod index d13254dd6da..94ad900fe7f 100644 --- a/service/databrew/go.mod +++ b/service/databrew/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/databrew go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..45813de442a 100644 --- a/service/dataexchange/endpoints.go +++ b/service/dataexchange/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dataexchange/go.mod b/service/dataexchange/go.mod index be24810d835..25da0741781 100644 --- a/service/dataexchange/go.mod +++ b/service/dataexchange/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/dataexchange go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a06627d64c0 100644 --- a/service/datapipeline/endpoints.go +++ b/service/datapipeline/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/datapipeline/go.mod b/service/datapipeline/go.mod index 4ff8ca0176c..77901f57308 100644 --- a/service/datapipeline/go.mod +++ b/service/datapipeline/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/datapipeline go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c39b366834e 100644 --- a/service/datasync/endpoints.go +++ b/service/datasync/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/datasync/go.mod b/service/datasync/go.mod index 9021c2476a0..e121758c348 100644 --- a/service/datasync/go.mod +++ b/service/datasync/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/datasync go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d0348e19dce 100644 --- a/service/dax/endpoints.go +++ b/service/dax/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dax/go.mod b/service/dax/go.mod index abce12d15f6..1b3eec688f1 100644 --- a/service/dax/go.mod +++ b/service/dax/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/dax go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..69318a04382 100644 --- a/service/detective/endpoints.go +++ b/service/detective/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/detective/go.mod b/service/detective/go.mod index 5dcb99fcd6c..4c17aac9993 100644 --- a/service/detective/go.mod +++ b/service/detective/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/detective go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..da7378a1f97 100644 --- a/service/devicefarm/endpoints.go +++ b/service/devicefarm/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/devicefarm/go.mod b/service/devicefarm/go.mod index 9cd1e2587d0..18f72e47c2f 100644 --- a/service/devicefarm/go.mod +++ b/service/devicefarm/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/devicefarm go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..29bd736915b 100644 --- a/service/devopsguru/endpoints.go +++ b/service/devopsguru/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/devopsguru/go.mod b/service/devopsguru/go.mod index b0c3637555f..3ef391b0ab3 100644 --- a/service/devopsguru/go.mod +++ b/service/devopsguru/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/devopsguru go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..47f93e7cab8 100644 --- a/service/directconnect/endpoints.go +++ b/service/directconnect/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/directconnect/go.mod b/service/directconnect/go.mod index b4a84feb858..7c66cfaef7a 100644 --- a/service/directconnect/go.mod +++ b/service/directconnect/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/directconnect go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c29013b7b2b 100644 --- a/service/directoryservice/endpoints.go +++ b/service/directoryservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/directoryservice/go.mod b/service/directoryservice/go.mod index c87bf4b6efd..560f3c44e68 100644 --- a/service/directoryservice/go.mod +++ b/service/directoryservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/directoryservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..080edda7956 100644 --- a/service/dlm/endpoints.go +++ b/service/dlm/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dlm/go.mod b/service/dlm/go.mod index 49f1c35dc9f..5d89674ce5e 100644 --- a/service/dlm/go.mod +++ b/service/dlm/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/dlm go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..60c70e63290 100644 --- a/service/docdb/endpoints.go +++ b/service/docdb/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/docdb/go.mod b/service/docdb/go.mod index 2bbf54e87db..cdeff6cde56 100644 --- a/service/docdb/go.mod +++ b/service/docdb/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/docdb go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..2a29dacff24 100644 --- a/service/dynamodb/endpoints.go +++ b/service/dynamodb/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dynamodb/go.mod b/service/dynamodb/go.mod index 633aa63caec..414f91a63d4 100644 --- a/service/dynamodb/go.mod +++ b/service/dynamodb/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/dynamodb go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.0.0 github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 diff --git a/service/dynamodb/go.sum b/service/dynamodb/go.sum index a2e42d7c5db..75ee26de8d8 100644 --- a/service/dynamodb/go.sum +++ b/service/dynamodb/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/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..094dba4f67a 100644 --- a/service/dynamodbstreams/endpoints.go +++ b/service/dynamodbstreams/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/dynamodbstreams/go.mod b/service/dynamodbstreams/go.mod index ab1a6d7f256..33679bb45fa 100644 --- a/service/dynamodbstreams/go.mod +++ b/service/dynamodbstreams/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/dynamodbstreams go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1c4a90f4215 100644 --- a/service/ebs/endpoints.go +++ b/service/ebs/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ebs/go.mod b/service/ebs/go.mod index 45fa9f356d3..89c4294cad7 100644 --- a/service/ebs/go.mod +++ b/service/ebs/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ebs go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..166f94fc5d0 100644 --- a/service/ec2/endpoints.go +++ b/service/ec2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ec2/go.mod b/service/ec2/go.mod index ef19533785a..33f9f610ccb 100644 --- a/service/ec2/go.mod +++ b/service/ec2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ec2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0 github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 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..92b2f882f53 100644 --- a/service/ec2instanceconnect/endpoints.go +++ b/service/ec2instanceconnect/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ec2instanceconnect/go.mod b/service/ec2instanceconnect/go.mod index feab6d13ea3..edaced11108 100644 --- a/service/ec2instanceconnect/go.mod +++ b/service/ec2instanceconnect/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ec2instanceconnect go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..0560256f7c6 100644 --- a/service/ecr/endpoints.go +++ b/service/ecr/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ecr/go.mod b/service/ecr/go.mod index 0a6c2a7e60e..b1650fbea1f 100644 --- a/service/ecr/go.mod +++ b/service/ecr/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ecr go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..b56d02d33eb 100644 --- a/service/ecrpublic/endpoints.go +++ b/service/ecrpublic/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ecrpublic/go.mod b/service/ecrpublic/go.mod index abc5965433e..2ebc2917527 100644 --- a/service/ecrpublic/go.mod +++ b/service/ecrpublic/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ecrpublic go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..368333b61c7 100644 --- a/service/ecs/endpoints.go +++ b/service/ecs/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ecs/go.mod b/service/ecs/go.mod index 02eab75fd39..4c9e3aa27e1 100644 --- a/service/ecs/go.mod +++ b/service/ecs/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ecs go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..cb49e291be8 100644 --- a/service/efs/endpoints.go +++ b/service/efs/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/efs/go.mod b/service/efs/go.mod index 5e687a4b049..a0fed59e496 100644 --- a/service/efs/go.mod +++ b/service/efs/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/efs go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..76398c13959 100644 --- a/service/eks/endpoints.go +++ b/service/eks/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/eks/go.mod b/service/eks/go.mod index f81a1c0d576..21ea707c771 100644 --- a/service/eks/go.mod +++ b/service/eks/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/eks go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..f13533468a2 100644 --- a/service/elasticache/endpoints.go +++ b/service/elasticache/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticache/go.mod b/service/elasticache/go.mod index e9530b53c32..45475a29daa 100644 --- a/service/elasticache/go.mod +++ b/service/elasticache/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/elasticache go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..107458aea1a 100644 --- a/service/elasticbeanstalk/endpoints.go +++ b/service/elasticbeanstalk/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticbeanstalk/go.mod b/service/elasticbeanstalk/go.mod index 03d1607c378..3df4488f8fc 100644 --- a/service/elasticbeanstalk/go.mod +++ b/service/elasticbeanstalk/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..b582d923610 100644 --- a/service/elasticinference/endpoints.go +++ b/service/elasticinference/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticinference/go.mod b/service/elasticinference/go.mod index 525998ac46e..0e961f0f41b 100644 --- a/service/elasticinference/go.mod +++ b/service/elasticinference/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/elasticinference go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a04e0f1b8bf 100644 --- a/service/elasticloadbalancing/endpoints.go +++ b/service/elasticloadbalancing/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticloadbalancing/go.mod b/service/elasticloadbalancing/go.mod index 049663a7d53..3804f6b85d6 100644 --- a/service/elasticloadbalancing/go.mod +++ b/service/elasticloadbalancing/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..46a021af441 100644 --- a/service/elasticloadbalancingv2/endpoints.go +++ b/service/elasticloadbalancingv2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticloadbalancingv2/go.mod b/service/elasticloadbalancingv2/go.mod index e956f7b3ddb..d645e55b224 100644 --- a/service/elasticloadbalancingv2/go.mod +++ b/service/elasticloadbalancingv2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a3af037074b 100644 --- a/service/elasticsearchservice/endpoints.go +++ b/service/elasticsearchservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elasticsearchservice/go.mod b/service/elasticsearchservice/go.mod index 8a1a8fd9ad2..dd194b98f1a 100644 --- a/service/elasticsearchservice/go.mod +++ b/service/elasticsearchservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/elasticsearchservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..11ccc71ef3b 100644 --- a/service/elastictranscoder/endpoints.go +++ b/service/elastictranscoder/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/elastictranscoder/go.mod b/service/elastictranscoder/go.mod index 1f47a80712b..475a785019c 100644 --- a/service/elastictranscoder/go.mod +++ b/service/elastictranscoder/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/elastictranscoder go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..ebac0a253e4 100644 --- a/service/emr/endpoints.go +++ b/service/emr/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/emr/go.mod b/service/emr/go.mod index db97a3ba959..9a34d6db012 100644 --- a/service/emr/go.mod +++ b/service/emr/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/emr go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..1ec6ea8e831 100644 --- a/service/emrcontainers/endpoints.go +++ b/service/emrcontainers/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/emrcontainers/go.mod b/service/emrcontainers/go.mod index 1dae42be01c..a6695c8372b 100644 --- a/service/emrcontainers/go.mod +++ b/service/emrcontainers/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/emrcontainers go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..500ec9ded1b 100644 --- a/service/eventbridge/endpoints.go +++ b/service/eventbridge/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/eventbridge/go.mod b/service/eventbridge/go.mod index 9b11d431c41..1de140d4aaa 100644 --- a/service/eventbridge/go.mod +++ b/service/eventbridge/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/eventbridge go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c754c933619 100644 --- a/service/firehose/endpoints.go +++ b/service/firehose/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/firehose/go.mod b/service/firehose/go.mod index 160d88fa954..03d7d7c1b5f 100644 --- a/service/firehose/go.mod +++ b/service/firehose/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/firehose go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..f11f0db27fc 100644 --- a/service/fms/endpoints.go +++ b/service/fms/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/fms/go.mod b/service/fms/go.mod index 1711ac6480d..304d5083d57 100644 --- a/service/fms/go.mod +++ b/service/fms/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/fms go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..ba4f94318c9 100644 --- a/service/forecast/endpoints.go +++ b/service/forecast/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/forecast/go.mod b/service/forecast/go.mod index 2a6b0c023d6..0775f82d0ad 100644 --- a/service/forecast/go.mod +++ b/service/forecast/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/forecast go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..83ecb2f62b0 100644 --- a/service/forecastquery/endpoints.go +++ b/service/forecastquery/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/forecastquery/go.mod b/service/forecastquery/go.mod index 2be617a085b..76d6e287da4 100644 --- a/service/forecastquery/go.mod +++ b/service/forecastquery/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/forecastquery go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..196c36eda2b 100644 --- a/service/frauddetector/endpoints.go +++ b/service/frauddetector/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/frauddetector/go.mod b/service/frauddetector/go.mod index e2355b3d68f..102b7d06e57 100644 --- a/service/frauddetector/go.mod +++ b/service/frauddetector/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/frauddetector go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c2ce8ccb22a 100644 --- a/service/fsx/endpoints.go +++ b/service/fsx/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/fsx/go.mod b/service/fsx/go.mod index 81b8c834702..3428d95758a 100644 --- a/service/fsx/go.mod +++ b/service/fsx/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/fsx go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..51f7e7b3baf 100644 --- a/service/gamelift/endpoints.go +++ b/service/gamelift/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/gamelift/go.mod b/service/gamelift/go.mod index ae9a3176e64..3b9f61b0738 100644 --- a/service/gamelift/go.mod +++ b/service/gamelift/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/gamelift go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c66f5b40384 100644 --- a/service/glacier/endpoints.go +++ b/service/glacier/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/glacier/go.mod b/service/glacier/go.mod index 14061812402..bc0f6f05d7e 100644 --- a/service/glacier/go.mod +++ b/service/glacier/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/glacier go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..7d4d5502562 100644 --- a/service/globalaccelerator/endpoints.go +++ b/service/globalaccelerator/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/globalaccelerator/go.mod b/service/globalaccelerator/go.mod index 9851acce405..f13f7c8801e 100644 --- a/service/globalaccelerator/go.mod +++ b/service/globalaccelerator/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/globalaccelerator go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..269932921f7 100644 --- a/service/glue/endpoints.go +++ b/service/glue/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/glue/go.mod b/service/glue/go.mod index d993e3e65f6..fa7155bad0f 100644 --- a/service/glue/go.mod +++ b/service/glue/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/glue go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..985d32f01e0 100644 --- a/service/greengrass/endpoints.go +++ b/service/greengrass/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/greengrass/go.mod b/service/greengrass/go.mod index 0abb56dc69b..1358d8b4f28 100644 --- a/service/greengrass/go.mod +++ b/service/greengrass/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/greengrass go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..506565a5834 100644 --- a/service/greengrassv2/endpoints.go +++ b/service/greengrassv2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/greengrassv2/go.mod b/service/greengrassv2/go.mod index 02a9fc146dc..1aa75e03054 100644 --- a/service/greengrassv2/go.mod +++ b/service/greengrassv2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/greengrassv2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..53e44328432 100644 --- a/service/groundstation/endpoints.go +++ b/service/groundstation/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/groundstation/go.mod b/service/groundstation/go.mod index af36d8d8507..c393f3b21d9 100644 --- a/service/groundstation/go.mod +++ b/service/groundstation/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/groundstation go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..5c83095c99b 100644 --- a/service/guardduty/endpoints.go +++ b/service/guardduty/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/guardduty/go.mod b/service/guardduty/go.mod index f2e6ef6a535..ff5468e9dc1 100644 --- a/service/guardduty/go.mod +++ b/service/guardduty/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/guardduty go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..4ab27290a92 100644 --- a/service/health/endpoints.go +++ b/service/health/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/health/go.mod b/service/health/go.mod index f15246c8bda..91cb8896641 100644 --- a/service/health/go.mod +++ b/service/health/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/health go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e54edf0d84d 100644 --- a/service/healthlake/endpoints.go +++ b/service/healthlake/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/healthlake/go.mod b/service/healthlake/go.mod index 529603f1de4..f5928e499c6 100644 --- a/service/healthlake/go.mod +++ b/service/healthlake/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/healthlake go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1ee2d0d1596 100644 --- a/service/honeycode/endpoints.go +++ b/service/honeycode/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/honeycode/go.mod b/service/honeycode/go.mod index 56bc535c9d3..1d8e64b29e9 100644 --- a/service/honeycode/go.mod +++ b/service/honeycode/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/honeycode go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d0c2948318d 100644 --- a/service/iam/endpoints.go +++ b/service/iam/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iam/go.mod b/service/iam/go.mod index aa0a4a8656c..f8f84055525 100644 --- a/service/iam/go.mod +++ b/service/iam/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iam go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..054f4c07232 100644 --- a/service/identitystore/endpoints.go +++ b/service/identitystore/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/identitystore/go.mod b/service/identitystore/go.mod index 7cfa292ec8d..cfbdb1118f8 100644 --- a/service/identitystore/go.mod +++ b/service/identitystore/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/identitystore go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..714493c0b82 100644 --- a/service/imagebuilder/endpoints.go +++ b/service/imagebuilder/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/imagebuilder/go.mod b/service/imagebuilder/go.mod index f7d73cbaeda..ac378b50131 100644 --- a/service/imagebuilder/go.mod +++ b/service/imagebuilder/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/imagebuilder go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..163db93acab 100644 --- a/service/inspector/endpoints.go +++ b/service/inspector/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/inspector/go.mod b/service/inspector/go.mod index 539df027869..615aa707b41 100644 --- a/service/inspector/go.mod +++ b/service/inspector/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/inspector go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..820115f440d 100644 --- a/service/internal/benchmark/go.mod +++ b/service/internal/benchmark/go.mod @@ -4,11 +4,10 @@ go 1.15 require ( github.com/aws/aws-sdk-go v1.34.33 - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f 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..0bdf9b2c51f 100644 --- a/service/internal/integrationtest/go.mod +++ b/service/internal/integrationtest/go.mod @@ -1,7 +1,7 @@ module github.com/aws/aws-sdk-go-v2/service/internal/integrationtest require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/config v1.0.0 github.com/aws/aws-sdk-go-v2/service/acm v1.0.0 github.com/aws/aws-sdk-go-v2/service/apigateway v1.0.0 @@ -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..187a5b34d91 100644 --- a/service/iot/endpoints.go +++ b/service/iot/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iot/go.mod b/service/iot/go.mod index ace394f0f5e..4d7af944844 100644 --- a/service/iot/go.mod +++ b/service/iot/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iot go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..3e21d7942d9 100644 --- a/service/iot1clickdevicesservice/endpoints.go +++ b/service/iot1clickdevicesservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iot1clickdevicesservice/go.mod b/service/iot1clickdevicesservice/go.mod index e773bd025db..6c6f8486f62 100644 --- a/service/iot1clickdevicesservice/go.mod +++ b/service/iot1clickdevicesservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..4751464ee3c 100644 --- a/service/iot1clickprojects/endpoints.go +++ b/service/iot1clickprojects/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iot1clickprojects/go.mod b/service/iot1clickprojects/go.mod index ff9361194e3..622d78a66e4 100644 --- a/service/iot1clickprojects/go.mod +++ b/service/iot1clickprojects/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iot1clickprojects go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..be9601c26b9 100644 --- a/service/iotanalytics/endpoints.go +++ b/service/iotanalytics/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotanalytics/go.mod b/service/iotanalytics/go.mod index 5bd462363a1..edffc02af8c 100644 --- a/service/iotanalytics/go.mod +++ b/service/iotanalytics/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotanalytics go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d395464ad03 100644 --- a/service/iotdataplane/endpoints.go +++ b/service/iotdataplane/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotdataplane/go.mod b/service/iotdataplane/go.mod index e3a4991c894..f1c7d2535fb 100644 --- a/service/iotdataplane/go.mod +++ b/service/iotdataplane/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotdataplane go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e49cf51c58f 100644 --- a/service/iotdeviceadvisor/endpoints.go +++ b/service/iotdeviceadvisor/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotdeviceadvisor/go.mod b/service/iotdeviceadvisor/go.mod index afe26eada1d..340e5619fc0 100644 --- a/service/iotdeviceadvisor/go.mod +++ b/service/iotdeviceadvisor/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotdeviceadvisor go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..61740ac36fe 100644 --- a/service/iotevents/endpoints.go +++ b/service/iotevents/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotevents/go.mod b/service/iotevents/go.mod index 8b95f94b968..32da3a2d6af 100644 --- a/service/iotevents/go.mod +++ b/service/iotevents/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotevents go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..756643e07e2 100644 --- a/service/ioteventsdata/endpoints.go +++ b/service/ioteventsdata/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ioteventsdata/go.mod b/service/ioteventsdata/go.mod index 4971f77b39b..1ef68a36cb8 100644 --- a/service/ioteventsdata/go.mod +++ b/service/ioteventsdata/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ioteventsdata go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..bb0ea0aa847 100644 --- a/service/iotfleethub/endpoints.go +++ b/service/iotfleethub/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotfleethub/go.mod b/service/iotfleethub/go.mod index 0b222785c2b..40e6e597767 100644 --- a/service/iotfleethub/go.mod +++ b/service/iotfleethub/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotfleethub go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..036715d7bb7 100644 --- a/service/iotjobsdataplane/endpoints.go +++ b/service/iotjobsdataplane/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotjobsdataplane/go.mod b/service/iotjobsdataplane/go.mod index b5251c80405..b4b10ac2ac4 100644 --- a/service/iotjobsdataplane/go.mod +++ b/service/iotjobsdataplane/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotjobsdataplane go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..abe087449cd 100644 --- a/service/iotsecuretunneling/endpoints.go +++ b/service/iotsecuretunneling/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotsecuretunneling/go.mod b/service/iotsecuretunneling/go.mod index ab95d4fc058..ba142d89835 100644 --- a/service/iotsecuretunneling/go.mod +++ b/service/iotsecuretunneling/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotsecuretunneling go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..53e9a0a1b20 100644 --- a/service/iotsitewise/endpoints.go +++ b/service/iotsitewise/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotsitewise/go.mod b/service/iotsitewise/go.mod index be240294ff9..5602401579e 100644 --- a/service/iotsitewise/go.mod +++ b/service/iotsitewise/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotsitewise go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..6455b7f7761 100644 --- a/service/iotthingsgraph/endpoints.go +++ b/service/iotthingsgraph/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotthingsgraph/go.mod b/service/iotthingsgraph/go.mod index dab5f249e82..933c82af221 100644 --- a/service/iotthingsgraph/go.mod +++ b/service/iotthingsgraph/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotthingsgraph go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..56a9091690f 100644 --- a/service/iotwireless/endpoints.go +++ b/service/iotwireless/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/iotwireless/go.mod b/service/iotwireless/go.mod index d1f09fc4256..66d64f06fd9 100644 --- a/service/iotwireless/go.mod +++ b/service/iotwireless/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/iotwireless go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..0247781b8cc 100644 --- a/service/ivs/endpoints.go +++ b/service/ivs/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ivs/go.mod b/service/ivs/go.mod index b040d0bc2cb..90c1e8ede83 100644 --- a/service/ivs/go.mod +++ b/service/ivs/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ivs go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..5d2d86d8fec 100644 --- a/service/kafka/endpoints.go +++ b/service/kafka/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kafka/go.mod b/service/kafka/go.mod index 1b417b296cc..312a0243751 100644 --- a/service/kafka/go.mod +++ b/service/kafka/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kafka go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..5ee8b33652f 100644 --- a/service/kendra/endpoints.go +++ b/service/kendra/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kendra/go.mod b/service/kendra/go.mod index 6fcc27202fd..62c42f4a8d4 100644 --- a/service/kendra/go.mod +++ b/service/kendra/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kendra go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c2291838a96 100644 --- a/service/kinesis/endpoints.go +++ b/service/kinesis/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesis/go.mod b/service/kinesis/go.mod index 971c6c89509..e6f8a91215e 100644 --- a/service/kinesis/go.mod +++ b/service/kinesis/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kinesis go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..0b52b16547e 100644 --- a/service/kinesisanalytics/endpoints.go +++ b/service/kinesisanalytics/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisanalytics/go.mod b/service/kinesisanalytics/go.mod index 85646b1274f..00ff3bc1496 100644 --- a/service/kinesisanalytics/go.mod +++ b/service/kinesisanalytics/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kinesisanalytics go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..faae17039b9 100644 --- a/service/kinesisanalyticsv2/endpoints.go +++ b/service/kinesisanalyticsv2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisanalyticsv2/go.mod b/service/kinesisanalyticsv2/go.mod index 701b5c0130e..03d8b8b89d1 100644 --- a/service/kinesisanalyticsv2/go.mod +++ b/service/kinesisanalyticsv2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kinesisanalyticsv2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..799dec4d6cb 100644 --- a/service/kinesisvideo/endpoints.go +++ b/service/kinesisvideo/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideo/go.mod b/service/kinesisvideo/go.mod index 88ea4be6a52..fc5278e4dc2 100644 --- a/service/kinesisvideo/go.mod +++ b/service/kinesisvideo/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kinesisvideo go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e93fac68bcb 100644 --- a/service/kinesisvideoarchivedmedia/endpoints.go +++ b/service/kinesisvideoarchivedmedia/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideoarchivedmedia/go.mod b/service/kinesisvideoarchivedmedia/go.mod index 4db46621634..ec5a8f85ca9 100644 --- a/service/kinesisvideoarchivedmedia/go.mod +++ b/service/kinesisvideoarchivedmedia/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kinesisvideoarchivedmedia go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2df69912443 100644 --- a/service/kinesisvideomedia/endpoints.go +++ b/service/kinesisvideomedia/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideomedia/go.mod b/service/kinesisvideomedia/go.mod index f08b8643af3..c1aeceeeef4 100644 --- a/service/kinesisvideomedia/go.mod +++ b/service/kinesisvideomedia/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kinesisvideomedia go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..67a2bfe5c7e 100644 --- a/service/kinesisvideosignaling/endpoints.go +++ b/service/kinesisvideosignaling/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kinesisvideosignaling/go.mod b/service/kinesisvideosignaling/go.mod index 1ac07017800..8960bb5264b 100644 --- a/service/kinesisvideosignaling/go.mod +++ b/service/kinesisvideosignaling/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kinesisvideosignaling go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..419cb794ada 100644 --- a/service/kms/endpoints.go +++ b/service/kms/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/kms/go.mod b/service/kms/go.mod index 2563634ee52..165d61631ef 100644 --- a/service/kms/go.mod +++ b/service/kms/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/kms go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d424a2e74d4 100644 --- a/service/lakeformation/endpoints.go +++ b/service/lakeformation/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lakeformation/go.mod b/service/lakeformation/go.mod index 0edf19b7cc2..a561f2c7dd6 100644 --- a/service/lakeformation/go.mod +++ b/service/lakeformation/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/lakeformation go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..11d7b6a2dc7 100644 --- a/service/lambda/endpoints.go +++ b/service/lambda/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lambda/go.mod b/service/lambda/go.mod index 8fcf4d9a24d..63fe7a18b05 100644 --- a/service/lambda/go.mod +++ b/service/lambda/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/lambda go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..0aab2ae852e 100644 --- a/service/lexmodelbuildingservice/endpoints.go +++ b/service/lexmodelbuildingservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lexmodelbuildingservice/go.mod b/service/lexmodelbuildingservice/go.mod index 9d0076960fe..1107a81067f 100644 --- a/service/lexmodelbuildingservice/go.mod +++ b/service/lexmodelbuildingservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..8a4e732de51 100644 --- a/service/lexruntimeservice/endpoints.go +++ b/service/lexruntimeservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lexruntimeservice/go.mod b/service/lexruntimeservice/go.mod index d3e55eecf7b..c2ec8a11443 100644 --- a/service/lexruntimeservice/go.mod +++ b/service/lexruntimeservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/lexruntimeservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..4102e8aa71a 100644 --- a/service/licensemanager/endpoints.go +++ b/service/licensemanager/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/licensemanager/go.mod b/service/licensemanager/go.mod index c233872abd9..6d60446ddab 100644 --- a/service/licensemanager/go.mod +++ b/service/licensemanager/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/licensemanager go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..02c6530ddc0 100644 --- a/service/lightsail/endpoints.go +++ b/service/lightsail/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lightsail/go.mod b/service/lightsail/go.mod index 32f36f920c6..19ab4b78353 100644 --- a/service/lightsail/go.mod +++ b/service/lightsail/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/lightsail go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..61cf8fb1ab5 100644 --- a/service/lookoutvision/endpoints.go +++ b/service/lookoutvision/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/lookoutvision/go.mod b/service/lookoutvision/go.mod index 9a6ac7846a5..1e23c01d829 100644 --- a/service/lookoutvision/go.mod +++ b/service/lookoutvision/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/lookoutvision go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a4564c156f6 100644 --- a/service/machinelearning/endpoints.go +++ b/service/machinelearning/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/machinelearning/go.mod b/service/machinelearning/go.mod index f4388e92b2f..a2ad8972fe8 100644 --- a/service/machinelearning/go.mod +++ b/service/machinelearning/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/machinelearning go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..fe2f0d5948c 100644 --- a/service/macie/endpoints.go +++ b/service/macie/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/macie/go.mod b/service/macie/go.mod index bd2cd735562..6a186fc790f 100644 --- a/service/macie/go.mod +++ b/service/macie/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/macie go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..9164a8b1da3 100644 --- a/service/macie2/endpoints.go +++ b/service/macie2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/macie2/go.mod b/service/macie2/go.mod index c9d51e946d9..b5f326dbfd3 100644 --- a/service/macie2/go.mod +++ b/service/macie2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/macie2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2b2eb2c6253 100644 --- a/service/managedblockchain/endpoints.go +++ b/service/managedblockchain/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/managedblockchain/go.mod b/service/managedblockchain/go.mod index c1e3121c44d..ca08e527695 100644 --- a/service/managedblockchain/go.mod +++ b/service/managedblockchain/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/managedblockchain go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..bb3a80889cf 100644 --- a/service/marketplacecatalog/endpoints.go +++ b/service/marketplacecatalog/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplacecatalog/go.mod b/service/marketplacecatalog/go.mod index 559f0c0c8ac..0162724eb7a 100644 --- a/service/marketplacecatalog/go.mod +++ b/service/marketplacecatalog/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/marketplacecatalog go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1b33d5780aa 100644 --- a/service/marketplacecommerceanalytics/endpoints.go +++ b/service/marketplacecommerceanalytics/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplacecommerceanalytics/go.mod b/service/marketplacecommerceanalytics/go.mod index 9969ff6e92f..d0e8e8fabda 100644 --- a/service/marketplacecommerceanalytics/go.mod +++ b/service/marketplacecommerceanalytics/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/marketplacecommerceanalytics go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..f044b0e8b12 100644 --- a/service/marketplaceentitlementservice/endpoints.go +++ b/service/marketplaceentitlementservice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplaceentitlementservice/go.mod b/service/marketplaceentitlementservice/go.mod index 2119b72c11b..d06094fb6a8 100644 --- a/service/marketplaceentitlementservice/go.mod +++ b/service/marketplaceentitlementservice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/marketplaceentitlementservice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..891c1f603f1 100644 --- a/service/marketplacemetering/endpoints.go +++ b/service/marketplacemetering/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/marketplacemetering/go.mod b/service/marketplacemetering/go.mod index 3cc7eacf303..e997a9e2ab2 100644 --- a/service/marketplacemetering/go.mod +++ b/service/marketplacemetering/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/marketplacemetering go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..09c486bcf7e 100644 --- a/service/mediaconnect/endpoints.go +++ b/service/mediaconnect/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediaconnect/go.mod b/service/mediaconnect/go.mod index cb7b4887532..813a9035c04 100644 --- a/service/mediaconnect/go.mod +++ b/service/mediaconnect/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mediaconnect go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..ddadb6bf304 100644 --- a/service/mediaconvert/endpoints.go +++ b/service/mediaconvert/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediaconvert/go.mod b/service/mediaconvert/go.mod index 25c413b3dd7..8cee0e605ee 100644 --- a/service/mediaconvert/go.mod +++ b/service/mediaconvert/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mediaconvert go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..65c8eec8d17 100644 --- a/service/medialive/endpoints.go +++ b/service/medialive/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/medialive/go.mod b/service/medialive/go.mod index b3d120fc857..528153930e6 100644 --- a/service/medialive/go.mod +++ b/service/medialive/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/medialive go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..326d47e5cc0 100644 --- a/service/mediapackage/endpoints.go +++ b/service/mediapackage/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediapackage/go.mod b/service/mediapackage/go.mod index b92fd7f406b..61df6812d26 100644 --- a/service/mediapackage/go.mod +++ b/service/mediapackage/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mediapackage go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..73bb05dcf10 100644 --- a/service/mediapackagevod/endpoints.go +++ b/service/mediapackagevod/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediapackagevod/go.mod b/service/mediapackagevod/go.mod index b41b656f3d4..fffb498f882 100644 --- a/service/mediapackagevod/go.mod +++ b/service/mediapackagevod/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mediapackagevod go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..40cb1d97c47 100644 --- a/service/mediastore/endpoints.go +++ b/service/mediastore/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediastore/go.mod b/service/mediastore/go.mod index 549b8d8dabc..be60cdb6d57 100644 --- a/service/mediastore/go.mod +++ b/service/mediastore/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mediastore go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..3ff97964f56 100644 --- a/service/mediastoredata/endpoints.go +++ b/service/mediastoredata/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediastoredata/go.mod b/service/mediastoredata/go.mod index d7d66929933..8f6693f99d6 100644 --- a/service/mediastoredata/go.mod +++ b/service/mediastoredata/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mediastoredata go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..463cfddbe50 100644 --- a/service/mediatailor/endpoints.go +++ b/service/mediatailor/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mediatailor/go.mod b/service/mediatailor/go.mod index 237a95c37ed..f3a472aafa8 100644 --- a/service/mediatailor/go.mod +++ b/service/mediatailor/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mediatailor go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..26de490e50c 100644 --- a/service/migrationhub/endpoints.go +++ b/service/migrationhub/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/migrationhub/go.mod b/service/migrationhub/go.mod index 33c5b882054..75b5444abb0 100644 --- a/service/migrationhub/go.mod +++ b/service/migrationhub/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/migrationhub go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d4d58e53b16 100644 --- a/service/migrationhubconfig/endpoints.go +++ b/service/migrationhubconfig/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/migrationhubconfig/go.mod b/service/migrationhubconfig/go.mod index bea5c75fe02..4f8bd72db49 100644 --- a/service/migrationhubconfig/go.mod +++ b/service/migrationhubconfig/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/migrationhubconfig go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..560fdbb5acd 100644 --- a/service/mobile/endpoints.go +++ b/service/mobile/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mobile/go.mod b/service/mobile/go.mod index 6201888c8af..e5f978ad41c 100644 --- a/service/mobile/go.mod +++ b/service/mobile/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mobile go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..142a0dd783c 100644 --- a/service/mq/endpoints.go +++ b/service/mq/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mq/go.mod b/service/mq/go.mod index 18fed09c2b7..16bbf91f7ed 100644 --- a/service/mq/go.mod +++ b/service/mq/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mq go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..8cddcfe6c8e 100644 --- a/service/mturk/endpoints.go +++ b/service/mturk/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/mturk/go.mod b/service/mturk/go.mod index 683f893548b..0edf555ac3d 100644 --- a/service/mturk/go.mod +++ b/service/mturk/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/mturk go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..f0125df9a32 100644 --- a/service/neptune/endpoints.go +++ b/service/neptune/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/neptune/go.mod b/service/neptune/go.mod index fd9c8a6a346..b40f620c038 100644 --- a/service/neptune/go.mod +++ b/service/neptune/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/neptune go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..ca8f4a55f35 100644 --- a/service/networkfirewall/endpoints.go +++ b/service/networkfirewall/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/networkfirewall/go.mod b/service/networkfirewall/go.mod index bbdd9eb7d25..8651f90e124 100644 --- a/service/networkfirewall/go.mod +++ b/service/networkfirewall/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/networkfirewall go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..9c13eb5990e 100644 --- a/service/networkmanager/endpoints.go +++ b/service/networkmanager/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/networkmanager/go.mod b/service/networkmanager/go.mod index b36e943d60b..0790ec10d22 100644 --- a/service/networkmanager/go.mod +++ b/service/networkmanager/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/networkmanager go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..58206c33845 100644 --- a/service/opsworks/endpoints.go +++ b/service/opsworks/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/opsworks/go.mod b/service/opsworks/go.mod index ba6b2b75533..62a5873b87a 100644 --- a/service/opsworks/go.mod +++ b/service/opsworks/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/opsworks go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..71ddb7b3a2b 100644 --- a/service/opsworkscm/endpoints.go +++ b/service/opsworkscm/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/opsworkscm/go.mod b/service/opsworkscm/go.mod index 9f828f6c1ae..2f42cf89ac7 100644 --- a/service/opsworkscm/go.mod +++ b/service/opsworkscm/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/opsworkscm go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..b769557beb3 100644 --- a/service/organizations/endpoints.go +++ b/service/organizations/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/organizations/go.mod b/service/organizations/go.mod index b862a78cd0f..19fd54a4d6f 100644 --- a/service/organizations/go.mod +++ b/service/organizations/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/organizations go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..408ccb9dbee 100644 --- a/service/outposts/endpoints.go +++ b/service/outposts/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/outposts/go.mod b/service/outposts/go.mod index 54dc49fe338..31b9fb2549c 100644 --- a/service/outposts/go.mod +++ b/service/outposts/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/outposts go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1d32e00c6c1 100644 --- a/service/personalize/endpoints.go +++ b/service/personalize/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/personalize/go.mod b/service/personalize/go.mod index 69690f85b5e..be55f463f76 100644 --- a/service/personalize/go.mod +++ b/service/personalize/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/personalize go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a8606aacf3f 100644 --- a/service/personalizeevents/endpoints.go +++ b/service/personalizeevents/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/personalizeevents/go.mod b/service/personalizeevents/go.mod index e9003d12636..ffd19193f24 100644 --- a/service/personalizeevents/go.mod +++ b/service/personalizeevents/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/personalizeevents go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..c2a6160427b 100644 --- a/service/personalizeruntime/endpoints.go +++ b/service/personalizeruntime/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/personalizeruntime/go.mod b/service/personalizeruntime/go.mod index 54d787a4600..b4ee0e3b43e 100644 --- a/service/personalizeruntime/go.mod +++ b/service/personalizeruntime/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/personalizeruntime go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..22920f822f1 100644 --- a/service/pi/endpoints.go +++ b/service/pi/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pi/go.mod b/service/pi/go.mod index 011df339071..5c28d71c7c8 100644 --- a/service/pi/go.mod +++ b/service/pi/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/pi go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..63adb361cbb 100644 --- a/service/pinpoint/endpoints.go +++ b/service/pinpoint/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pinpoint/go.mod b/service/pinpoint/go.mod index 52b8cc5d986..e94c5bc47db 100644 --- a/service/pinpoint/go.mod +++ b/service/pinpoint/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/pinpoint go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..b834c5b67e0 100644 --- a/service/pinpointemail/endpoints.go +++ b/service/pinpointemail/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pinpointemail/go.mod b/service/pinpointemail/go.mod index cb6c4799fd9..c7e9e6f1dc4 100644 --- a/service/pinpointemail/go.mod +++ b/service/pinpointemail/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/pinpointemail go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..ee490a88702 100644 --- a/service/pinpointsmsvoice/endpoints.go +++ b/service/pinpointsmsvoice/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pinpointsmsvoice/go.mod b/service/pinpointsmsvoice/go.mod index 93e63138e4e..e51fc03f4ad 100644 --- a/service/pinpointsmsvoice/go.mod +++ b/service/pinpointsmsvoice/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoice go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..90e40a899a8 100644 --- a/service/polly/endpoints.go +++ b/service/polly/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/polly/go.mod b/service/polly/go.mod index 38e94230316..2e2bdf678c8 100644 --- a/service/polly/go.mod +++ b/service/polly/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/polly go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d5696e89a4e 100644 --- a/service/pricing/endpoints.go +++ b/service/pricing/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/pricing/go.mod b/service/pricing/go.mod index 22da1236c35..c00cc373039 100644 --- a/service/pricing/go.mod +++ b/service/pricing/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/pricing go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..d51fe556e71 100644 --- a/service/qldb/endpoints.go +++ b/service/qldb/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/qldb/go.mod b/service/qldb/go.mod index 42dd95ccb17..547846e397a 100644 --- a/service/qldb/go.mod +++ b/service/qldb/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/qldb go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..3bc4b35f648 100644 --- a/service/qldbsession/endpoints.go +++ b/service/qldbsession/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/qldbsession/go.mod b/service/qldbsession/go.mod index 18e9d903427..656e0d511c2 100644 --- a/service/qldbsession/go.mod +++ b/service/qldbsession/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/qldbsession go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e92ce4abc09 100644 --- a/service/quicksight/endpoints.go +++ b/service/quicksight/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/quicksight/go.mod b/service/quicksight/go.mod index 052fa444f9d..7bd3f769647 100644 --- a/service/quicksight/go.mod +++ b/service/quicksight/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/quicksight go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a2e6b402a4c 100644 --- a/service/ram/endpoints.go +++ b/service/ram/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ram/go.mod b/service/ram/go.mod index 17541fc9cf4..1b7aeb3e4a3 100644 --- a/service/ram/go.mod +++ b/service/ram/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ram go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6d6c1d9860d 100644 --- a/service/rds/endpoints.go +++ b/service/rds/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/rds/go.mod b/service/rds/go.mod index f7f3ec8c113..f6ca9e65bb6 100644 --- a/service/rds/go.mod +++ b/service/rds/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/rds go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0 github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 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..be37e94297c 100644 --- a/service/rdsdata/endpoints.go +++ b/service/rdsdata/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/rdsdata/go.mod b/service/rdsdata/go.mod index 9a4607ddf61..e1c7cb9131c 100644 --- a/service/rdsdata/go.mod +++ b/service/rdsdata/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/rdsdata go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2227116aaa5 100644 --- a/service/redshift/endpoints.go +++ b/service/redshift/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/redshift/go.mod b/service/redshift/go.mod index 508a4fed0fb..791690c0b2a 100644 --- a/service/redshift/go.mod +++ b/service/redshift/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/redshift go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..8dc683a832c 100644 --- a/service/redshiftdata/endpoints.go +++ b/service/redshiftdata/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/redshiftdata/go.mod b/service/redshiftdata/go.mod index e42a54f36a6..fc95e1c203e 100644 --- a/service/redshiftdata/go.mod +++ b/service/redshiftdata/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/redshiftdata go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..f0885808743 100644 --- a/service/rekognition/endpoints.go +++ b/service/rekognition/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/rekognition/go.mod b/service/rekognition/go.mod index 03d33a62224..ced2c190536 100644 --- a/service/rekognition/go.mod +++ b/service/rekognition/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/rekognition go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..85393934d27 100644 --- a/service/resourcegroups/endpoints.go +++ b/service/resourcegroups/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/resourcegroups/go.mod b/service/resourcegroups/go.mod index 7ed3dec2efd..e7139881611 100644 --- a/service/resourcegroups/go.mod +++ b/service/resourcegroups/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/resourcegroups go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2939c372569 100644 --- a/service/resourcegroupstaggingapi/endpoints.go +++ b/service/resourcegroupstaggingapi/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/resourcegroupstaggingapi/go.mod b/service/resourcegroupstaggingapi/go.mod index 9a1268ec272..553e2db29a2 100644 --- a/service/resourcegroupstaggingapi/go.mod +++ b/service/resourcegroupstaggingapi/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..ddf627fb5f1 100644 --- a/service/robomaker/endpoints.go +++ b/service/robomaker/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/robomaker/go.mod b/service/robomaker/go.mod index 5174e2ebeef..3e8d7e5cbe1 100644 --- a/service/robomaker/go.mod +++ b/service/robomaker/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/robomaker go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a107e4b1c5e 100644 --- a/service/route53/endpoints.go +++ b/service/route53/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/route53/go.mod b/service/route53/go.mod index bf999d6832b..bb4f846e140 100644 --- a/service/route53/go.mod +++ b/service/route53/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/route53 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..5dea72b9b28 100644 --- a/service/route53domains/endpoints.go +++ b/service/route53domains/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/route53domains/go.mod b/service/route53domains/go.mod index 327645be0a8..703989be2ca 100644 --- a/service/route53domains/go.mod +++ b/service/route53domains/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/route53domains go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..8c49f8fe5c1 100644 --- a/service/route53resolver/endpoints.go +++ b/service/route53resolver/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/route53resolver/go.mod b/service/route53resolver/go.mod index df4edfb0921..95fbddd5c3c 100644 --- a/service/route53resolver/go.mod +++ b/service/route53resolver/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/route53resolver go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e8030225647 100644 --- a/service/s3/endpoints.go +++ b/service/s3/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/s3/go.mod b/service/s3/go.mod index 8f50b28e29d..fceefa4a0ab 100644 --- a/service/s3/go.mod +++ b/service/s3/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/s3 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f 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 diff --git a/service/s3/go.sum b/service/s3/go.sum index 2051d18c301..b66e1d584b9 100644 --- a/service/s3/go.sum +++ b/service/s3/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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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..8ccffa080f9 100644 --- a/service/s3control/endpoints.go +++ b/service/s3control/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/s3control/go.mod b/service/s3control/go.mod index 26ca66b2907..d45c379a875 100644 --- a/service/s3control/go.mod +++ b/service/s3control/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/s3control go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.0.0 github.com/aws/smithy-go v1.0.0 ) 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..36e5965777e 100644 --- a/service/s3outposts/endpoints.go +++ b/service/s3outposts/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/s3outposts/go.mod b/service/s3outposts/go.mod index 53abcbaee60..67c2cac9664 100644 --- a/service/s3outposts/go.mod +++ b/service/s3outposts/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/s3outposts go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..7b3351a48ae 100644 --- a/service/sagemaker/endpoints.go +++ b/service/sagemaker/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemaker/go.mod b/service/sagemaker/go.mod index 768b0850e8a..ddb6d01d392 100644 --- a/service/sagemaker/go.mod +++ b/service/sagemaker/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sagemaker go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..e6b1b1c9b37 100644 --- a/service/sagemakera2iruntime/endpoints.go +++ b/service/sagemakera2iruntime/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakera2iruntime/go.mod b/service/sagemakera2iruntime/go.mod index ca291f8389e..83f0c3d67a1 100644 --- a/service/sagemakera2iruntime/go.mod +++ b/service/sagemakera2iruntime/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sagemakera2iruntime go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a226a57f57a 100644 --- a/service/sagemakeredge/endpoints.go +++ b/service/sagemakeredge/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakeredge/go.mod b/service/sagemakeredge/go.mod index 912bce948a2..8c59cae198a 100644 --- a/service/sagemakeredge/go.mod +++ b/service/sagemakeredge/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sagemakeredge go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1e83908c216 100644 --- a/service/sagemakerfeaturestoreruntime/endpoints.go +++ b/service/sagemakerfeaturestoreruntime/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakerfeaturestoreruntime/go.mod b/service/sagemakerfeaturestoreruntime/go.mod index b200890b3ed..faed2369b87 100644 --- a/service/sagemakerfeaturestoreruntime/go.mod +++ b/service/sagemakerfeaturestoreruntime/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sagemakerfeaturestoreruntime go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..0f8fd33737e 100644 --- a/service/sagemakerruntime/endpoints.go +++ b/service/sagemakerruntime/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sagemakerruntime/go.mod b/service/sagemakerruntime/go.mod index 77a74245615..fa92d8d82d8 100644 --- a/service/sagemakerruntime/go.mod +++ b/service/sagemakerruntime/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sagemakerruntime go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6e9a01ead66 100644 --- a/service/savingsplans/endpoints.go +++ b/service/savingsplans/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/savingsplans/go.mod b/service/savingsplans/go.mod index 6869df2907e..b572eb6b5b7 100644 --- a/service/savingsplans/go.mod +++ b/service/savingsplans/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/savingsplans go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6a1ca8e106f 100644 --- a/service/schemas/endpoints.go +++ b/service/schemas/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/schemas/go.mod b/service/schemas/go.mod index b1429c3471e..9cf6f26c9da 100644 --- a/service/schemas/go.mod +++ b/service/schemas/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/schemas go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..c1318534563 100644 --- a/service/secretsmanager/endpoints.go +++ b/service/secretsmanager/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/secretsmanager/go.mod b/service/secretsmanager/go.mod index e0d63bbc61d..e472f25f5d5 100644 --- a/service/secretsmanager/go.mod +++ b/service/secretsmanager/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/secretsmanager go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..87f945a980e 100644 --- a/service/securityhub/endpoints.go +++ b/service/securityhub/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/securityhub/go.mod b/service/securityhub/go.mod index 67d7f0d8ef1..2c49f8bd8aa 100644 --- a/service/securityhub/go.mod +++ b/service/securityhub/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/securityhub go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..3808c6e9cc6 100644 --- a/service/serverlessapplicationrepository/endpoints.go +++ b/service/serverlessapplicationrepository/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/serverlessapplicationrepository/go.mod b/service/serverlessapplicationrepository/go.mod index c9cf675434b..c153362a502 100644 --- a/service/serverlessapplicationrepository/go.mod +++ b/service/serverlessapplicationrepository/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..448839fd3a1 100644 --- a/service/servicecatalog/endpoints.go +++ b/service/servicecatalog/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicecatalog/go.mod b/service/servicecatalog/go.mod index 69e8770db5d..a64211a27f6 100644 --- a/service/servicecatalog/go.mod +++ b/service/servicecatalog/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/servicecatalog go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6d455d48c76 100644 --- a/service/servicecatalogappregistry/endpoints.go +++ b/service/servicecatalogappregistry/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicecatalogappregistry/go.mod b/service/servicecatalogappregistry/go.mod index 36c292cafcd..a9bd358b15f 100644 --- a/service/servicecatalogappregistry/go.mod +++ b/service/servicecatalogappregistry/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..053824b93fa 100644 --- a/service/servicediscovery/endpoints.go +++ b/service/servicediscovery/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicediscovery/go.mod b/service/servicediscovery/go.mod index 81005de400a..65cc7e93953 100644 --- a/service/servicediscovery/go.mod +++ b/service/servicediscovery/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/servicediscovery go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e7752b660c9 100644 --- a/service/servicequotas/endpoints.go +++ b/service/servicequotas/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/servicequotas/go.mod b/service/servicequotas/go.mod index e8ec01326b7..ce1597c2478 100644 --- a/service/servicequotas/go.mod +++ b/service/servicequotas/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/servicequotas go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..74c2d6b6d7b 100644 --- a/service/ses/endpoints.go +++ b/service/ses/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ses/go.mod b/service/ses/go.mod index e559a234540..9a111f37fa2 100644 --- a/service/ses/go.mod +++ b/service/ses/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ses go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..8d1073d68ac 100644 --- a/service/sesv2/endpoints.go +++ b/service/sesv2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sesv2/go.mod b/service/sesv2/go.mod index 5497954c28b..534a5a20cc7 100644 --- a/service/sesv2/go.mod +++ b/service/sesv2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sesv2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..920f06c8841 100644 --- a/service/sfn/endpoints.go +++ b/service/sfn/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sfn/go.mod b/service/sfn/go.mod index ff66c2c8ac8..b563c2629cd 100644 --- a/service/sfn/go.mod +++ b/service/sfn/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sfn go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..bd48128be1e 100644 --- a/service/shield/endpoints.go +++ b/service/shield/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/shield/go.mod b/service/shield/go.mod index c3e65359cd6..f1d57d1b303 100644 --- a/service/shield/go.mod +++ b/service/shield/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/shield go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..0d3c922fdc1 100644 --- a/service/signer/endpoints.go +++ b/service/signer/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/signer/go.mod b/service/signer/go.mod index f78f8ce6788..d3ec1724d6d 100644 --- a/service/signer/go.mod +++ b/service/signer/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/signer go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..8888820539b 100644 --- a/service/sms/endpoints.go +++ b/service/sms/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sms/go.mod b/service/sms/go.mod index 6a14ec30944..0d7b472877d 100644 --- a/service/sms/go.mod +++ b/service/sms/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sms go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..28fe53c4f27 100644 --- a/service/snowball/endpoints.go +++ b/service/snowball/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/snowball/go.mod b/service/snowball/go.mod index 75b6a99eb1e..d14e1d618ca 100644 --- a/service/snowball/go.mod +++ b/service/snowball/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/snowball go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..280cdb5b0b0 100644 --- a/service/sns/endpoints.go +++ b/service/sns/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sns/go.mod b/service/sns/go.mod index 88ad12f57c5..4e5bc1cf45a 100644 --- a/service/sns/go.mod +++ b/service/sns/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sns go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..64324305555 100644 --- a/service/sqs/endpoints.go +++ b/service/sqs/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sqs/go.mod b/service/sqs/go.mod index 01583391593..87f40af8c24 100644 --- a/service/sqs/go.mod +++ b/service/sqs/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sqs go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..680c8554687 100644 --- a/service/ssm/endpoints.go +++ b/service/ssm/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ssm/go.mod b/service/ssm/go.mod index 823e020a7a3..1a79abf1dd5 100644 --- a/service/ssm/go.mod +++ b/service/ssm/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ssm go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 github.com/jmespath/go-jmespath v0.4.0 ) 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..6026165c7c0 100644 --- a/service/sso/endpoints.go +++ b/service/sso/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sso/go.mod b/service/sso/go.mod index 7bf0c5987b7..7cc56a3d8ad 100644 --- a/service/sso/go.mod +++ b/service/sso/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sso go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..a4faf5a1a65 100644 --- a/service/ssoadmin/endpoints.go +++ b/service/ssoadmin/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ssoadmin/go.mod b/service/ssoadmin/go.mod index 2d0e9fa95b0..6e4010e060f 100644 --- a/service/ssoadmin/go.mod +++ b/service/ssoadmin/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ssoadmin go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..fafc011faa2 100644 --- a/service/ssooidc/endpoints.go +++ b/service/ssooidc/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/ssooidc/go.mod b/service/ssooidc/go.mod index ac4c330bc4f..7ac11123792 100644 --- a/service/ssooidc/go.mod +++ b/service/ssooidc/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/ssooidc go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2bf04bbc223 100644 --- a/service/storagegateway/endpoints.go +++ b/service/storagegateway/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/storagegateway/go.mod b/service/storagegateway/go.mod index c47f6bd037a..48ab102cdb2 100644 --- a/service/storagegateway/go.mod +++ b/service/storagegateway/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/storagegateway go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..81131c5d9eb 100644 --- a/service/sts/endpoints.go +++ b/service/sts/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/sts/go.mod b/service/sts/go.mod index 3ac111e1337..2da5c8d03cd 100644 --- a/service/sts/go.mod +++ b/service/sts/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/sts go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0 github.com/aws/smithy-go v1.0.0 ) 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..78663941231 100644 --- a/service/support/endpoints.go +++ b/service/support/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/support/go.mod b/service/support/go.mod index a23af41fcb0..95c2c6b7511 100644 --- a/service/support/go.mod +++ b/service/support/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/support go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..4f17cec0b29 100644 --- a/service/swf/endpoints.go +++ b/service/swf/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/swf/go.mod b/service/swf/go.mod index b9965fd007e..6aab8734f45 100644 --- a/service/swf/go.mod +++ b/service/swf/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/swf go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..ef0a109df35 100644 --- a/service/synthetics/endpoints.go +++ b/service/synthetics/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/synthetics/go.mod b/service/synthetics/go.mod index 8b9903d91a2..ba3f7990853 100644 --- a/service/synthetics/go.mod +++ b/service/synthetics/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/synthetics go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6dae2c8dd91 100644 --- a/service/textract/endpoints.go +++ b/service/textract/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/textract/go.mod b/service/textract/go.mod index d00f5df2ad0..56ba3ab0e0c 100644 --- a/service/textract/go.mod +++ b/service/textract/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/textract go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..4ceb6b059ec 100644 --- a/service/timestreamquery/endpoints.go +++ b/service/timestreamquery/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/timestreamquery/go.mod b/service/timestreamquery/go.mod index 10a1974b13e..51b6d2acb52 100644 --- a/service/timestreamquery/go.mod +++ b/service/timestreamquery/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/timestreamquery go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..dde82f6b5ba 100644 --- a/service/timestreamwrite/endpoints.go +++ b/service/timestreamwrite/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/timestreamwrite/go.mod b/service/timestreamwrite/go.mod index 90262881a65..743811df516 100644 --- a/service/timestreamwrite/go.mod +++ b/service/timestreamwrite/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/timestreamwrite go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..151cbb22f6a 100644 --- a/service/transcribe/endpoints.go +++ b/service/transcribe/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/transcribe/go.mod b/service/transcribe/go.mod index ee6362e1550..c736a950198 100644 --- a/service/transcribe/go.mod +++ b/service/transcribe/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/transcribe go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..8b0292df9ec 100644 --- a/service/transfer/endpoints.go +++ b/service/transfer/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/transfer/go.mod b/service/transfer/go.mod index ae273a2b777..a248600a6ea 100644 --- a/service/transfer/go.mod +++ b/service/transfer/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/transfer go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..0f2f1e4152d 100644 --- a/service/translate/endpoints.go +++ b/service/translate/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/translate/go.mod b/service/translate/go.mod index 3911752a171..dd6f544ab82 100644 --- a/service/translate/go.mod +++ b/service/translate/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/translate go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..660cca97baa 100644 --- a/service/waf/endpoints.go +++ b/service/waf/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/waf/go.mod b/service/waf/go.mod index ee566f1adf1..3c52a6357f2 100644 --- a/service/waf/go.mod +++ b/service/waf/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/waf go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..01536882bbd 100644 --- a/service/wafregional/endpoints.go +++ b/service/wafregional/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/wafregional/go.mod b/service/wafregional/go.mod index ed387682da9..4a92fadb1fd 100644 --- a/service/wafregional/go.mod +++ b/service/wafregional/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/wafregional go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..2fdeb68b6ff 100644 --- a/service/wafv2/endpoints.go +++ b/service/wafv2/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/wafv2/go.mod b/service/wafv2/go.mod index bc953e2ddd0..089d5bb1dda 100644 --- a/service/wafv2/go.mod +++ b/service/wafv2/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/wafv2 go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..e76862019d5 100644 --- a/service/wellarchitected/endpoints.go +++ b/service/wellarchitected/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/wellarchitected/go.mod b/service/wellarchitected/go.mod index 6d9bf0a93a2..53fab4c9eb3 100644 --- a/service/wellarchitected/go.mod +++ b/service/wellarchitected/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/wellarchitected go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..1863c7fafef 100644 --- a/service/workdocs/endpoints.go +++ b/service/workdocs/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workdocs/go.mod b/service/workdocs/go.mod index b7e542ea829..7776237a728 100644 --- a/service/workdocs/go.mod +++ b/service/workdocs/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/workdocs go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..32848e81f45 100644 --- a/service/worklink/endpoints.go +++ b/service/worklink/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/worklink/go.mod b/service/worklink/go.mod index cdc0266bafc..68c3758618d 100644 --- a/service/worklink/go.mod +++ b/service/worklink/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/worklink go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6cf16d10ccb 100644 --- a/service/workmail/endpoints.go +++ b/service/workmail/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workmail/go.mod b/service/workmail/go.mod index d988872956f..715979134dc 100644 --- a/service/workmail/go.mod +++ b/service/workmail/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/workmail go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..6e89d4fdddd 100644 --- a/service/workmailmessageflow/endpoints.go +++ b/service/workmailmessageflow/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workmailmessageflow/go.mod b/service/workmailmessageflow/go.mod index 6de64e60cd2..11ba806440a 100644 --- a/service/workmailmessageflow/go.mod +++ b/service/workmailmessageflow/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/workmailmessageflow go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..3028bc45254 100644 --- a/service/workspaces/endpoints.go +++ b/service/workspaces/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/workspaces/go.mod b/service/workspaces/go.mod index 918fee776fb..c03f4922968 100644 --- a/service/workspaces/go.mod +++ b/service/workspaces/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/workspaces go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 ) 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..8b97ab9219e 100644 --- a/service/xray/endpoints.go +++ b/service/xray/endpoints.go @@ -45,6 +45,27 @@ func resolveDefaultEndpointConfiguration(o *Options) { o.EndpointResolver = NewDefaultEndpointResolver() } +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions diff --git a/service/xray/go.mod b/service/xray/go.mod index cc8cac15565..0f220f504bd 100644 --- a/service/xray/go.mod +++ b/service/xray/go.mod @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/xray go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v1.0.0 + github.com/aws/aws-sdk-go-v2 v1.0.1-0.20210122214637-6cf9ad2f8e2f github.com/aws/smithy-go v1.0.0 )