diff --git a/.changes/next-release/config-feature-1610496608654196000.json b/.changes/next-release/config-feature-1610496608654196000.json new file mode 100644 index 00000000000..0557b909dc5 --- /dev/null +++ b/.changes/next-release/config-feature-1610496608654196000.json @@ -0,0 +1,9 @@ +{ + "ID": "config-feature-1610496608654196000", + "SchemaVersion": 1, + "Module": "config", + "Type": "feature", + "Description": "Breaking Change: WithRetryer and LoadOptions has been updated to make Retryer a provider function", + "MinVersion": "", + "AffectedModules": null +} \ No newline at end of file diff --git a/.changes/next-release/credentials-feature-1610496796301711000.json b/.changes/next-release/credentials-feature-1610496796301711000.json new file mode 100644 index 00000000000..8d3b4e8521d --- /dev/null +++ b/.changes/next-release/credentials-feature-1610496796301711000.json @@ -0,0 +1,9 @@ +{ + "ID": "credentials-feature-1610496796301711000", + "SchemaVersion": 1, + "Module": "credentials", + "Type": "feature", + "Description": "endpointcreds Options Retryer member has been updated to be type aws.Retryer", + "MinVersion": "", + "AffectedModules": null +} diff --git a/.changes/next-release/feature.ec2.imds-feature-1610496712636622000.json b/.changes/next-release/feature.ec2.imds-feature-1610496712636622000.json new file mode 100644 index 00000000000..925611e5daa --- /dev/null +++ b/.changes/next-release/feature.ec2.imds-feature-1610496712636622000.json @@ -0,0 +1,9 @@ +{ + "ID": "feature.ec2.imds-feature-1610496712636622000", + "SchemaVersion": 1, + "Module": "feature/ec2/imds", + "Type": "feature", + "Description": "IMDS Client has been updated to utilize the Retryer provider function from aws.Config", + "MinVersion": "", + "AffectedModules": null +} diff --git a/.changes/next-release/service.wildcard-feature-1610496371066060000.json b/.changes/next-release/service.wildcard-feature-1610496371066060000.json new file mode 100644 index 00000000000..3897f1e966d --- /dev/null +++ b/.changes/next-release/service.wildcard-feature-1610496371066060000.json @@ -0,0 +1,260 @@ +{ + "ID": "service.wildcard-feature-1610496371066060000", + "SchemaVersion": 1, + "Module": "service/...", + "Type": "feature", + "Description": "Breaking Change: The Options Retryer memeber has been updated to be type aws.Retryer", + "MinVersion": "", + "AffectedModules": [ + "service/accessanalyzer", + "service/acm", + "service/acmpca", + "service/alexaforbusiness", + "service/amplify", + "service/apigateway", + "service/apigatewaymanagementapi", + "service/apigatewayv2", + "service/appconfig", + "service/appflow", + "service/appintegrations", + "service/applicationautoscaling", + "service/applicationdiscoveryservice", + "service/applicationinsights", + "service/appmesh", + "service/appstream", + "service/appsync", + "service/athena", + "service/auditmanager", + "service/autoscaling", + "service/autoscalingplans", + "service/backup", + "service/batch", + "service/braket", + "service/budgets", + "service/chime", + "service/cloud9", + "service/clouddirectory", + "service/cloudformation", + "service/cloudfront", + "service/cloudhsm", + "service/cloudhsmv2", + "service/cloudsearch", + "service/cloudsearchdomain", + "service/cloudtrail", + "service/cloudwatch", + "service/cloudwatchevents", + "service/cloudwatchlogs", + "service/codeartifact", + "service/codebuild", + "service/codecommit", + "service/codedeploy", + "service/codeguruprofiler", + "service/codegurureviewer", + "service/codepipeline", + "service/codestar", + "service/codestarconnections", + "service/codestarnotifications", + "service/cognitoidentity", + "service/cognitoidentityprovider", + "service/cognitosync", + "service/comprehend", + "service/comprehendmedical", + "service/computeoptimizer", + "service/configservice", + "service/connect", + "service/connectcontactlens", + "service/connectparticipant", + "service/costandusagereportservice", + "service/costexplorer", + "service/customerprofiles", + "service/databasemigrationservice", + "service/databrew", + "service/dataexchange", + "service/datapipeline", + "service/datasync", + "service/dax", + "service/detective", + "service/devicefarm", + "service/devopsguru", + "service/directconnect", + "service/directoryservice", + "service/dlm", + "service/docdb", + "service/dynamodb", + "service/dynamodbstreams", + "service/ebs", + "service/ec2", + "service/ec2instanceconnect", + "service/ecr", + "service/ecrpublic", + "service/ecs", + "service/efs", + "service/eks", + "service/elasticache", + "service/elasticbeanstalk", + "service/elasticinference", + "service/elasticloadbalancing", + "service/elasticloadbalancingv2", + "service/elasticsearchservice", + "service/elastictranscoder", + "service/emr", + "service/emrcontainers", + "service/eventbridge", + "service/firehose", + "service/fms", + "service/forecast", + "service/forecastquery", + "service/frauddetector", + "service/fsx", + "service/gamelift", + "service/glacier", + "service/globalaccelerator", + "service/glue", + "service/greengrass", + "service/greengrassv2", + "service/groundstation", + "service/guardduty", + "service/health", + "service/healthlake", + "service/honeycode", + "service/iam", + "service/identitystore", + "service/imagebuilder", + "service/inspector", + "service/iot", + "service/iot1clickdevicesservice", + "service/iot1clickprojects", + "service/iotanalytics", + "service/iotdataplane", + "service/iotdeviceadvisor", + "service/iotevents", + "service/ioteventsdata", + "service/iotfleethub", + "service/iotjobsdataplane", + "service/iotsecuretunneling", + "service/iotsitewise", + "service/iotthingsgraph", + "service/iotwireless", + "service/ivs", + "service/kafka", + "service/kendra", + "service/kinesis", + "service/kinesisanalytics", + "service/kinesisanalyticsv2", + "service/kinesisvideo", + "service/kinesisvideoarchivedmedia", + "service/kinesisvideomedia", + "service/kinesisvideosignaling", + "service/kms", + "service/lakeformation", + "service/lambda", + "service/lexmodelbuildingservice", + "service/lexruntimeservice", + "service/licensemanager", + "service/lightsail", + "service/lookoutvision", + "service/machinelearning", + "service/macie", + "service/macie2", + "service/managedblockchain", + "service/marketplacecatalog", + "service/marketplacecommerceanalytics", + "service/marketplaceentitlementservice", + "service/marketplacemetering", + "service/mediaconnect", + "service/mediaconvert", + "service/medialive", + "service/mediapackage", + "service/mediapackagevod", + "service/mediastore", + "service/mediastoredata", + "service/mediatailor", + "service/migrationhub", + "service/migrationhubconfig", + "service/mobile", + "service/mq", + "service/mturk", + "service/neptune", + "service/networkfirewall", + "service/networkmanager", + "service/opsworks", + "service/opsworkscm", + "service/organizations", + "service/outposts", + "service/personalize", + "service/personalizeevents", + "service/personalizeruntime", + "service/pi", + "service/pinpoint", + "service/pinpointemail", + "service/pinpointsmsvoice", + "service/polly", + "service/pricing", + "service/qldb", + "service/qldbsession", + "service/quicksight", + "service/ram", + "service/rds", + "service/rdsdata", + "service/redshift", + "service/redshiftdata", + "service/rekognition", + "service/resourcegroups", + "service/resourcegroupstaggingapi", + "service/robomaker", + "service/route53", + "service/route53domains", + "service/route53resolver", + "service/s3", + "service/s3control", + "service/s3outposts", + "service/sagemaker", + "service/sagemakera2iruntime", + "service/sagemakeredge", + "service/sagemakerfeaturestoreruntime", + "service/sagemakerruntime", + "service/savingsplans", + "service/schemas", + "service/secretsmanager", + "service/securityhub", + "service/serverlessapplicationrepository", + "service/servicecatalog", + "service/servicecatalogappregistry", + "service/servicediscovery", + "service/servicequotas", + "service/ses", + "service/sesv2", + "service/sfn", + "service/shield", + "service/signer", + "service/sms", + "service/snowball", + "service/sns", + "service/sqs", + "service/ssm", + "service/sso", + "service/ssoadmin", + "service/ssooidc", + "service/storagegateway", + "service/sts", + "service/support", + "service/swf", + "service/synthetics", + "service/textract", + "service/timestreamquery", + "service/timestreamwrite", + "service/transcribe", + "service/transfer", + "service/translate", + "service/waf", + "service/wafregional", + "service/wafv2", + "service/wellarchitected", + "service/workdocs", + "service/worklink", + "service/workmail", + "service/workmailmessageflow", + "service/workspaces", + "service/xray" + ] +} \ No newline at end of file diff --git a/aws/config.go b/aws/config.go index f2c977e058a..481aa156381 100644 --- a/aws/config.go +++ b/aws/config.go @@ -42,10 +42,15 @@ type Config struct { // service and region Please see the `aws.EndpointResolver` documentation on usage. EndpointResolver EndpointResolver - // Retryer guides how HTTP requests should be retried in case of - // recoverable failures. When nil the API client will use a default + // Retryer is a function that provides a Retryer implementation. A Retryer guides how HTTP requests should be + // retried in case of recoverable failures. When nil the API client will use a default // retryer. - Retryer Retryer + // + // In general, the provider function should return a new instance of a Retyer if you are attempting + // to provide a consistent Retryer configuration across all clients. This will ensure that each client will be + // provided a new instance of the Retryer implementation, and will avoid issues such as sharing the same retry token + // bucket across services. + Retryer func() Retryer // ConfigSources are the sources that were used to construct the Config. // Allows for additional configuration to be loaded by clients. diff --git a/aws/retry/doc.go b/aws/retry/doc.go new file mode 100644 index 00000000000..42ced06e248 --- /dev/null +++ b/aws/retry/doc.go @@ -0,0 +1,80 @@ +// Package retry provides interfaces and implementations for SDK request retry behavior. +// +// Retryer Interface and Implementations +// +// This packages defines Retryer interface that is used to either implement custom retry behavior +// or to extend the existing retry implementations provided by the SDK. This packages provides a single +// retry implementations: Standard. +// +// Standard +// +// Standard is the default retryer implementation used by service clients. The standard retryer is a rate limited +// retryer that has a configurable max attempts to limit the number of retry attempts when a retryable error occurs. +// In addition, the retryer uses a configurable token bucket to rate limit the retry attempts across the client, +// and uses an additional delay policy to limit the time between a requests subsequent attempts. +// +// By default the standard retryer uses the DefaultRetryables slice of IsErrorRetryable types to determine whether +// a given error is retryable. By default this list of retryables includes the following: +// - Retrying errors that implement the RetryableError method, and return true. +// - Connection Errors +// - Errors that implement a ConnectionError, Temporary, or Timeout method that return true. +// - Connection Reset Errors. +// - net.OpErr types that are dialing errors or are temporary. +// - HTTP Status Codes: 500, 502, 503, and 504. +// - API Error Codes +// - RequestTimeout, RequestTimeoutException +// - Throttling, ThrottlingException, ThrottledException, RequestThrottledException, TooManyRequestsException, +// RequestThrottled, SlowDown, EC2ThrottledException +// - ProvisionedThroughputExceededException, RequestLimitExceeded, BandwidthLimitExceeded, LimitExceededException +// - TransactionInProgressException, PriorRequestNotComplete +// +// The standard retryer will not retry a request in the event if the context associated with the request +// has been cancelled. Applications must handle this case explicitly if they wish to retry with a different context +// value. +// +// You can configure the standard retryer implementation to fit your applications by constructing a standard retryer +// using the NewStandard function, and providing one more functional arguments that mutate the StandardOptions +// structure. StandardOptions provides the ability to modify the token bucket rate limiter, retryable error conditions, +// and the retry delay policy. +// +// For example to modify the default retry attempts for the standard retryer: +// +// // configure the custom retryer +// customRetry := retry.NewStandard(func(o *retry.StandardOptions) { +// o.MaxAttempts = 5 +// }) +// +// // create a service client with the retryer +// s3.NewFromConfig(cfg, func(o *s3.Options) { +// o.Retryer = customRetry +// }) +// +// Utilities +// +// A number of package functions have been provided to easily wrap retryer implementations in an implementation agnostic +// way. These are: +// +// AddWithErrorCodes - Provides the ability to add additional API error codes that should be considered retryable +// in addition to those considered retryable by the provided retryer. +// +// AddWithMaxAttempts - Provides the ability to set the max number of attempts for retrying a request by wrapping +// a retryer implementation. +// +// AddWithMaxBackoffDelay - Provides the ability to set the max back off delay that can occur before retrying a +// request by wrapping a retryer implementation. +// +// The following package functions have been provided to easily satisfy different retry interfaces to further customize +// a given retryer's behavior: +// +// BackoffDelayerFunc - Can be used to wrap a function to satisfy the BackoffDelayer interface. For example, +// you can use this method to easily create custom back off policies to be used with the +// standard retryer. +// +// IsErrorRetryableFunc - Can be used to wrap a function to satisfy the IsErrorRetryable interface. For example, +// this can be used to extend the standard retryer to add additional logic ot determine if a +// error should be retried. +// +// IsErrorTimeoutFunc - Can be used to wrap a function to satisfy IsErrorTimeout interface. For example, +// this can be used to extend the standard retryer to add additional logic to determine if an +// error should be considered a timeout. +package retry diff --git a/aws/retry/example_test.go b/aws/retry/example_test.go new file mode 100644 index 00000000000..d135559c858 --- /dev/null +++ b/aws/retry/example_test.go @@ -0,0 +1,87 @@ +package retry_test + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/retry" + config "github.com/aws/aws-sdk-go-v2/aws/retry/internal/mock" + s3 "github.com/aws/aws-sdk-go-v2/aws/retry/internal/mock" + types "github.com/aws/aws-sdk-go-v2/aws/retry/internal/mock" +) + +func Example_overrideForAllClients() { + cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRetryer(func() aws.Retryer { + // Generally you will always want to return new instance of a Retryer. This will avoid a global rate limit + // bucket being shared between across all service clients. + return retry.AddWithMaxBackoffDelay(retry.NewStandard(), time.Second*5) + })) + if err != nil { + log.Fatal(err) + return + } + + client := s3.NewFromConfig(cfg) + _ = client +} + +func Example_overrideForSpecificClient() { + cfg, err := config.LoadDefaultConfig(context.TODO()) + if err != nil { + log.Fatal(err) + return + } + + client := s3.NewFromConfig(cfg, func(options *s3.Options) { + options.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, time.Second*5) + }) + _ = client +} + +func Example_overrideSpecificOperation() { + cfg, err := config.LoadDefaultConfig(context.TODO()) + if err != nil { + log.Fatal(err) + return + } + + client := s3.NewFromConfig(cfg) + + // Wrap the default client retryer with an additional retryable error code for this specific + // operation invocation + _, err = client.GetObject(context.Background(), &s3.GetObjectInput{ + Bucket: aws.String("my-bucket"), + Key: aws.String("my-key"), + }, func(options *types.Options) { + options.Retryer = retry.AddWithErrorCodes(options.Retryer, (*types.NoSuchBucketException)(nil).ErrorCode()) + }) + if err != nil { + log.Fatal(err) + return + } +} + +func ExampleAddWithErrorCodes() { + // Wrap a standard retyer and add the types.NoSuchBucketException Amazon S3 error code as retryable + custom := retry.AddWithErrorCodes(retry.NewStandard(), (*types.NoSuchBucketException)(nil).ErrorCode()) + + fmt.Println(custom.IsErrorRetryable(&types.NoSuchBucketException{})) + // Output: true +} + +func ExampleAddWithMaxAttempts() { + // Wrap a standard retyer and set the max attempts to 5 + custom := retry.AddWithMaxAttempts(retry.NewStandard(), 5) + + fmt.Println(custom.MaxAttempts()) + // Output: 5 +} + +func ExampleAddWithMaxBackoffDelay() { + // Wrap a standard retyer and add tthe NoSuchBucket API error code to the list of retryables + custom := retry.AddWithMaxBackoffDelay(retry.NewStandard(), time.Second*5) + _ = custom +} diff --git a/aws/retry/internal/mock/client.go b/aws/retry/internal/mock/client.go new file mode 100644 index 00000000000..33821dedb6a --- /dev/null +++ b/aws/retry/internal/mock/client.go @@ -0,0 +1,34 @@ +package mock + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// Options is a mock client Options +type Options struct { + Retryer aws.Retryer +} + +// Client is a mock service client +type Client struct{} + +// GetObjectInput is mock input +type GetObjectInput struct { + Bucket *string + Key *string +} + +// GetObjectOutput is mock output +type GetObjectOutput struct{} + +// NewFromConfig is a mock client constructor +func NewFromConfig(aws.Config, ...func(options *Options)) Client { + return Client{} +} + +// GetObject is a mock GetObject API +func (Client) GetObject(context.Context, *GetObjectInput, ...func(*Options)) (o *GetObjectOutput, err error) { + return o, err +} diff --git a/aws/retry/internal/mock/config.go b/aws/retry/internal/mock/config.go new file mode 100644 index 00000000000..88f0ac377bd --- /dev/null +++ b/aws/retry/internal/mock/config.go @@ -0,0 +1,17 @@ +package mock + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// LoadDefaultConfig is a mock for config.LoadDefaultConfig +func LoadDefaultConfig(context.Context, ...func()) (cfg aws.Config, err error) { + return cfg, err +} + +// WithRetryer is a mock for config.WithRetryer +func WithRetryer(v func() aws.Retryer) (f func()) { + return f +} diff --git a/aws/retry/internal/mock/types.go b/aws/retry/internal/mock/types.go new file mode 100644 index 00000000000..463f5fd08d6 --- /dev/null +++ b/aws/retry/internal/mock/types.go @@ -0,0 +1,14 @@ +package mock + +// NoSuchBucketException is a mock error +type NoSuchBucketException struct{} + +// Error is a mock error message +func (*NoSuchBucketException) Error() string { + return "mock error message" +} + +// ErrorCode is a mock error code +func (*NoSuchBucketException) ErrorCode() string { + return "NoSuchBucketException" +} diff --git a/aws/retry/middleware.go b/aws/retry/middleware.go index 748b88dbf19..8d703ed2176 100644 --- a/aws/retry/middleware.go +++ b/aws/retry/middleware.go @@ -34,12 +34,12 @@ type Attempt struct { // This will include logging retry attempts, unretryable errors, and when max attempts are reached. LogAttempts bool - retryer Retryer + retryer aws.Retryer requestCloner RequestCloner } -// NewAttemptMiddleware returns a new Attempt -func NewAttemptMiddleware(retryer Retryer, requestCloner RequestCloner, optFns ...func(*Attempt)) *Attempt { +// NewAttemptMiddleware returns a new Attempt retry middleware. +func NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optFns ...func(*Attempt)) *Attempt { m := &Attempt{retryer: retryer, requestCloner: requestCloner} for _, fn := range optFns { fn(m) @@ -250,7 +250,7 @@ func setRetryMetadata(ctx context.Context, metadata retryMetadata) context.Conte // AddRetryMiddlewaresOptions is the set of options that can be passed to AddRetryMiddlewares for configuring retry // associated middleware. type AddRetryMiddlewaresOptions struct { - Retryer Retryer + Retryer aws.Retryer // Enable the logging of retry attempts performed by the SDK. // This will include logging retry attempts, unretryable errors, and when max attempts are reached. diff --git a/aws/retry/middleware_test.go b/aws/retry/middleware_test.go index 3f1569f6405..4b200156f78 100644 --- a/aws/retry/middleware_test.go +++ b/aws/retry/middleware_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/sdk" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -87,10 +88,10 @@ func TestMetricsHeaderMiddleware(t *testing.T) { } type retryProvider struct { - Retryer Retryer + Retryer aws.Retryer } -func (t retryProvider) GetRetryer() Retryer { +func (t retryProvider) GetRetryer() aws.Retryer { return t.Retryer } diff --git a/aws/retry/retry.go b/aws/retry/retry.go index 9d8fc51aa81..ad81b8c9831 100644 --- a/aws/retry/retry.go +++ b/aws/retry/retry.go @@ -1,41 +1,14 @@ package retry import ( - "context" "time" "github.com/aws/aws-sdk-go-v2/aws" ) -// Retryer defines an interface for extension utilities to extend the built in -// retryer. -type Retryer interface { - // IsErrorRetryable returns if the failed request is retryable. This check - // should determine if the error can be retried, or if the error is - // terminal. - IsErrorRetryable(error) bool - - // MaxAttempts returns the maximum number of attempts that can be made for - // a request before failing. A value of 0 implies that the request should - // be retried until it succeeds if the errors are retryable. - MaxAttempts() int - - // RetryDelay returns the delay that should be used before retrying the - // request. Will return error if the if the delay could not be determined. - RetryDelay(attempt int, opErr error) (time.Duration, error) - - // GetRetryToken attempts to deduct the retry cost from the retry token pool. - // Returning the token release function, or error. - GetRetryToken(ctx context.Context, opErr error) (releaseToken func(error) error, err error) - - // GetInitalToken returns the initial request token that can increment the - // retry token pool if the request is successful. - GetInitialToken() (releaseToken func(error) error) -} - // AddWithErrorCodes returns a Retryer with additional error codes considered // for determining if the error should be retried. -func AddWithErrorCodes(r Retryer, codes ...string) Retryer { +func AddWithErrorCodes(r aws.Retryer, codes ...string) aws.Retryer { retryable := &RetryableErrorCode{ Codes: map[string]struct{}{}, } @@ -50,7 +23,7 @@ func AddWithErrorCodes(r Retryer, codes ...string) Retryer { } type withIsErrorRetryable struct { - Retryer + aws.Retryer Retryable IsErrorRetryable } @@ -63,7 +36,7 @@ func (r *withIsErrorRetryable) IsErrorRetryable(err error) bool { // AddWithMaxAttempts returns a Retryer with MaxAttempts set to the value // specified. -func AddWithMaxAttempts(r Retryer, max int) Retryer { +func AddWithMaxAttempts(r aws.Retryer, max int) aws.Retryer { return &withMaxAttempts{ Retryer: r, Max: max, @@ -71,7 +44,7 @@ func AddWithMaxAttempts(r Retryer, max int) Retryer { } type withMaxAttempts struct { - Retryer + aws.Retryer Max int } @@ -82,18 +55,18 @@ func (w *withMaxAttempts) MaxAttempts() int { // AddWithMaxBackoffDelay returns a retryer wrapping the passed in retryer // overriding the RetryDelay behavior for a alternate minimum initial backoff // delay. -func AddWithMaxBackoffDelay(r Retryer, delay time.Duration) Retryer { - return &withMinBackoffDelay{ +func AddWithMaxBackoffDelay(r aws.Retryer, delay time.Duration) aws.Retryer { + return &withMaxBackoffDelay{ Retryer: r, backoff: NewExponentialJitterBackoff(delay), } } -type withMinBackoffDelay struct { - Retryer +type withMaxBackoffDelay struct { + aws.Retryer backoff *ExponentialJitterBackoff } -func (r *withMinBackoffDelay) RetryDelay(attempt int, err error) (time.Duration, error) { +func (r *withMaxBackoffDelay) RetryDelay(attempt int, err error) (time.Duration, error) { return r.backoff.BackoffDelay(attempt, err) } 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 1c541b2b4cd..5f9ad89858e 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 @@ -52,6 +52,7 @@ public class AddAwsConfigFields implements GoIntegration { private static final String RESOLVE_HTTP_CLIENT = "resolveHTTPClient"; private static final String RESOLVE_RETRYER = "resolveRetryer"; private static final String RESOLVE_AWS_CONFIG_ENDPOINT_RESOLVER = "resolveAWSEndpointResolver"; + private static final String RESOLVE_AWS_CONFIG_RETRYER_PROVIDER = "resolveAWSRetryerProvider"; private static final List AWS_CONFIG_FIELDS = ListUtils.of( AwsConfigField.builder() @@ -61,11 +62,13 @@ public class AddAwsConfigFields implements GoIntegration { .build(), AwsConfigField.builder() .name(RETRYER_CONFIG_NAME) - .type(getAwsRetrySymbol("Retryer")) + .type(getAwsCoreSymbol("Retryer")) .documentation("Retryer guides how HTTP requests should be retried in case of\n" + "recoverable failures. When nil the API client will use a default\n" + "retryer.") .resolveFunction(SymbolUtils.createValueSymbolBuilder(RESOLVE_RETRYER).build()) + .awsResolveFunction(SymbolUtils.createValueSymbolBuilder(RESOLVE_AWS_CONFIG_RETRYER_PROVIDER) + .build()) .build(), AwsConfigField.builder() .name(HTTP_CLIENT_CONFIG_NAME) @@ -153,17 +156,22 @@ public void writeAdditionalFiles( private void writeAwsDefaultResolvers(GoWriter writer) { writeHttpClientResolver(writer); - writeRetryerResolver(writer); + writeRetryerResolvers(writer); writeAwsConfigEndpointResolver(writer); } - private void writeRetryerResolver(GoWriter writer) { + private void writeRetryerResolvers(GoWriter writer) { writer.openBlock("func $L(o *Options) {", "}", RESOLVE_RETRYER, () -> { writer.openBlock("if o.$L != nil {", "}", RETRYER_CONFIG_NAME, () -> writer.write("return")); writer.write("o.$L = $T()", RETRYER_CONFIG_NAME, SymbolUtils.createValueSymbolBuilder("NewStandard", AwsGoDependency.AWS_RETRY).build()); }); writer.write(""); + writer.openBlock("func $L(cfg aws.Config, o *Options) {", "}", RESOLVE_AWS_CONFIG_RETRYER_PROVIDER, () -> { + writer.openBlock("if cfg.$L == nil {", "}", RETRYER_CONFIG_NAME, () -> writer.write("return")); + writer.write("o.$L = cfg.$L()", RETRYER_CONFIG_NAME, RETRYER_CONFIG_NAME); + }); + writer.write(""); } private void writeHttpClientResolver(GoWriter writer) { @@ -225,7 +233,7 @@ private void writeAwsConfigConstructor(Model model, ServiceShape service, GoWrit List configFields = new ArrayList<>(AWS_CONFIG_FIELDS); // add client specific config fields - for (AwsConfigField cfgField: ResolveClientConfig.AWS_CONFIG_FIELDS) { + for (AwsConfigField cfgField : ResolveClientConfig.AWS_CONFIG_FIELDS) { configFields.add(cfgField); } diff --git a/config/load_options.go b/config/load_options.go index c296033271c..bd12a1fde61 100644 --- a/config/load_options.go +++ b/config/load_options.go @@ -33,9 +33,9 @@ type LoadOptions struct { // service and region Please see the `aws.EndpointResolver` documentation on usage. EndpointResolver aws.EndpointResolver - // Retryer guides how HTTP requests should be retried in case of - // recoverable failures. - Retryer aws.Retryer + // Retryer is a function that provides a Retryer implementation. A Retryer guides how HTTP requests should be + // retried in case of recoverable failures. + Retryer func() aws.Retryer // APIOptions provides the set of middleware mutations modify how the API // client requests will be handled. This is useful for adding additional @@ -477,7 +477,7 @@ func WithAPIOptions(v []func(*middleware.Stack) error) LoadOptionsFunc { } } -func (o LoadOptions) getRetryer(ctx context.Context) (aws.Retryer, bool, error) { +func (o LoadOptions) getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) { if o.Retryer == nil { return nil, false, nil } @@ -489,7 +489,7 @@ func (o LoadOptions) getRetryer(ctx context.Context) (aws.Retryer, bool, error) // that sets Retryer on LoadOptions. If Retryer is set to nil, the // Retryer value is ignored. If multiple WithRetryer calls are // made, the last call overrides the previous call values. -func WithRetryer(v aws.Retryer) LoadOptionsFunc { +func WithRetryer(v func() aws.Retryer) LoadOptionsFunc { return func(o *LoadOptions) error { o.Retryer = v return nil diff --git a/config/provider.go b/config/provider.go index cd282923517..68406c6b881 100644 --- a/config/provider.go +++ b/config/provider.go @@ -373,10 +373,10 @@ func getClientLogMode(ctx context.Context, configs configs) (m aws.ClientLogMode // retryProvider is an configuration provider for custom Retryer. type retryProvider interface { - getRetryer(ctx context.Context) (aws.Retryer, bool, error) + getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) } -func getRetryer(ctx context.Context, configs configs) (v aws.Retryer, found bool, err error) { +func getRetryer(ctx context.Context, configs configs) (v func() aws.Retryer, found bool, err error) { for _, c := range configs { if p, ok := c.(retryProvider); ok { v, found, err = p.getRetryer(ctx) diff --git a/config/resolve_credentials.go b/config/resolve_credentials.go index ddadc54ef11..35b48c4391c 100644 --- a/config/resolve_credentials.go +++ b/config/resolve_credentials.go @@ -202,7 +202,9 @@ func resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToke options.AuthorizationToken = authToken } options.APIOptions = cfg.APIOptions - options.Retryer = cfg.Retryer + if cfg.Retryer != nil { + options.Retryer = cfg.Retryer() + } }, } @@ -258,10 +260,13 @@ func resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs con optFns = append(optFns, func(o *ec2rolecreds.Options) { // Only define a client from config if not already defined. if o.Client != nil { - o.Client = imds.New(imds.Options{ + options := imds.Options{ HTTPClient: cfg.HTTPClient, - Retryer: cfg.Retryer, - }) + } + if cfg.Retryer != nil { + options.Retryer = cfg.Retryer() + } + o.Client = imds.New(options) } }) diff --git a/credentials/endpointcreds/internal/client/client.go b/credentials/endpointcreds/internal/client/client.go index cc28f7ba263..60b8298f86f 100644 --- a/credentials/endpointcreds/internal/client/client.go +++ b/credentials/endpointcreds/internal/client/client.go @@ -6,6 +6,7 @@ import ( "net/http" "time" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" @@ -33,7 +34,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // Set of options to modify how the credentials operation is invoked. APIOptions []func(*smithymiddleware.Stack) error diff --git a/feature/ec2/imds/api_client.go b/feature/ec2/imds/api_client.go index 2b72fc3a474..998668d29f5 100644 --- a/feature/ec2/imds/api_client.go +++ b/feature/ec2/imds/api_client.go @@ -96,7 +96,10 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ APIOptions: append([]func(*middleware.Stack) error{}, cfg.APIOptions...), HTTPClient: cfg.HTTPClient, - Retryer: cfg.Retryer, + } + + if cfg.Retryer != nil { + opts.Retryer = cfg.Retryer() } return New(opts, optFns...) @@ -125,7 +128,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // Changes if the EC2 Instance Metadata client is enabled or not. Client // will default to enabled if not set to ClientDisabled. When the client is diff --git a/internal/protocoltest/awsrestjson/api_client.go b/internal/protocoltest/awsrestjson/api_client.go index 185a6f441cb..e8b699d4cd3 100644 --- a/internal/protocoltest/awsrestjson/api_client.go +++ b/internal/protocoltest/awsrestjson/api_client.go @@ -79,7 +79,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -152,12 +152,12 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -176,6 +176,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/internal/protocoltest/ec2query/api_client.go b/internal/protocoltest/ec2query/api_client.go index f704c984397..c1aac9f478a 100644 --- a/internal/protocoltest/ec2query/api_client.go +++ b/internal/protocoltest/ec2query/api_client.go @@ -79,7 +79,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -152,12 +152,12 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -176,6 +176,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/internal/protocoltest/jsonrpc/api_client.go b/internal/protocoltest/jsonrpc/api_client.go index 397af08b937..d890b1e6b0e 100644 --- a/internal/protocoltest/jsonrpc/api_client.go +++ b/internal/protocoltest/jsonrpc/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/internal/protocoltest/jsonrpc10/api_client.go b/internal/protocoltest/jsonrpc10/api_client.go index 94889c97361..dda46ac0449 100644 --- a/internal/protocoltest/jsonrpc10/api_client.go +++ b/internal/protocoltest/jsonrpc10/api_client.go @@ -71,7 +71,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -144,12 +144,12 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -168,6 +168,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/internal/protocoltest/query/api_client.go b/internal/protocoltest/query/api_client.go index b9107adf678..213c7d2381f 100644 --- a/internal/protocoltest/query/api_client.go +++ b/internal/protocoltest/query/api_client.go @@ -79,7 +79,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -152,12 +152,12 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -176,6 +176,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/internal/protocoltest/restxml/api_client.go b/internal/protocoltest/restxml/api_client.go index 5347529f90c..474351ec6ca 100644 --- a/internal/protocoltest/restxml/api_client.go +++ b/internal/protocoltest/restxml/api_client.go @@ -79,7 +79,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -152,12 +152,12 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -176,6 +176,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/accessanalyzer/api_client.go b/service/accessanalyzer/api_client.go index 567d31631dd..2ff4b89ebe5 100644 --- a/service/accessanalyzer/api_client.go +++ b/service/accessanalyzer/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/acm/api_client.go b/service/acm/api_client.go index fc0460f0b67..a7e5a3b145e 100644 --- a/service/acm/api_client.go +++ b/service/acm/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/acmpca/api_client.go b/service/acmpca/api_client.go index 40e7367e412..2fafe02ada9 100644 --- a/service/acmpca/api_client.go +++ b/service/acmpca/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/alexaforbusiness/api_client.go b/service/alexaforbusiness/api_client.go index bf27693c27a..7f08c5427cb 100644 --- a/service/alexaforbusiness/api_client.go +++ b/service/alexaforbusiness/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/amplify/api_client.go b/service/amplify/api_client.go index bafe6914391..e738745788b 100644 --- a/service/amplify/api_client.go +++ b/service/amplify/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/apigateway/api_client.go b/service/apigateway/api_client.go index c799b5322ef..d516b5cf29e 100644 --- a/service/apigateway/api_client.go +++ b/service/apigateway/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/apigateway/internal/customizations/unit_test.go b/service/apigateway/internal/customizations/unit_test.go index 6c13c4a46a6..86eb219b3d0 100644 --- a/service/apigateway/internal/customizations/unit_test.go +++ b/service/apigateway/internal/customizations/unit_test.go @@ -51,7 +51,9 @@ func Test_EmptyResponse(t *testing.T) { SigningName: "apigateway", }, nil }), - Retryer: aws.NopRetryer{}, + Retryer: func() aws.Retryer { + return aws.NopRetryer{} + }, } client := apigateway.NewFromConfig(cfg) diff --git a/service/apigatewaymanagementapi/api_client.go b/service/apigatewaymanagementapi/api_client.go index 6eb09fc9f04..efd48c5ae64 100644 --- a/service/apigatewaymanagementapi/api_client.go +++ b/service/apigatewaymanagementapi/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/apigatewayv2/api_client.go b/service/apigatewayv2/api_client.go index 27f5cd99d1e..6bb133aea9c 100644 --- a/service/apigatewayv2/api_client.go +++ b/service/apigatewayv2/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/appconfig/api_client.go b/service/appconfig/api_client.go index de828e699c5..a44c977544a 100644 --- a/service/appconfig/api_client.go +++ b/service/appconfig/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/appflow/api_client.go b/service/appflow/api_client.go index 723bcc40cc0..c79dba03393 100644 --- a/service/appflow/api_client.go +++ b/service/appflow/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/appintegrations/api_client.go b/service/appintegrations/api_client.go index 31318adb3c3..e7daac32e5d 100644 --- a/service/appintegrations/api_client.go +++ b/service/appintegrations/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/applicationautoscaling/api_client.go b/service/applicationautoscaling/api_client.go index 2083c5f8a15..52fb75c450e 100644 --- a/service/applicationautoscaling/api_client.go +++ b/service/applicationautoscaling/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/applicationdiscoveryservice/api_client.go b/service/applicationdiscoveryservice/api_client.go index b7de65e499b..34637dc633b 100644 --- a/service/applicationdiscoveryservice/api_client.go +++ b/service/applicationdiscoveryservice/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/applicationinsights/api_client.go b/service/applicationinsights/api_client.go index 4385267deb7..6dd17887243 100644 --- a/service/applicationinsights/api_client.go +++ b/service/applicationinsights/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/appmesh/api_client.go b/service/appmesh/api_client.go index 41f62e2fd8b..82b3614ed12 100644 --- a/service/appmesh/api_client.go +++ b/service/appmesh/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/appstream/api_client.go b/service/appstream/api_client.go index c8776eca9e9..e8c87162916 100644 --- a/service/appstream/api_client.go +++ b/service/appstream/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/appsync/api_client.go b/service/appsync/api_client.go index 772f5ec1c48..140651384cb 100644 --- a/service/appsync/api_client.go +++ b/service/appsync/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/athena/api_client.go b/service/athena/api_client.go index f2ba379e148..07f2156b677 100644 --- a/service/athena/api_client.go +++ b/service/athena/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/auditmanager/api_client.go b/service/auditmanager/api_client.go index 26c14c3819c..5817fec80d7 100644 --- a/service/auditmanager/api_client.go +++ b/service/auditmanager/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/autoscaling/api_client.go b/service/autoscaling/api_client.go index f320edc660d..49ad23243bd 100644 --- a/service/autoscaling/api_client.go +++ b/service/autoscaling/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/autoscalingplans/api_client.go b/service/autoscalingplans/api_client.go index 0cea7097536..750b6bd33f5 100644 --- a/service/autoscalingplans/api_client.go +++ b/service/autoscalingplans/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/backup/api_client.go b/service/backup/api_client.go index b53c406fdb8..74de2f1b859 100644 --- a/service/backup/api_client.go +++ b/service/backup/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/batch/api_client.go b/service/batch/api_client.go index 42a16ddc754..9ebbb60c12f 100644 --- a/service/batch/api_client.go +++ b/service/batch/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/braket/api_client.go b/service/braket/api_client.go index 0d21bd55e1f..ee2353534e0 100644 --- a/service/braket/api_client.go +++ b/service/braket/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/budgets/api_client.go b/service/budgets/api_client.go index 880271a56f4..f7e875a0a1a 100644 --- a/service/budgets/api_client.go +++ b/service/budgets/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/chime/api_client.go b/service/chime/api_client.go index b71f1800298..b4ee3db1830 100644 --- a/service/chime/api_client.go +++ b/service/chime/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloud9/api_client.go b/service/cloud9/api_client.go index b9e536e9c23..05ff738b1cb 100644 --- a/service/cloud9/api_client.go +++ b/service/cloud9/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/clouddirectory/api_client.go b/service/clouddirectory/api_client.go index 0a99048b095..3cba1656361 100644 --- a/service/clouddirectory/api_client.go +++ b/service/clouddirectory/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudformation/api_client.go b/service/cloudformation/api_client.go index 5ef4309d5bf..a1aee81d23f 100644 --- a/service/cloudformation/api_client.go +++ b/service/cloudformation/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudfront/api_client.go b/service/cloudfront/api_client.go index 57c82a284f3..2cebf6943cd 100644 --- a/service/cloudfront/api_client.go +++ b/service/cloudfront/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudhsm/api_client.go b/service/cloudhsm/api_client.go index 2e52f39b581..ecf9827b704 100644 --- a/service/cloudhsm/api_client.go +++ b/service/cloudhsm/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudhsmv2/api_client.go b/service/cloudhsmv2/api_client.go index fcda062fd8d..231c16879a3 100644 --- a/service/cloudhsmv2/api_client.go +++ b/service/cloudhsmv2/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudsearch/api_client.go b/service/cloudsearch/api_client.go index a00d872c30f..5740d7c1a57 100644 --- a/service/cloudsearch/api_client.go +++ b/service/cloudsearch/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudsearchdomain/api_client.go b/service/cloudsearchdomain/api_client.go index 8cfda10f556..225fb6db0c4 100644 --- a/service/cloudsearchdomain/api_client.go +++ b/service/cloudsearchdomain/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudtrail/api_client.go b/service/cloudtrail/api_client.go index 15bcf345420..ef91a4bbd8f 100644 --- a/service/cloudtrail/api_client.go +++ b/service/cloudtrail/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudwatch/api_client.go b/service/cloudwatch/api_client.go index 8cc1702b550..4fc1b88646e 100644 --- a/service/cloudwatch/api_client.go +++ b/service/cloudwatch/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudwatchevents/api_client.go b/service/cloudwatchevents/api_client.go index 76f9b9ba9fd..3ca7df9b51c 100644 --- a/service/cloudwatchevents/api_client.go +++ b/service/cloudwatchevents/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cloudwatchlogs/api_client.go b/service/cloudwatchlogs/api_client.go index 77a6332d342..dc794d4ddec 100644 --- a/service/cloudwatchlogs/api_client.go +++ b/service/cloudwatchlogs/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codeartifact/api_client.go b/service/codeartifact/api_client.go index ee8bb93f6d5..7734d866c24 100644 --- a/service/codeartifact/api_client.go +++ b/service/codeartifact/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codebuild/api_client.go b/service/codebuild/api_client.go index 93cae1f231e..ac4079ef8ef 100644 --- a/service/codebuild/api_client.go +++ b/service/codebuild/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codecommit/api_client.go b/service/codecommit/api_client.go index 412a62e7cb7..7e104047489 100644 --- a/service/codecommit/api_client.go +++ b/service/codecommit/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codedeploy/api_client.go b/service/codedeploy/api_client.go index d8a8b90095a..35288a341f3 100644 --- a/service/codedeploy/api_client.go +++ b/service/codedeploy/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codeguruprofiler/api_client.go b/service/codeguruprofiler/api_client.go index 329f933d04c..db80f2805bb 100644 --- a/service/codeguruprofiler/api_client.go +++ b/service/codeguruprofiler/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codegurureviewer/api_client.go b/service/codegurureviewer/api_client.go index de394a7ab9f..2ea7c6b15ce 100644 --- a/service/codegurureviewer/api_client.go +++ b/service/codegurureviewer/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codepipeline/api_client.go b/service/codepipeline/api_client.go index 09413546e50..be99cda9efd 100644 --- a/service/codepipeline/api_client.go +++ b/service/codepipeline/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codestar/api_client.go b/service/codestar/api_client.go index 9af5ae19945..9278860bbc7 100644 --- a/service/codestar/api_client.go +++ b/service/codestar/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codestarconnections/api_client.go b/service/codestarconnections/api_client.go index a7a26e9e0bb..dc0f1571402 100644 --- a/service/codestarconnections/api_client.go +++ b/service/codestarconnections/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/codestarnotifications/api_client.go b/service/codestarnotifications/api_client.go index 9034e6811e0..f40e2e8b1d6 100644 --- a/service/codestarnotifications/api_client.go +++ b/service/codestarnotifications/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cognitoidentity/api_client.go b/service/cognitoidentity/api_client.go index 6f381fdf2cc..e4ef4ca2052 100644 --- a/service/cognitoidentity/api_client.go +++ b/service/cognitoidentity/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cognitoidentityprovider/api_client.go b/service/cognitoidentityprovider/api_client.go index 46006219fb8..b07640e1ab9 100644 --- a/service/cognitoidentityprovider/api_client.go +++ b/service/cognitoidentityprovider/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/cognitosync/api_client.go b/service/cognitosync/api_client.go index 0280538ddfe..8ddb1eb9926 100644 --- a/service/cognitosync/api_client.go +++ b/service/cognitosync/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/comprehend/api_client.go b/service/comprehend/api_client.go index 32e5b07a7f9..59ce1092205 100644 --- a/service/comprehend/api_client.go +++ b/service/comprehend/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/comprehendmedical/api_client.go b/service/comprehendmedical/api_client.go index 953cea9062d..5a141413f20 100644 --- a/service/comprehendmedical/api_client.go +++ b/service/comprehendmedical/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/computeoptimizer/api_client.go b/service/computeoptimizer/api_client.go index 015f8e41e9f..6b80590fc62 100644 --- a/service/computeoptimizer/api_client.go +++ b/service/computeoptimizer/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/configservice/api_client.go b/service/configservice/api_client.go index 7222db71362..0bf77d224d0 100644 --- a/service/configservice/api_client.go +++ b/service/configservice/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/connect/api_client.go b/service/connect/api_client.go index bded42c65ed..d3c6cc37dc0 100644 --- a/service/connect/api_client.go +++ b/service/connect/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/connectcontactlens/api_client.go b/service/connectcontactlens/api_client.go index 70a0e404003..b4861518991 100644 --- a/service/connectcontactlens/api_client.go +++ b/service/connectcontactlens/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/connectparticipant/api_client.go b/service/connectparticipant/api_client.go index 16781559f97..18dc20666c7 100644 --- a/service/connectparticipant/api_client.go +++ b/service/connectparticipant/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/costandusagereportservice/api_client.go b/service/costandusagereportservice/api_client.go index b77adcab022..d4b8a173e85 100644 --- a/service/costandusagereportservice/api_client.go +++ b/service/costandusagereportservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/costexplorer/api_client.go b/service/costexplorer/api_client.go index 22415eeb825..f310c15c9d5 100644 --- a/service/costexplorer/api_client.go +++ b/service/costexplorer/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/customerprofiles/api_client.go b/service/customerprofiles/api_client.go index dcb5db53e07..8ba8448fbcd 100644 --- a/service/customerprofiles/api_client.go +++ b/service/customerprofiles/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/databasemigrationservice/api_client.go b/service/databasemigrationservice/api_client.go index 86692d612c9..91ef52815e1 100644 --- a/service/databasemigrationservice/api_client.go +++ b/service/databasemigrationservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/databrew/api_client.go b/service/databrew/api_client.go index 3e286b0c29a..b738d5986ec 100644 --- a/service/databrew/api_client.go +++ b/service/databrew/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/dataexchange/api_client.go b/service/dataexchange/api_client.go index 89e8d31fae5..a61f43d3368 100644 --- a/service/dataexchange/api_client.go +++ b/service/dataexchange/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/datapipeline/api_client.go b/service/datapipeline/api_client.go index 764c02a75bc..4641fa865a4 100644 --- a/service/datapipeline/api_client.go +++ b/service/datapipeline/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/datasync/api_client.go b/service/datasync/api_client.go index 51c7137b563..45844364531 100644 --- a/service/datasync/api_client.go +++ b/service/datasync/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/dax/api_client.go b/service/dax/api_client.go index 310df59d68f..f648e7625eb 100644 --- a/service/dax/api_client.go +++ b/service/dax/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/detective/api_client.go b/service/detective/api_client.go index e987e277bae..70c2c229f97 100644 --- a/service/detective/api_client.go +++ b/service/detective/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/devicefarm/api_client.go b/service/devicefarm/api_client.go index e0eb587f85e..92c64a5e347 100644 --- a/service/devicefarm/api_client.go +++ b/service/devicefarm/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/devopsguru/api_client.go b/service/devopsguru/api_client.go index 218969c4cb5..bb0168c5dd0 100644 --- a/service/devopsguru/api_client.go +++ b/service/devopsguru/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/directconnect/api_client.go b/service/directconnect/api_client.go index 40ff7be68d2..fef08c9856e 100644 --- a/service/directconnect/api_client.go +++ b/service/directconnect/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/directoryservice/api_client.go b/service/directoryservice/api_client.go index d81d9f45bb5..a6472fa78b8 100644 --- a/service/directoryservice/api_client.go +++ b/service/directoryservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/dlm/api_client.go b/service/dlm/api_client.go index ebb96d66c5c..6a3e43de47f 100644 --- a/service/dlm/api_client.go +++ b/service/dlm/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/docdb/api_client.go b/service/docdb/api_client.go index 96fac5ef99e..f088b648969 100644 --- a/service/docdb/api_client.go +++ b/service/docdb/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/dynamodb/api_client.go b/service/dynamodb/api_client.go index d4d8650ef05..4a6caf38e71 100644 --- a/service/dynamodb/api_client.go +++ b/service/dynamodb/api_client.go @@ -99,7 +99,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -172,13 +172,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -197,6 +197,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/dynamodbstreams/api_client.go b/service/dynamodbstreams/api_client.go index 58b3277fb75..11286dcd504 100644 --- a/service/dynamodbstreams/api_client.go +++ b/service/dynamodbstreams/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ebs/api_client.go b/service/ebs/api_client.go index 1daa01624b7..3a553c35cf8 100644 --- a/service/ebs/api_client.go +++ b/service/ebs/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ec2/api_client.go b/service/ec2/api_client.go index 04a490e2435..3140ae0ff0e 100644 --- a/service/ec2/api_client.go +++ b/service/ec2/api_client.go @@ -92,7 +92,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -165,13 +165,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -190,6 +190,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ec2/internal/customizations/unit_test.go b/service/ec2/internal/customizations/unit_test.go index bacb89b4f7c..e8bbfae7bcf 100644 --- a/service/ec2/internal/customizations/unit_test.go +++ b/service/ec2/internal/customizations/unit_test.go @@ -51,7 +51,9 @@ func Test_EmptyResponse(t *testing.T) { SigningName: "ec2", }, nil }), - Retryer: aws.NopRetryer{}, + Retryer: func() aws.Retryer { + return aws.NopRetryer{} + }, } client := ec2.NewFromConfig(cfg) diff --git a/service/ec2instanceconnect/api_client.go b/service/ec2instanceconnect/api_client.go index eed9998f762..8ad02bef5dc 100644 --- a/service/ec2instanceconnect/api_client.go +++ b/service/ec2instanceconnect/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ecr/api_client.go b/service/ecr/api_client.go index 80006058dea..56d294b4c2a 100644 --- a/service/ecr/api_client.go +++ b/service/ecr/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ecrpublic/api_client.go b/service/ecrpublic/api_client.go index c5621358242..104ae5b1210 100644 --- a/service/ecrpublic/api_client.go +++ b/service/ecrpublic/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ecs/api_client.go b/service/ecs/api_client.go index dc336a6c998..d2b6739f5e3 100644 --- a/service/ecs/api_client.go +++ b/service/ecs/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/efs/api_client.go b/service/efs/api_client.go index 07ad0fae4fb..b428ee5858b 100644 --- a/service/efs/api_client.go +++ b/service/efs/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/eks/api_client.go b/service/eks/api_client.go index 9fbc3b46f18..a3959117b3b 100644 --- a/service/eks/api_client.go +++ b/service/eks/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/elasticache/api_client.go b/service/elasticache/api_client.go index 0ac664d384d..c71d02c5d6a 100644 --- a/service/elasticache/api_client.go +++ b/service/elasticache/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/elasticbeanstalk/api_client.go b/service/elasticbeanstalk/api_client.go index 0f17cb157ce..3e4f6cc5f93 100644 --- a/service/elasticbeanstalk/api_client.go +++ b/service/elasticbeanstalk/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/elasticinference/api_client.go b/service/elasticinference/api_client.go index aa7711896d1..f703ffa3df0 100644 --- a/service/elasticinference/api_client.go +++ b/service/elasticinference/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/elasticloadbalancing/api_client.go b/service/elasticloadbalancing/api_client.go index 4cb1cb0dbfe..db16ac4e9df 100644 --- a/service/elasticloadbalancing/api_client.go +++ b/service/elasticloadbalancing/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/elasticloadbalancingv2/api_client.go b/service/elasticloadbalancingv2/api_client.go index fde96365595..cf9df8873a5 100644 --- a/service/elasticloadbalancingv2/api_client.go +++ b/service/elasticloadbalancingv2/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/elasticsearchservice/api_client.go b/service/elasticsearchservice/api_client.go index cca5b99965b..f29c53cfc99 100644 --- a/service/elasticsearchservice/api_client.go +++ b/service/elasticsearchservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/elastictranscoder/api_client.go b/service/elastictranscoder/api_client.go index 97868272ada..9276fb6c439 100644 --- a/service/elastictranscoder/api_client.go +++ b/service/elastictranscoder/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/emr/api_client.go b/service/emr/api_client.go index 5d2bfcdd198..2da2df5a076 100644 --- a/service/emr/api_client.go +++ b/service/emr/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/emrcontainers/api_client.go b/service/emrcontainers/api_client.go index fba771b131f..50d67678f74 100644 --- a/service/emrcontainers/api_client.go +++ b/service/emrcontainers/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/eventbridge/api_client.go b/service/eventbridge/api_client.go index 423afd0e3ea..2a21ac83006 100644 --- a/service/eventbridge/api_client.go +++ b/service/eventbridge/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/firehose/api_client.go b/service/firehose/api_client.go index 3b81c3000d0..947d17136ea 100644 --- a/service/firehose/api_client.go +++ b/service/firehose/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/fms/api_client.go b/service/fms/api_client.go index 26c6a290a16..ce3026fd003 100644 --- a/service/fms/api_client.go +++ b/service/fms/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/forecast/api_client.go b/service/forecast/api_client.go index 14b20ce3bbf..93ff1ec0ae8 100644 --- a/service/forecast/api_client.go +++ b/service/forecast/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/forecastquery/api_client.go b/service/forecastquery/api_client.go index e8634db16d0..e52a475c00a 100644 --- a/service/forecastquery/api_client.go +++ b/service/forecastquery/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/frauddetector/api_client.go b/service/frauddetector/api_client.go index 64c5fe0b1c4..80e084fdf20 100644 --- a/service/frauddetector/api_client.go +++ b/service/frauddetector/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/fsx/api_client.go b/service/fsx/api_client.go index c6bb866bf3a..c8b39f90389 100644 --- a/service/fsx/api_client.go +++ b/service/fsx/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/gamelift/api_client.go b/service/gamelift/api_client.go index 97d9c82a08f..fbf2cb504dc 100644 --- a/service/gamelift/api_client.go +++ b/service/gamelift/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/glacier/api_client.go b/service/glacier/api_client.go index a1c170c17f8..be46afcc9be 100644 --- a/service/glacier/api_client.go +++ b/service/glacier/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/globalaccelerator/api_client.go b/service/globalaccelerator/api_client.go index f3b546d3a87..8359cff8a77 100644 --- a/service/globalaccelerator/api_client.go +++ b/service/globalaccelerator/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/glue/api_client.go b/service/glue/api_client.go index ff4bfb6e783..5ada9851b4f 100644 --- a/service/glue/api_client.go +++ b/service/glue/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/greengrass/api_client.go b/service/greengrass/api_client.go index 0bbf82a9269..a94fca5ffb2 100644 --- a/service/greengrass/api_client.go +++ b/service/greengrass/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/greengrassv2/api_client.go b/service/greengrassv2/api_client.go index f22ee2afc29..8ba6121b7f1 100644 --- a/service/greengrassv2/api_client.go +++ b/service/greengrassv2/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/groundstation/api_client.go b/service/groundstation/api_client.go index 748068b0e60..fadc286d078 100644 --- a/service/groundstation/api_client.go +++ b/service/groundstation/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/guardduty/api_client.go b/service/guardduty/api_client.go index 8d2a560b1e7..466ae4128aa 100644 --- a/service/guardduty/api_client.go +++ b/service/guardduty/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/health/api_client.go b/service/health/api_client.go index 442c0935430..e9b0d4f202d 100644 --- a/service/health/api_client.go +++ b/service/health/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/healthlake/api_client.go b/service/healthlake/api_client.go index 595189e2b80..c87d5c3c3e4 100644 --- a/service/healthlake/api_client.go +++ b/service/healthlake/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/honeycode/api_client.go b/service/honeycode/api_client.go index fb8d4894c87..4c9345c88d4 100644 --- a/service/honeycode/api_client.go +++ b/service/honeycode/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iam/api_client.go b/service/iam/api_client.go index 70c6f0b9cf4..81f4ac6d1db 100644 --- a/service/iam/api_client.go +++ b/service/iam/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/identitystore/api_client.go b/service/identitystore/api_client.go index 0c58a688932..dc3962b4a1c 100644 --- a/service/identitystore/api_client.go +++ b/service/identitystore/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/imagebuilder/api_client.go b/service/imagebuilder/api_client.go index 5345c772c51..b33bf32d731 100644 --- a/service/imagebuilder/api_client.go +++ b/service/imagebuilder/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/inspector/api_client.go b/service/inspector/api_client.go index 2aa623cc8d0..f837ddf32f1 100644 --- a/service/inspector/api_client.go +++ b/service/inspector/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iot/api_client.go b/service/iot/api_client.go index 172959c0c18..1b271eb2ed4 100644 --- a/service/iot/api_client.go +++ b/service/iot/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iot1clickdevicesservice/api_client.go b/service/iot1clickdevicesservice/api_client.go index a84d95d7e2b..8b640f47972 100644 --- a/service/iot1clickdevicesservice/api_client.go +++ b/service/iot1clickdevicesservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iot1clickprojects/api_client.go b/service/iot1clickprojects/api_client.go index cceb5fbe9c7..6206623d679 100644 --- a/service/iot1clickprojects/api_client.go +++ b/service/iot1clickprojects/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotanalytics/api_client.go b/service/iotanalytics/api_client.go index 87ec78bcf3d..c60a1e1d12a 100644 --- a/service/iotanalytics/api_client.go +++ b/service/iotanalytics/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotdataplane/api_client.go b/service/iotdataplane/api_client.go index 0a87cd47650..c4584ffc55e 100644 --- a/service/iotdataplane/api_client.go +++ b/service/iotdataplane/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotdeviceadvisor/api_client.go b/service/iotdeviceadvisor/api_client.go index 929baf4b6a7..e4ccca1a0f6 100644 --- a/service/iotdeviceadvisor/api_client.go +++ b/service/iotdeviceadvisor/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotevents/api_client.go b/service/iotevents/api_client.go index 827623703ac..677e410a86b 100644 --- a/service/iotevents/api_client.go +++ b/service/iotevents/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ioteventsdata/api_client.go b/service/ioteventsdata/api_client.go index 0657c573ad5..e9ed0d17d2f 100644 --- a/service/ioteventsdata/api_client.go +++ b/service/ioteventsdata/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotfleethub/api_client.go b/service/iotfleethub/api_client.go index dee60045b36..081885b8a71 100644 --- a/service/iotfleethub/api_client.go +++ b/service/iotfleethub/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotjobsdataplane/api_client.go b/service/iotjobsdataplane/api_client.go index 638d3335b0a..fe3a2499ab4 100644 --- a/service/iotjobsdataplane/api_client.go +++ b/service/iotjobsdataplane/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotsecuretunneling/api_client.go b/service/iotsecuretunneling/api_client.go index 096983b4d45..eff572ad148 100644 --- a/service/iotsecuretunneling/api_client.go +++ b/service/iotsecuretunneling/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotsitewise/api_client.go b/service/iotsitewise/api_client.go index f90f9397957..bf26f38b02b 100644 --- a/service/iotsitewise/api_client.go +++ b/service/iotsitewise/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotthingsgraph/api_client.go b/service/iotthingsgraph/api_client.go index 16503cc10d3..9562e71b899 100644 --- a/service/iotthingsgraph/api_client.go +++ b/service/iotthingsgraph/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/iotwireless/api_client.go b/service/iotwireless/api_client.go index e4a3232e09c..0ebc63036d2 100644 --- a/service/iotwireless/api_client.go +++ b/service/iotwireless/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ivs/api_client.go b/service/ivs/api_client.go index d7859bbdbbd..7d7bd7f2a8f 100644 --- a/service/ivs/api_client.go +++ b/service/ivs/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kafka/api_client.go b/service/kafka/api_client.go index bd676bc7126..10041c1173e 100644 --- a/service/kafka/api_client.go +++ b/service/kafka/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kendra/api_client.go b/service/kendra/api_client.go index a1abc883be1..13d7f7c5254 100644 --- a/service/kendra/api_client.go +++ b/service/kendra/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kinesis/api_client.go b/service/kinesis/api_client.go index dd12dc7816a..5375235ad2e 100644 --- a/service/kinesis/api_client.go +++ b/service/kinesis/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kinesisanalytics/api_client.go b/service/kinesisanalytics/api_client.go index 48784a86e1b..2155ce114d2 100644 --- a/service/kinesisanalytics/api_client.go +++ b/service/kinesisanalytics/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kinesisanalyticsv2/api_client.go b/service/kinesisanalyticsv2/api_client.go index d65c28986b4..d531bd1774d 100644 --- a/service/kinesisanalyticsv2/api_client.go +++ b/service/kinesisanalyticsv2/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kinesisvideo/api_client.go b/service/kinesisvideo/api_client.go index eec891efce2..60aa5245621 100644 --- a/service/kinesisvideo/api_client.go +++ b/service/kinesisvideo/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kinesisvideoarchivedmedia/api_client.go b/service/kinesisvideoarchivedmedia/api_client.go index b68cfc53dcd..52895b5efff 100644 --- a/service/kinesisvideoarchivedmedia/api_client.go +++ b/service/kinesisvideoarchivedmedia/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kinesisvideomedia/api_client.go b/service/kinesisvideomedia/api_client.go index 47296013999..f34ef00cf34 100644 --- a/service/kinesisvideomedia/api_client.go +++ b/service/kinesisvideomedia/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kinesisvideosignaling/api_client.go b/service/kinesisvideosignaling/api_client.go index 4ecc82804eb..6f598e93d36 100644 --- a/service/kinesisvideosignaling/api_client.go +++ b/service/kinesisvideosignaling/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/kms/api_client.go b/service/kms/api_client.go index 443a3c543fe..7d81b40901f 100644 --- a/service/kms/api_client.go +++ b/service/kms/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/lakeformation/api_client.go b/service/lakeformation/api_client.go index aac80925c84..bc1da12c14c 100644 --- a/service/lakeformation/api_client.go +++ b/service/lakeformation/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/lambda/api_client.go b/service/lambda/api_client.go index b4e53177eca..603be97ff6a 100644 --- a/service/lambda/api_client.go +++ b/service/lambda/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/lexmodelbuildingservice/api_client.go b/service/lexmodelbuildingservice/api_client.go index 6e5f5e1404a..db87b4fca80 100644 --- a/service/lexmodelbuildingservice/api_client.go +++ b/service/lexmodelbuildingservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/lexruntimeservice/api_client.go b/service/lexruntimeservice/api_client.go index 3d06cf3fdaf..a694ecc909d 100644 --- a/service/lexruntimeservice/api_client.go +++ b/service/lexruntimeservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/licensemanager/api_client.go b/service/licensemanager/api_client.go index 46debbcef51..60ec619b2a9 100644 --- a/service/licensemanager/api_client.go +++ b/service/licensemanager/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/lightsail/api_client.go b/service/lightsail/api_client.go index 1b981f37415..9e9f1a3f77f 100644 --- a/service/lightsail/api_client.go +++ b/service/lightsail/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/lookoutvision/api_client.go b/service/lookoutvision/api_client.go index 79847d3cbb1..a06fdcc5c56 100644 --- a/service/lookoutvision/api_client.go +++ b/service/lookoutvision/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/machinelearning/api_client.go b/service/machinelearning/api_client.go index cdb65797b9f..adee28d68f0 100644 --- a/service/machinelearning/api_client.go +++ b/service/machinelearning/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/macie/api_client.go b/service/macie/api_client.go index cfe5c222937..260e744e160 100644 --- a/service/macie/api_client.go +++ b/service/macie/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/macie2/api_client.go b/service/macie2/api_client.go index e499bc72f6d..3602994734b 100644 --- a/service/macie2/api_client.go +++ b/service/macie2/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/managedblockchain/api_client.go b/service/managedblockchain/api_client.go index 8b57a087b8e..6431f7f14cd 100644 --- a/service/managedblockchain/api_client.go +++ b/service/managedblockchain/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/marketplacecatalog/api_client.go b/service/marketplacecatalog/api_client.go index 5e35797d276..185a965efde 100644 --- a/service/marketplacecatalog/api_client.go +++ b/service/marketplacecatalog/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/marketplacecommerceanalytics/api_client.go b/service/marketplacecommerceanalytics/api_client.go index 5a97b9dcc59..0f1b399fdb5 100644 --- a/service/marketplacecommerceanalytics/api_client.go +++ b/service/marketplacecommerceanalytics/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/marketplaceentitlementservice/api_client.go b/service/marketplaceentitlementservice/api_client.go index 66babb8fb42..d181f747453 100644 --- a/service/marketplaceentitlementservice/api_client.go +++ b/service/marketplaceentitlementservice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/marketplacemetering/api_client.go b/service/marketplacemetering/api_client.go index 5c02601f7ca..bf5d5384f22 100644 --- a/service/marketplacemetering/api_client.go +++ b/service/marketplacemetering/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mediaconnect/api_client.go b/service/mediaconnect/api_client.go index c5613fd059c..e9ae75bb210 100644 --- a/service/mediaconnect/api_client.go +++ b/service/mediaconnect/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mediaconvert/api_client.go b/service/mediaconvert/api_client.go index 1927be4debb..478174510cd 100644 --- a/service/mediaconvert/api_client.go +++ b/service/mediaconvert/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/medialive/api_client.go b/service/medialive/api_client.go index fb6be04ab53..4f8c93e546c 100644 --- a/service/medialive/api_client.go +++ b/service/medialive/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mediapackage/api_client.go b/service/mediapackage/api_client.go index 56e3fbc7aee..9d5bbb75645 100644 --- a/service/mediapackage/api_client.go +++ b/service/mediapackage/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mediapackagevod/api_client.go b/service/mediapackagevod/api_client.go index d1fdbd71595..7b74ad0137b 100644 --- a/service/mediapackagevod/api_client.go +++ b/service/mediapackagevod/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mediastore/api_client.go b/service/mediastore/api_client.go index 4df73ca7f44..6cc4739a98f 100644 --- a/service/mediastore/api_client.go +++ b/service/mediastore/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mediastoredata/api_client.go b/service/mediastoredata/api_client.go index e141ed4c373..4214c2bbd68 100644 --- a/service/mediastoredata/api_client.go +++ b/service/mediastoredata/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mediatailor/api_client.go b/service/mediatailor/api_client.go index d86bbb12727..eff05b43a95 100644 --- a/service/mediatailor/api_client.go +++ b/service/mediatailor/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/migrationhub/api_client.go b/service/migrationhub/api_client.go index 9bf744f20bd..1a23efba619 100644 --- a/service/migrationhub/api_client.go +++ b/service/migrationhub/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/migrationhubconfig/api_client.go b/service/migrationhubconfig/api_client.go index 6ccfbcefbfe..459ee9542b8 100644 --- a/service/migrationhubconfig/api_client.go +++ b/service/migrationhubconfig/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mobile/api_client.go b/service/mobile/api_client.go index 041159635d7..c7552f80026 100644 --- a/service/mobile/api_client.go +++ b/service/mobile/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mq/api_client.go b/service/mq/api_client.go index a31ddebf08f..43cdd6ac4a0 100644 --- a/service/mq/api_client.go +++ b/service/mq/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/mturk/api_client.go b/service/mturk/api_client.go index bc021b987f9..6ed03843aa3 100644 --- a/service/mturk/api_client.go +++ b/service/mturk/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/neptune/api_client.go b/service/neptune/api_client.go index 1187468dd56..313e9d815ab 100644 --- a/service/neptune/api_client.go +++ b/service/neptune/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/networkfirewall/api_client.go b/service/networkfirewall/api_client.go index 13ac2439856..bf7991e2446 100644 --- a/service/networkfirewall/api_client.go +++ b/service/networkfirewall/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/networkmanager/api_client.go b/service/networkmanager/api_client.go index c8cc29bd456..2e6817b3eb0 100644 --- a/service/networkmanager/api_client.go +++ b/service/networkmanager/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/opsworks/api_client.go b/service/opsworks/api_client.go index 1b50e9cfee9..e3f5f1e2f1e 100644 --- a/service/opsworks/api_client.go +++ b/service/opsworks/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/opsworkscm/api_client.go b/service/opsworkscm/api_client.go index 204f3c8b4c0..4cc82899d41 100644 --- a/service/opsworkscm/api_client.go +++ b/service/opsworkscm/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/organizations/api_client.go b/service/organizations/api_client.go index ec77d8aa32b..4eddf811e63 100644 --- a/service/organizations/api_client.go +++ b/service/organizations/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/outposts/api_client.go b/service/outposts/api_client.go index 7a51e00ed02..e1d6ebc28c0 100644 --- a/service/outposts/api_client.go +++ b/service/outposts/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/personalize/api_client.go b/service/personalize/api_client.go index 88da4f6301f..2b5d79ef49d 100644 --- a/service/personalize/api_client.go +++ b/service/personalize/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/personalizeevents/api_client.go b/service/personalizeevents/api_client.go index 08122a75d4f..7f6ac557d7b 100644 --- a/service/personalizeevents/api_client.go +++ b/service/personalizeevents/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/personalizeruntime/api_client.go b/service/personalizeruntime/api_client.go index 79218ef8e70..3700547f030 100644 --- a/service/personalizeruntime/api_client.go +++ b/service/personalizeruntime/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/pi/api_client.go b/service/pi/api_client.go index a9df7069fa7..c32417355d6 100644 --- a/service/pi/api_client.go +++ b/service/pi/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/pinpoint/api_client.go b/service/pinpoint/api_client.go index 69e57bf5fc2..f696accd8c6 100644 --- a/service/pinpoint/api_client.go +++ b/service/pinpoint/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/pinpointemail/api_client.go b/service/pinpointemail/api_client.go index 5afd0fed135..dc7beb34d74 100644 --- a/service/pinpointemail/api_client.go +++ b/service/pinpointemail/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/pinpointsmsvoice/api_client.go b/service/pinpointsmsvoice/api_client.go index 3f9bb69033a..f087737ee0e 100644 --- a/service/pinpointsmsvoice/api_client.go +++ b/service/pinpointsmsvoice/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/polly/api_client.go b/service/polly/api_client.go index 6a47fa8b68b..df993ad1c06 100644 --- a/service/polly/api_client.go +++ b/service/polly/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/pricing/api_client.go b/service/pricing/api_client.go index 21a4a2450ae..a8614b8ee7f 100644 --- a/service/pricing/api_client.go +++ b/service/pricing/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/qldb/api_client.go b/service/qldb/api_client.go index c890ea0c132..da9bf9d8b81 100644 --- a/service/qldb/api_client.go +++ b/service/qldb/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/qldbsession/api_client.go b/service/qldbsession/api_client.go index b9f7beab7da..5b5a5e88e84 100644 --- a/service/qldbsession/api_client.go +++ b/service/qldbsession/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/quicksight/api_client.go b/service/quicksight/api_client.go index eeca4301838..053b4a4534a 100644 --- a/service/quicksight/api_client.go +++ b/service/quicksight/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ram/api_client.go b/service/ram/api_client.go index 9d1e665e55e..1ea078d2f35 100644 --- a/service/ram/api_client.go +++ b/service/ram/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/rds/api_client.go b/service/rds/api_client.go index efc9fbbe7d1..7b41016cdb1 100644 --- a/service/rds/api_client.go +++ b/service/rds/api_client.go @@ -84,7 +84,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -157,13 +157,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -182,6 +182,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/rdsdata/api_client.go b/service/rdsdata/api_client.go index bb56714f3cb..c953e1bf55d 100644 --- a/service/rdsdata/api_client.go +++ b/service/rdsdata/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/redshift/api_client.go b/service/redshift/api_client.go index 96933fc046a..10031a8ba44 100644 --- a/service/redshift/api_client.go +++ b/service/redshift/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/redshiftdata/api_client.go b/service/redshiftdata/api_client.go index b6a9736ff3b..1433922eb68 100644 --- a/service/redshiftdata/api_client.go +++ b/service/redshiftdata/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/rekognition/api_client.go b/service/rekognition/api_client.go index 1e3af66dffd..dc51b50ae7f 100644 --- a/service/rekognition/api_client.go +++ b/service/rekognition/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/resourcegroups/api_client.go b/service/resourcegroups/api_client.go index 8421e2ae818..b791bd92482 100644 --- a/service/resourcegroups/api_client.go +++ b/service/resourcegroups/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/resourcegroupstaggingapi/api_client.go b/service/resourcegroupstaggingapi/api_client.go index 24cf6a9a29c..4830df59af2 100644 --- a/service/resourcegroupstaggingapi/api_client.go +++ b/service/resourcegroupstaggingapi/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/robomaker/api_client.go b/service/robomaker/api_client.go index aba6cc16a04..4fc6aeb5a5d 100644 --- a/service/robomaker/api_client.go +++ b/service/robomaker/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/route53/api_client.go b/service/route53/api_client.go index e8a826738d6..a7b933d23b4 100644 --- a/service/route53/api_client.go +++ b/service/route53/api_client.go @@ -83,7 +83,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -156,13 +156,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -181,6 +181,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/route53/internal/customizations/custom_error_deser_test.go b/service/route53/internal/customizations/custom_error_deser_test.go index de976a6e824..4e269fbdfec 100644 --- a/service/route53/internal/customizations/custom_error_deser_test.go +++ b/service/route53/internal/customizations/custom_error_deser_test.go @@ -80,7 +80,9 @@ func TestCustomErrorDeserialization(t *testing.T) { SigningName: "route53", }, nil }), - Retryer: aws.NopRetryer{}, + Retryer: func() aws.Retryer { + return aws.NopRetryer{} + }, }) resp, err := svc.ChangeResourceRecordSets(context.Background(), &route53.ChangeResourceRecordSetsInput{ ChangeBatch: &types.ChangeBatch{ diff --git a/service/route53/internal/customizations/sanitizeurl_test.go b/service/route53/internal/customizations/sanitizeurl_test.go index 0aea417a029..5d275203cd8 100644 --- a/service/route53/internal/customizations/sanitizeurl_test.go +++ b/service/route53/internal/customizations/sanitizeurl_test.go @@ -37,7 +37,9 @@ func TestSanitizeURLMiddleware(t *testing.T) { t.Run(name, func(t *testing.T) { cfg := aws.Config{ Credentials: unit.StubCredentialsProvider{}, - Retryer: aws.NopRetryer{}, + Retryer: func() aws.Retryer { + return aws.NopRetryer{} + }, Region: "mock-region", } diff --git a/service/route53domains/api_client.go b/service/route53domains/api_client.go index 8eea987a5be..b7519f210d5 100644 --- a/service/route53domains/api_client.go +++ b/service/route53domains/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/route53resolver/api_client.go b/service/route53resolver/api_client.go index dbafd8791b2..1cc71b53e35 100644 --- a/service/route53resolver/api_client.go +++ b/service/route53resolver/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/s3/api_client.go b/service/s3/api_client.go index e77767fa05d..7f9433081eb 100644 --- a/service/s3/api_client.go +++ b/service/s3/api_client.go @@ -88,7 +88,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // Allows you to enable arn region support for the service. UseARNRegion bool @@ -180,13 +180,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveClientConfig(cfg, &opts) return New(opts, optFns...) @@ -206,6 +206,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/s3/internal/customizations/presign_test.go b/service/s3/internal/customizations/presign_test.go index 9a3ee22f892..7c1fa02495a 100644 --- a/service/s3/internal/customizations/presign_test.go +++ b/service/s3/internal/customizations/presign_test.go @@ -133,7 +133,9 @@ func TestPutObject_PresignURL(t *testing.T) { cfg := aws.Config{ Region: "us-west-2", Credentials: unit.StubCredentialsProvider{}, - Retryer: aws.NopRetryer{}, + Retryer: func() aws.Retryer { + return aws.NopRetryer{} + }, } presignClient := s3.NewPresignClient(s3.NewFromConfig(cfg), func(options *s3.PresignOptions) { options = &c.options diff --git a/service/s3/internal/customizations/unit_test.go b/service/s3/internal/customizations/unit_test.go index 8fd87acc017..467fcbd0d4b 100644 --- a/service/s3/internal/customizations/unit_test.go +++ b/service/s3/internal/customizations/unit_test.go @@ -52,7 +52,9 @@ func Test_EmptyResponse(t *testing.T) { SigningName: "s3", }, nil }), - Retryer: aws.NopRetryer{}, + Retryer: func() aws.Retryer { + return aws.NopRetryer{} + }, } client := s3.NewFromConfig(cfg, func(options *s3.Options) { diff --git a/service/s3control/api_client.go b/service/s3control/api_client.go index 1d7948c49a8..450a8fb51d6 100644 --- a/service/s3control/api_client.go +++ b/service/s3control/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // Allows you to enable arn region support for the service. UseARNRegion bool @@ -169,13 +169,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveClientConfig(cfg, &opts) return New(opts, optFns...) @@ -195,6 +195,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/s3outposts/api_client.go b/service/s3outposts/api_client.go index 076d7b621bf..42ff790a57e 100644 --- a/service/s3outposts/api_client.go +++ b/service/s3outposts/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sagemaker/api_client.go b/service/sagemaker/api_client.go index b4bdce7dc21..9b24ef98ad4 100644 --- a/service/sagemaker/api_client.go +++ b/service/sagemaker/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sagemakera2iruntime/api_client.go b/service/sagemakera2iruntime/api_client.go index ea6ff2dec71..ad42440f793 100644 --- a/service/sagemakera2iruntime/api_client.go +++ b/service/sagemakera2iruntime/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sagemakeredge/api_client.go b/service/sagemakeredge/api_client.go index 0301d0a089f..d9e5efe851a 100644 --- a/service/sagemakeredge/api_client.go +++ b/service/sagemakeredge/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sagemakerfeaturestoreruntime/api_client.go b/service/sagemakerfeaturestoreruntime/api_client.go index 56fb01c8868..5c56f2d3eed 100644 --- a/service/sagemakerfeaturestoreruntime/api_client.go +++ b/service/sagemakerfeaturestoreruntime/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sagemakerruntime/api_client.go b/service/sagemakerruntime/api_client.go index 581d123095e..6c571b09832 100644 --- a/service/sagemakerruntime/api_client.go +++ b/service/sagemakerruntime/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/savingsplans/api_client.go b/service/savingsplans/api_client.go index 33a64008d84..6c087328a55 100644 --- a/service/savingsplans/api_client.go +++ b/service/savingsplans/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/schemas/api_client.go b/service/schemas/api_client.go index 44f64ee3d06..ccaa354c8de 100644 --- a/service/schemas/api_client.go +++ b/service/schemas/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/secretsmanager/api_client.go b/service/secretsmanager/api_client.go index 4ee89a92706..ca2f7192ac8 100644 --- a/service/secretsmanager/api_client.go +++ b/service/secretsmanager/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/securityhub/api_client.go b/service/securityhub/api_client.go index b7ddc56b352..68fdd31beca 100644 --- a/service/securityhub/api_client.go +++ b/service/securityhub/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/serverlessapplicationrepository/api_client.go b/service/serverlessapplicationrepository/api_client.go index 7634e7b288b..9f968d673fc 100644 --- a/service/serverlessapplicationrepository/api_client.go +++ b/service/serverlessapplicationrepository/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/servicecatalog/api_client.go b/service/servicecatalog/api_client.go index 22643ff798c..dabb4abee88 100644 --- a/service/servicecatalog/api_client.go +++ b/service/servicecatalog/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/servicecatalogappregistry/api_client.go b/service/servicecatalogappregistry/api_client.go index 24bc241cf77..6de2fd6a0ce 100644 --- a/service/servicecatalogappregistry/api_client.go +++ b/service/servicecatalogappregistry/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/servicediscovery/api_client.go b/service/servicediscovery/api_client.go index 78e3c104aeb..c055c61e493 100644 --- a/service/servicediscovery/api_client.go +++ b/service/servicediscovery/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/servicequotas/api_client.go b/service/servicequotas/api_client.go index 9a07080725b..a39f1fc87bd 100644 --- a/service/servicequotas/api_client.go +++ b/service/servicequotas/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ses/api_client.go b/service/ses/api_client.go index e1574d625c7..5b58f6e8d95 100644 --- a/service/ses/api_client.go +++ b/service/ses/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sesv2/api_client.go b/service/sesv2/api_client.go index 3a09a04a368..1a9576435b4 100644 --- a/service/sesv2/api_client.go +++ b/service/sesv2/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sfn/api_client.go b/service/sfn/api_client.go index 7510db1badf..64c58065f07 100644 --- a/service/sfn/api_client.go +++ b/service/sfn/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/shield/api_client.go b/service/shield/api_client.go index e8b578ba806..8139d4606b1 100644 --- a/service/shield/api_client.go +++ b/service/shield/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/signer/api_client.go b/service/signer/api_client.go index 2caf470d2aa..d7ee87e591f 100644 --- a/service/signer/api_client.go +++ b/service/signer/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sms/api_client.go b/service/sms/api_client.go index c579d7971ee..09d476be699 100644 --- a/service/sms/api_client.go +++ b/service/sms/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/snowball/api_client.go b/service/snowball/api_client.go index c0e1f4c2f74..fb62582a179 100644 --- a/service/snowball/api_client.go +++ b/service/snowball/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sns/api_client.go b/service/sns/api_client.go index 6ea06d12ee5..ffaf6ce2787 100644 --- a/service/sns/api_client.go +++ b/service/sns/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sqs/api_client.go b/service/sqs/api_client.go index 6ed5a5faf42..6b9b5c8fc66 100644 --- a/service/sqs/api_client.go +++ b/service/sqs/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ssm/api_client.go b/service/ssm/api_client.go index a2600c30c50..8a7d5669b51 100644 --- a/service/ssm/api_client.go +++ b/service/ssm/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sso/api_client.go b/service/sso/api_client.go index 3bc7a8ce6cf..f35e80c95f8 100644 --- a/service/sso/api_client.go +++ b/service/sso/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ssoadmin/api_client.go b/service/ssoadmin/api_client.go index e960a1c861b..e6799d39388 100644 --- a/service/ssoadmin/api_client.go +++ b/service/ssoadmin/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/ssooidc/api_client.go b/service/ssooidc/api_client.go index 2cb7b154347..da54ce1702b 100644 --- a/service/ssooidc/api_client.go +++ b/service/ssooidc/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/storagegateway/api_client.go b/service/storagegateway/api_client.go index 636658b15e3..2c49446caa0 100644 --- a/service/storagegateway/api_client.go +++ b/service/storagegateway/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/sts/api_client.go b/service/sts/api_client.go index 6bb42b4f648..9b747a445c7 100644 --- a/service/sts/api_client.go +++ b/service/sts/api_client.go @@ -84,7 +84,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -157,13 +157,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -182,6 +182,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/support/api_client.go b/service/support/api_client.go index c64aaad2636..ce51b933116 100644 --- a/service/support/api_client.go +++ b/service/support/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/swf/api_client.go b/service/swf/api_client.go index 40699c63cab..de2128875fb 100644 --- a/service/swf/api_client.go +++ b/service/swf/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/synthetics/api_client.go b/service/synthetics/api_client.go index 1cae9024df9..d4664a39d1b 100644 --- a/service/synthetics/api_client.go +++ b/service/synthetics/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/textract/api_client.go b/service/textract/api_client.go index 1f1b9c3d3d6..2d87dd82dfe 100644 --- a/service/textract/api_client.go +++ b/service/textract/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/timestreamquery/api_client.go b/service/timestreamquery/api_client.go index 2a42f33c534..190ab3af8bd 100644 --- a/service/timestreamquery/api_client.go +++ b/service/timestreamquery/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/timestreamwrite/api_client.go b/service/timestreamwrite/api_client.go index af9728c7cde..ed234f4387d 100644 --- a/service/timestreamwrite/api_client.go +++ b/service/timestreamwrite/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/transcribe/api_client.go b/service/transcribe/api_client.go index d3c4ab45a6c..08026cd62cd 100644 --- a/service/transcribe/api_client.go +++ b/service/transcribe/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/transfer/api_client.go b/service/transfer/api_client.go index 25ec40bdb4c..f54f60d4703 100644 --- a/service/transfer/api_client.go +++ b/service/transfer/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/translate/api_client.go b/service/translate/api_client.go index 956f3719996..a7be3426990 100644 --- a/service/translate/api_client.go +++ b/service/translate/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/waf/api_client.go b/service/waf/api_client.go index 3086615d153..75afa70732c 100644 --- a/service/waf/api_client.go +++ b/service/waf/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/wafregional/api_client.go b/service/wafregional/api_client.go index aea47cd6691..029f48caa1a 100644 --- a/service/wafregional/api_client.go +++ b/service/wafregional/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/wafv2/api_client.go b/service/wafv2/api_client.go index ae01f809f69..d4236361fed 100644 --- a/service/wafv2/api_client.go +++ b/service/wafv2/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/wellarchitected/api_client.go b/service/wellarchitected/api_client.go index 83e0d80d1a3..9ef44fc2902 100644 --- a/service/wellarchitected/api_client.go +++ b/service/wellarchitected/api_client.go @@ -90,7 +90,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -163,13 +163,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -188,6 +188,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/workdocs/api_client.go b/service/workdocs/api_client.go index 43df7b46011..4dec4c9e030 100644 --- a/service/workdocs/api_client.go +++ b/service/workdocs/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/worklink/api_client.go b/service/worklink/api_client.go index 1507f231e8d..eb3e01be6fd 100644 --- a/service/worklink/api_client.go +++ b/service/worklink/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/workmail/api_client.go b/service/workmail/api_client.go index 8a45d8a91dc..5a8e2b40c85 100644 --- a/service/workmail/api_client.go +++ b/service/workmail/api_client.go @@ -89,7 +89,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -162,13 +162,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -187,6 +187,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/workmailmessageflow/api_client.go b/service/workmailmessageflow/api_client.go index 13183dec070..cf0990c1747 100644 --- a/service/workmailmessageflow/api_client.go +++ b/service/workmailmessageflow/api_client.go @@ -82,7 +82,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -155,13 +155,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -180,6 +180,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/workspaces/api_client.go b/service/workspaces/api_client.go index 978077533ee..b08883464ff 100644 --- a/service/workspaces/api_client.go +++ b/service/workspaces/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return diff --git a/service/xray/api_client.go b/service/xray/api_client.go index bca0444983e..c631409e876 100644 --- a/service/xray/api_client.go +++ b/service/xray/api_client.go @@ -81,7 +81,7 @@ type Options struct { // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. - Retryer retry.Retryer + Retryer aws.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. @@ -154,13 +154,13 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, - Retryer: cfg.Retryer, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } + resolveAWSRetryerProvider(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) return New(opts, optFns...) } @@ -179,6 +179,13 @@ func resolveRetryer(o *Options) { o.Retryer = retry.NewStandard() } +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil { return