diff --git a/clients/client-accessanalyzer/AccessAnalyzerClient.ts b/clients/client-accessanalyzer/AccessAnalyzerClient.ts index f9c23f265187e..24b77813b6b8b 100644 --- a/clients/client-accessanalyzer/AccessAnalyzerClient.ts +++ b/clients/client-accessanalyzer/AccessAnalyzerClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AccessAnalyzerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +217,8 @@ export type AccessAnalyzerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AccessAnalyzerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +226,8 @@ export type AccessAnalyzerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IAM Access Analyzer helps identify potential resource-access risks by enabling you to identify @@ -253,16 +255,16 @@ export class AccessAnalyzerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-accessanalyzer/runtimeConfig.browser.ts b/clients/client-accessanalyzer/runtimeConfig.browser.ts index aea62fb426257..116aa076a1618 100644 --- a/clients/client-accessanalyzer/runtimeConfig.browser.ts +++ b/clients/client-accessanalyzer/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-accessanalyzer/runtimeConfig.native.ts b/clients/client-accessanalyzer/runtimeConfig.native.ts index 977139ea8ccf0..27025d278a61a 100644 --- a/clients/client-accessanalyzer/runtimeConfig.native.ts +++ b/clients/client-accessanalyzer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AccessAnalyzerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-accessanalyzer/runtimeConfig.ts b/clients/client-accessanalyzer/runtimeConfig.ts index fe6bac89cd3a2..174dac3a46519 100644 --- a/clients/client-accessanalyzer/runtimeConfig.ts +++ b/clients/client-accessanalyzer/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-acm-pca/ACMPCAClient.ts b/clients/client-acm-pca/ACMPCAClient.ts index 5e197d837534a..d1091a80609a5 100644 --- a/clients/client-acm-pca/ACMPCAClient.ts +++ b/clients/client-acm-pca/ACMPCAClient.ts @@ -97,6 +97,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -107,6 +108,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -206,11 +208,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -252,6 +249,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ACMPCAClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -260,8 +262,8 @@ export type ACMPCAClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ACMPCAClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -269,8 +271,8 @@ export type ACMPCAClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -307,16 +309,16 @@ export class ACMPCAClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-acm-pca/runtimeConfig.browser.ts b/clients/client-acm-pca/runtimeConfig.browser.ts index 9b071e3e9dd57..e80fd1faee4d0 100644 --- a/clients/client-acm-pca/runtimeConfig.browser.ts +++ b/clients/client-acm-pca/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-acm-pca/runtimeConfig.native.ts b/clients/client-acm-pca/runtimeConfig.native.ts index d103502caad3b..3bc3237efc3be 100644 --- a/clients/client-acm-pca/runtimeConfig.native.ts +++ b/clients/client-acm-pca/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ACMPCAClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-acm-pca/runtimeConfig.ts b/clients/client-acm-pca/runtimeConfig.ts index f7c71161f59e6..eec81e30f8e70 100644 --- a/clients/client-acm-pca/runtimeConfig.ts +++ b/clients/client-acm-pca/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-acm/ACMClient.ts b/clients/client-acm/ACMClient.ts index 1ba3fef53d5a4..b274fe60ecdfc 100644 --- a/clients/client-acm/ACMClient.ts +++ b/clients/client-acm/ACMClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ACMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +211,8 @@ export type ACMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ACMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +220,8 @@ export type ACMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Certificate Manager @@ -246,16 +248,16 @@ export class ACMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-acm/runtimeConfig.browser.ts b/clients/client-acm/runtimeConfig.browser.ts index 92c538fdd6816..21a722a741f36 100644 --- a/clients/client-acm/runtimeConfig.browser.ts +++ b/clients/client-acm/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-acm/runtimeConfig.native.ts b/clients/client-acm/runtimeConfig.native.ts index df9a10ab63b65..3583aceeb6c15 100644 --- a/clients/client-acm/runtimeConfig.native.ts +++ b/clients/client-acm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ACMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-acm/runtimeConfig.ts b/clients/client-acm/runtimeConfig.ts index b40f62b46c221..997cf616b07e1 100644 --- a/clients/client-acm/runtimeConfig.ts +++ b/clients/client-acm/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-alexa-for-business/AlexaForBusinessClient.ts b/clients/client-alexa-for-business/AlexaForBusinessClient.ts index 038500f442bcc..77704430beefa 100644 --- a/clients/client-alexa-for-business/AlexaForBusinessClient.ts +++ b/clients/client-alexa-for-business/AlexaForBusinessClient.ts @@ -245,6 +245,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -255,6 +256,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -494,11 +496,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -540,6 +537,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AlexaForBusinessClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -548,8 +550,8 @@ export type AlexaForBusinessClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AlexaForBusinessClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -557,8 +559,8 @@ export type AlexaForBusinessClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Alexa for Business helps you use Alexa in your organization. Alexa for Business provides you with the tools @@ -587,16 +589,16 @@ export class AlexaForBusinessClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-alexa-for-business/runtimeConfig.browser.ts b/clients/client-alexa-for-business/runtimeConfig.browser.ts index 9b181024e2927..f2f51297cc6c0 100644 --- a/clients/client-alexa-for-business/runtimeConfig.browser.ts +++ b/clients/client-alexa-for-business/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-alexa-for-business/runtimeConfig.native.ts b/clients/client-alexa-for-business/runtimeConfig.native.ts index 0a2c52c955f39..ad88f4b0f6fbb 100644 --- a/clients/client-alexa-for-business/runtimeConfig.native.ts +++ b/clients/client-alexa-for-business/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AlexaForBusinessClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-alexa-for-business/runtimeConfig.ts b/clients/client-alexa-for-business/runtimeConfig.ts index a7671434b4188..b4a0cd46211af 100644 --- a/clients/client-alexa-for-business/runtimeConfig.ts +++ b/clients/client-alexa-for-business/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-amplify/AmplifyClient.ts b/clients/client-amplify/AmplifyClient.ts index c70758d5374bf..80c6ffe724293 100644 --- a/clients/client-amplify/AmplifyClient.ts +++ b/clients/client-amplify/AmplifyClient.ts @@ -102,6 +102,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -112,6 +113,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AmplifyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +295,8 @@ export type AmplifyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AmplifyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +304,8 @@ export type AmplifyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amplify enables developers to develop and deploy cloud-powered mobile and web apps. @@ -330,16 +332,16 @@ export class AmplifyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-amplify/runtimeConfig.browser.ts b/clients/client-amplify/runtimeConfig.browser.ts index 94d63be37d9d7..592421b9c32f3 100644 --- a/clients/client-amplify/runtimeConfig.browser.ts +++ b/clients/client-amplify/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-amplify/runtimeConfig.native.ts b/clients/client-amplify/runtimeConfig.native.ts index 67186c904256e..886468e2a6fe8 100644 --- a/clients/client-amplify/runtimeConfig.native.ts +++ b/clients/client-amplify/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AmplifyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-amplify/runtimeConfig.ts b/clients/client-amplify/runtimeConfig.ts index 98bbb08b8ee35..a235cd5bc2fda 100644 --- a/clients/client-amplify/runtimeConfig.ts +++ b/clients/client-amplify/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-amplifybackend/AmplifyBackendClient.ts b/clients/client-amplifybackend/AmplifyBackendClient.ts index 57c1ba5c2479f..ebafda991235d 100644 --- a/clients/client-amplifybackend/AmplifyBackendClient.ts +++ b/clients/client-amplifybackend/AmplifyBackendClient.ts @@ -74,6 +74,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -84,6 +85,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AmplifyBackendClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +241,8 @@ export type AmplifyBackendClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AmplifyBackendClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +250,8 @@ export type AmplifyBackendClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Amplify Admin API

@@ -271,16 +273,16 @@ export class AmplifyBackendClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-amplifybackend/runtimeConfig.browser.ts b/clients/client-amplifybackend/runtimeConfig.browser.ts index 1ad28c41c63a0..94746753bd5f5 100644 --- a/clients/client-amplifybackend/runtimeConfig.browser.ts +++ b/clients/client-amplifybackend/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-amplifybackend/runtimeConfig.native.ts b/clients/client-amplifybackend/runtimeConfig.native.ts index 56a11bbb199dd..f0be385fe8248 100644 --- a/clients/client-amplifybackend/runtimeConfig.native.ts +++ b/clients/client-amplifybackend/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AmplifyBackendClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-amplifybackend/runtimeConfig.ts b/clients/client-amplifybackend/runtimeConfig.ts index 8b2a934698efe..67267a3de56e7 100644 --- a/clients/client-amplifybackend/runtimeConfig.ts +++ b/clients/client-amplifybackend/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-api-gateway/APIGatewayClient.ts b/clients/client-api-gateway/APIGatewayClient.ts index 0ca741da0c6de..5b294c7c7e156 100644 --- a/clients/client-api-gateway/APIGatewayClient.ts +++ b/clients/client-api-gateway/APIGatewayClient.ts @@ -264,6 +264,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -274,6 +275,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -567,11 +569,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -613,6 +610,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type APIGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -621,8 +623,8 @@ export type APIGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type APIGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -630,8 +632,8 @@ export type APIGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon API Gateway @@ -654,17 +656,17 @@ export class APIGatewayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getAcceptHeaderPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-api-gateway/runtimeConfig.browser.ts b/clients/client-api-gateway/runtimeConfig.browser.ts index fd249324763eb..a7365f045d638 100644 --- a/clients/client-api-gateway/runtimeConfig.browser.ts +++ b/clients/client-api-gateway/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-api-gateway/runtimeConfig.native.ts b/clients/client-api-gateway/runtimeConfig.native.ts index 09bcef62e9075..b163cffadc3b1 100644 --- a/clients/client-api-gateway/runtimeConfig.native.ts +++ b/clients/client-api-gateway/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./APIGatewayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-api-gateway/runtimeConfig.ts b/clients/client-api-gateway/runtimeConfig.ts index ab7c57f926a2a..36c5485e356cf 100644 --- a/clients/client-api-gateway/runtimeConfig.ts +++ b/clients/client-api-gateway/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts b/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts index f916a2e0b43fd..69f35f4e55da2 100644 --- a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts +++ b/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DeleteConnectionCommandInput | GetConnectionCommandInput | PostToConnectionCommandInput; @@ -104,11 +106,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -150,6 +147,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ApiGatewayManagementApiClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -158,8 +160,8 @@ export type ApiGatewayManagementApiClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApiGatewayManagementApiClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -167,8 +169,8 @@ export type ApiGatewayManagementApiClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon API Gateway Management API allows you to directly manage runtime aspects of your deployed APIs. To use it, you must explicitly set the SDK's endpoint to point to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, or will be the endpoint corresponding to your API's custom domain and base path, if applicable.

@@ -190,16 +192,16 @@ export class ApiGatewayManagementApiClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts index ee28d5c154cf4..653ff4e350844 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts index 7230ad03c35ba..418428ceb61e7 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApiGatewayManagementApiClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.ts index feb00fe0763d1..1db6a7778a2f1 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-apigatewayv2/ApiGatewayV2Client.ts b/clients/client-apigatewayv2/ApiGatewayV2Client.ts index 1aced5bc712bb..637eb3967d31c 100644 --- a/clients/client-apigatewayv2/ApiGatewayV2Client.ts +++ b/clients/client-apigatewayv2/ApiGatewayV2Client.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -353,11 +355,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -399,6 +396,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ApiGatewayV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -407,8 +409,8 @@ export type ApiGatewayV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApiGatewayV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -416,8 +418,8 @@ export type ApiGatewayV2ClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon API Gateway V2

@@ -439,16 +441,16 @@ export class ApiGatewayV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-apigatewayv2/runtimeConfig.browser.ts b/clients/client-apigatewayv2/runtimeConfig.browser.ts index b3ad587e97f7f..11fb41ca574cc 100644 --- a/clients/client-apigatewayv2/runtimeConfig.browser.ts +++ b/clients/client-apigatewayv2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-apigatewayv2/runtimeConfig.native.ts b/clients/client-apigatewayv2/runtimeConfig.native.ts index 01cb1a3346bea..4f4096e65edad 100644 --- a/clients/client-apigatewayv2/runtimeConfig.native.ts +++ b/clients/client-apigatewayv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApiGatewayV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-apigatewayv2/runtimeConfig.ts b/clients/client-apigatewayv2/runtimeConfig.ts index d9a914fe7a49f..ff62929a46c0e 100644 --- a/clients/client-apigatewayv2/runtimeConfig.ts +++ b/clients/client-apigatewayv2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-app-mesh/AppMeshClient.ts b/clients/client-app-mesh/AppMeshClient.ts index b9fc0b6e18313..a289ebfbb7da2 100644 --- a/clients/client-app-mesh/AppMeshClient.ts +++ b/clients/client-app-mesh/AppMeshClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AppMeshClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +319,8 @@ export type AppMeshClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppMeshClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +328,8 @@ export type AppMeshClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS App Mesh is a service mesh based on the Envoy proxy that makes it easy to monitor and @@ -361,16 +363,16 @@ export class AppMeshClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-app-mesh/runtimeConfig.browser.ts b/clients/client-app-mesh/runtimeConfig.browser.ts index 828cbab883916..bdc5b51ac342a 100644 --- a/clients/client-app-mesh/runtimeConfig.browser.ts +++ b/clients/client-app-mesh/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-app-mesh/runtimeConfig.native.ts b/clients/client-app-mesh/runtimeConfig.native.ts index 268b7f6eee3f6..4b9aaa11dd343 100644 --- a/clients/client-app-mesh/runtimeConfig.native.ts +++ b/clients/client-app-mesh/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppMeshClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-app-mesh/runtimeConfig.ts b/clients/client-app-mesh/runtimeConfig.ts index 85c57aa16db8e..64a8497df86fd 100644 --- a/clients/client-app-mesh/runtimeConfig.ts +++ b/clients/client-app-mesh/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appconfig/AppConfigClient.ts b/clients/client-appconfig/AppConfigClient.ts index 8bf768cb61628..e2e6a6927afea 100644 --- a/clients/client-appconfig/AppConfigClient.ts +++ b/clients/client-appconfig/AppConfigClient.ts @@ -116,6 +116,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -126,6 +127,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AppConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +301,8 @@ export type AppConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppConfigClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +310,8 @@ export type AppConfigClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS AppConfig @@ -379,16 +381,16 @@ export class AppConfigClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appconfig/runtimeConfig.browser.ts b/clients/client-appconfig/runtimeConfig.browser.ts index 2cf27d1514fa7..8cc88f8d19da8 100644 --- a/clients/client-appconfig/runtimeConfig.browser.ts +++ b/clients/client-appconfig/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appconfig/runtimeConfig.native.ts b/clients/client-appconfig/runtimeConfig.native.ts index af56e0576fd67..7437c5e8815b0 100644 --- a/clients/client-appconfig/runtimeConfig.native.ts +++ b/clients/client-appconfig/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppConfigClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appconfig/runtimeConfig.ts b/clients/client-appconfig/runtimeConfig.ts index 489ae088f3867..3cc8fdc44555f 100644 --- a/clients/client-appconfig/runtimeConfig.ts +++ b/clients/client-appconfig/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appflow/AppflowClient.ts b/clients/client-appflow/AppflowClient.ts index eeeec77bc817e..85fed667ff2c2 100644 --- a/clients/client-appflow/AppflowClient.ts +++ b/clients/client-appflow/AppflowClient.ts @@ -77,6 +77,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -87,6 +88,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AppflowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +232,8 @@ export type AppflowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppflowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +241,8 @@ export type AppflowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the Amazon AppFlow API reference. This guide is for developers who need detailed information about the Amazon AppFlow API operations, data types, and errors.

@@ -292,16 +294,16 @@ export class AppflowClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appflow/runtimeConfig.browser.ts b/clients/client-appflow/runtimeConfig.browser.ts index 7ea6f6d852d17..3dbda209f977e 100644 --- a/clients/client-appflow/runtimeConfig.browser.ts +++ b/clients/client-appflow/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appflow/runtimeConfig.native.ts b/clients/client-appflow/runtimeConfig.native.ts index 42e5f2fe5fbe1..854e00b753671 100644 --- a/clients/client-appflow/runtimeConfig.native.ts +++ b/clients/client-appflow/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppflowClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appflow/runtimeConfig.ts b/clients/client-appflow/runtimeConfig.ts index 1a315f3cf68cb..9108a6af50fda 100644 --- a/clients/client-appflow/runtimeConfig.ts +++ b/clients/client-appflow/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appintegrations/AppIntegrationsClient.ts b/clients/client-appintegrations/AppIntegrationsClient.ts index f9aa5a5b5da06..d3ffc4abaffa5 100644 --- a/clients/client-appintegrations/AppIntegrationsClient.ts +++ b/clients/client-appintegrations/AppIntegrationsClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AppIntegrationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +202,8 @@ export type AppIntegrationsClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppIntegrationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +211,8 @@ export type AppIntegrationsClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon AppIntegrations APIs are in preview release and are subject to change.

@@ -235,16 +237,16 @@ export class AppIntegrationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appintegrations/runtimeConfig.browser.ts b/clients/client-appintegrations/runtimeConfig.browser.ts index f8911bb4e7304..f1889f1965c08 100644 --- a/clients/client-appintegrations/runtimeConfig.browser.ts +++ b/clients/client-appintegrations/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appintegrations/runtimeConfig.native.ts b/clients/client-appintegrations/runtimeConfig.native.ts index 9dddd1281d4e9..e54eac06d5bce 100644 --- a/clients/client-appintegrations/runtimeConfig.native.ts +++ b/clients/client-appintegrations/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppIntegrationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appintegrations/runtimeConfig.ts b/clients/client-appintegrations/runtimeConfig.ts index facdeb033815a..04b4e371cec90 100644 --- a/clients/client-appintegrations/runtimeConfig.ts +++ b/clients/client-appintegrations/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts b/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts index 5fd6341b8b824..05490a2745c30 100644 --- a/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts +++ b/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ApplicationAutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +208,8 @@ export type ApplicationAutoScalingClientConfig = Partial<__SmithyConfiguration<_ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationAutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +217,8 @@ export type ApplicationAutoScalingClientResolvedConfig = __SmithyResolvedConfigu EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

With Application Auto Scaling, you can configure automatic scaling for the following @@ -305,16 +307,16 @@ export class ApplicationAutoScalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-auto-scaling/runtimeConfig.browser.ts b/clients/client-application-auto-scaling/runtimeConfig.browser.ts index ba86a5f99019d..b052393514b9c 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.browser.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-auto-scaling/runtimeConfig.native.ts b/clients/client-application-auto-scaling/runtimeConfig.native.ts index 13d98e31c487f..e649ea552238f 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.native.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationAutoScalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-auto-scaling/runtimeConfig.ts b/clients/client-application-auto-scaling/runtimeConfig.ts index 6dfa2648669f2..417752ea58ead 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts b/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts index 39bc42bae53c2..088a8386e2bcf 100644 --- a/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts +++ b/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -218,11 +220,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -264,6 +261,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ApplicationDiscoveryServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -272,8 +274,8 @@ export type ApplicationDiscoveryServiceClientConfig = Partial<__SmithyConfigurat EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationDiscoveryServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -281,8 +283,8 @@ export type ApplicationDiscoveryServiceClientResolvedConfig = __SmithyResolvedCo EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Application Discovery Service @@ -430,16 +432,16 @@ export class ApplicationDiscoveryServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-discovery-service/runtimeConfig.browser.ts b/clients/client-application-discovery-service/runtimeConfig.browser.ts index ce53f6ccf93d8..67a7e99d586e8 100644 --- a/clients/client-application-discovery-service/runtimeConfig.browser.ts +++ b/clients/client-application-discovery-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-discovery-service/runtimeConfig.native.ts b/clients/client-application-discovery-service/runtimeConfig.native.ts index 476ab3fc9198f..f7f13bac556d1 100644 --- a/clients/client-application-discovery-service/runtimeConfig.native.ts +++ b/clients/client-application-discovery-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationDiscoveryServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-discovery-service/runtimeConfig.ts b/clients/client-application-discovery-service/runtimeConfig.ts index 80c7f1f04d63a..449cc9e421496 100644 --- a/clients/client-application-discovery-service/runtimeConfig.ts +++ b/clients/client-application-discovery-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-insights/ApplicationInsightsClient.ts b/clients/client-application-insights/ApplicationInsightsClient.ts index bfbf8a8e32601..2dbd1261c7323 100644 --- a/clients/client-application-insights/ApplicationInsightsClient.ts +++ b/clients/client-application-insights/ApplicationInsightsClient.ts @@ -86,6 +86,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -96,6 +97,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -203,11 +205,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -249,6 +246,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ApplicationInsightsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -257,8 +259,8 @@ export type ApplicationInsightsClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationInsightsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -266,8 +268,8 @@ export type ApplicationInsightsClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudWatch Application Insights @@ -301,16 +303,16 @@ export class ApplicationInsightsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-insights/runtimeConfig.browser.ts b/clients/client-application-insights/runtimeConfig.browser.ts index 42308c08870d7..4c84ffd9e1788 100644 --- a/clients/client-application-insights/runtimeConfig.browser.ts +++ b/clients/client-application-insights/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-insights/runtimeConfig.native.ts b/clients/client-application-insights/runtimeConfig.native.ts index 6b4315ecaf555..a5e50d48a70d5 100644 --- a/clients/client-application-insights/runtimeConfig.native.ts +++ b/clients/client-application-insights/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationInsightsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-insights/runtimeConfig.ts b/clients/client-application-insights/runtimeConfig.ts index 3e10b86e9ddfb..7f25de7eb72b1 100644 --- a/clients/client-application-insights/runtimeConfig.ts +++ b/clients/client-application-insights/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appstream/AppStreamClient.ts b/clients/client-appstream/AppStreamClient.ts index 18da3ac1171a6..53ff2cf7d24a3 100644 --- a/clients/client-appstream/AppStreamClient.ts +++ b/clients/client-appstream/AppStreamClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AppStreamClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +349,8 @@ export type AppStreamClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppStreamClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +358,8 @@ export type AppStreamClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon AppStream 2.0 @@ -399,16 +401,16 @@ export class AppStreamClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appstream/runtimeConfig.browser.ts b/clients/client-appstream/runtimeConfig.browser.ts index 800136672f53e..0a7b460e8e5b9 100644 --- a/clients/client-appstream/runtimeConfig.browser.ts +++ b/clients/client-appstream/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appstream/runtimeConfig.native.ts b/clients/client-appstream/runtimeConfig.native.ts index c2b730acd6ce1..c466709e8de18 100644 --- a/clients/client-appstream/runtimeConfig.native.ts +++ b/clients/client-appstream/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppStreamClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appstream/runtimeConfig.ts b/clients/client-appstream/runtimeConfig.ts index b3ab095188b32..2324e8afd38a6 100644 --- a/clients/client-appstream/runtimeConfig.ts +++ b/clients/client-appstream/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appsync/AppSyncClient.ts b/clients/client-appsync/AppSyncClient.ts index d649b1522cbf1..7b7a805377a42 100644 --- a/clients/client-appsync/AppSyncClient.ts +++ b/clients/client-appsync/AppSyncClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AppSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +292,8 @@ export type AppSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +301,8 @@ export type AppSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS AppSync provides API actions for creating and interacting with data sources using @@ -323,16 +325,16 @@ export class AppSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appsync/runtimeConfig.browser.ts b/clients/client-appsync/runtimeConfig.browser.ts index 134b4d6e52519..da5b3281e22b7 100644 --- a/clients/client-appsync/runtimeConfig.browser.ts +++ b/clients/client-appsync/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appsync/runtimeConfig.native.ts b/clients/client-appsync/runtimeConfig.native.ts index 8281561ead585..05128c0c244df 100644 --- a/clients/client-appsync/runtimeConfig.native.ts +++ b/clients/client-appsync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appsync/runtimeConfig.ts b/clients/client-appsync/runtimeConfig.ts index f8163806f57de..3ea0a3b5e9d1e 100644 --- a/clients/client-appsync/runtimeConfig.ts +++ b/clients/client-appsync/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-athena/AthenaClient.ts b/clients/client-athena/AthenaClient.ts index cd10b0250f8c2..24b31f3a08db5 100644 --- a/clients/client-athena/AthenaClient.ts +++ b/clients/client-athena/AthenaClient.ts @@ -75,6 +75,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -85,6 +86,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AthenaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +250,8 @@ export type AthenaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AthenaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +259,8 @@ export type AthenaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Athena is an interactive query service that lets you use standard SQL to @@ -292,16 +294,16 @@ export class AthenaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-athena/runtimeConfig.browser.ts b/clients/client-athena/runtimeConfig.browser.ts index 688953830511d..149cddb4fdb94 100644 --- a/clients/client-athena/runtimeConfig.browser.ts +++ b/clients/client-athena/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-athena/runtimeConfig.native.ts b/clients/client-athena/runtimeConfig.native.ts index 57a7464b2c07f..1df4f8e427f82 100644 --- a/clients/client-athena/runtimeConfig.native.ts +++ b/clients/client-athena/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AthenaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-athena/runtimeConfig.ts b/clients/client-athena/runtimeConfig.ts index 2970ab64cd811..eec024619f932 100644 --- a/clients/client-athena/runtimeConfig.ts +++ b/clients/client-athena/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auditmanager/AuditManagerClient.ts b/clients/client-auditmanager/AuditManagerClient.ts index edacc451bb473..50a3b49473996 100644 --- a/clients/client-auditmanager/AuditManagerClient.ts +++ b/clients/client-auditmanager/AuditManagerClient.ts @@ -170,6 +170,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -180,6 +181,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -335,11 +337,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -381,6 +378,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AuditManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -389,8 +391,8 @@ export type AuditManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AuditManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -398,8 +400,8 @@ export type AuditManagerClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Audit Manager API reference. This guide is for developers who need detailed information about the AWS Audit Manager API operations, data types, and errors.

@@ -451,16 +453,16 @@ export class AuditManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auditmanager/runtimeConfig.browser.ts b/clients/client-auditmanager/runtimeConfig.browser.ts index afb410dded2d3..d81adf33eeb28 100644 --- a/clients/client-auditmanager/runtimeConfig.browser.ts +++ b/clients/client-auditmanager/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auditmanager/runtimeConfig.native.ts b/clients/client-auditmanager/runtimeConfig.native.ts index 4685edfe7fe9e..d227113c6e503 100644 --- a/clients/client-auditmanager/runtimeConfig.native.ts +++ b/clients/client-auditmanager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AuditManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auditmanager/runtimeConfig.ts b/clients/client-auditmanager/runtimeConfig.ts index e562162bb8bfc..04b2ef1fc2ed4 100644 --- a/clients/client-auditmanager/runtimeConfig.ts +++ b/clients/client-auditmanager/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts index 3c9aa934fa14e..c5a37c7459c07 100644 --- a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts +++ b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts @@ -50,6 +50,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -60,6 +61,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AutoScalingPlansClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +181,8 @@ export type AutoScalingPlansClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AutoScalingPlansClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +190,8 @@ export type AutoScalingPlansClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Auto Scaling @@ -218,16 +220,16 @@ export class AutoScalingPlansClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts index e186de94b36ae..7c5fa7af92bef 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auto-scaling-plans/runtimeConfig.native.ts b/clients/client-auto-scaling-plans/runtimeConfig.native.ts index ec8c0f0136d32..ffb1458f9d347 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.native.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AutoScalingPlansClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.ts b/clients/client-auto-scaling-plans/runtimeConfig.ts index 7d1e7564adeb6..6942a75642529 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auto-scaling/AutoScalingClient.ts b/clients/client-auto-scaling/AutoScalingClient.ts index a91d682fb91f6..6c3270f8133d1 100644 --- a/clients/client-auto-scaling/AutoScalingClient.ts +++ b/clients/client-auto-scaling/AutoScalingClient.ts @@ -215,6 +215,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -225,6 +226,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -392,11 +394,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -438,6 +435,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type AutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -446,8 +448,8 @@ export type AutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -455,8 +457,8 @@ export type AutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon EC2 Auto Scaling @@ -484,16 +486,16 @@ export class AutoScalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auto-scaling/runtimeConfig.browser.ts b/clients/client-auto-scaling/runtimeConfig.browser.ts index fcfd7609814b8..71a955e6f36a4 100644 --- a/clients/client-auto-scaling/runtimeConfig.browser.ts +++ b/clients/client-auto-scaling/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auto-scaling/runtimeConfig.native.ts b/clients/client-auto-scaling/runtimeConfig.native.ts index 0b3e0d6849ef4..fd94fcca939c5 100644 --- a/clients/client-auto-scaling/runtimeConfig.native.ts +++ b/clients/client-auto-scaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AutoScalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auto-scaling/runtimeConfig.ts b/clients/client-auto-scaling/runtimeConfig.ts index 0ead5f163d7d4..f58182badb2c4 100644 --- a/clients/client-auto-scaling/runtimeConfig.ts +++ b/clients/client-auto-scaling/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-backup/BackupClient.ts b/clients/client-backup/BackupClient.ts index 7a7fbfd06fb78..960ef953e3c41 100644 --- a/clients/client-backup/BackupClient.ts +++ b/clients/client-backup/BackupClient.ts @@ -169,6 +169,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -179,6 +180,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type BackupClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +388,8 @@ export type BackupClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BackupClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +397,8 @@ export type BackupClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Backup @@ -421,16 +423,16 @@ export class BackupClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-backup/runtimeConfig.browser.ts b/clients/client-backup/runtimeConfig.browser.ts index 20fc2f3c06716..e814b9ed28304 100644 --- a/clients/client-backup/runtimeConfig.browser.ts +++ b/clients/client-backup/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-backup/runtimeConfig.native.ts b/clients/client-backup/runtimeConfig.native.ts index bfd353d687195..4371a7a73ebbe 100644 --- a/clients/client-backup/runtimeConfig.native.ts +++ b/clients/client-backup/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BackupClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-backup/runtimeConfig.ts b/clients/client-backup/runtimeConfig.ts index 6fcb94473f6df..ec5f486a2968b 100644 --- a/clients/client-backup/runtimeConfig.ts +++ b/clients/client-backup/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-batch/BatchClient.ts b/clients/client-batch/BatchClient.ts index 691a2bc37497b..0fd803a8a58f4 100644 --- a/clients/client-batch/BatchClient.ts +++ b/clients/client-batch/BatchClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type BatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +235,8 @@ export type BatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +244,8 @@ export type BatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Using AWS Batch, you can run batch computing workloads on the AWS Cloud. Batch computing is a common means for @@ -274,16 +276,16 @@ export class BatchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-batch/runtimeConfig.browser.ts b/clients/client-batch/runtimeConfig.browser.ts index 8099a7dea94bb..4f4b2f1a373f7 100644 --- a/clients/client-batch/runtimeConfig.browser.ts +++ b/clients/client-batch/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-batch/runtimeConfig.native.ts b/clients/client-batch/runtimeConfig.native.ts index 2c6f27b10bf30..d53318dbf968e 100644 --- a/clients/client-batch/runtimeConfig.native.ts +++ b/clients/client-batch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BatchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-batch/runtimeConfig.ts b/clients/client-batch/runtimeConfig.ts index fd3d7c489a8af..32b62a5457df4 100644 --- a/clients/client-batch/runtimeConfig.ts +++ b/clients/client-batch/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-braket/BraketClient.ts b/clients/client-braket/BraketClient.ts index 2e7d2a5a2ad4b..be3194fb84248 100644 --- a/clients/client-braket/BraketClient.ts +++ b/clients/client-braket/BraketClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type BraketClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +172,8 @@ export type BraketClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BraketClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +181,8 @@ export type BraketClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon Braket API Reference provides information about the operations and structures supported in Amazon Braket.

@@ -202,16 +204,16 @@ export class BraketClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-braket/runtimeConfig.browser.ts b/clients/client-braket/runtimeConfig.browser.ts index c2dc763f049bd..85c9a4a322e95 100644 --- a/clients/client-braket/runtimeConfig.browser.ts +++ b/clients/client-braket/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-braket/runtimeConfig.native.ts b/clients/client-braket/runtimeConfig.native.ts index f10724dc05f05..e8d73bb9e6243 100644 --- a/clients/client-braket/runtimeConfig.native.ts +++ b/clients/client-braket/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BraketClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-braket/runtimeConfig.ts b/clients/client-braket/runtimeConfig.ts index d97bd40c278dd..4d95f7ba45492 100644 --- a/clients/client-braket/runtimeConfig.ts +++ b/clients/client-braket/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-budgets/BudgetsClient.ts b/clients/client-budgets/BudgetsClient.ts index d454cd98094b5..c3f07c81e8e89 100644 --- a/clients/client-budgets/BudgetsClient.ts +++ b/clients/client-budgets/BudgetsClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -188,11 +190,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -234,6 +231,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type BudgetsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -242,8 +244,8 @@ export type BudgetsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BudgetsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -251,8 +253,8 @@ export type BudgetsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Budgets API enables you to use AWS Budgets to plan your service usage, service costs, and instance reservations. The API reference provides descriptions, syntax, and usage examples for each of the actions and data types for AWS Budgets.

@@ -316,16 +318,16 @@ export class BudgetsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-budgets/runtimeConfig.browser.ts b/clients/client-budgets/runtimeConfig.browser.ts index 28528ee7c7b2f..bf26ac0b73004 100644 --- a/clients/client-budgets/runtimeConfig.browser.ts +++ b/clients/client-budgets/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-budgets/runtimeConfig.native.ts b/clients/client-budgets/runtimeConfig.native.ts index 8f5eeae7675c8..3278370473d9f 100644 --- a/clients/client-budgets/runtimeConfig.native.ts +++ b/clients/client-budgets/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BudgetsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-budgets/runtimeConfig.ts b/clients/client-budgets/runtimeConfig.ts index 14782fb1ba9a3..adae2c50b0f1c 100644 --- a/clients/client-budgets/runtimeConfig.ts +++ b/clients/client-budgets/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-chime/ChimeClient.ts b/clients/client-chime/ChimeClient.ts index 2f185513876b9..cf07158b953b0 100644 --- a/clients/client-chime/ChimeClient.ts +++ b/clients/client-chime/ChimeClient.ts @@ -531,6 +531,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -541,6 +542,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -956,11 +958,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1002,6 +999,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ChimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1010,8 +1012,8 @@ export type ChimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ChimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1019,8 +1021,8 @@ export type ChimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon Chime API (application programming interface) is designed for developers to @@ -1080,16 +1082,16 @@ export class ChimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-chime/runtimeConfig.browser.ts b/clients/client-chime/runtimeConfig.browser.ts index 63562750f1b96..4d6da0080a372 100644 --- a/clients/client-chime/runtimeConfig.browser.ts +++ b/clients/client-chime/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-chime/runtimeConfig.native.ts b/clients/client-chime/runtimeConfig.native.ts index f4841fdb69c7b..f0316d22048a7 100644 --- a/clients/client-chime/runtimeConfig.native.ts +++ b/clients/client-chime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ChimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-chime/runtimeConfig.ts b/clients/client-chime/runtimeConfig.ts index fadd77f299b39..2fba0bda3f172 100644 --- a/clients/client-chime/runtimeConfig.ts +++ b/clients/client-chime/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloud9/Cloud9Client.ts b/clients/client-cloud9/Cloud9Client.ts index 7ec692732ccfa..3f7c10f67d404 100644 --- a/clients/client-cloud9/Cloud9Client.ts +++ b/clients/client-cloud9/Cloud9Client.ts @@ -72,6 +72,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -82,6 +83,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type Cloud9ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +217,8 @@ export type Cloud9ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Cloud9ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +226,8 @@ export type Cloud9ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Cloud9 @@ -304,16 +306,16 @@ export class Cloud9Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloud9/runtimeConfig.browser.ts b/clients/client-cloud9/runtimeConfig.browser.ts index 6bd17f48efdc8..748641fce31be 100644 --- a/clients/client-cloud9/runtimeConfig.browser.ts +++ b/clients/client-cloud9/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloud9/runtimeConfig.native.ts b/clients/client-cloud9/runtimeConfig.native.ts index 0991da279ce75..ef11a033b5066 100644 --- a/clients/client-cloud9/runtimeConfig.native.ts +++ b/clients/client-cloud9/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Cloud9Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloud9/runtimeConfig.ts b/clients/client-cloud9/runtimeConfig.ts index 2287cb2d4e26e..b759b365560a1 100644 --- a/clients/client-cloud9/runtimeConfig.ts +++ b/clients/client-cloud9/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-clouddirectory/CloudDirectoryClient.ts b/clients/client-clouddirectory/CloudDirectoryClient.ts index 9eac936b7b7d4..dabdfbb3e9d8e 100644 --- a/clients/client-clouddirectory/CloudDirectoryClient.ts +++ b/clients/client-clouddirectory/CloudDirectoryClient.ts @@ -179,6 +179,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -189,6 +190,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -374,11 +376,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -420,6 +417,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudDirectoryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -428,8 +430,8 @@ export type CloudDirectoryClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudDirectoryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -437,8 +439,8 @@ export type CloudDirectoryClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cloud Directory @@ -465,16 +467,16 @@ export class CloudDirectoryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-clouddirectory/runtimeConfig.browser.ts b/clients/client-clouddirectory/runtimeConfig.browser.ts index 784991fb10fd1..efd91a1419619 100644 --- a/clients/client-clouddirectory/runtimeConfig.browser.ts +++ b/clients/client-clouddirectory/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-clouddirectory/runtimeConfig.native.ts b/clients/client-clouddirectory/runtimeConfig.native.ts index d581d4dbda97a..df92245a81875 100644 --- a/clients/client-clouddirectory/runtimeConfig.native.ts +++ b/clients/client-clouddirectory/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudDirectoryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-clouddirectory/runtimeConfig.ts b/clients/client-clouddirectory/runtimeConfig.ts index 165c823c950f1..5b65eb2debad2 100644 --- a/clients/client-clouddirectory/runtimeConfig.ts +++ b/clients/client-clouddirectory/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudformation/CloudFormationClient.ts b/clients/client-cloudformation/CloudFormationClient.ts index 29d94f6946c38..b9e0712aba407 100644 --- a/clients/client-cloudformation/CloudFormationClient.ts +++ b/clients/client-cloudformation/CloudFormationClient.ts @@ -159,6 +159,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -169,6 +170,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudFormationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +388,8 @@ export type CloudFormationClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudFormationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +397,8 @@ export type CloudFormationClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudFormation @@ -432,16 +434,16 @@ export class CloudFormationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudformation/runtimeConfig.browser.ts b/clients/client-cloudformation/runtimeConfig.browser.ts index 2608f64837d93..a3d6bc59188c2 100644 --- a/clients/client-cloudformation/runtimeConfig.browser.ts +++ b/clients/client-cloudformation/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudformation/runtimeConfig.native.ts b/clients/client-cloudformation/runtimeConfig.native.ts index 061a5f34e3469..813fdb72926bd 100644 --- a/clients/client-cloudformation/runtimeConfig.native.ts +++ b/clients/client-cloudformation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudFormationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudformation/runtimeConfig.ts b/clients/client-cloudformation/runtimeConfig.ts index 6a76dc14bd67a..f69271f53f575 100644 --- a/clients/client-cloudformation/runtimeConfig.ts +++ b/clients/client-cloudformation/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudfront/CloudFrontClient.ts b/clients/client-cloudfront/CloudFrontClient.ts index c4439a9ee3e15..802a4271304e9 100644 --- a/clients/client-cloudfront/CloudFrontClient.ts +++ b/clients/client-cloudfront/CloudFrontClient.ts @@ -254,6 +254,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -264,6 +265,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -467,11 +469,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -513,6 +510,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudFrontClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -521,8 +523,8 @@ export type CloudFrontClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudFrontClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -530,8 +532,8 @@ export type CloudFrontClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudFront @@ -555,16 +557,16 @@ export class CloudFrontClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudfront/runtimeConfig.browser.ts b/clients/client-cloudfront/runtimeConfig.browser.ts index 9229b4403ae72..e10a45cc8166d 100644 --- a/clients/client-cloudfront/runtimeConfig.browser.ts +++ b/clients/client-cloudfront/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudfront/runtimeConfig.native.ts b/clients/client-cloudfront/runtimeConfig.native.ts index 9bc6666c384a5..efa94494b6f47 100644 --- a/clients/client-cloudfront/runtimeConfig.native.ts +++ b/clients/client-cloudfront/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudFrontClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudfront/runtimeConfig.ts b/clients/client-cloudfront/runtimeConfig.ts index 576ce1f413bac..7043136460723 100644 --- a/clients/client-cloudfront/runtimeConfig.ts +++ b/clients/client-cloudfront/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudhsm-v2/CloudHSMV2Client.ts b/clients/client-cloudhsm-v2/CloudHSMV2Client.ts index 08678390b7c63..a26650d72762a 100644 --- a/clients/client-cloudhsm-v2/CloudHSMV2Client.ts +++ b/clients/client-cloudhsm-v2/CloudHSMV2Client.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudHSMV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +202,8 @@ export type CloudHSMV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudHSMV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +211,8 @@ export type CloudHSMV2ClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

For more information about AWS CloudHSM, see AWS CloudHSM and the AWS @@ -233,16 +235,16 @@ export class CloudHSMV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts b/clients/client-cloudhsm-v2/runtimeConfig.browser.ts index c1d051d6d1f86..8030416d79907 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudhsm-v2/runtimeConfig.native.ts b/clients/client-cloudhsm-v2/runtimeConfig.native.ts index de306dbe83369..cb4541187049d 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.native.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudHSMV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudhsm-v2/runtimeConfig.ts b/clients/client-cloudhsm-v2/runtimeConfig.ts index 58ad9e65a94e5..87863d46aa0fd 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudhsm/CloudHSMClient.ts b/clients/client-cloudhsm/CloudHSMClient.ts index dfdd061ee05f2..b8a171eb693f9 100644 --- a/clients/client-cloudhsm/CloudHSMClient.ts +++ b/clients/client-cloudhsm/CloudHSMClient.ts @@ -61,6 +61,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudHSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +220,8 @@ export type CloudHSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudHSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +229,8 @@ export type CloudHSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudHSM Service @@ -260,16 +262,16 @@ export class CloudHSMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudhsm/runtimeConfig.browser.ts b/clients/client-cloudhsm/runtimeConfig.browser.ts index d55671208cc6a..dfe367b72f123 100644 --- a/clients/client-cloudhsm/runtimeConfig.browser.ts +++ b/clients/client-cloudhsm/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudhsm/runtimeConfig.native.ts b/clients/client-cloudhsm/runtimeConfig.native.ts index 6f9ef25a258f0..522df75579378 100644 --- a/clients/client-cloudhsm/runtimeConfig.native.ts +++ b/clients/client-cloudhsm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudHSMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudhsm/runtimeConfig.ts b/clients/client-cloudhsm/runtimeConfig.ts index 2d4541c9b76ac..90719187b1cc7 100644 --- a/clients/client-cloudhsm/runtimeConfig.ts +++ b/clients/client-cloudhsm/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts b/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts index 9e9d7c088a941..a9d9d76387a39 100644 --- a/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts +++ b/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SearchCommandInput | SuggestCommandInput | UploadDocumentsCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudSearchDomainClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +157,8 @@ export type CloudSearchDomainClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudSearchDomainClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +166,8 @@ export type CloudSearchDomainClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You use the AmazonCloudSearch2013 API to upload documents to a search domain and search those documents.

@@ -190,16 +192,16 @@ export class CloudSearchDomainClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts b/clients/client-cloudsearch-domain/runtimeConfig.browser.ts index b3e8f0ee43373..fe705a5e14cef 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudsearch-domain/runtimeConfig.native.ts b/clients/client-cloudsearch-domain/runtimeConfig.native.ts index 8494fa28e0352..c6bbd7f137e34 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.native.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudSearchDomainClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudsearch-domain/runtimeConfig.ts b/clients/client-cloudsearch-domain/runtimeConfig.ts index 7ccb0e83414d9..d417977cf062e 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudsearch/CloudSearchClient.ts b/clients/client-cloudsearch/CloudSearchClient.ts index 88c84a97c80c0..471e2299d4d94 100644 --- a/clients/client-cloudsearch/CloudSearchClient.ts +++ b/clients/client-cloudsearch/CloudSearchClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -215,11 +217,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -261,6 +258,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudSearchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -269,8 +271,8 @@ export type CloudSearchClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudSearchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -278,8 +280,8 @@ export type CloudSearchClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudSearch Configuration Service @@ -307,16 +309,16 @@ export class CloudSearchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudsearch/runtimeConfig.browser.ts b/clients/client-cloudsearch/runtimeConfig.browser.ts index 3f83cfbfa4280..21464d21384e3 100644 --- a/clients/client-cloudsearch/runtimeConfig.browser.ts +++ b/clients/client-cloudsearch/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudsearch/runtimeConfig.native.ts b/clients/client-cloudsearch/runtimeConfig.native.ts index 0e1972d5cffd2..f6d8caa780a2a 100644 --- a/clients/client-cloudsearch/runtimeConfig.native.ts +++ b/clients/client-cloudsearch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudSearchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudsearch/runtimeConfig.ts b/clients/client-cloudsearch/runtimeConfig.ts index 5a461c56038a2..5b48ce820410f 100644 --- a/clients/client-cloudsearch/runtimeConfig.ts +++ b/clients/client-cloudsearch/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudtrail/CloudTrailClient.ts b/clients/client-cloudtrail/CloudTrailClient.ts index 74471dbb097db..18e07c4c7b439 100644 --- a/clients/client-cloudtrail/CloudTrailClient.ts +++ b/clients/client-cloudtrail/CloudTrailClient.ts @@ -59,6 +59,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -69,6 +70,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudTrailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +214,8 @@ export type CloudTrailClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudTrailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +223,8 @@ export type CloudTrailClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudTrail @@ -258,16 +260,16 @@ export class CloudTrailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudtrail/runtimeConfig.browser.ts b/clients/client-cloudtrail/runtimeConfig.browser.ts index ea7b936f2eb70..65cabc761ecee 100644 --- a/clients/client-cloudtrail/runtimeConfig.browser.ts +++ b/clients/client-cloudtrail/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudtrail/runtimeConfig.native.ts b/clients/client-cloudtrail/runtimeConfig.native.ts index b16ddb69ae2a8..d1c8d93bc36b1 100644 --- a/clients/client-cloudtrail/runtimeConfig.native.ts +++ b/clients/client-cloudtrail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudTrailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudtrail/runtimeConfig.ts b/clients/client-cloudtrail/runtimeConfig.ts index 8164591d03169..1f0a3c162d8c3 100644 --- a/clients/client-cloudtrail/runtimeConfig.ts +++ b/clients/client-cloudtrail/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch-events/CloudWatchEventsClient.ts b/clients/client-cloudwatch-events/CloudWatchEventsClient.ts index aa8d15f8bd01b..c979f741d2bfa 100644 --- a/clients/client-cloudwatch-events/CloudWatchEventsClient.ts +++ b/clients/client-cloudwatch-events/CloudWatchEventsClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudWatchEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +304,8 @@ export type CloudWatchEventsClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +313,8 @@ export type CloudWatchEventsClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge helps you to respond to state changes in your AWS resources. @@ -355,16 +357,16 @@ export class CloudWatchEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch-events/runtimeConfig.browser.ts b/clients/client-cloudwatch-events/runtimeConfig.browser.ts index 396c11b774255..b92b411177f84 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch-events/runtimeConfig.native.ts b/clients/client-cloudwatch-events/runtimeConfig.native.ts index e042819f13241..e67184f838927 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.native.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch-events/runtimeConfig.ts b/clients/client-cloudwatch-events/runtimeConfig.ts index 13dbab5b5226f..db894a3d81cc4 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts b/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts index 8cb692001c793..42596e7fb78c5 100644 --- a/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts +++ b/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts @@ -113,6 +113,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -123,6 +124,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -260,11 +262,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -306,6 +303,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudWatchLogsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -314,8 +316,8 @@ export type CloudWatchLogsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchLogsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -323,8 +325,8 @@ export type CloudWatchLogsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use Amazon CloudWatch Logs to monitor, store, and access your log files from @@ -379,16 +381,16 @@ export class CloudWatchLogsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts b/clients/client-cloudwatch-logs/runtimeConfig.browser.ts index 654fea3e6e316..78c1f3f188241 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch-logs/runtimeConfig.native.ts b/clients/client-cloudwatch-logs/runtimeConfig.native.ts index 1bb795a06c169..51c69acdb6890 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.native.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchLogsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch-logs/runtimeConfig.ts b/clients/client-cloudwatch-logs/runtimeConfig.ts index 6780fe5741d63..69cec586841c9 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch/CloudWatchClient.ts b/clients/client-cloudwatch/CloudWatchClient.ts index 9efb0d5cdb4e6..200b9a5284e5e 100644 --- a/clients/client-cloudwatch/CloudWatchClient.ts +++ b/clients/client-cloudwatch/CloudWatchClient.ts @@ -98,6 +98,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -108,6 +109,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -221,11 +223,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -267,6 +264,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CloudWatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -275,8 +277,8 @@ export type CloudWatchClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -284,8 +286,8 @@ export type CloudWatchClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the @@ -321,16 +323,16 @@ export class CloudWatchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch/runtimeConfig.browser.ts b/clients/client-cloudwatch/runtimeConfig.browser.ts index 930f159ba383c..b74cb4d2b55ca 100644 --- a/clients/client-cloudwatch/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch/runtimeConfig.native.ts b/clients/client-cloudwatch/runtimeConfig.native.ts index 3b3da3e46f946..062d28f7b3889 100644 --- a/clients/client-cloudwatch/runtimeConfig.native.ts +++ b/clients/client-cloudwatch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch/runtimeConfig.ts b/clients/client-cloudwatch/runtimeConfig.ts index 9309e714846bc..ec39d06bf9156 100644 --- a/clients/client-cloudwatch/runtimeConfig.ts +++ b/clients/client-cloudwatch/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeartifact/CodeartifactClient.ts b/clients/client-codeartifact/CodeartifactClient.ts index 89d31446c6378..18b9ad41689fb 100644 --- a/clients/client-codeartifact/CodeartifactClient.ts +++ b/clients/client-codeartifact/CodeartifactClient.ts @@ -135,6 +135,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -145,6 +146,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -266,11 +268,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -312,6 +309,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeartifactClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -320,8 +322,8 @@ export type CodeartifactClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeartifactClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -329,8 +331,8 @@ export type CodeartifactClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS CodeArtifact is a fully managed artifact repository compatible with language-native @@ -627,16 +629,16 @@ export class CodeartifactClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeartifact/runtimeConfig.browser.ts b/clients/client-codeartifact/runtimeConfig.browser.ts index db03607571dc4..d876eea1172e9 100644 --- a/clients/client-codeartifact/runtimeConfig.browser.ts +++ b/clients/client-codeartifact/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeartifact/runtimeConfig.native.ts b/clients/client-codeartifact/runtimeConfig.native.ts index 3898b2fe38000..0b860f18c4824 100644 --- a/clients/client-codeartifact/runtimeConfig.native.ts +++ b/clients/client-codeartifact/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeartifactClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeartifact/runtimeConfig.ts b/clients/client-codeartifact/runtimeConfig.ts index a75635fb4066e..c3e475ae37633 100644 --- a/clients/client-codeartifact/runtimeConfig.ts +++ b/clients/client-codeartifact/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codebuild/CodeBuildClient.ts b/clients/client-codebuild/CodeBuildClient.ts index 302c54f9eaf96..dbc0428d3db46 100644 --- a/clients/client-codebuild/CodeBuildClient.ts +++ b/clients/client-codebuild/CodeBuildClient.ts @@ -121,6 +121,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -131,6 +132,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeBuildClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +328,8 @@ export type CodeBuildClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeBuildClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +337,8 @@ export type CodeBuildClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeBuild @@ -542,16 +544,16 @@ export class CodeBuildClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codebuild/runtimeConfig.browser.ts b/clients/client-codebuild/runtimeConfig.browser.ts index f98a337451d0f..b486db382ade9 100644 --- a/clients/client-codebuild/runtimeConfig.browser.ts +++ b/clients/client-codebuild/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codebuild/runtimeConfig.native.ts b/clients/client-codebuild/runtimeConfig.native.ts index ebf6dcb961b85..7535c90ed473c 100644 --- a/clients/client-codebuild/runtimeConfig.native.ts +++ b/clients/client-codebuild/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeBuildClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codebuild/runtimeConfig.ts b/clients/client-codebuild/runtimeConfig.ts index 241b28f1a9a4a..081cd7b7610e5 100644 --- a/clients/client-codebuild/runtimeConfig.ts +++ b/clients/client-codebuild/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codecommit/CodeCommitClient.ts b/clients/client-codecommit/CodeCommitClient.ts index 61a7e9b7cc8bf..cbb0baca49545 100644 --- a/clients/client-codecommit/CodeCommitClient.ts +++ b/clients/client-codecommit/CodeCommitClient.ts @@ -256,6 +256,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -266,6 +267,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -473,11 +475,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -519,6 +516,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeCommitClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -527,8 +529,8 @@ export type CodeCommitClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeCommitClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -536,8 +538,8 @@ export type CodeCommitClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeCommit @@ -955,16 +957,16 @@ export class CodeCommitClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codecommit/runtimeConfig.browser.ts b/clients/client-codecommit/runtimeConfig.browser.ts index b0fe76fabddaa..63e9c7c960203 100644 --- a/clients/client-codecommit/runtimeConfig.browser.ts +++ b/clients/client-codecommit/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codecommit/runtimeConfig.native.ts b/clients/client-codecommit/runtimeConfig.native.ts index 22af34073883e..aa2ef6de18668 100644 --- a/clients/client-codecommit/runtimeConfig.native.ts +++ b/clients/client-codecommit/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeCommitClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codecommit/runtimeConfig.ts b/clients/client-codecommit/runtimeConfig.ts index 67f897187efd8..1bd72858c6930 100644 --- a/clients/client-codecommit/runtimeConfig.ts +++ b/clients/client-codecommit/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codedeploy/CodeDeployClient.ts b/clients/client-codedeploy/CodeDeployClient.ts index f5545b49a38a8..dbee89f402c36 100644 --- a/clients/client-codedeploy/CodeDeployClient.ts +++ b/clients/client-codedeploy/CodeDeployClient.ts @@ -184,6 +184,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -194,6 +195,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -341,11 +343,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -387,6 +384,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeDeployClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -395,8 +397,8 @@ export type CodeDeployClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeDeployClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -404,8 +406,8 @@ export type CodeDeployClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeDeploy @@ -526,16 +528,16 @@ export class CodeDeployClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codedeploy/runtimeConfig.browser.ts b/clients/client-codedeploy/runtimeConfig.browser.ts index 79dc845fadbe7..04faccfd774e5 100644 --- a/clients/client-codedeploy/runtimeConfig.browser.ts +++ b/clients/client-codedeploy/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codedeploy/runtimeConfig.native.ts b/clients/client-codedeploy/runtimeConfig.native.ts index dab024883e226..e2b10ba330763 100644 --- a/clients/client-codedeploy/runtimeConfig.native.ts +++ b/clients/client-codedeploy/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeDeployClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codedeploy/runtimeConfig.ts b/clients/client-codedeploy/runtimeConfig.ts index 768be9eff8024..d3fdd1eff8ad8 100644 --- a/clients/client-codedeploy/runtimeConfig.ts +++ b/clients/client-codedeploy/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts b/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts index 8366c6377a22d..b2f206eee9ab8 100644 --- a/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts +++ b/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeGuruReviewerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +223,8 @@ export type CodeGuruReviewerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeGuruReviewerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +232,8 @@ export type CodeGuruReviewerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the Amazon CodeGuru Reviewer API operations. CodeGuru Reviewer is a service @@ -268,16 +270,16 @@ export class CodeGuruReviewerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts b/clients/client-codeguru-reviewer/runtimeConfig.browser.ts index 4cdd6b918c6fc..c8d90126e63aa 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeguru-reviewer/runtimeConfig.native.ts b/clients/client-codeguru-reviewer/runtimeConfig.native.ts index bf811af49660d..8300083647b66 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.native.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeGuruReviewerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeguru-reviewer/runtimeConfig.ts b/clients/client-codeguru-reviewer/runtimeConfig.ts index 8660ac01b7d1c..adf1cd00936bf 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts b/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts index 351ab3250787f..1e9eae5ecb001 100644 --- a/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts +++ b/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeGuruProfilerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +208,8 @@ export type CodeGuruProfilerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeGuruProfilerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +217,8 @@ export type CodeGuruProfilerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the Amazon CodeGuru Profiler API operations.

@@ -238,16 +240,16 @@ export class CodeGuruProfilerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeguruprofiler/runtimeConfig.browser.ts b/clients/client-codeguruprofiler/runtimeConfig.browser.ts index de0d8fe56f0c3..a8ae831c00770 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.browser.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeguruprofiler/runtimeConfig.native.ts b/clients/client-codeguruprofiler/runtimeConfig.native.ts index bb7df9fefa175..f2cc2ba24dc07 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.native.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeGuruProfilerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeguruprofiler/runtimeConfig.ts b/clients/client-codeguruprofiler/runtimeConfig.ts index 71bb1c05f730a..ac85d993f9b84 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codepipeline/CodePipelineClient.ts b/clients/client-codepipeline/CodePipelineClient.ts index 0cf50dd2a33b1..a1614b35bdfe7 100644 --- a/clients/client-codepipeline/CodePipelineClient.ts +++ b/clients/client-codepipeline/CodePipelineClient.ts @@ -132,6 +132,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -142,6 +143,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodePipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +325,8 @@ export type CodePipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodePipelineClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +334,8 @@ export type CodePipelineClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodePipeline @@ -549,16 +551,16 @@ export class CodePipelineClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codepipeline/runtimeConfig.browser.ts b/clients/client-codepipeline/runtimeConfig.browser.ts index d5fd093ac1d1c..a3df0f7221941 100644 --- a/clients/client-codepipeline/runtimeConfig.browser.ts +++ b/clients/client-codepipeline/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codepipeline/runtimeConfig.native.ts b/clients/client-codepipeline/runtimeConfig.native.ts index e95574d1e7b8d..9c0999d852c55 100644 --- a/clients/client-codepipeline/runtimeConfig.native.ts +++ b/clients/client-codepipeline/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodePipelineClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codepipeline/runtimeConfig.ts b/clients/client-codepipeline/runtimeConfig.ts index 03013d23ed5b0..6c2ceef13705c 100644 --- a/clients/client-codepipeline/runtimeConfig.ts +++ b/clients/client-codepipeline/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar-connections/CodeStarConnectionsClient.ts b/clients/client-codestar-connections/CodeStarConnectionsClient.ts index e360103dcdec7..edc78e87baad4 100644 --- a/clients/client-codestar-connections/CodeStarConnectionsClient.ts +++ b/clients/client-codestar-connections/CodeStarConnectionsClient.ts @@ -50,6 +50,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -60,6 +61,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -137,11 +139,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -183,6 +180,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeStarConnectionsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -191,8 +193,8 @@ export type CodeStarConnectionsClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeStarConnectionsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -200,8 +202,8 @@ export type CodeStarConnectionsClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeStar Connections @@ -302,16 +304,16 @@ export class CodeStarConnectionsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar-connections/runtimeConfig.browser.ts b/clients/client-codestar-connections/runtimeConfig.browser.ts index 94bd12cc1a79e..1d30d66b1af32 100644 --- a/clients/client-codestar-connections/runtimeConfig.browser.ts +++ b/clients/client-codestar-connections/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar-connections/runtimeConfig.native.ts b/clients/client-codestar-connections/runtimeConfig.native.ts index d39d0e088c449..17f7b3d692507 100644 --- a/clients/client-codestar-connections/runtimeConfig.native.ts +++ b/clients/client-codestar-connections/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeStarConnectionsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar-connections/runtimeConfig.ts b/clients/client-codestar-connections/runtimeConfig.ts index 0c91e40220db0..c1fa5d7abde33 100644 --- a/clients/client-codestar-connections/runtimeConfig.ts +++ b/clients/client-codestar-connections/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar-notifications/CodestarNotificationsClient.ts b/clients/client-codestar-notifications/CodestarNotificationsClient.ts index ba87ec77f112a..55895136769a1 100644 --- a/clients/client-codestar-notifications/CodestarNotificationsClient.ts +++ b/clients/client-codestar-notifications/CodestarNotificationsClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodestarNotificationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +211,8 @@ export type CodestarNotificationsClientConfig = Partial<__SmithyConfiguration<__ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodestarNotificationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +220,8 @@ export type CodestarNotificationsClientResolvedConfig = __SmithyResolvedConfigur EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This AWS CodeStar Notifications API Reference provides descriptions and usage examples of the @@ -324,16 +326,16 @@ export class CodestarNotificationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar-notifications/runtimeConfig.browser.ts b/clients/client-codestar-notifications/runtimeConfig.browser.ts index 56d9f07993dbd..ded3d8dbf0daa 100644 --- a/clients/client-codestar-notifications/runtimeConfig.browser.ts +++ b/clients/client-codestar-notifications/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar-notifications/runtimeConfig.native.ts b/clients/client-codestar-notifications/runtimeConfig.native.ts index 688f359752ee8..9cdb5511d924a 100644 --- a/clients/client-codestar-notifications/runtimeConfig.native.ts +++ b/clients/client-codestar-notifications/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodestarNotificationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar-notifications/runtimeConfig.ts b/clients/client-codestar-notifications/runtimeConfig.ts index d8690cf416d99..54e0f99a9954a 100644 --- a/clients/client-codestar-notifications/runtimeConfig.ts +++ b/clients/client-codestar-notifications/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar/CodeStarClient.ts b/clients/client-codestar/CodeStarClient.ts index 5d8aa9246b255..d488a60146dcf 100644 --- a/clients/client-codestar/CodeStarClient.ts +++ b/clients/client-codestar/CodeStarClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CodeStarClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +217,8 @@ export type CodeStarClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeStarClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +226,8 @@ export type CodeStarClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeStar @@ -336,16 +338,16 @@ export class CodeStarClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar/runtimeConfig.browser.ts b/clients/client-codestar/runtimeConfig.browser.ts index 3f58b65fdce39..0f44ac3ba0f41 100644 --- a/clients/client-codestar/runtimeConfig.browser.ts +++ b/clients/client-codestar/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar/runtimeConfig.native.ts b/clients/client-codestar/runtimeConfig.native.ts index 4d380d997771d..40c5bb753bf59 100644 --- a/clients/client-codestar/runtimeConfig.native.ts +++ b/clients/client-codestar/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeStarClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar/runtimeConfig.ts b/clients/client-codestar/runtimeConfig.ts index 86d3b1a82bb50..952a4da04c181 100644 --- a/clients/client-codestar/runtimeConfig.ts +++ b/clients/client-codestar/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts b/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts index efd4ac3c9df79..b4601ba2339f4 100644 --- a/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts +++ b/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts @@ -298,6 +298,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -308,6 +309,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -561,11 +563,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -607,6 +604,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CognitoIdentityProviderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -615,8 +617,8 @@ export type CognitoIdentityProviderClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoIdentityProviderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -624,8 +626,8 @@ export type CognitoIdentityProviderClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Using the Amazon Cognito User Pools API, you can create a user pool to manage @@ -652,15 +654,15 @@ export class CognitoIdentityProviderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts b/clients/client-cognito-identity-provider/runtimeConfig.browser.ts index 7621eec4c8278..da0e2978c5815 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-identity-provider/runtimeConfig.native.ts b/clients/client-cognito-identity-provider/runtimeConfig.native.ts index 402aecead4539..3026a60425b39 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.native.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoIdentityProviderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-identity-provider/runtimeConfig.ts b/clients/client-cognito-identity-provider/runtimeConfig.ts index e001c79a04e91..233bba0829368 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-identity/CognitoIdentityClient.ts b/clients/client-cognito-identity/CognitoIdentityClient.ts index 7d35ee6a04ce4..641cc2f814aa6 100644 --- a/clients/client-cognito-identity/CognitoIdentityClient.ts +++ b/clients/client-cognito-identity/CognitoIdentityClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -183,11 +185,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -229,6 +226,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CognitoIdentityClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -237,8 +239,8 @@ export type CognitoIdentityClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoIdentityClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -246,8 +248,8 @@ export type CognitoIdentityClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cognito Federated Identities @@ -282,15 +284,15 @@ export class CognitoIdentityClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-identity/runtimeConfig.browser.ts b/clients/client-cognito-identity/runtimeConfig.browser.ts index 69f1637cb22c5..e8cb95f1e94c9 100644 --- a/clients/client-cognito-identity/runtimeConfig.browser.ts +++ b/clients/client-cognito-identity/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-identity/runtimeConfig.native.ts b/clients/client-cognito-identity/runtimeConfig.native.ts index 870131af0bef5..f33e0dec2ccfd 100644 --- a/clients/client-cognito-identity/runtimeConfig.native.ts +++ b/clients/client-cognito-identity/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoIdentityClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-identity/runtimeConfig.ts b/clients/client-cognito-identity/runtimeConfig.ts index d236052526af1..950b7a55f5cb9 100644 --- a/clients/client-cognito-identity/runtimeConfig.ts +++ b/clients/client-cognito-identity/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-sync/CognitoSyncClient.ts b/clients/client-cognito-sync/CognitoSyncClient.ts index 8e6817f04555b..4911a342dd62d 100644 --- a/clients/client-cognito-sync/CognitoSyncClient.ts +++ b/clients/client-cognito-sync/CognitoSyncClient.ts @@ -73,6 +73,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -83,6 +84,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CognitoSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +226,8 @@ export type CognitoSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +235,8 @@ export type CognitoSyncClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cognito Sync @@ -262,16 +264,16 @@ export class CognitoSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-sync/runtimeConfig.browser.ts b/clients/client-cognito-sync/runtimeConfig.browser.ts index 87d48c6c1cfa6..f8351769d74a6 100644 --- a/clients/client-cognito-sync/runtimeConfig.browser.ts +++ b/clients/client-cognito-sync/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-sync/runtimeConfig.native.ts b/clients/client-cognito-sync/runtimeConfig.native.ts index f7a473853ce85..d6bc203a42bb0 100644 --- a/clients/client-cognito-sync/runtimeConfig.native.ts +++ b/clients/client-cognito-sync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-sync/runtimeConfig.ts b/clients/client-cognito-sync/runtimeConfig.ts index b0c6f72106f30..9cfa7e56b7d30 100644 --- a/clients/client-cognito-sync/runtimeConfig.ts +++ b/clients/client-cognito-sync/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-comprehend/ComprehendClient.ts b/clients/client-comprehend/ComprehendClient.ts index 908fb280a975c..b6be378bd3553 100644 --- a/clients/client-comprehend/ComprehendClient.ts +++ b/clients/client-comprehend/ComprehendClient.ts @@ -233,6 +233,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -243,6 +244,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -416,11 +418,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -462,6 +459,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ComprehendClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -470,8 +472,8 @@ export type ComprehendClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComprehendClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -479,8 +481,8 @@ export type ComprehendClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Comprehend is an AWS service for gaining insight into the content of documents. @@ -505,16 +507,16 @@ export class ComprehendClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-comprehend/runtimeConfig.browser.ts b/clients/client-comprehend/runtimeConfig.browser.ts index 616dd876ba9be..88c078f690f9b 100644 --- a/clients/client-comprehend/runtimeConfig.browser.ts +++ b/clients/client-comprehend/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-comprehend/runtimeConfig.native.ts b/clients/client-comprehend/runtimeConfig.native.ts index d7dc348aebc58..521b67e7a5358 100644 --- a/clients/client-comprehend/runtimeConfig.native.ts +++ b/clients/client-comprehend/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComprehendClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-comprehend/runtimeConfig.ts b/clients/client-comprehend/runtimeConfig.ts index 919aefc24d03e..329e3ff6e4486 100644 --- a/clients/client-comprehend/runtimeConfig.ts +++ b/clients/client-comprehend/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-comprehendmedical/ComprehendMedicalClient.ts b/clients/client-comprehendmedical/ComprehendMedicalClient.ts index 26901c7756e33..933fb8c562fad 100644 --- a/clients/client-comprehendmedical/ComprehendMedicalClient.ts +++ b/clients/client-comprehendmedical/ComprehendMedicalClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -114,6 +115,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ComprehendMedicalClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +265,8 @@ export type ComprehendMedicalClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComprehendMedicalClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +274,8 @@ export type ComprehendMedicalClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Comprehend Medical extracts structured information from unstructured clinical text. Use these actions @@ -296,16 +298,16 @@ export class ComprehendMedicalClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-comprehendmedical/runtimeConfig.browser.ts b/clients/client-comprehendmedical/runtimeConfig.browser.ts index 611752e1ac17c..3438839cd1ad6 100644 --- a/clients/client-comprehendmedical/runtimeConfig.browser.ts +++ b/clients/client-comprehendmedical/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-comprehendmedical/runtimeConfig.native.ts b/clients/client-comprehendmedical/runtimeConfig.native.ts index c2386c7cccdf0..8e1a180c85c83 100644 --- a/clients/client-comprehendmedical/runtimeConfig.native.ts +++ b/clients/client-comprehendmedical/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComprehendMedicalClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-comprehendmedical/runtimeConfig.ts b/clients/client-comprehendmedical/runtimeConfig.ts index 1437a913e54ac..4006a7730f6c9 100644 --- a/clients/client-comprehendmedical/runtimeConfig.ts +++ b/clients/client-comprehendmedical/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-compute-optimizer/ComputeOptimizerClient.ts b/clients/client-compute-optimizer/ComputeOptimizerClient.ts index cb5135c63890c..f4d84fa5289bd 100644 --- a/clients/client-compute-optimizer/ComputeOptimizerClient.ts +++ b/clients/client-compute-optimizer/ComputeOptimizerClient.ts @@ -75,6 +75,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -85,6 +86,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ComputeOptimizerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +214,8 @@ export type ComputeOptimizerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComputeOptimizerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +223,8 @@ export type ComputeOptimizerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Compute Optimizer is a service that analyzes the configuration and utilization metrics of your @@ -253,16 +255,16 @@ export class ComputeOptimizerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-compute-optimizer/runtimeConfig.browser.ts b/clients/client-compute-optimizer/runtimeConfig.browser.ts index de4cb581cee77..631e94feb4e78 100644 --- a/clients/client-compute-optimizer/runtimeConfig.browser.ts +++ b/clients/client-compute-optimizer/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-compute-optimizer/runtimeConfig.native.ts b/clients/client-compute-optimizer/runtimeConfig.native.ts index e9fd73c91ecd3..0bf60a2374bfc 100644 --- a/clients/client-compute-optimizer/runtimeConfig.native.ts +++ b/clients/client-compute-optimizer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComputeOptimizerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-compute-optimizer/runtimeConfig.ts b/clients/client-compute-optimizer/runtimeConfig.ts index 9cdedb63ec698..a5fbc93d56438 100644 --- a/clients/client-compute-optimizer/runtimeConfig.ts +++ b/clients/client-compute-optimizer/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-config-service/ConfigServiceClient.ts b/clients/client-config-service/ConfigServiceClient.ts index 67d1dc807665f..d99f59869feb8 100644 --- a/clients/client-config-service/ConfigServiceClient.ts +++ b/clients/client-config-service/ConfigServiceClient.ts @@ -327,6 +327,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -337,6 +338,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -548,11 +550,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -594,6 +591,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ConfigServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -602,8 +604,8 @@ export type ConfigServiceClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConfigServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -611,8 +613,8 @@ export type ConfigServiceClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Config @@ -657,16 +659,16 @@ export class ConfigServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-config-service/runtimeConfig.browser.ts b/clients/client-config-service/runtimeConfig.browser.ts index 5d1b9935f122b..da3647c4b2fd1 100644 --- a/clients/client-config-service/runtimeConfig.browser.ts +++ b/clients/client-config-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-config-service/runtimeConfig.native.ts b/clients/client-config-service/runtimeConfig.native.ts index 865c56277d199..57b1619e574ca 100644 --- a/clients/client-config-service/runtimeConfig.native.ts +++ b/clients/client-config-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConfigServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-config-service/runtimeConfig.ts b/clients/client-config-service/runtimeConfig.ts index fc47ea0d7f867..d856d382fce44 100644 --- a/clients/client-config-service/runtimeConfig.ts +++ b/clients/client-config-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connect-contact-lens/ConnectContactLensClient.ts b/clients/client-connect-contact-lens/ConnectContactLensClient.ts index d76e7ffca9734..24d47ad8bd07a 100644 --- a/clients/client-connect-contact-lens/ConnectContactLensClient.ts +++ b/clients/client-connect-contact-lens/ConnectContactLensClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = ListRealtimeContactAnalysisSegmentsCommandInput; @@ -102,11 +104,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -148,6 +145,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ConnectContactLensClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -156,8 +158,8 @@ export type ConnectContactLensClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectContactLensClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -165,8 +167,8 @@ export type ConnectContactLensClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Contact Lens for Amazon Connect enables you to analyze conversations between customer and agents, @@ -194,16 +196,16 @@ export class ConnectContactLensClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connect-contact-lens/runtimeConfig.browser.ts b/clients/client-connect-contact-lens/runtimeConfig.browser.ts index 55336fef5a8e6..0b2cb2df54244 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.browser.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connect-contact-lens/runtimeConfig.native.ts b/clients/client-connect-contact-lens/runtimeConfig.native.ts index 0bfb0e7b05cda..6b182dd756fd8 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.native.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectContactLensClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connect-contact-lens/runtimeConfig.ts b/clients/client-connect-contact-lens/runtimeConfig.ts index 7e47a19f4ce0e..6bef811ca85ef 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connect/ConnectClient.ts b/clients/client-connect/ConnectClient.ts index f70ea34c4e41e..567ad0e4c8f92 100644 --- a/clients/client-connect/ConnectClient.ts +++ b/clients/client-connect/ConnectClient.ts @@ -282,6 +282,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -292,6 +293,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -509,11 +511,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -555,6 +552,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -563,8 +565,8 @@ export type ConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -572,8 +574,8 @@ export type ConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage a @@ -608,16 +610,16 @@ export class ConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connect/runtimeConfig.browser.ts b/clients/client-connect/runtimeConfig.browser.ts index 4e2c2e16f6a02..52d18e453afc1 100644 --- a/clients/client-connect/runtimeConfig.browser.ts +++ b/clients/client-connect/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connect/runtimeConfig.native.ts b/clients/client-connect/runtimeConfig.native.ts index b3dab48b2ae7a..f07ce4c7c8ff8 100644 --- a/clients/client-connect/runtimeConfig.native.ts +++ b/clients/client-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connect/runtimeConfig.ts b/clients/client-connect/runtimeConfig.ts index 49f908e3a2769..df065a925a2b5 100644 --- a/clients/client-connect/runtimeConfig.ts +++ b/clients/client-connect/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connectparticipant/ConnectParticipantClient.ts b/clients/client-connectparticipant/ConnectParticipantClient.ts index ebc7f2c064897..72e31c179d2e9 100644 --- a/clients/client-connectparticipant/ConnectParticipantClient.ts +++ b/clients/client-connectparticipant/ConnectParticipantClient.ts @@ -46,6 +46,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -56,6 +57,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -119,11 +121,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -165,6 +162,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ConnectParticipantClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -173,8 +175,8 @@ export type ConnectParticipantClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectParticipantClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -182,8 +184,8 @@ export type ConnectParticipantClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage @@ -210,16 +212,16 @@ export class ConnectParticipantClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connectparticipant/runtimeConfig.browser.ts b/clients/client-connectparticipant/runtimeConfig.browser.ts index 0ce59f46c95e5..eb122642dd631 100644 --- a/clients/client-connectparticipant/runtimeConfig.browser.ts +++ b/clients/client-connectparticipant/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connectparticipant/runtimeConfig.native.ts b/clients/client-connectparticipant/runtimeConfig.native.ts index 8db6b6e6a5afc..8ee1e2943c1b5 100644 --- a/clients/client-connectparticipant/runtimeConfig.native.ts +++ b/clients/client-connectparticipant/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectParticipantClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connectparticipant/runtimeConfig.ts b/clients/client-connectparticipant/runtimeConfig.ts index 3369c8941a800..9bd2a82741e70 100644 --- a/clients/client-connectparticipant/runtimeConfig.ts +++ b/clients/client-connectparticipant/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts b/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts index 21eff09eba3c5..952b71c8fb300 100644 --- a/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts +++ b/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts @@ -51,6 +51,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -61,6 +62,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CostAndUsageReportServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +178,8 @@ export type CostAndUsageReportServiceClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CostAndUsageReportServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +187,8 @@ export type CostAndUsageReportServiceClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Cost and Usage Report API enables you to programmatically create, query, and delete @@ -226,16 +228,16 @@ export class CostAndUsageReportServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts index e7c31d6031ba3..e6d50b493c64e 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts index d92776d084ff6..020e837c44f45 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CostAndUsageReportServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.ts index d96a57092627b..7774e323fa76b 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cost-explorer/CostExplorerClient.ts b/clients/client-cost-explorer/CostExplorerClient.ts index 1c931237d28ac..214cb1886fdd3 100644 --- a/clients/client-cost-explorer/CostExplorerClient.ts +++ b/clients/client-cost-explorer/CostExplorerClient.ts @@ -130,6 +130,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -140,6 +141,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -251,11 +253,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -297,6 +294,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CostExplorerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -305,8 +307,8 @@ export type CostExplorerClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CostExplorerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -314,8 +316,8 @@ export type CostExplorerClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Cost Explorer API enables you to programmatically query your cost and usage data. You can query for aggregated data @@ -350,16 +352,16 @@ export class CostExplorerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cost-explorer/runtimeConfig.browser.ts b/clients/client-cost-explorer/runtimeConfig.browser.ts index 8f3344350f8fb..6f80dbcadf06d 100644 --- a/clients/client-cost-explorer/runtimeConfig.browser.ts +++ b/clients/client-cost-explorer/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cost-explorer/runtimeConfig.native.ts b/clients/client-cost-explorer/runtimeConfig.native.ts index 76c2d7c94281a..10aadf852c4ff 100644 --- a/clients/client-cost-explorer/runtimeConfig.native.ts +++ b/clients/client-cost-explorer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CostExplorerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cost-explorer/runtimeConfig.ts b/clients/client-cost-explorer/runtimeConfig.ts index 56a478efe7867..9feaadb52b7d6 100644 --- a/clients/client-cost-explorer/runtimeConfig.ts +++ b/clients/client-cost-explorer/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-customer-profiles/CustomerProfilesClient.ts b/clients/client-customer-profiles/CustomerProfilesClient.ts index e1b5ac4573c5e..37b99cf5e23da 100644 --- a/clients/client-customer-profiles/CustomerProfilesClient.ts +++ b/clients/client-customer-profiles/CustomerProfilesClient.ts @@ -90,6 +90,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -100,6 +101,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type CustomerProfilesClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +265,8 @@ export type CustomerProfilesClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CustomerProfilesClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +274,8 @@ export type CustomerProfilesClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Connect Customer Profiles @@ -304,16 +306,16 @@ export class CustomerProfilesClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-customer-profiles/runtimeConfig.browser.ts b/clients/client-customer-profiles/runtimeConfig.browser.ts index 316fd99724463..5d57cab315b0b 100644 --- a/clients/client-customer-profiles/runtimeConfig.browser.ts +++ b/clients/client-customer-profiles/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-customer-profiles/runtimeConfig.native.ts b/clients/client-customer-profiles/runtimeConfig.native.ts index 0be66651c368d..e502d4e012b5e 100644 --- a/clients/client-customer-profiles/runtimeConfig.native.ts +++ b/clients/client-customer-profiles/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CustomerProfilesClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-customer-profiles/runtimeConfig.ts b/clients/client-customer-profiles/runtimeConfig.ts index 5b2c73cdbf089..2e93f382faddf 100644 --- a/clients/client-customer-profiles/runtimeConfig.ts +++ b/clients/client-customer-profiles/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-data-pipeline/DataPipelineClient.ts b/clients/client-data-pipeline/DataPipelineClient.ts index bfebb99163f9f..8131b7f6199ec 100644 --- a/clients/client-data-pipeline/DataPipelineClient.ts +++ b/clients/client-data-pipeline/DataPipelineClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DataPipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +223,8 @@ export type DataPipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataPipelineClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +232,8 @@ export type DataPipelineClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Data Pipeline configures and manages a data-driven workflow called a pipeline. AWS Data Pipeline handles the details of scheduling and ensuring that data dependencies are met so that your application can focus on processing the data.

@@ -257,16 +259,16 @@ export class DataPipelineClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-data-pipeline/runtimeConfig.browser.ts b/clients/client-data-pipeline/runtimeConfig.browser.ts index 613353f22c2b1..3eeaefa7640c0 100644 --- a/clients/client-data-pipeline/runtimeConfig.browser.ts +++ b/clients/client-data-pipeline/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-data-pipeline/runtimeConfig.native.ts b/clients/client-data-pipeline/runtimeConfig.native.ts index d29208f6198c2..53680a0299427 100644 --- a/clients/client-data-pipeline/runtimeConfig.native.ts +++ b/clients/client-data-pipeline/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataPipelineClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-data-pipeline/runtimeConfig.ts b/clients/client-data-pipeline/runtimeConfig.ts index b3bde8d16c6c7..f32c84169189c 100644 --- a/clients/client-data-pipeline/runtimeConfig.ts +++ b/clients/client-data-pipeline/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts b/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts index a4453abdbd7fa..fc4045ec3cb9d 100644 --- a/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts +++ b/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts @@ -212,6 +212,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -222,6 +223,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -383,11 +385,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -429,6 +426,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DatabaseMigrationServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -437,8 +439,8 @@ export type DatabaseMigrationServiceClientConfig = Partial<__SmithyConfiguration EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DatabaseMigrationServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -446,8 +448,8 @@ export type DatabaseMigrationServiceClientResolvedConfig = __SmithyResolvedConfi EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Database Migration Service @@ -478,16 +480,16 @@ export class DatabaseMigrationServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-database-migration-service/runtimeConfig.browser.ts b/clients/client-database-migration-service/runtimeConfig.browser.ts index ea13446b6c9ae..009550d815720 100644 --- a/clients/client-database-migration-service/runtimeConfig.browser.ts +++ b/clients/client-database-migration-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-database-migration-service/runtimeConfig.native.ts b/clients/client-database-migration-service/runtimeConfig.native.ts index 9cad9050d511b..ae7ea57e683eb 100644 --- a/clients/client-database-migration-service/runtimeConfig.native.ts +++ b/clients/client-database-migration-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DatabaseMigrationServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-database-migration-service/runtimeConfig.ts b/clients/client-database-migration-service/runtimeConfig.ts index 385a6d603237a..91af283fd4ccf 100644 --- a/clients/client-database-migration-service/runtimeConfig.ts +++ b/clients/client-database-migration-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-databrew/DataBrewClient.ts b/clients/client-databrew/DataBrewClient.ts index 3e76f942ef8d2..2d418b0109a56 100644 --- a/clients/client-databrew/DataBrewClient.ts +++ b/clients/client-databrew/DataBrewClient.ts @@ -88,6 +88,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -98,6 +99,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -227,11 +229,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -273,6 +270,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DataBrewClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -281,8 +283,8 @@ export type DataBrewClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataBrewClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -290,8 +292,8 @@ export type DataBrewClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Glue DataBrew is a visual, cloud-scale data-preparation service. DataBrew @@ -316,16 +318,16 @@ export class DataBrewClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-databrew/runtimeConfig.browser.ts b/clients/client-databrew/runtimeConfig.browser.ts index 2844b55136af5..2c12f4f8d802b 100644 --- a/clients/client-databrew/runtimeConfig.browser.ts +++ b/clients/client-databrew/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-databrew/runtimeConfig.native.ts b/clients/client-databrew/runtimeConfig.native.ts index fa48ccf8dc742..ed1e7c8d6f8cb 100644 --- a/clients/client-databrew/runtimeConfig.native.ts +++ b/clients/client-databrew/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataBrewClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-databrew/runtimeConfig.ts b/clients/client-databrew/runtimeConfig.ts index f349e2a52150c..038e2e1a00959 100644 --- a/clients/client-databrew/runtimeConfig.ts +++ b/clients/client-databrew/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dataexchange/DataExchangeClient.ts b/clients/client-dataexchange/DataExchangeClient.ts index fc3025afd62d0..d01e10d1b7e6e 100644 --- a/clients/client-dataexchange/DataExchangeClient.ts +++ b/clients/client-dataexchange/DataExchangeClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DataExchangeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +226,8 @@ export type DataExchangeClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataExchangeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +235,8 @@ export type DataExchangeClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Data Exchange is a service that makes it easy for AWS customers to exchange data in the cloud. You can use the AWS Data Exchange APIs to create, update, manage, and access file-based data set in the AWS Cloud.

As a subscriber, you can view and access the data sets that you have an entitlement to through a subscription. You can use the APIS to download or copy your entitled data sets to Amazon S3 for use across a variety of AWS analytics and machine learning services.

As a provider, you can create and manage your data sets that you would like to publish to a product. Being able to package and provide your data sets into products requires a few steps to determine eligibility. For more information, visit the AWS Data Exchange User Guide.

A data set is a collection of data that can be changed or updated over time. Data sets can be updated using revisions, which represent a new version or incremental change to a data set. A revision contains one or more assets. An asset in AWS Data Exchange is a piece of data that can be stored as an Amazon S3 object. The asset can be a structured data file, an image file, or some other data file. Jobs are asynchronous import or export operations used to create or copy assets.

@@ -256,16 +258,16 @@ export class DataExchangeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dataexchange/runtimeConfig.browser.ts b/clients/client-dataexchange/runtimeConfig.browser.ts index dadda53b3ccd0..99d95522ccf05 100644 --- a/clients/client-dataexchange/runtimeConfig.browser.ts +++ b/clients/client-dataexchange/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dataexchange/runtimeConfig.native.ts b/clients/client-dataexchange/runtimeConfig.native.ts index e255fb75e86be..303b37f5f971f 100644 --- a/clients/client-dataexchange/runtimeConfig.native.ts +++ b/clients/client-dataexchange/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataExchangeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dataexchange/runtimeConfig.ts b/clients/client-dataexchange/runtimeConfig.ts index 68d2306ee16fb..aa78f5f38b38c 100644 --- a/clients/client-dataexchange/runtimeConfig.ts +++ b/clients/client-dataexchange/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-datasync/DataSyncClient.ts b/clients/client-datasync/DataSyncClient.ts index a530ee21ed51d..590ffe5c63ace 100644 --- a/clients/client-datasync/DataSyncClient.ts +++ b/clients/client-datasync/DataSyncClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -227,11 +229,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -273,6 +270,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DataSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -281,8 +283,8 @@ export type DataSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -290,8 +292,8 @@ export type DataSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS DataSync @@ -319,16 +321,16 @@ export class DataSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-datasync/runtimeConfig.browser.ts b/clients/client-datasync/runtimeConfig.browser.ts index 5c295b330156a..caff98c6c8580 100644 --- a/clients/client-datasync/runtimeConfig.browser.ts +++ b/clients/client-datasync/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-datasync/runtimeConfig.native.ts b/clients/client-datasync/runtimeConfig.native.ts index 54339bc051d30..e9d9c4fe1fd92 100644 --- a/clients/client-datasync/runtimeConfig.native.ts +++ b/clients/client-datasync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-datasync/runtimeConfig.ts b/clients/client-datasync/runtimeConfig.ts index 99558ff59855f..fc904b98f871b 100644 --- a/clients/client-datasync/runtimeConfig.ts +++ b/clients/client-datasync/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dax/DAXClient.ts b/clients/client-dax/DAXClient.ts index 8e504006f327b..8432e0add6942 100644 --- a/clients/client-dax/DAXClient.ts +++ b/clients/client-dax/DAXClient.ts @@ -80,6 +80,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -90,6 +91,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DAXClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +241,8 @@ export type DAXClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DAXClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +250,8 @@ export type DAXClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

DAX is a managed caching service engineered for Amazon DynamoDB. DAX @@ -276,16 +278,16 @@ export class DAXClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dax/runtimeConfig.browser.ts b/clients/client-dax/runtimeConfig.browser.ts index 2ff9968497fc9..1587ab9992087 100644 --- a/clients/client-dax/runtimeConfig.browser.ts +++ b/clients/client-dax/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dax/runtimeConfig.native.ts b/clients/client-dax/runtimeConfig.native.ts index 6fb187d530248..15a4a4be0299b 100644 --- a/clients/client-dax/runtimeConfig.native.ts +++ b/clients/client-dax/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DAXClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dax/runtimeConfig.ts b/clients/client-dax/runtimeConfig.ts index e69ce75ab04f7..cb93c91ac554e 100644 --- a/clients/client-dax/runtimeConfig.ts +++ b/clients/client-dax/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-detective/DetectiveClient.ts b/clients/client-detective/DetectiveClient.ts index 910ce0013b54d..76917710b52f2 100644 --- a/clients/client-detective/DetectiveClient.ts +++ b/clients/client-detective/DetectiveClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -140,11 +142,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -186,6 +183,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DetectiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -194,8 +196,8 @@ export type DetectiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DetectiveClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -203,8 +205,8 @@ export type DetectiveClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Detective uses machine learning and purpose-built visualizations to help you analyze and @@ -266,16 +268,16 @@ export class DetectiveClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-detective/runtimeConfig.browser.ts b/clients/client-detective/runtimeConfig.browser.ts index 0239a097a0dc6..5171f8825fcda 100644 --- a/clients/client-detective/runtimeConfig.browser.ts +++ b/clients/client-detective/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-detective/runtimeConfig.native.ts b/clients/client-detective/runtimeConfig.native.ts index b16fad6b8cde8..ba265876a0169 100644 --- a/clients/client-detective/runtimeConfig.native.ts +++ b/clients/client-detective/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DetectiveClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-detective/runtimeConfig.ts b/clients/client-detective/runtimeConfig.ts index a46f863e1eda3..563b3e3d50087 100644 --- a/clients/client-detective/runtimeConfig.ts +++ b/clients/client-detective/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-device-farm/DeviceFarmClient.ts b/clients/client-device-farm/DeviceFarmClient.ts index 9a545020b5def..f40ac6412b062 100644 --- a/clients/client-device-farm/DeviceFarmClient.ts +++ b/clients/client-device-farm/DeviceFarmClient.ts @@ -208,6 +208,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -218,6 +219,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -425,11 +427,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -471,6 +468,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DeviceFarmClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -479,8 +481,8 @@ export type DeviceFarmClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DeviceFarmClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -488,8 +490,8 @@ export type DeviceFarmClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Device Farm API documentation, which contains APIs for:

@@ -525,16 +527,16 @@ export class DeviceFarmClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-device-farm/runtimeConfig.browser.ts b/clients/client-device-farm/runtimeConfig.browser.ts index 8b7baa2d90dd3..f1b133b9f11fb 100644 --- a/clients/client-device-farm/runtimeConfig.browser.ts +++ b/clients/client-device-farm/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-device-farm/runtimeConfig.native.ts b/clients/client-device-farm/runtimeConfig.native.ts index 50894c54866f9..855933af044d8 100644 --- a/clients/client-device-farm/runtimeConfig.native.ts +++ b/clients/client-device-farm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DeviceFarmClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-device-farm/runtimeConfig.ts b/clients/client-device-farm/runtimeConfig.ts index 1d2df95bf0539..2855ab0430977 100644 --- a/clients/client-device-farm/runtimeConfig.ts +++ b/clients/client-device-farm/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-devops-guru/DevOpsGuruClient.ts b/clients/client-devops-guru/DevOpsGuruClient.ts index 358483568cca4..d2e31e82b3ad8 100644 --- a/clients/client-devops-guru/DevOpsGuruClient.ts +++ b/clients/client-devops-guru/DevOpsGuruClient.ts @@ -89,6 +89,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -99,6 +100,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -188,11 +190,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -234,6 +231,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DevOpsGuruClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -242,8 +244,8 @@ export type DevOpsGuruClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DevOpsGuruClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -251,8 +253,8 @@ export type DevOpsGuruClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class DevOpsGuruClient extends __Client< __HttpHandlerOptions, @@ -271,16 +273,16 @@ export class DevOpsGuruClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-devops-guru/runtimeConfig.browser.ts b/clients/client-devops-guru/runtimeConfig.browser.ts index 3d624b5e89fed..085684617fec8 100644 --- a/clients/client-devops-guru/runtimeConfig.browser.ts +++ b/clients/client-devops-guru/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-devops-guru/runtimeConfig.native.ts b/clients/client-devops-guru/runtimeConfig.native.ts index 00208d07f98a0..19a82d284c7bc 100644 --- a/clients/client-devops-guru/runtimeConfig.native.ts +++ b/clients/client-devops-guru/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DevOpsGuruClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-devops-guru/runtimeConfig.ts b/clients/client-devops-guru/runtimeConfig.ts index 6b10468c3264c..46062c278016c 100644 --- a/clients/client-devops-guru/runtimeConfig.ts +++ b/clients/client-devops-guru/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-direct-connect/DirectConnectClient.ts b/clients/client-direct-connect/DirectConnectClient.ts index 0bcf7630eb013..bf4178ecfe1aa 100644 --- a/clients/client-direct-connect/DirectConnectClient.ts +++ b/clients/client-direct-connect/DirectConnectClient.ts @@ -211,6 +211,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -221,6 +222,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -386,11 +388,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -432,6 +429,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DirectConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -440,8 +442,8 @@ export type DirectConnectClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DirectConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -449,8 +451,8 @@ export type DirectConnectClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Direct Connect links your internal network to an AWS Direct Connect location over a standard Ethernet fiber-optic cable. @@ -477,16 +479,16 @@ export class DirectConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-direct-connect/runtimeConfig.browser.ts b/clients/client-direct-connect/runtimeConfig.browser.ts index 1a709d07189c6..f3fe593c20462 100644 --- a/clients/client-direct-connect/runtimeConfig.browser.ts +++ b/clients/client-direct-connect/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-direct-connect/runtimeConfig.native.ts b/clients/client-direct-connect/runtimeConfig.native.ts index f3790d49a3e8a..1a4b98cb32c82 100644 --- a/clients/client-direct-connect/runtimeConfig.native.ts +++ b/clients/client-direct-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DirectConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-direct-connect/runtimeConfig.ts b/clients/client-direct-connect/runtimeConfig.ts index de45384040d4f..ee34497894e4e 100644 --- a/clients/client-direct-connect/runtimeConfig.ts +++ b/clients/client-direct-connect/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-directory-service/DirectoryServiceClient.ts b/clients/client-directory-service/DirectoryServiceClient.ts index c887f97f61762..3a57ec72415df 100644 --- a/clients/client-directory-service/DirectoryServiceClient.ts +++ b/clients/client-directory-service/DirectoryServiceClient.ts @@ -178,6 +178,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -188,6 +189,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -365,11 +367,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -411,6 +408,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DirectoryServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -419,8 +421,8 @@ export type DirectoryServiceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DirectoryServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -428,8 +430,8 @@ export type DirectoryServiceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Directory Service @@ -456,16 +458,16 @@ export class DirectoryServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-directory-service/runtimeConfig.browser.ts b/clients/client-directory-service/runtimeConfig.browser.ts index 2c144ceb1746e..693a3ee30834c 100644 --- a/clients/client-directory-service/runtimeConfig.browser.ts +++ b/clients/client-directory-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-directory-service/runtimeConfig.native.ts b/clients/client-directory-service/runtimeConfig.native.ts index 1feba5c63d243..e82655bb667f9 100644 --- a/clients/client-directory-service/runtimeConfig.native.ts +++ b/clients/client-directory-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DirectoryServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-directory-service/runtimeConfig.ts b/clients/client-directory-service/runtimeConfig.ts index c14456b94afcb..5f2f2e18293d8 100644 --- a/clients/client-directory-service/runtimeConfig.ts +++ b/clients/client-directory-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dlm/DLMClient.ts b/clients/client-dlm/DLMClient.ts index 862608dea8082..991a60f8476e9 100644 --- a/clients/client-dlm/DLMClient.ts +++ b/clients/client-dlm/DLMClient.ts @@ -58,6 +58,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -68,6 +69,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -137,11 +139,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -183,6 +180,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DLMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -191,8 +193,8 @@ export type DLMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DLMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -200,8 +202,8 @@ export type DLMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Data Lifecycle Manager

With Amazon Data Lifecycle Manager, you can manage the lifecycle of your AWS resources. You create lifecycle policies, which are used to automate operations on the specified resources.

Amazon DLM supports Amazon EBS volumes and snapshots. For information about using Amazon DLM with Amazon EBS, see Automating the Amazon EBS Snapshot Lifecycle in the Amazon EC2 User Guide.

@@ -223,16 +225,16 @@ export class DLMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dlm/runtimeConfig.browser.ts b/clients/client-dlm/runtimeConfig.browser.ts index 734d036d47500..ef8e23d7ab523 100644 --- a/clients/client-dlm/runtimeConfig.browser.ts +++ b/clients/client-dlm/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dlm/runtimeConfig.native.ts b/clients/client-dlm/runtimeConfig.native.ts index 3eb41cac64d8a..2bef215b6595a 100644 --- a/clients/client-dlm/runtimeConfig.native.ts +++ b/clients/client-dlm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DLMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dlm/runtimeConfig.ts b/clients/client-dlm/runtimeConfig.ts index 88be42bbdb0eb..28466c6071784 100644 --- a/clients/client-dlm/runtimeConfig.ts +++ b/clients/client-dlm/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-docdb/DocDBClient.ts b/clients/client-docdb/DocDBClient.ts index 29f6d45157235..b1affdf92a1b8 100644 --- a/clients/client-docdb/DocDBClient.ts +++ b/clients/client-docdb/DocDBClient.ts @@ -164,6 +164,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -174,6 +175,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -311,11 +313,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -357,6 +354,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DocDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -365,8 +367,8 @@ export type DocDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DocDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -374,8 +376,8 @@ export type DocDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon DocumentDB API documentation

@@ -397,16 +399,16 @@ export class DocDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-docdb/runtimeConfig.browser.ts b/clients/client-docdb/runtimeConfig.browser.ts index c6ce37fec65f6..a676e39476786 100644 --- a/clients/client-docdb/runtimeConfig.browser.ts +++ b/clients/client-docdb/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-docdb/runtimeConfig.native.ts b/clients/client-docdb/runtimeConfig.native.ts index 3ad2a39f55414..bf5339ed2558a 100644 --- a/clients/client-docdb/runtimeConfig.native.ts +++ b/clients/client-docdb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DocDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-docdb/runtimeConfig.ts b/clients/client-docdb/runtimeConfig.ts index 5e82f963d1fea..ddb5c6251da9b 100644 --- a/clients/client-docdb/runtimeConfig.ts +++ b/clients/client-docdb/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts b/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts index 2763f483a0f19..56ff94dc5d907 100644 --- a/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts +++ b/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DynamoDBStreamsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +166,8 @@ export type DynamoDBStreamsClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DynamoDBStreamsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +175,8 @@ export type DynamoDBStreamsClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon DynamoDB @@ -201,16 +203,16 @@ export class DynamoDBStreamsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dynamodb-streams/runtimeConfig.browser.ts b/clients/client-dynamodb-streams/runtimeConfig.browser.ts index a669444fa9212..3467993952ac0 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.browser.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dynamodb-streams/runtimeConfig.native.ts b/clients/client-dynamodb-streams/runtimeConfig.native.ts index 1acb3d688fbab..9e84dfbab8f52 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.native.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DynamoDBStreamsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dynamodb-streams/runtimeConfig.ts b/clients/client-dynamodb-streams/runtimeConfig.ts index 3338b79dcebdf..6fa9f42489cbf 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dynamodb/DynamoDBClient.ts b/clients/client-dynamodb/DynamoDBClient.ts index 9aa68921402f7..bff71b9e38e4d 100644 --- a/clients/client-dynamodb/DynamoDBClient.ts +++ b/clients/client-dynamodb/DynamoDBClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -299,11 +301,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -345,6 +342,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type DynamoDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -353,8 +355,8 @@ export type DynamoDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DynamoDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -362,8 +364,8 @@ export type DynamoDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon DynamoDB @@ -403,16 +405,16 @@ export class DynamoDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dynamodb/runtimeConfig.browser.ts b/clients/client-dynamodb/runtimeConfig.browser.ts index 8e14698997938..e63a0033dd07e 100644 --- a/clients/client-dynamodb/runtimeConfig.browser.ts +++ b/clients/client-dynamodb/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dynamodb/runtimeConfig.native.ts b/clients/client-dynamodb/runtimeConfig.native.ts index f015139582b9d..4435dd96ded20 100644 --- a/clients/client-dynamodb/runtimeConfig.native.ts +++ b/clients/client-dynamodb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DynamoDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dynamodb/runtimeConfig.ts b/clients/client-dynamodb/runtimeConfig.ts index 80e1f5a134398..4f0f71342dff1 100644 --- a/clients/client-dynamodb/runtimeConfig.ts +++ b/clients/client-dynamodb/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ebs/EBSClient.ts b/clients/client-ebs/EBSClient.ts index e76e91cb964c3..f606d7df7f050 100644 --- a/clients/client-ebs/EBSClient.ts +++ b/clients/client-ebs/EBSClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EBSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +172,8 @@ export type EBSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EBSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +181,8 @@ export type EBSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create EBS snapshots, write data directly to @@ -221,16 +223,16 @@ export class EBSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ebs/runtimeConfig.browser.ts b/clients/client-ebs/runtimeConfig.browser.ts index 56236077f9b98..d0d28c989d00e 100644 --- a/clients/client-ebs/runtimeConfig.browser.ts +++ b/clients/client-ebs/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ebs/runtimeConfig.native.ts b/clients/client-ebs/runtimeConfig.native.ts index 45a219b271f69..d33457a7b13c4 100644 --- a/clients/client-ebs/runtimeConfig.native.ts +++ b/clients/client-ebs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EBSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ebs/runtimeConfig.ts b/clients/client-ebs/runtimeConfig.ts index 4c73edb206eae..514553091ecd2 100644 --- a/clients/client-ebs/runtimeConfig.ts +++ b/clients/client-ebs/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts b/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts index 6d2832b833a15..77c6eb5850fc0 100644 --- a/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts +++ b/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SendSSHPublicKeyCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EC2InstanceConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +155,8 @@ export type EC2InstanceConnectClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2InstanceConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +164,8 @@ export type EC2InstanceConnectClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS EC2 Connect Service is a service that enables system administrators to publish @@ -187,16 +189,16 @@ export class EC2InstanceConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts b/clients/client-ec2-instance-connect/runtimeConfig.browser.ts index 27ffa0dacd2f8..d4577a4807f37 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ec2-instance-connect/runtimeConfig.native.ts b/clients/client-ec2-instance-connect/runtimeConfig.native.ts index a8c90fe154563..ac0aa39a7d0a9 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.native.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2InstanceConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ec2-instance-connect/runtimeConfig.ts b/clients/client-ec2-instance-connect/runtimeConfig.ts index dc88e54cfc039..7e4777874c777 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ec2/EC2Client.ts b/clients/client-ec2/EC2Client.ts index 9e487fd8986a4..4e4512e6f4347 100644 --- a/clients/client-ec2/EC2Client.ts +++ b/clients/client-ec2/EC2Client.ts @@ -1492,6 +1492,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -1502,6 +1503,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -2435,11 +2437,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -2481,6 +2478,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EC2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -2489,8 +2491,8 @@ export type EC2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -2498,8 +2500,8 @@ export type EC2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Compute Cloud @@ -2543,16 +2545,16 @@ export class EC2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ec2/runtimeConfig.browser.ts b/clients/client-ec2/runtimeConfig.browser.ts index f25edc10f29bd..65a7754b53ad8 100644 --- a/clients/client-ec2/runtimeConfig.browser.ts +++ b/clients/client-ec2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ec2/runtimeConfig.native.ts b/clients/client-ec2/runtimeConfig.native.ts index 8f7b7fcc1d8f5..8f7c4b5e69945 100644 --- a/clients/client-ec2/runtimeConfig.native.ts +++ b/clients/client-ec2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ec2/runtimeConfig.ts b/clients/client-ec2/runtimeConfig.ts index e087b571b3030..3ec70f80bf28d 100644 --- a/clients/client-ec2/runtimeConfig.ts +++ b/clients/client-ec2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecr-public/ECRPUBLICClient.ts b/clients/client-ecr-public/ECRPUBLICClient.ts index 48aa5564403f4..0747884431489 100644 --- a/clients/client-ecr-public/ECRPUBLICClient.ts +++ b/clients/client-ecr-public/ECRPUBLICClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ECRPUBLICClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +250,8 @@ export type ECRPUBLICClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECRPUBLICClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +259,8 @@ export type ECRPUBLICClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Registry Public @@ -286,16 +288,16 @@ export class ECRPUBLICClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecr-public/runtimeConfig.browser.ts b/clients/client-ecr-public/runtimeConfig.browser.ts index 5e3675eab6a16..7c3891d7febe8 100644 --- a/clients/client-ecr-public/runtimeConfig.browser.ts +++ b/clients/client-ecr-public/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecr-public/runtimeConfig.native.ts b/clients/client-ecr-public/runtimeConfig.native.ts index 97909e5f0316d..a772a48bb7d33 100644 --- a/clients/client-ecr-public/runtimeConfig.native.ts +++ b/clients/client-ecr-public/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECRPUBLICClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecr-public/runtimeConfig.ts b/clients/client-ecr-public/runtimeConfig.ts index f8589fd728f51..583f997a833b3 100644 --- a/clients/client-ecr-public/runtimeConfig.ts +++ b/clients/client-ecr-public/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecr/ECRClient.ts b/clients/client-ecr/ECRClient.ts index 600e6eefadf6e..042801915201c 100644 --- a/clients/client-ecr/ECRClient.ts +++ b/clients/client-ecr/ECRClient.ts @@ -123,6 +123,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -133,6 +134,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -254,11 +256,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -300,6 +297,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ECRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -308,8 +310,8 @@ export type ECRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -317,8 +319,8 @@ export type ECRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Registry @@ -346,16 +348,16 @@ export class ECRClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecr/runtimeConfig.browser.ts b/clients/client-ecr/runtimeConfig.browser.ts index c200a5e3fd9da..0db7582019c5e 100644 --- a/clients/client-ecr/runtimeConfig.browser.ts +++ b/clients/client-ecr/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecr/runtimeConfig.native.ts b/clients/client-ecr/runtimeConfig.native.ts index eef2372a336c2..a4e6e46a060ff 100644 --- a/clients/client-ecr/runtimeConfig.native.ts +++ b/clients/client-ecr/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECRClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecr/runtimeConfig.ts b/clients/client-ecr/runtimeConfig.ts index 2bad181d3b209..96aa023689565 100644 --- a/clients/client-ecr/runtimeConfig.ts +++ b/clients/client-ecr/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecs/ECSClient.ts b/clients/client-ecs/ECSClient.ts index 400c917f0fb45..b7b616cac47c6 100644 --- a/clients/client-ecs/ECSClient.ts +++ b/clients/client-ecs/ECSClient.ts @@ -163,6 +163,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -173,6 +174,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -326,11 +328,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -372,6 +369,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ECSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -380,8 +382,8 @@ export type ECSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -389,8 +391,8 @@ export type ECSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Service @@ -426,16 +428,16 @@ export class ECSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecs/runtimeConfig.browser.ts b/clients/client-ecs/runtimeConfig.browser.ts index 308e028f2e72c..4d34c970aef2f 100644 --- a/clients/client-ecs/runtimeConfig.browser.ts +++ b/clients/client-ecs/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecs/runtimeConfig.native.ts b/clients/client-ecs/runtimeConfig.native.ts index 0339c7eae4a8a..f7fadafb32190 100644 --- a/clients/client-ecs/runtimeConfig.native.ts +++ b/clients/client-ecs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecs/runtimeConfig.ts b/clients/client-ecs/runtimeConfig.ts index d519403c91b5c..f7d2ccfc51cfd 100644 --- a/clients/client-ecs/runtimeConfig.ts +++ b/clients/client-ecs/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-efs/EFSClient.ts b/clients/client-efs/EFSClient.ts index 0559eeac3e123..aa116097a6526 100644 --- a/clients/client-efs/EFSClient.ts +++ b/clients/client-efs/EFSClient.ts @@ -96,6 +96,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -106,6 +107,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EFSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +265,8 @@ export type EFSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EFSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +274,8 @@ export type EFSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic File System @@ -299,16 +301,16 @@ export class EFSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-efs/runtimeConfig.browser.ts b/clients/client-efs/runtimeConfig.browser.ts index 3b747ea08dd72..880d54374857d 100644 --- a/clients/client-efs/runtimeConfig.browser.ts +++ b/clients/client-efs/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-efs/runtimeConfig.native.ts b/clients/client-efs/runtimeConfig.native.ts index ad1cccea4b598..bdaa689854fe8 100644 --- a/clients/client-efs/runtimeConfig.native.ts +++ b/clients/client-efs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EFSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-efs/runtimeConfig.ts b/clients/client-efs/runtimeConfig.ts index e47ff76c0d555..b7b7507fb93eb 100644 --- a/clients/client-efs/runtimeConfig.ts +++ b/clients/client-efs/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-eks/EKSClient.ts b/clients/client-eks/EKSClient.ts index 22b8b403ddfa2..da1e1022831d4 100644 --- a/clients/client-eks/EKSClient.ts +++ b/clients/client-eks/EKSClient.ts @@ -92,6 +92,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -102,6 +103,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EKSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +265,8 @@ export type EKSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EKSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +274,8 @@ export type EKSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes it easy for you to run Kubernetes on @@ -304,16 +306,16 @@ export class EKSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-eks/runtimeConfig.browser.ts b/clients/client-eks/runtimeConfig.browser.ts index 075359b1e4ac1..0243d322a1784 100644 --- a/clients/client-eks/runtimeConfig.browser.ts +++ b/clients/client-eks/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-eks/runtimeConfig.native.ts b/clients/client-eks/runtimeConfig.native.ts index c24b5017a2823..25e1dd3904258 100644 --- a/clients/client-eks/runtimeConfig.native.ts +++ b/clients/client-eks/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EKSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-eks/runtimeConfig.ts b/clients/client-eks/runtimeConfig.ts index 679ea0f0c8753..6a7b5e2c41662 100644 --- a/clients/client-eks/runtimeConfig.ts +++ b/clients/client-eks/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts b/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts index 5693c39f3bd6c..81094a8930330 100644 --- a/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts +++ b/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts @@ -199,6 +199,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -209,6 +210,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -356,11 +358,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -402,6 +399,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ElasticBeanstalkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -410,8 +412,8 @@ export type ElasticBeanstalkClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticBeanstalkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -419,8 +421,8 @@ export type ElasticBeanstalkClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elastic Beanstalk @@ -456,16 +458,16 @@ export class ElasticBeanstalkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts b/clients/client-elastic-beanstalk/runtimeConfig.browser.ts index c3d616c549fec..5df2e0dd269ee 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-beanstalk/runtimeConfig.native.ts b/clients/client-elastic-beanstalk/runtimeConfig.native.ts index 848ae9a1aa504..b51ffcdb93fe5 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.native.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticBeanstalkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-beanstalk/runtimeConfig.ts b/clients/client-elastic-beanstalk/runtimeConfig.ts index a22e1a8cb295e..d345125dff4de 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-inference/ElasticInferenceClient.ts b/clients/client-elastic-inference/ElasticInferenceClient.ts index 81cd7e208243a..2a0af9ccc3cca 100644 --- a/clients/client-elastic-inference/ElasticInferenceClient.ts +++ b/clients/client-elastic-inference/ElasticInferenceClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ElasticInferenceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +184,8 @@ export type ElasticInferenceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticInferenceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +193,8 @@ export type ElasticInferenceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -216,16 +218,16 @@ export class ElasticInferenceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-inference/runtimeConfig.browser.ts b/clients/client-elastic-inference/runtimeConfig.browser.ts index b87fe5e3bc676..176490633898e 100644 --- a/clients/client-elastic-inference/runtimeConfig.browser.ts +++ b/clients/client-elastic-inference/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-inference/runtimeConfig.native.ts b/clients/client-elastic-inference/runtimeConfig.native.ts index f11ac3fdcf14c..ffa246b21f4d1 100644 --- a/clients/client-elastic-inference/runtimeConfig.native.ts +++ b/clients/client-elastic-inference/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticInferenceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-inference/runtimeConfig.ts b/clients/client-elastic-inference/runtimeConfig.ts index a5ed0615a7290..9b09a2b23f58a 100644 --- a/clients/client-elastic-inference/runtimeConfig.ts +++ b/clients/client-elastic-inference/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts b/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts index 3df53c955dabf..e651ffe118e6f 100644 --- a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts +++ b/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ElasticLoadBalancingV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +292,8 @@ export type ElasticLoadBalancingV2ClientConfig = Partial<__SmithyConfiguration<_ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticLoadBalancingV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +301,8 @@ export type ElasticLoadBalancingV2ClientResolvedConfig = __SmithyResolvedConfigu EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Elastic Load Balancing @@ -357,16 +359,16 @@ export class ElasticLoadBalancingV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts index 58ba193eaf5ac..7749a077a5c07 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts index d52871de013ab..2597bd5ec8483 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticLoadBalancingV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.ts index c3a2a71bef9a3..8dc4234a7096d 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts b/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts index b6be7c06db5ec..8133b919d76cd 100644 --- a/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts +++ b/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -257,11 +259,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -303,6 +300,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ElasticLoadBalancingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -311,8 +313,8 @@ export type ElasticLoadBalancingClientConfig = Partial<__SmithyConfiguration<__H EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticLoadBalancingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -320,8 +322,8 @@ export type ElasticLoadBalancingClientResolvedConfig = __SmithyResolvedConfigura EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Elastic Load Balancing @@ -363,16 +365,16 @@ export class ElasticLoadBalancingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing/runtimeConfig.browser.ts index da5081073853b..87d5af9b5d999 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-load-balancing/runtimeConfig.native.ts b/clients/client-elastic-load-balancing/runtimeConfig.native.ts index e19210d6be4be..059b51de5f3b1 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.native.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticLoadBalancingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-load-balancing/runtimeConfig.ts b/clients/client-elastic-load-balancing/runtimeConfig.ts index 7df45914a3cb4..26c34c811395e 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-transcoder/ElasticTranscoderClient.ts b/clients/client-elastic-transcoder/ElasticTranscoderClient.ts index f8066930c345c..aa3f7120e5e9f 100644 --- a/clients/client-elastic-transcoder/ElasticTranscoderClient.ts +++ b/clients/client-elastic-transcoder/ElasticTranscoderClient.ts @@ -58,6 +58,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -68,6 +69,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ElasticTranscoderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +211,8 @@ export type ElasticTranscoderClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticTranscoderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +220,8 @@ export type ElasticTranscoderClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elastic Transcoder Service @@ -242,16 +244,16 @@ export class ElasticTranscoderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-transcoder/runtimeConfig.browser.ts b/clients/client-elastic-transcoder/runtimeConfig.browser.ts index a4f866dab231b..3f44516f09b69 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.browser.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-transcoder/runtimeConfig.native.ts b/clients/client-elastic-transcoder/runtimeConfig.native.ts index 5420df3ac78bb..7508161f44110 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.native.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticTranscoderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-transcoder/runtimeConfig.ts b/clients/client-elastic-transcoder/runtimeConfig.ts index a401f1692959c..6b50006919101 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elasticache/ElastiCacheClient.ts b/clients/client-elasticache/ElastiCacheClient.ts index 43530a2d25e33..22472a51751fa 100644 --- a/clients/client-elasticache/ElastiCacheClient.ts +++ b/clients/client-elasticache/ElastiCacheClient.ts @@ -232,6 +232,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -242,6 +243,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -425,11 +427,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -471,6 +468,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ElastiCacheClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -479,8 +481,8 @@ export type ElastiCacheClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElastiCacheClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -488,8 +490,8 @@ export type ElastiCacheClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon ElastiCache @@ -520,16 +522,16 @@ export class ElastiCacheClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elasticache/runtimeConfig.browser.ts b/clients/client-elasticache/runtimeConfig.browser.ts index f4b6fcd4a184d..495890f49f472 100644 --- a/clients/client-elasticache/runtimeConfig.browser.ts +++ b/clients/client-elasticache/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elasticache/runtimeConfig.native.ts b/clients/client-elasticache/runtimeConfig.native.ts index 8e7ad69a6ef2a..5a2513da9eb91 100644 --- a/clients/client-elasticache/runtimeConfig.native.ts +++ b/clients/client-elasticache/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElastiCacheClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elasticache/runtimeConfig.ts b/clients/client-elasticache/runtimeConfig.ts index a16e31a99c422..0fdc04699903d 100644 --- a/clients/client-elasticache/runtimeConfig.ts +++ b/clients/client-elasticache/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts b/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts index baadc5e34cde0..4ea0f5bc5c2b5 100644 --- a/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts +++ b/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts @@ -155,6 +155,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -165,6 +166,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -296,11 +298,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -342,6 +339,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ElasticsearchServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -350,8 +352,8 @@ export type ElasticsearchServiceClientConfig = Partial<__SmithyConfiguration<__H EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticsearchServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -359,8 +361,8 @@ export type ElasticsearchServiceClientResolvedConfig = __SmithyResolvedConfigura EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elasticsearch Configuration Service @@ -388,16 +390,16 @@ export class ElasticsearchServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elasticsearch-service/runtimeConfig.browser.ts b/clients/client-elasticsearch-service/runtimeConfig.browser.ts index 5d127229beea5..7525f5db1c091 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.browser.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elasticsearch-service/runtimeConfig.native.ts b/clients/client-elasticsearch-service/runtimeConfig.native.ts index 263f5a6fc63ca..a3c881d65a177 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.native.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticsearchServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elasticsearch-service/runtimeConfig.ts b/clients/client-elasticsearch-service/runtimeConfig.ts index eae4a9f996ed6..b410f8b1123e5 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-emr-containers/EMRContainersClient.ts b/clients/client-emr-containers/EMRContainersClient.ts index ddbead9ea10de..9548497085991 100644 --- a/clients/client-emr-containers/EMRContainersClient.ts +++ b/clients/client-emr-containers/EMRContainersClient.ts @@ -77,6 +77,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -87,6 +88,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EMRContainersClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +226,8 @@ export type EMRContainersClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EMRContainersClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +235,8 @@ export type EMRContainersClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EMR on EKS provides a deployment option for Amazon EMR that allows you to run @@ -277,16 +279,16 @@ export class EMRContainersClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-emr-containers/runtimeConfig.browser.ts b/clients/client-emr-containers/runtimeConfig.browser.ts index 8260c2acd9180..9d7af131b3d7f 100644 --- a/clients/client-emr-containers/runtimeConfig.browser.ts +++ b/clients/client-emr-containers/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-emr-containers/runtimeConfig.native.ts b/clients/client-emr-containers/runtimeConfig.native.ts index a106dbb795dc4..622b9b9b986ca 100644 --- a/clients/client-emr-containers/runtimeConfig.native.ts +++ b/clients/client-emr-containers/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EMRContainersClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-emr-containers/runtimeConfig.ts b/clients/client-emr-containers/runtimeConfig.ts index 1cc9bddbe4fe2..da8b4ca4679a2 100644 --- a/clients/client-emr-containers/runtimeConfig.ts +++ b/clients/client-emr-containers/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-emr/EMRClient.ts b/clients/client-emr/EMRClient.ts index 2e43d3ff4e38a..0d92c0f505f5a 100644 --- a/clients/client-emr/EMRClient.ts +++ b/clients/client-emr/EMRClient.ts @@ -156,6 +156,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -166,6 +167,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -311,11 +313,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -357,6 +354,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EMRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -365,8 +367,8 @@ export type EMRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EMRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -374,8 +376,8 @@ export type EMRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EMR is a web service that makes it easier to process large amounts of data @@ -400,16 +402,16 @@ export class EMRClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-emr/runtimeConfig.browser.ts b/clients/client-emr/runtimeConfig.browser.ts index 394b91541f3b9..d76665f2646b7 100644 --- a/clients/client-emr/runtimeConfig.browser.ts +++ b/clients/client-emr/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-emr/runtimeConfig.native.ts b/clients/client-emr/runtimeConfig.native.ts index baf9056f41d2d..5c15ca853b4a4 100644 --- a/clients/client-emr/runtimeConfig.native.ts +++ b/clients/client-emr/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EMRClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-emr/runtimeConfig.ts b/clients/client-emr/runtimeConfig.ts index 29b1438f6c255..f1277a914f227 100644 --- a/clients/client-emr/runtimeConfig.ts +++ b/clients/client-emr/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-eventbridge/EventBridgeClient.ts b/clients/client-eventbridge/EventBridgeClient.ts index 699424f30b108..64e7c4907f426 100644 --- a/clients/client-eventbridge/EventBridgeClient.ts +++ b/clients/client-eventbridge/EventBridgeClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EventBridgeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +304,8 @@ export type EventBridgeClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EventBridgeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +313,8 @@ export type EventBridgeClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge helps you to respond to state changes in your AWS resources. @@ -355,16 +357,16 @@ export class EventBridgeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-eventbridge/runtimeConfig.browser.ts b/clients/client-eventbridge/runtimeConfig.browser.ts index 52c92b281eebf..bf9c4a5954f10 100644 --- a/clients/client-eventbridge/runtimeConfig.browser.ts +++ b/clients/client-eventbridge/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-eventbridge/runtimeConfig.native.ts b/clients/client-eventbridge/runtimeConfig.native.ts index 0e5f70f3a1488..11ea8c3096291 100644 --- a/clients/client-eventbridge/runtimeConfig.native.ts +++ b/clients/client-eventbridge/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EventBridgeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-eventbridge/runtimeConfig.ts b/clients/client-eventbridge/runtimeConfig.ts index 49ab30278bb46..d047678e0874e 100644 --- a/clients/client-eventbridge/runtimeConfig.ts +++ b/clients/client-eventbridge/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-firehose/FirehoseClient.ts b/clients/client-firehose/FirehoseClient.ts index 6cbe7c6f6d1a5..703191a2b2471 100644 --- a/clients/client-firehose/FirehoseClient.ts +++ b/clients/client-firehose/FirehoseClient.ts @@ -71,6 +71,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -81,6 +82,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type FirehoseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +214,8 @@ export type FirehoseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FirehoseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +223,8 @@ export type FirehoseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Kinesis Data Firehose API Reference @@ -247,16 +249,16 @@ export class FirehoseClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-firehose/runtimeConfig.browser.ts b/clients/client-firehose/runtimeConfig.browser.ts index 14b92e169ad6d..47dd3f886cb4a 100644 --- a/clients/client-firehose/runtimeConfig.browser.ts +++ b/clients/client-firehose/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-firehose/runtimeConfig.native.ts b/clients/client-firehose/runtimeConfig.native.ts index 56e99155daabf..85ff7de04da06 100644 --- a/clients/client-firehose/runtimeConfig.native.ts +++ b/clients/client-firehose/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FirehoseClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-firehose/runtimeConfig.ts b/clients/client-firehose/runtimeConfig.ts index 53ec05d589dbe..5f30bd9b59c5a 100644 --- a/clients/client-firehose/runtimeConfig.ts +++ b/clients/client-firehose/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-fms/FMSClient.ts b/clients/client-fms/FMSClient.ts index 83254b13b24a0..6ed1e4ed79ffc 100644 --- a/clients/client-fms/FMSClient.ts +++ b/clients/client-fms/FMSClient.ts @@ -94,6 +94,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -104,6 +105,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type FMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +265,8 @@ export type FMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +274,8 @@ export type FMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Firewall Manager @@ -302,16 +304,16 @@ export class FMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-fms/runtimeConfig.browser.ts b/clients/client-fms/runtimeConfig.browser.ts index 86365b3512e99..9afe51ec0a781 100644 --- a/clients/client-fms/runtimeConfig.browser.ts +++ b/clients/client-fms/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-fms/runtimeConfig.native.ts b/clients/client-fms/runtimeConfig.native.ts index 2881bc1eeb16c..06fae71ba3bf9 100644 --- a/clients/client-fms/runtimeConfig.native.ts +++ b/clients/client-fms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-fms/runtimeConfig.ts b/clients/client-fms/runtimeConfig.ts index 73908a670ecf8..63b6d5a7b9dbf 100644 --- a/clients/client-fms/runtimeConfig.ts +++ b/clients/client-fms/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-forecast/ForecastClient.ts b/clients/client-forecast/ForecastClient.ts index 421dda3d183df..0528b67f7ac69 100644 --- a/clients/client-forecast/ForecastClient.ts +++ b/clients/client-forecast/ForecastClient.ts @@ -110,6 +110,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -120,6 +121,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ForecastClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +295,8 @@ export type ForecastClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ForecastClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +304,8 @@ export type ForecastClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon Forecast resources.

@@ -325,16 +327,16 @@ export class ForecastClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-forecast/runtimeConfig.browser.ts b/clients/client-forecast/runtimeConfig.browser.ts index 761e437655209..3a996255f68de 100644 --- a/clients/client-forecast/runtimeConfig.browser.ts +++ b/clients/client-forecast/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-forecast/runtimeConfig.native.ts b/clients/client-forecast/runtimeConfig.native.ts index 152d020ae81c3..8fc2abba31ea2 100644 --- a/clients/client-forecast/runtimeConfig.native.ts +++ b/clients/client-forecast/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ForecastClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-forecast/runtimeConfig.ts b/clients/client-forecast/runtimeConfig.ts index 21856457fadc0..a6e53489f32c5 100644 --- a/clients/client-forecast/runtimeConfig.ts +++ b/clients/client-forecast/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-forecastquery/ForecastqueryClient.ts b/clients/client-forecastquery/ForecastqueryClient.ts index 38503bdb5c2ab..dfc2f57cecc03 100644 --- a/clients/client-forecastquery/ForecastqueryClient.ts +++ b/clients/client-forecastquery/ForecastqueryClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = QueryForecastCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ForecastqueryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +155,8 @@ export type ForecastqueryClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ForecastqueryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +164,8 @@ export type ForecastqueryClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon Forecast resources.

@@ -185,16 +187,16 @@ export class ForecastqueryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-forecastquery/runtimeConfig.browser.ts b/clients/client-forecastquery/runtimeConfig.browser.ts index 8156913b6fdf0..ae95b8aa5e2ea 100644 --- a/clients/client-forecastquery/runtimeConfig.browser.ts +++ b/clients/client-forecastquery/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-forecastquery/runtimeConfig.native.ts b/clients/client-forecastquery/runtimeConfig.native.ts index 98bec5c1d37f3..5a99514c36bfc 100644 --- a/clients/client-forecastquery/runtimeConfig.native.ts +++ b/clients/client-forecastquery/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ForecastqueryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-forecastquery/runtimeConfig.ts b/clients/client-forecastquery/runtimeConfig.ts index 1de92622a3d40..ed3642654f619 100644 --- a/clients/client-forecastquery/runtimeConfig.ts +++ b/clients/client-forecastquery/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-frauddetector/FraudDetectorClient.ts b/clients/client-frauddetector/FraudDetectorClient.ts index 4e3749f0e5bc7..d5005030174c6 100644 --- a/clients/client-frauddetector/FraudDetectorClient.ts +++ b/clients/client-frauddetector/FraudDetectorClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type FraudDetectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +349,8 @@ export type FraudDetectorClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FraudDetectorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +358,8 @@ export type FraudDetectorClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Fraud Detector API Reference. This guide is for developers who need @@ -381,16 +383,16 @@ export class FraudDetectorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-frauddetector/runtimeConfig.browser.ts b/clients/client-frauddetector/runtimeConfig.browser.ts index 142e9e3b8098a..04fd5eb1bb059 100644 --- a/clients/client-frauddetector/runtimeConfig.browser.ts +++ b/clients/client-frauddetector/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-frauddetector/runtimeConfig.native.ts b/clients/client-frauddetector/runtimeConfig.native.ts index ed6f21b6f56a2..ffeddbcfa5587 100644 --- a/clients/client-frauddetector/runtimeConfig.native.ts +++ b/clients/client-frauddetector/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FraudDetectorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-frauddetector/runtimeConfig.ts b/clients/client-frauddetector/runtimeConfig.ts index 8c169c22c4637..e129df88d5bf5 100644 --- a/clients/client-frauddetector/runtimeConfig.ts +++ b/clients/client-frauddetector/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-fsx/FSxClient.ts b/clients/client-fsx/FSxClient.ts index e499b7221bc79..21019d0e672b9 100644 --- a/clients/client-fsx/FSxClient.ts +++ b/clients/client-fsx/FSxClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type FSxClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +232,8 @@ export type FSxClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FSxClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +241,8 @@ export type FSxClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon FSx is a fully managed service that makes it easy for storage and @@ -263,16 +265,16 @@ export class FSxClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-fsx/runtimeConfig.browser.ts b/clients/client-fsx/runtimeConfig.browser.ts index 7f485db76e085..49a8347b97a80 100644 --- a/clients/client-fsx/runtimeConfig.browser.ts +++ b/clients/client-fsx/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-fsx/runtimeConfig.native.ts b/clients/client-fsx/runtimeConfig.native.ts index e48c057da2410..667d2d75c5832 100644 --- a/clients/client-fsx/runtimeConfig.native.ts +++ b/clients/client-fsx/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FSxClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-fsx/runtimeConfig.ts b/clients/client-fsx/runtimeConfig.ts index 94f668bfffc11..3daa62b86f53b 100644 --- a/clients/client-fsx/runtimeConfig.ts +++ b/clients/client-fsx/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-gamelift/GameLiftClient.ts b/clients/client-gamelift/GameLiftClient.ts index dcc0f31d56f80..ae53db26a1191 100644 --- a/clients/client-gamelift/GameLiftClient.ts +++ b/clients/client-gamelift/GameLiftClient.ts @@ -281,6 +281,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -291,6 +292,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -524,11 +526,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -570,6 +567,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type GameLiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -578,8 +580,8 @@ export type GameLiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GameLiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -587,8 +589,8 @@ export type GameLiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon GameLift Service @@ -660,16 +662,16 @@ export class GameLiftClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-gamelift/runtimeConfig.browser.ts b/clients/client-gamelift/runtimeConfig.browser.ts index f478c90dc94c7..6484023ba8b46 100644 --- a/clients/client-gamelift/runtimeConfig.browser.ts +++ b/clients/client-gamelift/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-gamelift/runtimeConfig.native.ts b/clients/client-gamelift/runtimeConfig.native.ts index 2180707fe0555..d7c948f5a4702 100644 --- a/clients/client-gamelift/runtimeConfig.native.ts +++ b/clients/client-gamelift/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GameLiftClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-gamelift/runtimeConfig.ts b/clients/client-gamelift/runtimeConfig.ts index 30d6766730089..5b151b0188587 100644 --- a/clients/client-gamelift/runtimeConfig.ts +++ b/clients/client-gamelift/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-glacier/GlacierClient.ts b/clients/client-glacier/GlacierClient.ts index fadbc8211ed09..bb7b06f905b56 100644 --- a/clients/client-glacier/GlacierClient.ts +++ b/clients/client-glacier/GlacierClient.ts @@ -117,6 +117,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -128,6 +129,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -247,11 +249,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -301,6 +298,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ request: __HttpRequest, options: { sha256: __HashConstructor; utf8Decoder: __Decoder } ) => Promise<[string, string]>; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type GlacierClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -309,8 +311,8 @@ export type GlacierClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlacierClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -318,8 +320,8 @@ export type GlacierClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon S3 Glacier (Glacier) is a storage solution for "cold data."

@@ -378,17 +380,17 @@ export class GlacierClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getGlacierPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-glacier/runtimeConfig.browser.ts b/clients/client-glacier/runtimeConfig.browser.ts index b3f2a0e9414fc..935db674fd3e2 100644 --- a/clients/client-glacier/runtimeConfig.browser.ts +++ b/clients/client-glacier/runtimeConfig.browser.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { bodyChecksumGenerator, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-glacier/runtimeConfig.native.ts b/clients/client-glacier/runtimeConfig.native.ts index 4ec7e88ba2315..d9be63dceac03 100644 --- a/clients/client-glacier/runtimeConfig.native.ts +++ b/clients/client-glacier/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlacierClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-glacier/runtimeConfig.ts b/clients/client-glacier/runtimeConfig.ts index 86a45687b07a2..2a94cfafde621 100644 --- a/clients/client-glacier/runtimeConfig.ts +++ b/clients/client-glacier/runtimeConfig.ts @@ -26,7 +26,7 @@ export const ClientDefaultValues: Required = { bodyChecksumGenerator, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-global-accelerator/GlobalAcceleratorClient.ts b/clients/client-global-accelerator/GlobalAcceleratorClient.ts index 8e82f5563942b..c8032a1fb95fa 100644 --- a/clients/client-global-accelerator/GlobalAcceleratorClient.ts +++ b/clients/client-global-accelerator/GlobalAcceleratorClient.ts @@ -175,6 +175,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -185,6 +186,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type GlobalAcceleratorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +388,8 @@ export type GlobalAcceleratorClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlobalAcceleratorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +397,8 @@ export type GlobalAcceleratorClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Global Accelerator @@ -565,16 +567,16 @@ export class GlobalAcceleratorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-global-accelerator/runtimeConfig.browser.ts b/clients/client-global-accelerator/runtimeConfig.browser.ts index 5a1f4789e0df0..25a1d669bb978 100644 --- a/clients/client-global-accelerator/runtimeConfig.browser.ts +++ b/clients/client-global-accelerator/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-global-accelerator/runtimeConfig.native.ts b/clients/client-global-accelerator/runtimeConfig.native.ts index 5255941fe136f..e88df1cf00636 100644 --- a/clients/client-global-accelerator/runtimeConfig.native.ts +++ b/clients/client-global-accelerator/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlobalAcceleratorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-global-accelerator/runtimeConfig.ts b/clients/client-global-accelerator/runtimeConfig.ts index e8e36b46ebd24..839fdf632439d 100644 --- a/clients/client-global-accelerator/runtimeConfig.ts +++ b/clients/client-global-accelerator/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-glue/GlueClient.ts b/clients/client-glue/GlueClient.ts index aa999df654321..04f525e09bcec 100644 --- a/clients/client-glue/GlueClient.ts +++ b/clients/client-glue/GlueClient.ts @@ -333,6 +333,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -343,6 +344,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -710,11 +712,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -756,6 +753,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type GlueClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -764,8 +766,8 @@ export type GlueClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlueClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -773,8 +775,8 @@ export type GlueClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Glue @@ -797,16 +799,16 @@ export class GlueClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-glue/runtimeConfig.browser.ts b/clients/client-glue/runtimeConfig.browser.ts index 6de537f2e151e..50feaaebe437c 100644 --- a/clients/client-glue/runtimeConfig.browser.ts +++ b/clients/client-glue/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-glue/runtimeConfig.native.ts b/clients/client-glue/runtimeConfig.native.ts index cfaeac2fcf549..02a5755960942 100644 --- a/clients/client-glue/runtimeConfig.native.ts +++ b/clients/client-glue/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlueClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-glue/runtimeConfig.ts b/clients/client-glue/runtimeConfig.ts index 57795af494f82..637a1cf0dab43 100644 --- a/clients/client-glue/runtimeConfig.ts +++ b/clients/client-glue/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-greengrass/GreengrassClient.ts b/clients/client-greengrass/GreengrassClient.ts index 01e9243cd2a8e..a99be6498c635 100644 --- a/clients/client-greengrass/GreengrassClient.ts +++ b/clients/client-greengrass/GreengrassClient.ts @@ -355,6 +355,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -365,6 +366,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -602,11 +604,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -648,6 +645,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type GreengrassClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -656,8 +658,8 @@ export type GreengrassClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GreengrassClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -665,8 +667,8 @@ export type GreengrassClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Greengrass seamlessly extends AWS onto physical devices so they can act locally on the data they generate, while still using the cloud for management, analytics, and durable storage. AWS IoT Greengrass ensures your devices can respond quickly to local events and operate with intermittent connectivity. AWS IoT Greengrass minimizes the cost of transmitting data to the cloud by allowing you to author AWS Lambda functions that execute locally. @@ -688,16 +690,16 @@ export class GreengrassClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-greengrass/runtimeConfig.browser.ts b/clients/client-greengrass/runtimeConfig.browser.ts index 7863e3490661f..2c39bffc7ffc6 100644 --- a/clients/client-greengrass/runtimeConfig.browser.ts +++ b/clients/client-greengrass/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-greengrass/runtimeConfig.native.ts b/clients/client-greengrass/runtimeConfig.native.ts index 37cafa18bc80c..a87dc5ee17b04 100644 --- a/clients/client-greengrass/runtimeConfig.native.ts +++ b/clients/client-greengrass/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GreengrassClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-greengrass/runtimeConfig.ts b/clients/client-greengrass/runtimeConfig.ts index 3dee4468021ef..2f7bac1f431d1 100644 --- a/clients/client-greengrass/runtimeConfig.ts +++ b/clients/client-greengrass/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-groundstation/GroundStationClient.ts b/clients/client-groundstation/GroundStationClient.ts index aa23e6be190be..293259e94dd96 100644 --- a/clients/client-groundstation/GroundStationClient.ts +++ b/clients/client-groundstation/GroundStationClient.ts @@ -87,6 +87,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -97,6 +98,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type GroundStationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +256,8 @@ export type GroundStationClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GroundStationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +265,8 @@ export type GroundStationClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Ground Station API Reference. AWS Ground Station is a fully managed service that @@ -289,16 +291,16 @@ export class GroundStationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-groundstation/runtimeConfig.browser.ts b/clients/client-groundstation/runtimeConfig.browser.ts index 47cb7d5f0ce73..46bb4f1bc2749 100644 --- a/clients/client-groundstation/runtimeConfig.browser.ts +++ b/clients/client-groundstation/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-groundstation/runtimeConfig.native.ts b/clients/client-groundstation/runtimeConfig.native.ts index 3475909505162..52aa8d6e84559 100644 --- a/clients/client-groundstation/runtimeConfig.native.ts +++ b/clients/client-groundstation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GroundStationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-groundstation/runtimeConfig.ts b/clients/client-groundstation/runtimeConfig.ts index 132b23b9b6e67..3963f2858fb62 100644 --- a/clients/client-groundstation/runtimeConfig.ts +++ b/clients/client-groundstation/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-guardduty/GuardDutyClient.ts b/clients/client-guardduty/GuardDutyClient.ts index 9ebea17d47ef7..b363cda25ffdb 100644 --- a/clients/client-guardduty/GuardDutyClient.ts +++ b/clients/client-guardduty/GuardDutyClient.ts @@ -165,6 +165,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -175,6 +176,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -344,11 +346,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -390,6 +387,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type GuardDutyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -398,8 +400,8 @@ export type GuardDutyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GuardDutyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -407,8 +409,8 @@ export type GuardDutyClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon GuardDuty is a continuous security monitoring service that analyzes and processes @@ -446,16 +448,16 @@ export class GuardDutyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-guardduty/runtimeConfig.browser.ts b/clients/client-guardduty/runtimeConfig.browser.ts index 222af394850f1..7c1e7a543e88e 100644 --- a/clients/client-guardduty/runtimeConfig.browser.ts +++ b/clients/client-guardduty/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-guardduty/runtimeConfig.native.ts b/clients/client-guardduty/runtimeConfig.native.ts index e17adf04da27d..9267548ef2638 100644 --- a/clients/client-guardduty/runtimeConfig.native.ts +++ b/clients/client-guardduty/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GuardDutyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-guardduty/runtimeConfig.ts b/clients/client-guardduty/runtimeConfig.ts index fd1af1067c3eb..771fbe4971a89 100644 --- a/clients/client-guardduty/runtimeConfig.ts +++ b/clients/client-guardduty/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-health/HealthClient.ts b/clients/client-health/HealthClient.ts index cf6ca6604c766..555286d69b2bd 100644 --- a/clients/client-health/HealthClient.ts +++ b/clients/client-health/HealthClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type HealthClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +226,8 @@ export type HealthClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HealthClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +235,8 @@ export type HealthClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Health @@ -293,16 +295,16 @@ export class HealthClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-health/runtimeConfig.browser.ts b/clients/client-health/runtimeConfig.browser.ts index 0b3ebc6dd73a3..fc5c3ed95d499 100644 --- a/clients/client-health/runtimeConfig.browser.ts +++ b/clients/client-health/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-health/runtimeConfig.native.ts b/clients/client-health/runtimeConfig.native.ts index 6abcd5288a07d..1134bd9e518d3 100644 --- a/clients/client-health/runtimeConfig.native.ts +++ b/clients/client-health/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HealthClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-health/runtimeConfig.ts b/clients/client-health/runtimeConfig.ts index 4674df4347074..784b7298bd97a 100644 --- a/clients/client-health/runtimeConfig.ts +++ b/clients/client-health/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-healthlake/HealthLakeClient.ts b/clients/client-healthlake/HealthLakeClient.ts index 36e8c7f57e9e6..c77ca6fd51f14 100644 --- a/clients/client-healthlake/HealthLakeClient.ts +++ b/clients/client-healthlake/HealthLakeClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type HealthLakeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +184,8 @@ export type HealthLakeClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HealthLakeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +193,8 @@ export type HealthLakeClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon HealthLake is a HIPAA eligibile service that allows customers to store, @@ -215,16 +217,16 @@ export class HealthLakeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-healthlake/runtimeConfig.browser.ts b/clients/client-healthlake/runtimeConfig.browser.ts index f13a36c320bc7..ea64c93681b62 100644 --- a/clients/client-healthlake/runtimeConfig.browser.ts +++ b/clients/client-healthlake/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-healthlake/runtimeConfig.native.ts b/clients/client-healthlake/runtimeConfig.native.ts index f1bf34725bff0..4ae36a662ffc4 100644 --- a/clients/client-healthlake/runtimeConfig.native.ts +++ b/clients/client-healthlake/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HealthLakeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-healthlake/runtimeConfig.ts b/clients/client-healthlake/runtimeConfig.ts index f746e7bdbabab..669eed0a0d9a2 100644 --- a/clients/client-healthlake/runtimeConfig.ts +++ b/clients/client-healthlake/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-honeycode/HoneycodeClient.ts b/clients/client-honeycode/HoneycodeClient.ts index 00ae63a57c3b8..014b4cccc3439 100644 --- a/clients/client-honeycode/HoneycodeClient.ts +++ b/clients/client-honeycode/HoneycodeClient.ts @@ -68,6 +68,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -78,6 +79,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type HoneycodeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +211,8 @@ export type HoneycodeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HoneycodeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +220,8 @@ export type HoneycodeClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -245,16 +247,16 @@ export class HoneycodeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-honeycode/runtimeConfig.browser.ts b/clients/client-honeycode/runtimeConfig.browser.ts index 2e4c76f329921..8007f5e5c3866 100644 --- a/clients/client-honeycode/runtimeConfig.browser.ts +++ b/clients/client-honeycode/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-honeycode/runtimeConfig.native.ts b/clients/client-honeycode/runtimeConfig.native.ts index 44dbb946ab270..58470e9f41cd3 100644 --- a/clients/client-honeycode/runtimeConfig.native.ts +++ b/clients/client-honeycode/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HoneycodeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-honeycode/runtimeConfig.ts b/clients/client-honeycode/runtimeConfig.ts index 7bb6c92a8d222..987a1992f8bf6 100644 --- a/clients/client-honeycode/runtimeConfig.ts +++ b/clients/client-honeycode/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iam/IAMClient.ts b/clients/client-iam/IAMClient.ts index 1f4a9f712288f..692c7c5b9e759 100644 --- a/clients/client-iam/IAMClient.ts +++ b/clients/client-iam/IAMClient.ts @@ -373,6 +373,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -383,6 +384,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -716,11 +718,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -762,6 +759,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -770,8 +772,8 @@ export type IAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -779,8 +781,8 @@ export type IAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Identity and Access Management @@ -806,16 +808,16 @@ export class IAMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iam/runtimeConfig.browser.ts b/clients/client-iam/runtimeConfig.browser.ts index 8101d3b6dd293..182ec07707b4d 100644 --- a/clients/client-iam/runtimeConfig.browser.ts +++ b/clients/client-iam/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iam/runtimeConfig.native.ts b/clients/client-iam/runtimeConfig.native.ts index 106f9305b8347..f15d8cf5ef8de 100644 --- a/clients/client-iam/runtimeConfig.native.ts +++ b/clients/client-iam/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IAMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iam/runtimeConfig.ts b/clients/client-iam/runtimeConfig.ts index c89b77e118c7b..33b2f18228a54 100644 --- a/clients/client-iam/runtimeConfig.ts +++ b/clients/client-iam/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-identitystore/IdentitystoreClient.ts b/clients/client-identitystore/IdentitystoreClient.ts index 665627767456b..41dabf4bea43c 100644 --- a/clients/client-identitystore/IdentitystoreClient.ts +++ b/clients/client-identitystore/IdentitystoreClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IdentitystoreClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +166,8 @@ export type IdentitystoreClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IdentitystoreClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +175,8 @@ export type IdentitystoreClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class IdentitystoreClient extends __Client< __HttpHandlerOptions, @@ -193,16 +195,16 @@ export class IdentitystoreClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-identitystore/runtimeConfig.browser.ts b/clients/client-identitystore/runtimeConfig.browser.ts index 5fd83a0895882..64856c4360326 100644 --- a/clients/client-identitystore/runtimeConfig.browser.ts +++ b/clients/client-identitystore/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-identitystore/runtimeConfig.native.ts b/clients/client-identitystore/runtimeConfig.native.ts index b19b8146668ff..614b2deec4960 100644 --- a/clients/client-identitystore/runtimeConfig.native.ts +++ b/clients/client-identitystore/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IdentitystoreClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-identitystore/runtimeConfig.ts b/clients/client-identitystore/runtimeConfig.ts index 17f04bfe149d8..6d954139f38f2 100644 --- a/clients/client-identitystore/runtimeConfig.ts +++ b/clients/client-identitystore/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-imagebuilder/ImagebuilderClient.ts b/clients/client-imagebuilder/ImagebuilderClient.ts index 3c9d326e037f4..1762c93f60129 100644 --- a/clients/client-imagebuilder/ImagebuilderClient.ts +++ b/clients/client-imagebuilder/ImagebuilderClient.ts @@ -140,6 +140,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -150,6 +151,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -287,11 +289,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -333,6 +330,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ImagebuilderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -341,8 +343,8 @@ export type ImagebuilderClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ImagebuilderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -350,8 +352,8 @@ export type ImagebuilderClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

EC2 Image Builder is a fully managed AWS service that makes it easier to automate the creation, management, and deployment of customized, secure, and up-to-date “golden” server images that are pre-installed and pre-configured with software and settings to meet specific IT standards.

@@ -373,16 +375,16 @@ export class ImagebuilderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-imagebuilder/runtimeConfig.browser.ts b/clients/client-imagebuilder/runtimeConfig.browser.ts index ee32dda920d77..23ff63131ec3a 100644 --- a/clients/client-imagebuilder/runtimeConfig.browser.ts +++ b/clients/client-imagebuilder/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-imagebuilder/runtimeConfig.native.ts b/clients/client-imagebuilder/runtimeConfig.native.ts index 6b13e01d7af4c..3f695e2f0715d 100644 --- a/clients/client-imagebuilder/runtimeConfig.native.ts +++ b/clients/client-imagebuilder/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ImagebuilderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-imagebuilder/runtimeConfig.ts b/clients/client-imagebuilder/runtimeConfig.ts index 840a8b42e4d98..6bde8dddb4972 100644 --- a/clients/client-imagebuilder/runtimeConfig.ts +++ b/clients/client-imagebuilder/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-inspector/InspectorClient.ts b/clients/client-inspector/InspectorClient.ts index 49331db397bf3..b480686d1352f 100644 --- a/clients/client-inspector/InspectorClient.ts +++ b/clients/client-inspector/InspectorClient.ts @@ -150,6 +150,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -160,6 +161,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -287,11 +289,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -333,6 +330,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type InspectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -341,8 +343,8 @@ export type InspectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type InspectorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -350,8 +352,8 @@ export type InspectorClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Inspector @@ -376,16 +378,16 @@ export class InspectorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-inspector/runtimeConfig.browser.ts b/clients/client-inspector/runtimeConfig.browser.ts index 5a01db88c24ad..d8a1b8ba29d2b 100644 --- a/clients/client-inspector/runtimeConfig.browser.ts +++ b/clients/client-inspector/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-inspector/runtimeConfig.native.ts b/clients/client-inspector/runtimeConfig.native.ts index d8d382462da9d..925dd30f5e86c 100644 --- a/clients/client-inspector/runtimeConfig.native.ts +++ b/clients/client-inspector/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./InspectorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-inspector/runtimeConfig.ts b/clients/client-inspector/runtimeConfig.ts index 96a508aadadd4..01072db09a48f 100644 --- a/clients/client-inspector/runtimeConfig.ts +++ b/clients/client-inspector/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts b/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts index 2960f82f53864..3e5be3d236c24 100644 --- a/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts +++ b/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts @@ -60,6 +60,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -70,6 +71,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -149,11 +151,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -195,6 +192,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoT1ClickDevicesServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -203,8 +205,8 @@ export type IoT1ClickDevicesServiceClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoT1ClickDevicesServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -212,8 +214,8 @@ export type IoT1ClickDevicesServiceClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Describes all of the AWS IoT 1-Click device-related API operations for the service. @@ -237,16 +239,16 @@ export class IoT1ClickDevicesServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts b/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts index 5657814d55c23..fd00080c50235 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.native.ts b/clients/client-iot-1click-devices-service/runtimeConfig.native.ts index f86e6e9dce990..aa8a1e5bc3774 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.native.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoT1ClickDevicesServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.ts b/clients/client-iot-1click-devices-service/runtimeConfig.ts index 5ee39c34cfd09..d3a90f4979060 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts b/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts index 60cf49887d711..edbe3b895b2df 100644 --- a/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts +++ b/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoT1ClickProjectsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +214,8 @@ export type IoT1ClickProjectsClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoT1ClickProjectsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +223,8 @@ export type IoT1ClickProjectsClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS IoT 1-Click Projects API Reference

@@ -244,16 +246,16 @@ export class IoT1ClickProjectsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-1click-projects/runtimeConfig.browser.ts b/clients/client-iot-1click-projects/runtimeConfig.browser.ts index 74eda9ea83265..850bf5c30b72b 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.browser.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-1click-projects/runtimeConfig.native.ts b/clients/client-iot-1click-projects/runtimeConfig.native.ts index a5bd4ffe1fc08..ed52b2091d019 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.native.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoT1ClickProjectsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-1click-projects/runtimeConfig.ts b/clients/client-iot-1click-projects/runtimeConfig.ts index c336965ae3902..e03c5a65ca4f7 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-data-plane/IoTDataPlaneClient.ts b/clients/client-iot-data-plane/IoTDataPlaneClient.ts index 7c4475f674cae..f85401868e39a 100644 --- a/clients/client-iot-data-plane/IoTDataPlaneClient.ts +++ b/clients/client-iot-data-plane/IoTDataPlaneClient.ts @@ -43,6 +43,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -53,6 +54,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +172,8 @@ export type IoTDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +181,8 @@ export type IoTDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT @@ -212,16 +214,16 @@ export class IoTDataPlaneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-data-plane/runtimeConfig.browser.ts b/clients/client-iot-data-plane/runtimeConfig.browser.ts index a0282f592e89f..4261b339e3ca1 100644 --- a/clients/client-iot-data-plane/runtimeConfig.browser.ts +++ b/clients/client-iot-data-plane/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-data-plane/runtimeConfig.native.ts b/clients/client-iot-data-plane/runtimeConfig.native.ts index f667ec0e62316..4e4ea28faab2c 100644 --- a/clients/client-iot-data-plane/runtimeConfig.native.ts +++ b/clients/client-iot-data-plane/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTDataPlaneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-data-plane/runtimeConfig.ts b/clients/client-iot-data-plane/runtimeConfig.ts index b9d051dce059b..17f1fdbdb00e3 100644 --- a/clients/client-iot-data-plane/runtimeConfig.ts +++ b/clients/client-iot-data-plane/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-events-data/IoTEventsDataClient.ts b/clients/client-iot-events-data/IoTEventsDataClient.ts index 47b1dffda2e85..6e27aa058986d 100644 --- a/clients/client-iot-events-data/IoTEventsDataClient.ts +++ b/clients/client-iot-events-data/IoTEventsDataClient.ts @@ -42,6 +42,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -52,6 +53,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTEventsDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +169,8 @@ export type IoTEventsDataClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTEventsDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +178,8 @@ export type IoTEventsDataClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, @@ -201,16 +203,16 @@ export class IoTEventsDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-events-data/runtimeConfig.browser.ts b/clients/client-iot-events-data/runtimeConfig.browser.ts index 1b65ea8766662..ae01c65aa9b34 100644 --- a/clients/client-iot-events-data/runtimeConfig.browser.ts +++ b/clients/client-iot-events-data/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-events-data/runtimeConfig.native.ts b/clients/client-iot-events-data/runtimeConfig.native.ts index 78149a851e496..0aeb7db1ce3cb 100644 --- a/clients/client-iot-events-data/runtimeConfig.native.ts +++ b/clients/client-iot-events-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTEventsDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-events-data/runtimeConfig.ts b/clients/client-iot-events-data/runtimeConfig.ts index f6b6214026111..cfa6c05b536e8 100644 --- a/clients/client-iot-events-data/runtimeConfig.ts +++ b/clients/client-iot-events-data/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-events/IoTEventsClient.ts b/clients/client-iot-events/IoTEventsClient.ts index eca0d490de8a9..f9b587f1a0c24 100644 --- a/clients/client-iot-events/IoTEventsClient.ts +++ b/clients/client-iot-events/IoTEventsClient.ts @@ -72,6 +72,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -82,6 +83,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +223,8 @@ export type IoTEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +232,8 @@ export type IoTEventsClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and @@ -255,16 +257,16 @@ export class IoTEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-events/runtimeConfig.browser.ts b/clients/client-iot-events/runtimeConfig.browser.ts index c23b7156601c6..20c37c72aae9b 100644 --- a/clients/client-iot-events/runtimeConfig.browser.ts +++ b/clients/client-iot-events/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-events/runtimeConfig.native.ts b/clients/client-iot-events/runtimeConfig.native.ts index 2f1a3ebeef314..eaa85451d4b6f 100644 --- a/clients/client-iot-events/runtimeConfig.native.ts +++ b/clients/client-iot-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-events/runtimeConfig.ts b/clients/client-iot-events/runtimeConfig.ts index 0246c2690c054..7c70fa1b402c1 100644 --- a/clients/client-iot-events/runtimeConfig.ts +++ b/clients/client-iot-events/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts b/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts index b234757cda311..684e76bdee19a 100644 --- a/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts +++ b/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts @@ -48,6 +48,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -58,6 +59,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -119,11 +121,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -165,6 +162,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTJobsDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -173,8 +175,8 @@ export type IoTJobsDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTJobsDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -182,8 +184,8 @@ export type IoTJobsDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to @@ -215,16 +217,16 @@ export class IoTJobsDataPlaneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts index 2fbc727eac35b..56cc14ed075d9 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts index 923cfbf906623..abad19f8dc8da 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTJobsDataPlaneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.ts index a9963712a96f2..ff9903407ef9c 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot/IoTClient.ts b/clients/client-iot/IoTClient.ts index bc693d2c2aaec..9b88a44084c1d 100644 --- a/clients/client-iot/IoTClient.ts +++ b/clients/client-iot/IoTClient.ts @@ -616,6 +616,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -626,6 +627,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -1103,11 +1105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1149,6 +1146,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1157,8 +1159,8 @@ export type IoTClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1166,8 +1168,8 @@ export type IoTClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT @@ -1204,16 +1206,16 @@ export class IoTClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot/runtimeConfig.browser.ts b/clients/client-iot/runtimeConfig.browser.ts index 22885b57e5813..09031ad967416 100644 --- a/clients/client-iot/runtimeConfig.browser.ts +++ b/clients/client-iot/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot/runtimeConfig.native.ts b/clients/client-iot/runtimeConfig.native.ts index 6198932a1074d..defb8198e3d54 100644 --- a/clients/client-iot/runtimeConfig.native.ts +++ b/clients/client-iot/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot/runtimeConfig.ts b/clients/client-iot/runtimeConfig.ts index a4a6bcd600008..4e3aad317aa3d 100644 --- a/clients/client-iot/runtimeConfig.ts +++ b/clients/client-iot/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotanalytics/IoTAnalyticsClient.ts b/clients/client-iotanalytics/IoTAnalyticsClient.ts index 8ae72a8de38f3..7c29611db73c1 100644 --- a/clients/client-iotanalytics/IoTAnalyticsClient.ts +++ b/clients/client-iotanalytics/IoTAnalyticsClient.ts @@ -93,6 +93,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -103,6 +104,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -224,11 +226,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -270,6 +267,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -278,8 +280,8 @@ export type IoTAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -287,8 +289,8 @@ export type IoTAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Analytics allows you to collect large amounts of device data, process messages, and store them. @@ -328,16 +330,16 @@ export class IoTAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotanalytics/runtimeConfig.browser.ts b/clients/client-iotanalytics/runtimeConfig.browser.ts index ebce7964af708..ac3f1712b479f 100644 --- a/clients/client-iotanalytics/runtimeConfig.browser.ts +++ b/clients/client-iotanalytics/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotanalytics/runtimeConfig.native.ts b/clients/client-iotanalytics/runtimeConfig.native.ts index 117a38577fedc..23b40c4c11684 100644 --- a/clients/client-iotanalytics/runtimeConfig.native.ts +++ b/clients/client-iotanalytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotanalytics/runtimeConfig.ts b/clients/client-iotanalytics/runtimeConfig.ts index 737120b902969..00c75bfeb9cbb 100644 --- a/clients/client-iotanalytics/runtimeConfig.ts +++ b/clients/client-iotanalytics/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts b/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts index 598f6a650e4aa..b2c798ed15937 100644 --- a/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts +++ b/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts @@ -45,6 +45,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -55,6 +56,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTSecureTunnelingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +178,8 @@ export type IoTSecureTunnelingClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTSecureTunnelingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +187,8 @@ export type IoTSecureTunnelingClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Secure Tunneling @@ -212,16 +214,16 @@ export class IoTSecureTunnelingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts b/clients/client-iotsecuretunneling/runtimeConfig.browser.ts index e052690091069..68059151babef 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotsecuretunneling/runtimeConfig.native.ts b/clients/client-iotsecuretunneling/runtimeConfig.native.ts index 6ebdb592cf139..775e2c3dfe3f7 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.native.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTSecureTunnelingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotsecuretunneling/runtimeConfig.ts b/clients/client-iotsecuretunneling/runtimeConfig.ts index 5c767909f1e2a..61c5ccadee9a6 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotsitewise/IoTSiteWiseClient.ts b/clients/client-iotsitewise/IoTSiteWiseClient.ts index 16dcf5574d9c6..aa70313363be0 100644 --- a/clients/client-iotsitewise/IoTSiteWiseClient.ts +++ b/clients/client-iotsitewise/IoTSiteWiseClient.ts @@ -143,6 +143,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -153,6 +154,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -320,11 +322,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -366,6 +363,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTSiteWiseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -374,8 +376,8 @@ export type IoTSiteWiseClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTSiteWiseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -383,8 +385,8 @@ export type IoTSiteWiseClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS IoT SiteWise API Reference. AWS IoT SiteWise is an AWS service that connects Industrial Internet of Things (IIoT) devices to the power of the AWS Cloud. For more information, see the @@ -407,16 +409,16 @@ export class IoTSiteWiseClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotsitewise/runtimeConfig.browser.ts b/clients/client-iotsitewise/runtimeConfig.browser.ts index ce1cfd4eb1a70..72234983ccf48 100644 --- a/clients/client-iotsitewise/runtimeConfig.browser.ts +++ b/clients/client-iotsitewise/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotsitewise/runtimeConfig.native.ts b/clients/client-iotsitewise/runtimeConfig.native.ts index 9a54d295a80e6..4be83e5b64411 100644 --- a/clients/client-iotsitewise/runtimeConfig.native.ts +++ b/clients/client-iotsitewise/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTSiteWiseClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotsitewise/runtimeConfig.ts b/clients/client-iotsitewise/runtimeConfig.ts index cfbdefac46253..304e49a3c707c 100644 --- a/clients/client-iotsitewise/runtimeConfig.ts +++ b/clients/client-iotsitewise/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotthingsgraph/IoTThingsGraphClient.ts b/clients/client-iotthingsgraph/IoTThingsGraphClient.ts index 03052b99ca83f..46a96ccbaa957 100644 --- a/clients/client-iotthingsgraph/IoTThingsGraphClient.ts +++ b/clients/client-iotthingsgraph/IoTThingsGraphClient.ts @@ -133,6 +133,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -143,6 +144,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -266,11 +268,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -312,6 +309,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IoTThingsGraphClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -320,8 +322,8 @@ export type IoTThingsGraphClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTThingsGraphClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -329,8 +331,8 @@ export type IoTThingsGraphClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Things Graph @@ -356,16 +358,16 @@ export class IoTThingsGraphClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotthingsgraph/runtimeConfig.browser.ts b/clients/client-iotthingsgraph/runtimeConfig.browser.ts index ab12a90c403d2..977d91e78e35a 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.browser.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotthingsgraph/runtimeConfig.native.ts b/clients/client-iotthingsgraph/runtimeConfig.native.ts index 07fb9211275fd..245cc397926d1 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.native.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTThingsGraphClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotthingsgraph/runtimeConfig.ts b/clients/client-iotthingsgraph/runtimeConfig.ts index 228ed6e4fd4b5..d4966aeeb975a 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ivs/IvsClient.ts b/clients/client-ivs/IvsClient.ts index 7e598fe25cb52..3dbffd708f134 100644 --- a/clients/client-ivs/IvsClient.ts +++ b/clients/client-ivs/IvsClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type IvsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +232,8 @@ export type IvsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IvsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +241,8 @@ export type IvsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -537,16 +539,16 @@ export class IvsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ivs/runtimeConfig.browser.ts b/clients/client-ivs/runtimeConfig.browser.ts index 7ab32ca29a68b..38eeb54b34251 100644 --- a/clients/client-ivs/runtimeConfig.browser.ts +++ b/clients/client-ivs/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ivs/runtimeConfig.native.ts b/clients/client-ivs/runtimeConfig.native.ts index a3ae4490de2d2..4b1a6f4af45ec 100644 --- a/clients/client-ivs/runtimeConfig.native.ts +++ b/clients/client-ivs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IvsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ivs/runtimeConfig.ts b/clients/client-ivs/runtimeConfig.ts index 64682c169a78d..7d64ea62ede13 100644 --- a/clients/client-ivs/runtimeConfig.ts +++ b/clients/client-ivs/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kafka/KafkaClient.ts b/clients/client-kafka/KafkaClient.ts index 29b639e20a70d..69a324dbc54c3 100644 --- a/clients/client-kafka/KafkaClient.ts +++ b/clients/client-kafka/KafkaClient.ts @@ -112,6 +112,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -122,6 +123,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -233,11 +235,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -279,6 +276,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KafkaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -287,8 +289,8 @@ export type KafkaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KafkaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -296,8 +298,8 @@ export type KafkaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The operations for managing an Amazon MSK cluster.

@@ -319,16 +321,16 @@ export class KafkaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kafka/runtimeConfig.browser.ts b/clients/client-kafka/runtimeConfig.browser.ts index 1cbf191089832..4a21307020d53 100644 --- a/clients/client-kafka/runtimeConfig.browser.ts +++ b/clients/client-kafka/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kafka/runtimeConfig.native.ts b/clients/client-kafka/runtimeConfig.native.ts index 68f1b5b25b893..d07a4bd8f6555 100644 --- a/clients/client-kafka/runtimeConfig.native.ts +++ b/clients/client-kafka/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KafkaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kafka/runtimeConfig.ts b/clients/client-kafka/runtimeConfig.ts index 98d4c018d4a49..b1d690292e17a 100644 --- a/clients/client-kafka/runtimeConfig.ts +++ b/clients/client-kafka/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kendra/KendraClient.ts b/clients/client-kendra/KendraClient.ts index 09128593a4c96..4fa82863d4165 100644 --- a/clients/client-kendra/KendraClient.ts +++ b/clients/client-kendra/KendraClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KendraClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +256,8 @@ export type KendraClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KendraClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +265,8 @@ export type KendraClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Kendra is a service for indexing large document sets.

@@ -286,16 +288,16 @@ export class KendraClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kendra/runtimeConfig.browser.ts b/clients/client-kendra/runtimeConfig.browser.ts index 214af8a7d83e7..ec9f822dcba52 100644 --- a/clients/client-kendra/runtimeConfig.browser.ts +++ b/clients/client-kendra/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kendra/runtimeConfig.native.ts b/clients/client-kendra/runtimeConfig.native.ts index ac61356eb12eb..755249dcd2339 100644 --- a/clients/client-kendra/runtimeConfig.native.ts +++ b/clients/client-kendra/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KendraClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kendra/runtimeConfig.ts b/clients/client-kendra/runtimeConfig.ts index 599c639044b69..63efd33361b80 100644 --- a/clients/client-kendra/runtimeConfig.ts +++ b/clients/client-kendra/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts b/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts index 0d02be0f19fce..d96e610df6b2a 100644 --- a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts +++ b/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts @@ -119,6 +119,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -129,6 +130,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KinesisAnalyticsV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +292,8 @@ export type KinesisAnalyticsV2ClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisAnalyticsV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +301,8 @@ export type KinesisAnalyticsV2ClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Kinesis Data Analytics is a fully managed service that you can use to process and analyze streaming data using Java, SQL, or Scala. The service @@ -324,16 +326,16 @@ export class KinesisAnalyticsV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts index 937d32a94b372..48e110251efdf 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts index 606d5e3900cf1..99b3f7a09ee3d 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisAnalyticsV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.ts index 17a51ee82a490..d46aac40d00fc 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts b/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts index b111f393f2dc5..c0d6621196ef8 100644 --- a/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts +++ b/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KinesisAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +250,8 @@ export type KinesisAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +259,8 @@ export type KinesisAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Kinesis Analytics @@ -289,16 +291,16 @@ export class KinesisAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-analytics/runtimeConfig.browser.ts b/clients/client-kinesis-analytics/runtimeConfig.browser.ts index 659d88daaccf8..019846a560303 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.browser.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-analytics/runtimeConfig.native.ts b/clients/client-kinesis-analytics/runtimeConfig.native.ts index 0b4967f929ec0..8e2002dedfb3e 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.native.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-analytics/runtimeConfig.ts b/clients/client-kinesis-analytics/runtimeConfig.ts index f851dc8599a50..4e00b048937e1 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts b/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts index c07c02ff7fef0..bc756a31336c0 100644 --- a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts +++ b/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts @@ -49,6 +49,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -59,6 +60,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KinesisVideoArchivedMediaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +178,8 @@ export type KinesisVideoArchivedMediaClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoArchivedMediaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +187,8 @@ export type KinesisVideoArchivedMediaClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -208,16 +210,16 @@ export class KinesisVideoArchivedMediaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts index 03046c3eafa2d..1cb755c16ecb0 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts index 35aab72b2651e..a989d29c4357b 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoArchivedMediaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.ts index e04c61531cd7c..30fac4f4ca9b1 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts b/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts index 5e37683b26082..94aecaf2b0194 100644 --- a/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts +++ b/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetMediaCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KinesisVideoMediaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +155,8 @@ export type KinesisVideoMediaClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoMediaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +164,8 @@ export type KinesisVideoMediaClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -185,16 +187,16 @@ export class KinesisVideoMediaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-media/runtimeConfig.browser.ts index c3f79ca4d69bf..87dfa8ca23911 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-media/runtimeConfig.native.ts b/clients/client-kinesis-video-media/runtimeConfig.native.ts index 6d03ff5513a6d..d96c0cda321b2 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoMediaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-media/runtimeConfig.ts b/clients/client-kinesis-video-media/runtimeConfig.ts index 7c6e92295fae1..3ef4b7cdea205 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts b/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts index 4c73a9b7a3f78..7cbac4580a811 100644 --- a/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts +++ b/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetIceServerConfigCommandInput | SendAlexaOfferToMasterCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KinesisVideoSignalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +159,8 @@ export type KinesisVideoSignalingClientConfig = Partial<__SmithyConfiguration<__ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoSignalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +168,8 @@ export type KinesisVideoSignalingClientResolvedConfig = __SmithyResolvedConfigur EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Kinesis Video Streams Signaling Service is a intermediate service that establishes a @@ -191,16 +193,16 @@ export class KinesisVideoSignalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts b/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts index cc758db8a392a..106830e167cf8 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.native.ts b/clients/client-kinesis-video-signaling/runtimeConfig.native.ts index 937f52f01ab19..cad8c52fe0a27 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoSignalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.ts b/clients/client-kinesis-video-signaling/runtimeConfig.ts index 1e2930df1e8cb..8184b9ebeebac 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video/KinesisVideoClient.ts b/clients/client-kinesis-video/KinesisVideoClient.ts index 95abff7b57743..25b6171273ea6 100644 --- a/clients/client-kinesis-video/KinesisVideoClient.ts +++ b/clients/client-kinesis-video/KinesisVideoClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KinesisVideoClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +235,8 @@ export type KinesisVideoClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +244,8 @@ export type KinesisVideoClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -265,16 +267,16 @@ export class KinesisVideoClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video/runtimeConfig.browser.ts b/clients/client-kinesis-video/runtimeConfig.browser.ts index a0515622f4c1d..686a690656d22 100644 --- a/clients/client-kinesis-video/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video/runtimeConfig.native.ts b/clients/client-kinesis-video/runtimeConfig.native.ts index fe63b5e9b2343..111673a8627f5 100644 --- a/clients/client-kinesis-video/runtimeConfig.native.ts +++ b/clients/client-kinesis-video/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video/runtimeConfig.ts b/clients/client-kinesis-video/runtimeConfig.ts index 21787e7efa9eb..018252e0e2df1 100644 --- a/clients/client-kinesis-video/runtimeConfig.ts +++ b/clients/client-kinesis-video/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis/KinesisClient.ts b/clients/client-kinesis/KinesisClient.ts index 29fc04810df9b..e9c4986a38867 100644 --- a/clients/client-kinesis/KinesisClient.ts +++ b/clients/client-kinesis/KinesisClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -224,11 +226,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -271,6 +268,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ regionInfoProvider?: RegionInfoProvider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -283,8 +285,8 @@ export type KinesisClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type KinesisClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -293,8 +295,8 @@ export type KinesisClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -319,17 +321,17 @@ export class KinesisClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); let _config_7 = resolveEventStreamSerdeConfig(_config_6); super(_config_7); this.config = _config_7; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis/runtimeConfig.browser.ts b/clients/client-kinesis/runtimeConfig.browser.ts index 1eaaa5072663d..6b6c493667046 100644 --- a/clients/client-kinesis/runtimeConfig.browser.ts +++ b/clients/client-kinesis/runtimeConfig.browser.ts @@ -23,7 +23,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, diff --git a/clients/client-kinesis/runtimeConfig.native.ts b/clients/client-kinesis/runtimeConfig.native.ts index 2680f5dc28e39..6db24364702cb 100644 --- a/clients/client-kinesis/runtimeConfig.native.ts +++ b/clients/client-kinesis/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis/runtimeConfig.ts b/clients/client-kinesis/runtimeConfig.ts index f08804e57ff80..6f9d6a695fe4d 100644 --- a/clients/client-kinesis/runtimeConfig.ts +++ b/clients/client-kinesis/runtimeConfig.ts @@ -25,7 +25,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), diff --git a/clients/client-kms/KMSClient.ts b/clients/client-kms/KMSClient.ts index 4b60eeb367381..3b30bcac78737 100644 --- a/clients/client-kms/KMSClient.ts +++ b/clients/client-kms/KMSClient.ts @@ -126,6 +126,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -136,6 +137,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -281,11 +283,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -327,6 +324,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type KMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -335,8 +337,8 @@ export type KMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -344,8 +346,8 @@ export type KMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Key Management Service @@ -455,16 +457,16 @@ export class KMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kms/runtimeConfig.browser.ts b/clients/client-kms/runtimeConfig.browser.ts index 6a2f63e13ccdf..1cd66cbfd4fbd 100644 --- a/clients/client-kms/runtimeConfig.browser.ts +++ b/clients/client-kms/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kms/runtimeConfig.native.ts b/clients/client-kms/runtimeConfig.native.ts index f589702c79b6b..9f37a196e9a65 100644 --- a/clients/client-kms/runtimeConfig.native.ts +++ b/clients/client-kms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kms/runtimeConfig.ts b/clients/client-kms/runtimeConfig.ts index fa965e1a8bd2d..4780f809677a5 100644 --- a/clients/client-kms/runtimeConfig.ts +++ b/clients/client-kms/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lakeformation/LakeFormationClient.ts b/clients/client-lakeformation/LakeFormationClient.ts index bbfb99b62bda2..9d15a96eca7fa 100644 --- a/clients/client-lakeformation/LakeFormationClient.ts +++ b/clients/client-lakeformation/LakeFormationClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type LakeFormationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +208,8 @@ export type LakeFormationClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LakeFormationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +217,8 @@ export type LakeFormationClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Lake Formation @@ -239,16 +241,16 @@ export class LakeFormationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lakeformation/runtimeConfig.browser.ts b/clients/client-lakeformation/runtimeConfig.browser.ts index c3f4c7865c5e8..4442b0bd1a28e 100644 --- a/clients/client-lakeformation/runtimeConfig.browser.ts +++ b/clients/client-lakeformation/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lakeformation/runtimeConfig.native.ts b/clients/client-lakeformation/runtimeConfig.native.ts index 0dbe680ce5b43..cc112c3661964 100644 --- a/clients/client-lakeformation/runtimeConfig.native.ts +++ b/clients/client-lakeformation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LakeFormationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lakeformation/runtimeConfig.ts b/clients/client-lakeformation/runtimeConfig.ts index dc67071f583df..62f770503b0bd 100644 --- a/clients/client-lakeformation/runtimeConfig.ts +++ b/clients/client-lakeformation/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lambda/LambdaClient.ts b/clients/client-lambda/LambdaClient.ts index fc4be790bc28a..5bd6b29b37450 100644 --- a/clients/client-lambda/LambdaClient.ts +++ b/clients/client-lambda/LambdaClient.ts @@ -195,6 +195,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -205,6 +206,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -374,11 +376,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -420,6 +417,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type LambdaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -428,8 +430,8 @@ export type LambdaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LambdaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -437,8 +439,8 @@ export type LambdaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Lambda @@ -466,16 +468,16 @@ export class LambdaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lambda/runtimeConfig.browser.ts b/clients/client-lambda/runtimeConfig.browser.ts index bc489aa675a89..ce758d9aaf796 100644 --- a/clients/client-lambda/runtimeConfig.browser.ts +++ b/clients/client-lambda/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lambda/runtimeConfig.native.ts b/clients/client-lambda/runtimeConfig.native.ts index 95427ba54a600..294305bfb6ebc 100644 --- a/clients/client-lambda/runtimeConfig.native.ts +++ b/clients/client-lambda/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LambdaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lambda/runtimeConfig.ts b/clients/client-lambda/runtimeConfig.ts index 57812c2d25f81..e42e3b7bd8781 100644 --- a/clients/client-lambda/runtimeConfig.ts +++ b/clients/client-lambda/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts b/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts index c9a278b45a5fa..a817f8fa0ec04 100644 --- a/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts +++ b/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -114,6 +115,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type LexModelBuildingServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +301,8 @@ export type LexModelBuildingServiceClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LexModelBuildingServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +310,8 @@ export type LexModelBuildingServiceClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Lex Build-Time Actions @@ -334,16 +336,16 @@ export class LexModelBuildingServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lex-model-building-service/runtimeConfig.browser.ts b/clients/client-lex-model-building-service/runtimeConfig.browser.ts index 7bff2a013b34f..9f437b16633eb 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.browser.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lex-model-building-service/runtimeConfig.native.ts b/clients/client-lex-model-building-service/runtimeConfig.native.ts index efae1a69a053f..f972a1b1781e2 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.native.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LexModelBuildingServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lex-model-building-service/runtimeConfig.ts b/clients/client-lex-model-building-service/runtimeConfig.ts index c06f2589364ad..2a77e7b207758 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts b/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts index 30c574f902e88..4845f8d35be40 100644 --- a/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts +++ b/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type LexRuntimeServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +169,8 @@ export type LexRuntimeServiceClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LexRuntimeServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +178,8 @@ export type LexRuntimeServiceClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of @@ -207,16 +209,16 @@ export class LexRuntimeServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lex-runtime-service/runtimeConfig.browser.ts b/clients/client-lex-runtime-service/runtimeConfig.browser.ts index 3fee6e138d0f8..3d0a43b3939d3 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.browser.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lex-runtime-service/runtimeConfig.native.ts b/clients/client-lex-runtime-service/runtimeConfig.native.ts index 3d97604d2104d..2dafe4e39ae01 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.native.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LexRuntimeServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lex-runtime-service/runtimeConfig.ts b/clients/client-lex-runtime-service/runtimeConfig.ts index 0a67dee71d61e..897196fb41736 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-license-manager/LicenseManagerClient.ts b/clients/client-license-manager/LicenseManagerClient.ts index c189a024dcf17..95228f73940ac 100644 --- a/clients/client-license-manager/LicenseManagerClient.ts +++ b/clients/client-license-manager/LicenseManagerClient.ts @@ -132,6 +132,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -142,6 +143,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -275,11 +277,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -321,6 +318,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type LicenseManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -329,8 +331,8 @@ export type LicenseManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LicenseManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -338,8 +340,8 @@ export type LicenseManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS License Manager @@ -363,16 +365,16 @@ export class LicenseManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-license-manager/runtimeConfig.browser.ts b/clients/client-license-manager/runtimeConfig.browser.ts index a84c699effda7..ecc8de1739136 100644 --- a/clients/client-license-manager/runtimeConfig.browser.ts +++ b/clients/client-license-manager/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-license-manager/runtimeConfig.native.ts b/clients/client-license-manager/runtimeConfig.native.ts index f2d40a1463190..40aba5fecaee0 100644 --- a/clients/client-license-manager/runtimeConfig.native.ts +++ b/clients/client-license-manager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LicenseManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-license-manager/runtimeConfig.ts b/clients/client-license-manager/runtimeConfig.ts index e0698a2e9427b..1ccc3c3ea9761 100644 --- a/clients/client-license-manager/runtimeConfig.ts +++ b/clients/client-license-manager/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lightsail/LightsailClient.ts b/clients/client-lightsail/LightsailClient.ts index 69549b4294e09..d9abfc47d1099 100644 --- a/clients/client-lightsail/LightsailClient.ts +++ b/clients/client-lightsail/LightsailClient.ts @@ -386,6 +386,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -396,6 +397,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -731,11 +733,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -777,6 +774,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type LightsailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -785,8 +787,8 @@ export type LightsailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LightsailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -794,8 +796,8 @@ export type LightsailClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Lightsail is the easiest way to get started with Amazon Web Services (AWS) for developers @@ -831,16 +833,16 @@ export class LightsailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lightsail/runtimeConfig.browser.ts b/clients/client-lightsail/runtimeConfig.browser.ts index 0ac4cd8d625d9..64b71d0005cd6 100644 --- a/clients/client-lightsail/runtimeConfig.browser.ts +++ b/clients/client-lightsail/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lightsail/runtimeConfig.native.ts b/clients/client-lightsail/runtimeConfig.native.ts index 5868249ab557f..591ab77bd51d9 100644 --- a/clients/client-lightsail/runtimeConfig.native.ts +++ b/clients/client-lightsail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LightsailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lightsail/runtimeConfig.ts b/clients/client-lightsail/runtimeConfig.ts index fec6ffebc3c9c..66cad149b02c0 100644 --- a/clients/client-lightsail/runtimeConfig.ts +++ b/clients/client-lightsail/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lookoutvision/LookoutVisionClient.ts b/clients/client-lookoutvision/LookoutVisionClient.ts index f26001f1d0482..c6efc67225530 100644 --- a/clients/client-lookoutvision/LookoutVisionClient.ts +++ b/clients/client-lookoutvision/LookoutVisionClient.ts @@ -54,6 +54,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -64,6 +65,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -149,11 +151,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -195,6 +192,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type LookoutVisionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -203,8 +205,8 @@ export type LookoutVisionClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LookoutVisionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -212,8 +214,8 @@ export type LookoutVisionClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Lookout for Vision API Reference. It provides descriptions of actions, @@ -241,16 +243,16 @@ export class LookoutVisionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lookoutvision/runtimeConfig.browser.ts b/clients/client-lookoutvision/runtimeConfig.browser.ts index 174f22a943bb1..04eaa8e412cda 100644 --- a/clients/client-lookoutvision/runtimeConfig.browser.ts +++ b/clients/client-lookoutvision/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lookoutvision/runtimeConfig.native.ts b/clients/client-lookoutvision/runtimeConfig.native.ts index 9c425471e0547..dbd3e5d33f277 100644 --- a/clients/client-lookoutvision/runtimeConfig.native.ts +++ b/clients/client-lookoutvision/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LookoutVisionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lookoutvision/runtimeConfig.ts b/clients/client-lookoutvision/runtimeConfig.ts index 9ebb374218c66..5ed7e04fb35b8 100644 --- a/clients/client-lookoutvision/runtimeConfig.ts +++ b/clients/client-lookoutvision/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-machine-learning/MachineLearningClient.ts b/clients/client-machine-learning/MachineLearningClient.ts index 27d5872e39fd4..4b35e215ad54e 100644 --- a/clients/client-machine-learning/MachineLearningClient.ts +++ b/clients/client-machine-learning/MachineLearningClient.ts @@ -96,6 +96,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -106,6 +107,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -215,11 +217,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -261,6 +258,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MachineLearningClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -269,8 +271,8 @@ export type MachineLearningClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MachineLearningClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -278,8 +280,8 @@ export type MachineLearningClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Definition of the public APIs @@ -302,16 +304,16 @@ export class MachineLearningClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-machine-learning/runtimeConfig.browser.ts b/clients/client-machine-learning/runtimeConfig.browser.ts index 1658535d8132b..e89e458ff92ca 100644 --- a/clients/client-machine-learning/runtimeConfig.browser.ts +++ b/clients/client-machine-learning/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-machine-learning/runtimeConfig.native.ts b/clients/client-machine-learning/runtimeConfig.native.ts index 6f46fd040c75f..b84819bb12804 100644 --- a/clients/client-machine-learning/runtimeConfig.native.ts +++ b/clients/client-machine-learning/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MachineLearningClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-machine-learning/runtimeConfig.ts b/clients/client-machine-learning/runtimeConfig.ts index 04050d943d6c2..16593e5b39646 100644 --- a/clients/client-machine-learning/runtimeConfig.ts +++ b/clients/client-machine-learning/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-macie/MacieClient.ts b/clients/client-macie/MacieClient.ts index e4f88b336e2f2..d9495d1b354bd 100644 --- a/clients/client-macie/MacieClient.ts +++ b/clients/client-macie/MacieClient.ts @@ -54,6 +54,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -64,6 +65,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MacieClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +187,8 @@ export type MacieClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MacieClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +196,8 @@ export type MacieClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Macie Classic @@ -227,16 +229,16 @@ export class MacieClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-macie/runtimeConfig.browser.ts b/clients/client-macie/runtimeConfig.browser.ts index a6a89f18a7bdf..43c889d21cb39 100644 --- a/clients/client-macie/runtimeConfig.browser.ts +++ b/clients/client-macie/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-macie/runtimeConfig.native.ts b/clients/client-macie/runtimeConfig.native.ts index 7177195219a5e..8af081227fcbc 100644 --- a/clients/client-macie/runtimeConfig.native.ts +++ b/clients/client-macie/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MacieClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-macie/runtimeConfig.ts b/clients/client-macie/runtimeConfig.ts index 54ae38186ed7b..60bde439c1dab 100644 --- a/clients/client-macie/runtimeConfig.ts +++ b/clients/client-macie/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-macie2/Macie2Client.ts b/clients/client-macie2/Macie2Client.ts index 819416067d5a9..d18ce9be61b17 100644 --- a/clients/client-macie2/Macie2Client.ts +++ b/clients/client-macie2/Macie2Client.ts @@ -170,6 +170,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -180,6 +181,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -335,11 +337,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -381,6 +378,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type Macie2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -389,8 +391,8 @@ export type Macie2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Macie2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -398,8 +400,8 @@ export type Macie2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Macie is a fully managed data security and data privacy service that uses machine learning and pattern matching to discover and protect your sensitive data in AWS. Macie automates the discovery of sensitive data, such as PII and intellectual property, to provide you with insight into the data that your organization stores in AWS. Macie also provides an inventory of your Amazon S3 buckets, which it continually monitors for you. If Macie detects sensitive data or potential data access issues, it generates detailed findings for you to review and act upon as necessary.

@@ -421,16 +423,16 @@ export class Macie2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-macie2/runtimeConfig.browser.ts b/clients/client-macie2/runtimeConfig.browser.ts index a445915561154..3c01dfd39fc26 100644 --- a/clients/client-macie2/runtimeConfig.browser.ts +++ b/clients/client-macie2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-macie2/runtimeConfig.native.ts b/clients/client-macie2/runtimeConfig.native.ts index c947e3b96a933..56aa2e97b888e 100644 --- a/clients/client-macie2/runtimeConfig.native.ts +++ b/clients/client-macie2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Macie2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-macie2/runtimeConfig.ts b/clients/client-macie2/runtimeConfig.ts index 372f10f8bbf18..d7c597b13a5ff 100644 --- a/clients/client-macie2/runtimeConfig.ts +++ b/clients/client-macie2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-managedblockchain/ManagedBlockchainClient.ts b/clients/client-managedblockchain/ManagedBlockchainClient.ts index 29c08b1a2a6b5..af8bebb9573cd 100644 --- a/clients/client-managedblockchain/ManagedBlockchainClient.ts +++ b/clients/client-managedblockchain/ManagedBlockchainClient.ts @@ -55,6 +55,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -65,6 +66,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ManagedBlockchainClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +214,8 @@ export type ManagedBlockchainClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ManagedBlockchainClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +223,8 @@ export type ManagedBlockchainClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -245,16 +247,16 @@ export class ManagedBlockchainClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-managedblockchain/runtimeConfig.browser.ts b/clients/client-managedblockchain/runtimeConfig.browser.ts index 0abd1eda07877..fa8e76daad74a 100644 --- a/clients/client-managedblockchain/runtimeConfig.browser.ts +++ b/clients/client-managedblockchain/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-managedblockchain/runtimeConfig.native.ts b/clients/client-managedblockchain/runtimeConfig.native.ts index 958e3de5d4848..faeead11e077d 100644 --- a/clients/client-managedblockchain/runtimeConfig.native.ts +++ b/clients/client-managedblockchain/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ManagedBlockchainClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-managedblockchain/runtimeConfig.ts b/clients/client-managedblockchain/runtimeConfig.ts index 6be200e1d018f..bd7e12617ec7d 100644 --- a/clients/client-managedblockchain/runtimeConfig.ts +++ b/clients/client-managedblockchain/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts b/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts index da3780b62caeb..1b88307e91adb 100644 --- a/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts +++ b/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MarketplaceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +172,8 @@ export type MarketplaceCatalogClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +181,8 @@ export type MarketplaceCatalogClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Catalog API actions allow you to manage your entities through list, describe, and update @@ -208,16 +210,16 @@ export class MarketplaceCatalogClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-catalog/runtimeConfig.browser.ts b/clients/client-marketplace-catalog/runtimeConfig.browser.ts index 24faccf6ed40d..dbd46a900d11d 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.browser.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-catalog/runtimeConfig.native.ts b/clients/client-marketplace-catalog/runtimeConfig.native.ts index db977ea40f232..e2dfdfb7bd7cd 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.native.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceCatalogClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-catalog/runtimeConfig.ts b/clients/client-marketplace-catalog/runtimeConfig.ts index b04154ca820e8..2928f9d91bb2b 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts b/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts index d51affc184459..3c86125546773 100644 --- a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts +++ b/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GenerateDataSetCommandInput | StartSupportDataExportCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MarketplaceCommerceAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +159,8 @@ export type MarketplaceCommerceAnalyticsClientConfig = Partial<__SmithyConfigura EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceCommerceAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +168,8 @@ export type MarketplaceCommerceAnalyticsClientResolvedConfig = __SmithyResolvedC EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Provides AWS Marketplace business intelligence data on-demand. @@ -189,16 +191,16 @@ export class MarketplaceCommerceAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts index 38c169205c460..dc152f37f70ee 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts index 5521199facf30..1ff4198d6d666 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceCommerceAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.ts index b53b4bb6ccd71..b9586421fe642 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts b/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts index a6bc0c100f774..5c3b5733d6456 100644 --- a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts +++ b/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetEntitlementsCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MarketplaceEntitlementServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +155,8 @@ export type MarketplaceEntitlementServiceClientConfig = Partial<__SmithyConfigur EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceEntitlementServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +164,8 @@ export type MarketplaceEntitlementServiceClientResolvedConfig = __SmithyResolved EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Marketplace Entitlement Service @@ -201,16 +203,16 @@ export class MarketplaceEntitlementServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts index 78333b72fbff0..a6d75dbd253cd 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts index cf94a1d6e5a46..9a05824b6595e 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceEntitlementServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.ts index 9cea2f8517bec..6e6dce7979333 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-metering/MarketplaceMeteringClient.ts b/clients/client-marketplace-metering/MarketplaceMeteringClient.ts index 86597ebe23e72..36b986a2b4119 100644 --- a/clients/client-marketplace-metering/MarketplaceMeteringClient.ts +++ b/clients/client-marketplace-metering/MarketplaceMeteringClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MarketplaceMeteringClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +166,8 @@ export type MarketplaceMeteringClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceMeteringClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +175,8 @@ export type MarketplaceMeteringClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Marketplace Metering Service @@ -252,16 +254,16 @@ export class MarketplaceMeteringClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-metering/runtimeConfig.browser.ts b/clients/client-marketplace-metering/runtimeConfig.browser.ts index c41c5e38106a8..07fd8af6e8c6e 100644 --- a/clients/client-marketplace-metering/runtimeConfig.browser.ts +++ b/clients/client-marketplace-metering/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-metering/runtimeConfig.native.ts b/clients/client-marketplace-metering/runtimeConfig.native.ts index e42dc36ff62f0..822a898b4f809 100644 --- a/clients/client-marketplace-metering/runtimeConfig.native.ts +++ b/clients/client-marketplace-metering/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceMeteringClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-metering/runtimeConfig.ts b/clients/client-marketplace-metering/runtimeConfig.ts index 88c43d3d14a2f..c3dd7b36781a9 100644 --- a/clients/client-marketplace-metering/runtimeConfig.ts +++ b/clients/client-marketplace-metering/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediaconnect/MediaConnectClient.ts b/clients/client-mediaconnect/MediaConnectClient.ts index 557df93d6ae9e..ede7ac50045df 100644 --- a/clients/client-mediaconnect/MediaConnectClient.ts +++ b/clients/client-mediaconnect/MediaConnectClient.ts @@ -83,6 +83,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -93,6 +94,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +256,8 @@ export type MediaConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +265,8 @@ export type MediaConnectClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * API for AWS Elemental MediaConnect @@ -286,16 +288,16 @@ export class MediaConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediaconnect/runtimeConfig.browser.ts b/clients/client-mediaconnect/runtimeConfig.browser.ts index a7f8aa623d14a..ce7e960fd79ef 100644 --- a/clients/client-mediaconnect/runtimeConfig.browser.ts +++ b/clients/client-mediaconnect/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediaconnect/runtimeConfig.native.ts b/clients/client-mediaconnect/runtimeConfig.native.ts index 5d0e362bb3e9b..65480d3e28657 100644 --- a/clients/client-mediaconnect/runtimeConfig.native.ts +++ b/clients/client-mediaconnect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediaconnect/runtimeConfig.ts b/clients/client-mediaconnect/runtimeConfig.ts index 50ee9f024cd24..68935f8749adc 100644 --- a/clients/client-mediaconnect/runtimeConfig.ts +++ b/clients/client-mediaconnect/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediaconvert/MediaConvertClient.ts b/clients/client-mediaconvert/MediaConvertClient.ts index 65e408b3b5fe1..e541fb2e4cb38 100644 --- a/clients/client-mediaconvert/MediaConvertClient.ts +++ b/clients/client-mediaconvert/MediaConvertClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -182,11 +184,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -228,6 +225,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaConvertClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -236,8 +238,8 @@ export type MediaConvertClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaConvertClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -245,8 +247,8 @@ export type MediaConvertClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaConvert @@ -268,16 +270,16 @@ export class MediaConvertClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediaconvert/runtimeConfig.browser.ts b/clients/client-mediaconvert/runtimeConfig.browser.ts index b431a5e74268d..c11e1eb7989f5 100644 --- a/clients/client-mediaconvert/runtimeConfig.browser.ts +++ b/clients/client-mediaconvert/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediaconvert/runtimeConfig.native.ts b/clients/client-mediaconvert/runtimeConfig.native.ts index 9f886f7722f6c..384cb42f0b1d7 100644 --- a/clients/client-mediaconvert/runtimeConfig.native.ts +++ b/clients/client-mediaconvert/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaConvertClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediaconvert/runtimeConfig.ts b/clients/client-mediaconvert/runtimeConfig.ts index c51e53d7ae3f2..37818527c32d0 100644 --- a/clients/client-mediaconvert/runtimeConfig.ts +++ b/clients/client-mediaconvert/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-medialive/MediaLiveClient.ts b/clients/client-medialive/MediaLiveClient.ts index 3017f0f00fc82..7e48e7acc70e9 100644 --- a/clients/client-medialive/MediaLiveClient.ts +++ b/clients/client-medialive/MediaLiveClient.ts @@ -150,6 +150,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -160,6 +161,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -323,11 +325,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -369,6 +366,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaLiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -377,8 +379,8 @@ export type MediaLiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaLiveClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -386,8 +388,8 @@ export type MediaLiveClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * API for AWS Elemental MediaLive @@ -409,16 +411,16 @@ export class MediaLiveClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-medialive/runtimeConfig.browser.ts b/clients/client-medialive/runtimeConfig.browser.ts index c806ed837fdae..6be70a8223127 100644 --- a/clients/client-medialive/runtimeConfig.browser.ts +++ b/clients/client-medialive/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-medialive/runtimeConfig.native.ts b/clients/client-medialive/runtimeConfig.native.ts index 978431e867c87..1c811ff93104b 100644 --- a/clients/client-medialive/runtimeConfig.native.ts +++ b/clients/client-medialive/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaLiveClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-medialive/runtimeConfig.ts b/clients/client-medialive/runtimeConfig.ts index b395e847f6568..1b10d2f7a81b6 100644 --- a/clients/client-medialive/runtimeConfig.ts +++ b/clients/client-medialive/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediapackage-vod/MediaPackageVodClient.ts b/clients/client-mediapackage-vod/MediaPackageVodClient.ts index 24a4c9f5084cc..0b8bf5fbbd15d 100644 --- a/clients/client-mediapackage-vod/MediaPackageVodClient.ts +++ b/clients/client-mediapackage-vod/MediaPackageVodClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaPackageVodClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +232,8 @@ export type MediaPackageVodClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaPackageVodClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +241,8 @@ export type MediaPackageVodClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaPackage VOD @@ -262,16 +264,16 @@ export class MediaPackageVodClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediapackage-vod/runtimeConfig.browser.ts b/clients/client-mediapackage-vod/runtimeConfig.browser.ts index c21fda55558e1..f3b569cf7e1f3 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.browser.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediapackage-vod/runtimeConfig.native.ts b/clients/client-mediapackage-vod/runtimeConfig.native.ts index 2fb54a3a1bfa0..ebf00bea258ac 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.native.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaPackageVodClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediapackage-vod/runtimeConfig.ts b/clients/client-mediapackage-vod/runtimeConfig.ts index 7dfcfc1ccc970..1fd37fa759385 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediapackage/MediaPackageClient.ts b/clients/client-mediapackage/MediaPackageClient.ts index 7334d9c98da04..209b136f8a839 100644 --- a/clients/client-mediapackage/MediaPackageClient.ts +++ b/clients/client-mediapackage/MediaPackageClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaPackageClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +235,8 @@ export type MediaPackageClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaPackageClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +244,8 @@ export type MediaPackageClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaPackage @@ -265,16 +267,16 @@ export class MediaPackageClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediapackage/runtimeConfig.browser.ts b/clients/client-mediapackage/runtimeConfig.browser.ts index eb1e8310a0f4a..7c6babd6055f6 100644 --- a/clients/client-mediapackage/runtimeConfig.browser.ts +++ b/clients/client-mediapackage/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediapackage/runtimeConfig.native.ts b/clients/client-mediapackage/runtimeConfig.native.ts index a554726da5a5f..54d8667e228c1 100644 --- a/clients/client-mediapackage/runtimeConfig.native.ts +++ b/clients/client-mediapackage/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaPackageClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediapackage/runtimeConfig.ts b/clients/client-mediapackage/runtimeConfig.ts index faed062b5b34e..5d6f03a3d2dac 100644 --- a/clients/client-mediapackage/runtimeConfig.ts +++ b/clients/client-mediapackage/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediastore-data/MediaStoreDataClient.ts b/clients/client-mediastore-data/MediaStoreDataClient.ts index 7838080ad64c6..1f9abaec5a6b8 100644 --- a/clients/client-mediastore-data/MediaStoreDataClient.ts +++ b/clients/client-mediastore-data/MediaStoreDataClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaStoreDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +169,8 @@ export type MediaStoreDataClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaStoreDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +178,8 @@ export type MediaStoreDataClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3 @@ -201,16 +203,16 @@ export class MediaStoreDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediastore-data/runtimeConfig.browser.ts b/clients/client-mediastore-data/runtimeConfig.browser.ts index 958f1b4c07513..6d8fa8f790748 100644 --- a/clients/client-mediastore-data/runtimeConfig.browser.ts +++ b/clients/client-mediastore-data/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediastore-data/runtimeConfig.native.ts b/clients/client-mediastore-data/runtimeConfig.native.ts index f4fa4b4a5c531..45b59a450dc26 100644 --- a/clients/client-mediastore-data/runtimeConfig.native.ts +++ b/clients/client-mediastore-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaStoreDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediastore-data/runtimeConfig.ts b/clients/client-mediastore-data/runtimeConfig.ts index dc70773617c5b..df1ce338b1b31 100644 --- a/clients/client-mediastore-data/runtimeConfig.ts +++ b/clients/client-mediastore-data/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediastore/MediaStoreClient.ts b/clients/client-mediastore/MediaStoreClient.ts index b1b4e5aab8f73..cfd92b79425c0 100644 --- a/clients/client-mediastore/MediaStoreClient.ts +++ b/clients/client-mediastore/MediaStoreClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaStoreClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +226,8 @@ export type MediaStoreClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaStoreClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +235,8 @@ export type MediaStoreClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

An AWS Elemental MediaStore container is a namespace that holds folders and objects. @@ -257,16 +259,16 @@ export class MediaStoreClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediastore/runtimeConfig.browser.ts b/clients/client-mediastore/runtimeConfig.browser.ts index 1719626d88c70..71f5c44de8de2 100644 --- a/clients/client-mediastore/runtimeConfig.browser.ts +++ b/clients/client-mediastore/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediastore/runtimeConfig.native.ts b/clients/client-mediastore/runtimeConfig.native.ts index 35ed4f0e88ff2..1086d5038f189 100644 --- a/clients/client-mediastore/runtimeConfig.native.ts +++ b/clients/client-mediastore/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaStoreClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediastore/runtimeConfig.ts b/clients/client-mediastore/runtimeConfig.ts index c1ed36b0e902b..c089187ca2bf6 100644 --- a/clients/client-mediastore/runtimeConfig.ts +++ b/clients/client-mediastore/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediatailor/MediaTailorClient.ts b/clients/client-mediatailor/MediaTailorClient.ts index ccdfa9fc7b3f8..c4eec91dd9f2b 100644 --- a/clients/client-mediatailor/MediaTailorClient.ts +++ b/clients/client-mediatailor/MediaTailorClient.ts @@ -57,6 +57,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -67,6 +68,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -134,11 +136,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -180,6 +177,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MediaTailorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -188,8 +190,8 @@ export type MediaTailorClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaTailorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -197,8 +199,8 @@ export type MediaTailorClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Use the AWS Elemental MediaTailor SDK to configure scalable ad insertion for your live and VOD content. With AWS Elemental MediaTailor, you can serve targeted ads to viewers while maintaining broadcast quality in over-the-top (OTT) video applications. For information about using the service, including detailed information about the settings covered in this guide, see the AWS Elemental MediaTailor User Guide.

Through the SDK, you manage AWS Elemental MediaTailor configurations the same as you do through the console. For example, you specify ad insertion behavior and mapping information for the origin server and the ad decision server (ADS).

@@ -220,16 +222,16 @@ export class MediaTailorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediatailor/runtimeConfig.browser.ts b/clients/client-mediatailor/runtimeConfig.browser.ts index b1e53b07d9081..5e78321227ee1 100644 --- a/clients/client-mediatailor/runtimeConfig.browser.ts +++ b/clients/client-mediatailor/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediatailor/runtimeConfig.native.ts b/clients/client-mediatailor/runtimeConfig.native.ts index 21f532e35a469..e55085eac7ae0 100644 --- a/clients/client-mediatailor/runtimeConfig.native.ts +++ b/clients/client-mediatailor/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaTailorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediatailor/runtimeConfig.ts b/clients/client-mediatailor/runtimeConfig.ts index cf2ac30a12ed7..a574f875c153d 100644 --- a/clients/client-mediatailor/runtimeConfig.ts +++ b/clients/client-mediatailor/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-migration-hub/MigrationHubClient.ts b/clients/client-migration-hub/MigrationHubClient.ts index 82e8e5ef89f14..18898ef10ce6a 100644 --- a/clients/client-migration-hub/MigrationHubClient.ts +++ b/clients/client-migration-hub/MigrationHubClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -197,11 +199,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -243,6 +240,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MigrationHubClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -251,8 +253,8 @@ export type MigrationHubClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MigrationHubClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -260,8 +262,8 @@ export type MigrationHubClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Migration Hub API methods help to obtain server and application migration status @@ -288,16 +290,16 @@ export class MigrationHubClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-migration-hub/runtimeConfig.browser.ts b/clients/client-migration-hub/runtimeConfig.browser.ts index 35c86deda7346..1d9c47fed3499 100644 --- a/clients/client-migration-hub/runtimeConfig.browser.ts +++ b/clients/client-migration-hub/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-migration-hub/runtimeConfig.native.ts b/clients/client-migration-hub/runtimeConfig.native.ts index 3e31aa7543c65..8a79f34c301eb 100644 --- a/clients/client-migration-hub/runtimeConfig.native.ts +++ b/clients/client-migration-hub/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MigrationHubClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-migration-hub/runtimeConfig.ts b/clients/client-migration-hub/runtimeConfig.ts index 7e49564037194..e0211a59f24d6 100644 --- a/clients/client-migration-hub/runtimeConfig.ts +++ b/clients/client-migration-hub/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-migrationhub-config/MigrationHubConfigClient.ts b/clients/client-migrationhub-config/MigrationHubConfigClient.ts index a77acbedd6904..2b89f912eeeec 100644 --- a/clients/client-migrationhub-config/MigrationHubConfigClient.ts +++ b/clients/client-migrationhub-config/MigrationHubConfigClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MigrationHubConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +169,8 @@ export type MigrationHubConfigClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MigrationHubConfigClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +178,8 @@ export type MigrationHubConfigClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Migration Hub home region APIs are available specifically for working with your @@ -224,16 +226,16 @@ export class MigrationHubConfigClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-migrationhub-config/runtimeConfig.browser.ts b/clients/client-migrationhub-config/runtimeConfig.browser.ts index e50d07af47750..ac88365d6c156 100644 --- a/clients/client-migrationhub-config/runtimeConfig.browser.ts +++ b/clients/client-migrationhub-config/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-migrationhub-config/runtimeConfig.native.ts b/clients/client-migrationhub-config/runtimeConfig.native.ts index 8d1f21b78e315..a747856aa20dd 100644 --- a/clients/client-migrationhub-config/runtimeConfig.native.ts +++ b/clients/client-migrationhub-config/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MigrationHubConfigClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-migrationhub-config/runtimeConfig.ts b/clients/client-migrationhub-config/runtimeConfig.ts index 39dbea53eda8d..6d107cd70f98d 100644 --- a/clients/client-migrationhub-config/runtimeConfig.ts +++ b/clients/client-migrationhub-config/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mobile/MobileClient.ts b/clients/client-mobile/MobileClient.ts index 85b1e8eec2f2d..904f213c9dd9a 100644 --- a/clients/client-mobile/MobileClient.ts +++ b/clients/client-mobile/MobileClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MobileClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +181,8 @@ export type MobileClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MobileClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +190,8 @@ export type MobileClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -215,16 +217,16 @@ export class MobileClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mobile/runtimeConfig.browser.ts b/clients/client-mobile/runtimeConfig.browser.ts index 070b80b5b7d5d..203e29f1a6840 100644 --- a/clients/client-mobile/runtimeConfig.browser.ts +++ b/clients/client-mobile/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mobile/runtimeConfig.native.ts b/clients/client-mobile/runtimeConfig.native.ts index 84ba34ab5324d..17e2209140c74 100644 --- a/clients/client-mobile/runtimeConfig.native.ts +++ b/clients/client-mobile/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MobileClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mobile/runtimeConfig.ts b/clients/client-mobile/runtimeConfig.ts index 3c4665f0c5f7c..cd36c805e5a5c 100644 --- a/clients/client-mobile/runtimeConfig.ts +++ b/clients/client-mobile/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mq/MqClient.ts b/clients/client-mq/MqClient.ts index efa22e857882c..7568cfc3d350b 100644 --- a/clients/client-mq/MqClient.ts +++ b/clients/client-mq/MqClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MqClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +241,8 @@ export type MqClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MqClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +250,8 @@ export type MqClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud. A message broker allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols. @@ -271,16 +273,16 @@ export class MqClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mq/runtimeConfig.browser.ts b/clients/client-mq/runtimeConfig.browser.ts index 8e45013929d2d..a0e145c65d54a 100644 --- a/clients/client-mq/runtimeConfig.browser.ts +++ b/clients/client-mq/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mq/runtimeConfig.native.ts b/clients/client-mq/runtimeConfig.native.ts index 0c06fe3b99b33..95a55aa5e4377 100644 --- a/clients/client-mq/runtimeConfig.native.ts +++ b/clients/client-mq/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MqClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mq/runtimeConfig.ts b/clients/client-mq/runtimeConfig.ts index 65927b97b4e73..03c0b5bcf5df0 100644 --- a/clients/client-mq/runtimeConfig.ts +++ b/clients/client-mq/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mturk/MTurkClient.ts b/clients/client-mturk/MTurkClient.ts index 0a442ef6171bc..47192fc28ca34 100644 --- a/clients/client-mturk/MTurkClient.ts +++ b/clients/client-mturk/MTurkClient.ts @@ -137,6 +137,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -147,6 +148,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -278,11 +280,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -324,6 +321,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type MTurkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -332,8 +334,8 @@ export type MTurkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MTurkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -341,8 +343,8 @@ export type MTurkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Mechanical Turk API Reference @@ -364,16 +366,16 @@ export class MTurkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mturk/runtimeConfig.browser.ts b/clients/client-mturk/runtimeConfig.browser.ts index 700ac5768ac72..d8821a5542974 100644 --- a/clients/client-mturk/runtimeConfig.browser.ts +++ b/clients/client-mturk/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mturk/runtimeConfig.native.ts b/clients/client-mturk/runtimeConfig.native.ts index 687ba097dc707..f87ecc7df4fa4 100644 --- a/clients/client-mturk/runtimeConfig.native.ts +++ b/clients/client-mturk/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MTurkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mturk/runtimeConfig.ts b/clients/client-mturk/runtimeConfig.ts index 7d468769805bc..49b11066a923e 100644 --- a/clients/client-mturk/runtimeConfig.ts +++ b/clients/client-mturk/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-neptune/NeptuneClient.ts b/clients/client-neptune/NeptuneClient.ts index d4e4907f238df..ed9807bcc92e1 100644 --- a/clients/client-neptune/NeptuneClient.ts +++ b/clients/client-neptune/NeptuneClient.ts @@ -245,6 +245,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -255,6 +256,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -434,11 +436,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -480,6 +477,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type NeptuneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -488,8 +490,8 @@ export type NeptuneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NeptuneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -497,8 +499,8 @@ export type NeptuneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Neptune @@ -537,16 +539,16 @@ export class NeptuneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-neptune/runtimeConfig.browser.ts b/clients/client-neptune/runtimeConfig.browser.ts index cd560819dfcf4..fa85409d16407 100644 --- a/clients/client-neptune/runtimeConfig.browser.ts +++ b/clients/client-neptune/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-neptune/runtimeConfig.native.ts b/clients/client-neptune/runtimeConfig.native.ts index 2b8c9ce733206..72d1508cda8b9 100644 --- a/clients/client-neptune/runtimeConfig.native.ts +++ b/clients/client-neptune/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NeptuneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-neptune/runtimeConfig.ts b/clients/client-neptune/runtimeConfig.ts index a339deeb1e6d8..6ffcb3c8d09c3 100644 --- a/clients/client-neptune/runtimeConfig.ts +++ b/clients/client-neptune/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-network-firewall/NetworkFirewallClient.ts b/clients/client-network-firewall/NetworkFirewallClient.ts index 5d9a7b15ccd77..eba5a40b83eb0 100644 --- a/clients/client-network-firewall/NetworkFirewallClient.ts +++ b/clients/client-network-firewall/NetworkFirewallClient.ts @@ -112,6 +112,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -122,6 +123,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -233,11 +235,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -279,6 +276,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type NetworkFirewallClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -287,8 +289,8 @@ export type NetworkFirewallClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NetworkFirewallClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -296,8 +298,8 @@ export type NetworkFirewallClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the API Reference for AWS Network Firewall. This guide is for developers who need @@ -398,16 +400,16 @@ export class NetworkFirewallClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-network-firewall/runtimeConfig.browser.ts b/clients/client-network-firewall/runtimeConfig.browser.ts index 181e838300cbf..698a2e5ad6fa1 100644 --- a/clients/client-network-firewall/runtimeConfig.browser.ts +++ b/clients/client-network-firewall/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-network-firewall/runtimeConfig.native.ts b/clients/client-network-firewall/runtimeConfig.native.ts index 9080a99499d2b..de9e7ea510f2b 100644 --- a/clients/client-network-firewall/runtimeConfig.native.ts +++ b/clients/client-network-firewall/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NetworkFirewallClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-network-firewall/runtimeConfig.ts b/clients/client-network-firewall/runtimeConfig.ts index e4bd0276e1fc3..d8bb5a0a2f77f 100644 --- a/clients/client-network-firewall/runtimeConfig.ts +++ b/clients/client-network-firewall/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-networkmanager/NetworkManagerClient.ts b/clients/client-networkmanager/NetworkManagerClient.ts index 21c1507c1d247..f7f651c0cbaa5 100644 --- a/clients/client-networkmanager/NetworkManagerClient.ts +++ b/clients/client-networkmanager/NetworkManagerClient.ts @@ -115,6 +115,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -125,6 +126,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type NetworkManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +304,8 @@ export type NetworkManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NetworkManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +313,8 @@ export type NetworkManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor your @@ -336,16 +338,16 @@ export class NetworkManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-networkmanager/runtimeConfig.browser.ts b/clients/client-networkmanager/runtimeConfig.browser.ts index 118482dbb6788..4a59b2b4a47a8 100644 --- a/clients/client-networkmanager/runtimeConfig.browser.ts +++ b/clients/client-networkmanager/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-networkmanager/runtimeConfig.native.ts b/clients/client-networkmanager/runtimeConfig.native.ts index 2dad3f50694e3..9f36f057a7a62 100644 --- a/clients/client-networkmanager/runtimeConfig.native.ts +++ b/clients/client-networkmanager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NetworkManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-networkmanager/runtimeConfig.ts b/clients/client-networkmanager/runtimeConfig.ts index e0b69d70634fd..f8c4719ccfa7e 100644 --- a/clients/client-networkmanager/runtimeConfig.ts +++ b/clients/client-networkmanager/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-opsworks/OpsWorksClient.ts b/clients/client-opsworks/OpsWorksClient.ts index bb373592a0c2d..3541a6f609d62 100644 --- a/clients/client-opsworks/OpsWorksClient.ts +++ b/clients/client-opsworks/OpsWorksClient.ts @@ -187,6 +187,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -197,6 +198,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -398,11 +400,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -444,6 +441,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type OpsWorksClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -452,8 +454,8 @@ export type OpsWorksClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OpsWorksClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -461,8 +463,8 @@ export type OpsWorksClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS OpsWorks @@ -598,16 +600,16 @@ export class OpsWorksClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-opsworks/runtimeConfig.browser.ts b/clients/client-opsworks/runtimeConfig.browser.ts index a8485afee0192..ec87c626c59cc 100644 --- a/clients/client-opsworks/runtimeConfig.browser.ts +++ b/clients/client-opsworks/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-opsworks/runtimeConfig.native.ts b/clients/client-opsworks/runtimeConfig.native.ts index 190be7c51134f..4e1e13b3eebac 100644 --- a/clients/client-opsworks/runtimeConfig.native.ts +++ b/clients/client-opsworks/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OpsWorksClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-opsworks/runtimeConfig.ts b/clients/client-opsworks/runtimeConfig.ts index 83dd8c28207a9..da73115cfd055 100644 --- a/clients/client-opsworks/runtimeConfig.ts +++ b/clients/client-opsworks/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-opsworkscm/OpsWorksCMClient.ts b/clients/client-opsworkscm/OpsWorksCMClient.ts index 9ec3ce2fbf409..4634c2dcf8d8a 100644 --- a/clients/client-opsworkscm/OpsWorksCMClient.ts +++ b/clients/client-opsworkscm/OpsWorksCMClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type OpsWorksCMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +226,8 @@ export type OpsWorksCMClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OpsWorksCMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +235,8 @@ export type OpsWorksCMClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS OpsWorks CM @@ -343,16 +345,16 @@ export class OpsWorksCMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-opsworkscm/runtimeConfig.browser.ts b/clients/client-opsworkscm/runtimeConfig.browser.ts index 9faa544c9b79f..2d269899a6504 100644 --- a/clients/client-opsworkscm/runtimeConfig.browser.ts +++ b/clients/client-opsworkscm/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-opsworkscm/runtimeConfig.native.ts b/clients/client-opsworkscm/runtimeConfig.native.ts index 46c8df4111135..136b8193f32c3 100644 --- a/clients/client-opsworkscm/runtimeConfig.native.ts +++ b/clients/client-opsworkscm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OpsWorksCMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-opsworkscm/runtimeConfig.ts b/clients/client-opsworkscm/runtimeConfig.ts index 05574e57fe014..18ed5df4bbf67 100644 --- a/clients/client-opsworkscm/runtimeConfig.ts +++ b/clients/client-opsworkscm/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-organizations/OrganizationsClient.ts b/clients/client-organizations/OrganizationsClient.ts index b54d8a2f63cca..447cbfee3c38f 100644 --- a/clients/client-organizations/OrganizationsClient.ts +++ b/clients/client-organizations/OrganizationsClient.ts @@ -161,6 +161,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -171,6 +172,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -326,11 +328,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -372,6 +369,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type OrganizationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -380,8 +382,8 @@ export type OrganizationsClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OrganizationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -389,8 +391,8 @@ export type OrganizationsClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Organizations @@ -412,16 +414,16 @@ export class OrganizationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-organizations/runtimeConfig.browser.ts b/clients/client-organizations/runtimeConfig.browser.ts index 0bbd703209087..2d727b5ec0d80 100644 --- a/clients/client-organizations/runtimeConfig.browser.ts +++ b/clients/client-organizations/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-organizations/runtimeConfig.native.ts b/clients/client-organizations/runtimeConfig.native.ts index 7f114f369b56b..e8e94b4f2b0aa 100644 --- a/clients/client-organizations/runtimeConfig.native.ts +++ b/clients/client-organizations/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OrganizationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-organizations/runtimeConfig.ts b/clients/client-organizations/runtimeConfig.ts index 4ef2f0fadf825..328994d7c21cf 100644 --- a/clients/client-organizations/runtimeConfig.ts +++ b/clients/client-organizations/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-outposts/OutpostsClient.ts b/clients/client-outposts/OutpostsClient.ts index d26eb71be3568..327cb1e340a87 100644 --- a/clients/client-outposts/OutpostsClient.ts +++ b/clients/client-outposts/OutpostsClient.ts @@ -45,6 +45,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -55,6 +56,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +178,8 @@ export type OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +187,8 @@ export type OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Outposts is a fully-managed service that extends AWS infrastructure, @@ -213,16 +215,16 @@ export class OutpostsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-outposts/runtimeConfig.browser.ts b/clients/client-outposts/runtimeConfig.browser.ts index f52a4bc657f70..bed72b8b66c34 100644 --- a/clients/client-outposts/runtimeConfig.browser.ts +++ b/clients/client-outposts/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-outposts/runtimeConfig.native.ts b/clients/client-outposts/runtimeConfig.native.ts index 0438b4ad69bde..b79a1ac2d3916 100644 --- a/clients/client-outposts/runtimeConfig.native.ts +++ b/clients/client-outposts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OutpostsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-outposts/runtimeConfig.ts b/clients/client-outposts/runtimeConfig.ts index 4365b133e0d40..cca29817e3e4e 100644 --- a/clients/client-outposts/runtimeConfig.ts +++ b/clients/client-outposts/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize-events/PersonalizeEventsClient.ts b/clients/client-personalize-events/PersonalizeEventsClient.ts index a7083b118ee4e..80e989942c957 100644 --- a/clients/client-personalize-events/PersonalizeEventsClient.ts +++ b/clients/client-personalize-events/PersonalizeEventsClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = PutEventsCommandInput | PutItemsCommandInput | PutUsersCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PersonalizeEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +157,8 @@ export type PersonalizeEventsClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +166,8 @@ export type PersonalizeEventsClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Personalize can consume real-time user event data, such as stream or click data, and use @@ -188,16 +190,16 @@ export class PersonalizeEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize-events/runtimeConfig.browser.ts b/clients/client-personalize-events/runtimeConfig.browser.ts index be6605596fd27..0ff1afc980d7f 100644 --- a/clients/client-personalize-events/runtimeConfig.browser.ts +++ b/clients/client-personalize-events/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize-events/runtimeConfig.native.ts b/clients/client-personalize-events/runtimeConfig.native.ts index 4014e952d21dc..fa4b108562d0d 100644 --- a/clients/client-personalize-events/runtimeConfig.native.ts +++ b/clients/client-personalize-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize-events/runtimeConfig.ts b/clients/client-personalize-events/runtimeConfig.ts index 8b8938c4b931a..f81f674ed0492 100644 --- a/clients/client-personalize-events/runtimeConfig.ts +++ b/clients/client-personalize-events/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts b/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts index aa2e4cf300c52..0edd9792ebc34 100644 --- a/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts +++ b/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetPersonalizedRankingCommandInput | GetRecommendationsCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PersonalizeRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +159,8 @@ export type PersonalizeRuntimeClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +168,8 @@ export type PersonalizeRuntimeClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -189,16 +191,16 @@ export class PersonalizeRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize-runtime/runtimeConfig.browser.ts b/clients/client-personalize-runtime/runtimeConfig.browser.ts index 84c92ec5acfa8..2b6b7d7c23236 100644 --- a/clients/client-personalize-runtime/runtimeConfig.browser.ts +++ b/clients/client-personalize-runtime/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize-runtime/runtimeConfig.native.ts b/clients/client-personalize-runtime/runtimeConfig.native.ts index ce7f23fe94f37..d3639a5e6f110 100644 --- a/clients/client-personalize-runtime/runtimeConfig.native.ts +++ b/clients/client-personalize-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize-runtime/runtimeConfig.ts b/clients/client-personalize-runtime/runtimeConfig.ts index 30d5025f9e3d2..d306f533f69b7 100644 --- a/clients/client-personalize-runtime/runtimeConfig.ts +++ b/clients/client-personalize-runtime/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize/PersonalizeClient.ts b/clients/client-personalize/PersonalizeClient.ts index 671dc6b410ec3..d3fa1d6214a79 100644 --- a/clients/client-personalize/PersonalizeClient.ts +++ b/clients/client-personalize/PersonalizeClient.ts @@ -114,6 +114,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -124,6 +125,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PersonalizeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +319,8 @@ export type PersonalizeClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +328,8 @@ export type PersonalizeClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Personalize is a machine learning service that makes it easy to add individualized @@ -350,16 +352,16 @@ export class PersonalizeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize/runtimeConfig.browser.ts b/clients/client-personalize/runtimeConfig.browser.ts index c29645ad41946..335c83b551e4c 100644 --- a/clients/client-personalize/runtimeConfig.browser.ts +++ b/clients/client-personalize/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize/runtimeConfig.native.ts b/clients/client-personalize/runtimeConfig.native.ts index 21b3daa6c979c..d04e00fcec44f 100644 --- a/clients/client-personalize/runtimeConfig.native.ts +++ b/clients/client-personalize/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize/runtimeConfig.ts b/clients/client-personalize/runtimeConfig.ts index 842195f9f8917..ff107132ca900 100644 --- a/clients/client-personalize/runtimeConfig.ts +++ b/clients/client-personalize/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pi/PIClient.ts b/clients/client-pi/PIClient.ts index f3cf5276b6c61..6eaf74a04e873 100644 --- a/clients/client-pi/PIClient.ts +++ b/clients/client-pi/PIClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DescribeDimensionKeysCommandInput | GetResourceMetricsCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +159,8 @@ export type PIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +168,8 @@ export type PIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Performance Insights enables you to monitor and explore different dimensions of @@ -202,16 +204,16 @@ export class PIClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pi/runtimeConfig.browser.ts b/clients/client-pi/runtimeConfig.browser.ts index 8505dd027c93c..a4faf640e08c4 100644 --- a/clients/client-pi/runtimeConfig.browser.ts +++ b/clients/client-pi/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pi/runtimeConfig.native.ts b/clients/client-pi/runtimeConfig.native.ts index a21490f338d42..8f17286345931 100644 --- a/clients/client-pi/runtimeConfig.native.ts +++ b/clients/client-pi/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PIClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pi/runtimeConfig.ts b/clients/client-pi/runtimeConfig.ts index d6c06c872fd5d..8c09a58dc6050 100644 --- a/clients/client-pi/runtimeConfig.ts +++ b/clients/client-pi/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint-email/PinpointEmailClient.ts b/clients/client-pinpoint-email/PinpointEmailClient.ts index bf81efa63bacb..a11cc616956ef 100644 --- a/clients/client-pinpoint-email/PinpointEmailClient.ts +++ b/clients/client-pinpoint-email/PinpointEmailClient.ts @@ -182,6 +182,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -192,6 +193,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -329,11 +331,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -375,6 +372,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PinpointEmailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -383,8 +385,8 @@ export type PinpointEmailClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointEmailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -392,8 +394,8 @@ export type PinpointEmailClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Pinpoint Email Service @@ -443,16 +445,16 @@ export class PinpointEmailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint-email/runtimeConfig.browser.ts b/clients/client-pinpoint-email/runtimeConfig.browser.ts index 4a03a5f4e91da..fe533edd3651c 100644 --- a/clients/client-pinpoint-email/runtimeConfig.browser.ts +++ b/clients/client-pinpoint-email/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint-email/runtimeConfig.native.ts b/clients/client-pinpoint-email/runtimeConfig.native.ts index 1b92604d7e02e..24013a65d121a 100644 --- a/clients/client-pinpoint-email/runtimeConfig.native.ts +++ b/clients/client-pinpoint-email/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointEmailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint-email/runtimeConfig.ts b/clients/client-pinpoint-email/runtimeConfig.ts index c977404112dea..7fc043855debc 100644 --- a/clients/client-pinpoint-email/runtimeConfig.ts +++ b/clients/client-pinpoint-email/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts b/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts index d4ebe4b192d6e..791632efe4b5e 100644 --- a/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts +++ b/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts @@ -64,6 +64,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -74,6 +75,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -143,11 +145,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -189,6 +186,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PinpointSMSVoiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -197,8 +199,8 @@ export type PinpointSMSVoiceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointSMSVoiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -206,8 +208,8 @@ export type PinpointSMSVoiceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Pinpoint SMS and Voice Messaging public facing APIs @@ -229,16 +231,16 @@ export class PinpointSMSVoiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts index 24d8d2b7e92e7..730b41ea22031 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts index 31636ad78ceec..e97a34cebcca0 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointSMSVoiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.ts index 9ba47ed1ffb74..0735f2e1689b4 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint/PinpointClient.ts b/clients/client-pinpoint/PinpointClient.ts index 028bdf5e9913c..f6cec30d5bbb9 100644 --- a/clients/client-pinpoint/PinpointClient.ts +++ b/clients/client-pinpoint/PinpointClient.ts @@ -255,6 +255,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -265,6 +266,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -542,11 +544,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -588,6 +585,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PinpointClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -596,8 +598,8 @@ export type PinpointClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -605,8 +607,8 @@ export type PinpointClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Doc Engage API - Amazon Pinpoint API

@@ -628,16 +630,16 @@ export class PinpointClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint/runtimeConfig.browser.ts b/clients/client-pinpoint/runtimeConfig.browser.ts index 2f20bbbad2bcb..7b3ce910bfa67 100644 --- a/clients/client-pinpoint/runtimeConfig.browser.ts +++ b/clients/client-pinpoint/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint/runtimeConfig.native.ts b/clients/client-pinpoint/runtimeConfig.native.ts index 023c17306d023..2f202ac7dc1d4 100644 --- a/clients/client-pinpoint/runtimeConfig.native.ts +++ b/clients/client-pinpoint/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint/runtimeConfig.ts b/clients/client-pinpoint/runtimeConfig.ts index 3163da034d73f..d8bbb8632ebf9 100644 --- a/clients/client-pinpoint/runtimeConfig.ts +++ b/clients/client-pinpoint/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-polly/PollyClient.ts b/clients/client-polly/PollyClient.ts index c090841946a9c..07204d5e7034b 100644 --- a/clients/client-polly/PollyClient.ts +++ b/clients/client-polly/PollyClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -134,11 +136,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -180,6 +177,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PollyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -188,8 +190,8 @@ export type PollyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PollyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -197,8 +199,8 @@ export type PollyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Polly is a web service that makes it easy to synthesize speech from @@ -225,16 +227,16 @@ export class PollyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-polly/runtimeConfig.browser.ts b/clients/client-polly/runtimeConfig.browser.ts index d666057083bcb..45e68b4df210d 100644 --- a/clients/client-polly/runtimeConfig.browser.ts +++ b/clients/client-polly/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-polly/runtimeConfig.native.ts b/clients/client-polly/runtimeConfig.native.ts index d4c46a6faab60..247aeafab705d 100644 --- a/clients/client-polly/runtimeConfig.native.ts +++ b/clients/client-polly/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PollyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-polly/runtimeConfig.ts b/clients/client-polly/runtimeConfig.ts index ee8ac98008364..8c8f59ece0208 100644 --- a/clients/client-polly/runtimeConfig.ts +++ b/clients/client-polly/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pricing/PricingClient.ts b/clients/client-pricing/PricingClient.ts index df0e5d62679b6..fd2e9decd253d 100644 --- a/clients/client-pricing/PricingClient.ts +++ b/clients/client-pricing/PricingClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DescribeServicesCommandInput | GetAttributeValuesCommandInput | GetProductsCommandInput; @@ -104,11 +106,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -150,6 +147,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type PricingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -158,8 +160,8 @@ export type PricingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PricingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -167,8 +169,8 @@ export type PricingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Price List Service API (AWS Price List Service) is a centralized and convenient way to @@ -213,16 +215,16 @@ export class PricingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pricing/runtimeConfig.browser.ts b/clients/client-pricing/runtimeConfig.browser.ts index 9727b15241e3f..ce7e75225ad6e 100644 --- a/clients/client-pricing/runtimeConfig.browser.ts +++ b/clients/client-pricing/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pricing/runtimeConfig.native.ts b/clients/client-pricing/runtimeConfig.native.ts index b503eccafd0f8..4792ba1e56e25 100644 --- a/clients/client-pricing/runtimeConfig.native.ts +++ b/clients/client-pricing/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PricingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pricing/runtimeConfig.ts b/clients/client-pricing/runtimeConfig.ts index a4ee6b5f39256..9a972a14af484 100644 --- a/clients/client-pricing/runtimeConfig.ts +++ b/clients/client-pricing/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-qldb-session/QLDBSessionClient.ts b/clients/client-qldb-session/QLDBSessionClient.ts index 3010230b33503..a5aacab0b5535 100644 --- a/clients/client-qldb-session/QLDBSessionClient.ts +++ b/clients/client-qldb-session/QLDBSessionClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SendCommandCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type QLDBSessionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +155,8 @@ export type QLDBSessionClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QLDBSessionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +164,8 @@ export type QLDBSessionClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The transactional data APIs for Amazon QLDB

@@ -205,16 +207,16 @@ export class QLDBSessionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-qldb-session/runtimeConfig.browser.ts b/clients/client-qldb-session/runtimeConfig.browser.ts index fe0ee71dbd68a..d8731ceb4b6ba 100644 --- a/clients/client-qldb-session/runtimeConfig.browser.ts +++ b/clients/client-qldb-session/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-qldb-session/runtimeConfig.native.ts b/clients/client-qldb-session/runtimeConfig.native.ts index 57fef29777303..9eadf3401b96a 100644 --- a/clients/client-qldb-session/runtimeConfig.native.ts +++ b/clients/client-qldb-session/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QLDBSessionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-qldb-session/runtimeConfig.ts b/clients/client-qldb-session/runtimeConfig.ts index 34d88d8c6aae9..c85f54e72ec71 100644 --- a/clients/client-qldb-session/runtimeConfig.ts +++ b/clients/client-qldb-session/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-qldb/QLDBClient.ts b/clients/client-qldb/QLDBClient.ts index 78e024bd1dfac..de8eb9cf110b8 100644 --- a/clients/client-qldb/QLDBClient.ts +++ b/clients/client-qldb/QLDBClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type QLDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +235,8 @@ export type QLDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QLDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +244,8 @@ export type QLDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The control plane for Amazon QLDB

@@ -265,16 +267,16 @@ export class QLDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-qldb/runtimeConfig.browser.ts b/clients/client-qldb/runtimeConfig.browser.ts index c7139cb57ae8c..e4be27ad84a90 100644 --- a/clients/client-qldb/runtimeConfig.browser.ts +++ b/clients/client-qldb/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-qldb/runtimeConfig.native.ts b/clients/client-qldb/runtimeConfig.native.ts index bd8912906853a..fee104745edf3 100644 --- a/clients/client-qldb/runtimeConfig.native.ts +++ b/clients/client-qldb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QLDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-qldb/runtimeConfig.ts b/clients/client-qldb/runtimeConfig.ts index 7a236f0e51cb6..bd41e73804005 100644 --- a/clients/client-qldb/runtimeConfig.ts +++ b/clients/client-qldb/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-quicksight/QuickSightClient.ts b/clients/client-quicksight/QuickSightClient.ts index 1e08316051d1d..695b58c66f491 100644 --- a/clients/client-quicksight/QuickSightClient.ts +++ b/clients/client-quicksight/QuickSightClient.ts @@ -248,6 +248,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -258,6 +259,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -509,11 +511,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -555,6 +552,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type QuickSightClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -563,8 +565,8 @@ export type QuickSightClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QuickSightClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -572,8 +574,8 @@ export type QuickSightClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon QuickSight API Reference @@ -599,16 +601,16 @@ export class QuickSightClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-quicksight/runtimeConfig.browser.ts b/clients/client-quicksight/runtimeConfig.browser.ts index 1cd4c65e949ee..6cbda404bf2aa 100644 --- a/clients/client-quicksight/runtimeConfig.browser.ts +++ b/clients/client-quicksight/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-quicksight/runtimeConfig.native.ts b/clients/client-quicksight/runtimeConfig.native.ts index 4a75770c25026..c140fe2890a5e 100644 --- a/clients/client-quicksight/runtimeConfig.native.ts +++ b/clients/client-quicksight/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QuickSightClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-quicksight/runtimeConfig.ts b/clients/client-quicksight/runtimeConfig.ts index 79d6ad23426bb..8fb3f5f517b11 100644 --- a/clients/client-quicksight/runtimeConfig.ts +++ b/clients/client-quicksight/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ram/RAMClient.ts b/clients/client-ram/RAMClient.ts index d1e1e1ad8a61e..e6d4767d3bf7c 100644 --- a/clients/client-ram/RAMClient.ts +++ b/clients/client-ram/RAMClient.ts @@ -107,6 +107,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -117,6 +118,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -218,11 +220,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -264,6 +261,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -272,8 +274,8 @@ export type RAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -281,8 +283,8 @@ export type RAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Use AWS Resource Access Manager to share AWS resources between AWS accounts. To share a resource, you @@ -309,16 +311,16 @@ export class RAMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ram/runtimeConfig.browser.ts b/clients/client-ram/runtimeConfig.browser.ts index 5c9dfc43f5688..2d98dce40ce0b 100644 --- a/clients/client-ram/runtimeConfig.browser.ts +++ b/clients/client-ram/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ram/runtimeConfig.native.ts b/clients/client-ram/runtimeConfig.native.ts index 0055d86d41c38..e90e29b19f8e9 100644 --- a/clients/client-ram/runtimeConfig.native.ts +++ b/clients/client-ram/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RAMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ram/runtimeConfig.ts b/clients/client-ram/runtimeConfig.ts index cf2e668214a20..52093fbb07e23 100644 --- a/clients/client-ram/runtimeConfig.ts +++ b/clients/client-ram/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rds-data/RDSDataClient.ts b/clients/client-rds-data/RDSDataClient.ts index f391e8b7944ba..7341cbae75d61 100644 --- a/clients/client-rds-data/RDSDataClient.ts +++ b/clients/client-rds-data/RDSDataClient.ts @@ -47,6 +47,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -57,6 +58,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RDSDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +178,8 @@ export type RDSDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RDSDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +187,8 @@ export type RDSDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon RDS Data Service @@ -217,16 +219,16 @@ export class RDSDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rds-data/runtimeConfig.browser.ts b/clients/client-rds-data/runtimeConfig.browser.ts index a2cc85379b4f5..142a52f5a5ece 100644 --- a/clients/client-rds-data/runtimeConfig.browser.ts +++ b/clients/client-rds-data/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rds-data/runtimeConfig.native.ts b/clients/client-rds-data/runtimeConfig.native.ts index 10e0bc1347bed..67e12ed55cd68 100644 --- a/clients/client-rds-data/runtimeConfig.native.ts +++ b/clients/client-rds-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RDSDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rds-data/runtimeConfig.ts b/clients/client-rds-data/runtimeConfig.ts index cd98eb24aa516..c89fe57652263 100644 --- a/clients/client-rds-data/runtimeConfig.ts +++ b/clients/client-rds-data/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rds/RDSClient.ts b/clients/client-rds/RDSClient.ts index 57cda35d6402d..31232eb5fdbd2 100644 --- a/clients/client-rds/RDSClient.ts +++ b/clients/client-rds/RDSClient.ts @@ -458,6 +458,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -468,6 +469,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -785,11 +787,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -831,6 +828,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RDSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -839,8 +841,8 @@ export type RDSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RDSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -848,8 +850,8 @@ export type RDSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Relational Database Service @@ -927,16 +929,16 @@ export class RDSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rds/runtimeConfig.browser.ts b/clients/client-rds/runtimeConfig.browser.ts index e1dd909bb3aa0..042ce97c73b02 100644 --- a/clients/client-rds/runtimeConfig.browser.ts +++ b/clients/client-rds/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rds/runtimeConfig.native.ts b/clients/client-rds/runtimeConfig.native.ts index df367c874d586..10be771599560 100644 --- a/clients/client-rds/runtimeConfig.native.ts +++ b/clients/client-rds/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RDSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rds/runtimeConfig.ts b/clients/client-rds/runtimeConfig.ts index de3407d0c2ab7..af97ab46d7938 100644 --- a/clients/client-rds/runtimeConfig.ts +++ b/clients/client-rds/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-redshift-data/RedshiftDataClient.ts b/clients/client-redshift-data/RedshiftDataClient.ts index 83a4eae5ea2da..c60c73deddf08 100644 --- a/clients/client-redshift-data/RedshiftDataClient.ts +++ b/clients/client-redshift-data/RedshiftDataClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RedshiftDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +181,8 @@ export type RedshiftDataClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RedshiftDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +190,8 @@ export type RedshiftDataClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use the Amazon Redshift Data API to run queries on Amazon Redshift tables. You @@ -212,16 +214,16 @@ export class RedshiftDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-redshift-data/runtimeConfig.browser.ts b/clients/client-redshift-data/runtimeConfig.browser.ts index 0ddcb664de062..df57acdaea4bf 100644 --- a/clients/client-redshift-data/runtimeConfig.browser.ts +++ b/clients/client-redshift-data/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-redshift-data/runtimeConfig.native.ts b/clients/client-redshift-data/runtimeConfig.native.ts index c2681c976a1c4..1c8f8e313b9c4 100644 --- a/clients/client-redshift-data/runtimeConfig.native.ts +++ b/clients/client-redshift-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RedshiftDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-redshift-data/runtimeConfig.ts b/clients/client-redshift-data/runtimeConfig.ts index bcb0acc43dbe4..be45e6879ba05 100644 --- a/clients/client-redshift-data/runtimeConfig.ts +++ b/clients/client-redshift-data/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-redshift/RedshiftClient.ts b/clients/client-redshift/RedshiftClient.ts index 2ab0cfffda959..72405760a4360 100644 --- a/clients/client-redshift/RedshiftClient.ts +++ b/clients/client-redshift/RedshiftClient.ts @@ -340,6 +340,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -350,6 +351,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -587,11 +589,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -633,6 +630,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RedshiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -641,8 +643,8 @@ export type RedshiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RedshiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -650,8 +652,8 @@ export type RedshiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Redshift @@ -694,16 +696,16 @@ export class RedshiftClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-redshift/runtimeConfig.browser.ts b/clients/client-redshift/runtimeConfig.browser.ts index 3c941956d348b..abadec4c18ee0 100644 --- a/clients/client-redshift/runtimeConfig.browser.ts +++ b/clients/client-redshift/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-redshift/runtimeConfig.native.ts b/clients/client-redshift/runtimeConfig.native.ts index 3e750a39c9faa..d0ff8a798c016 100644 --- a/clients/client-redshift/runtimeConfig.native.ts +++ b/clients/client-redshift/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RedshiftClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-redshift/runtimeConfig.ts b/clients/client-redshift/runtimeConfig.ts index 39398cc997b6d..2b5f9014ca425 100644 --- a/clients/client-redshift/runtimeConfig.ts +++ b/clients/client-redshift/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rekognition/RekognitionClient.ts b/clients/client-rekognition/RekognitionClient.ts index dd3519e6f4d29..eee49564e3144 100644 --- a/clients/client-rekognition/RekognitionClient.ts +++ b/clients/client-rekognition/RekognitionClient.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -305,11 +307,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -351,6 +348,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RekognitionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -359,8 +361,8 @@ export type RekognitionClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RekognitionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -368,8 +370,8 @@ export type RekognitionClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Rekognition API reference.

@@ -391,16 +393,16 @@ export class RekognitionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rekognition/runtimeConfig.browser.ts b/clients/client-rekognition/runtimeConfig.browser.ts index a4e078b5ac7f3..6adaafa46966b 100644 --- a/clients/client-rekognition/runtimeConfig.browser.ts +++ b/clients/client-rekognition/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rekognition/runtimeConfig.native.ts b/clients/client-rekognition/runtimeConfig.native.ts index 25394ac24fc4f..66912db06ab3e 100644 --- a/clients/client-rekognition/runtimeConfig.native.ts +++ b/clients/client-rekognition/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RekognitionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rekognition/runtimeConfig.ts b/clients/client-rekognition/runtimeConfig.ts index 02b01ecc142b3..a051ebd972a34 100644 --- a/clients/client-rekognition/runtimeConfig.ts +++ b/clients/client-rekognition/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts b/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts index 550ef8af8b123..c411a83a76fd1 100644 --- a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts +++ b/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts @@ -52,6 +52,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -62,6 +63,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ResourceGroupsTaggingAPIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +187,8 @@ export type ResourceGroupsTaggingAPIClientConfig = Partial<__SmithyConfiguration EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ResourceGroupsTaggingAPIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +196,8 @@ export type ResourceGroupsTaggingAPIClientResolvedConfig = __SmithyResolvedConfi EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Resource Groups Tagging API @@ -973,16 +975,16 @@ export class ResourceGroupsTaggingAPIClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts index 85702060e8381..f364faef67dcf 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts index 48a22bdedd23f..94081e75c64aa 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ResourceGroupsTaggingAPIClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.ts index 53d23d89f3d7d..2ba12d8cb5688 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-resource-groups/ResourceGroupsClient.ts b/clients/client-resource-groups/ResourceGroupsClient.ts index c84717252369f..3d7614d0e5efa 100644 --- a/clients/client-resource-groups/ResourceGroupsClient.ts +++ b/clients/client-resource-groups/ResourceGroupsClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ResourceGroupsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +202,8 @@ export type ResourceGroupsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ResourceGroupsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +211,8 @@ export type ResourceGroupsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Resource Groups @@ -267,16 +269,16 @@ export class ResourceGroupsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-resource-groups/runtimeConfig.browser.ts b/clients/client-resource-groups/runtimeConfig.browser.ts index a2823ee8e7852..6cf0f33c1eedb 100644 --- a/clients/client-resource-groups/runtimeConfig.browser.ts +++ b/clients/client-resource-groups/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-resource-groups/runtimeConfig.native.ts b/clients/client-resource-groups/runtimeConfig.native.ts index 2becb0f1bae9a..2372597f29694 100644 --- a/clients/client-resource-groups/runtimeConfig.native.ts +++ b/clients/client-resource-groups/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ResourceGroupsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-resource-groups/runtimeConfig.ts b/clients/client-resource-groups/runtimeConfig.ts index 566747c107bd1..55dfb126fe397 100644 --- a/clients/client-resource-groups/runtimeConfig.ts +++ b/clients/client-resource-groups/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-robomaker/RoboMakerClient.ts b/clients/client-robomaker/RoboMakerClient.ts index 5e5c1d86b7726..a2efde678c15e 100644 --- a/clients/client-robomaker/RoboMakerClient.ts +++ b/clients/client-robomaker/RoboMakerClient.ts @@ -206,6 +206,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -216,6 +217,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -383,11 +385,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -429,6 +426,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RoboMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -437,8 +439,8 @@ export type RoboMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RoboMakerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -446,8 +448,8 @@ export type RoboMakerClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the AWS RoboMaker API operations.

@@ -469,16 +471,16 @@ export class RoboMakerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-robomaker/runtimeConfig.browser.ts b/clients/client-robomaker/runtimeConfig.browser.ts index 18c64ac90a054..a145b7d08fdd7 100644 --- a/clients/client-robomaker/runtimeConfig.browser.ts +++ b/clients/client-robomaker/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-robomaker/runtimeConfig.native.ts b/clients/client-robomaker/runtimeConfig.native.ts index a97e86f8b06de..a94796711ac8c 100644 --- a/clients/client-robomaker/runtimeConfig.native.ts +++ b/clients/client-robomaker/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RoboMakerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-robomaker/runtimeConfig.ts b/clients/client-robomaker/runtimeConfig.ts index 6ad9fb078aa48..134c1b57f489f 100644 --- a/clients/client-robomaker/runtimeConfig.ts +++ b/clients/client-robomaker/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route-53-domains/Route53DomainsClient.ts b/clients/client-route-53-domains/Route53DomainsClient.ts index 1d2c7f7b3bead..47d82bd6f2f87 100644 --- a/clients/client-route-53-domains/Route53DomainsClient.ts +++ b/clients/client-route-53-domains/Route53DomainsClient.ts @@ -120,6 +120,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -130,6 +131,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type Route53DomainsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +295,8 @@ export type Route53DomainsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53DomainsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +304,8 @@ export type Route53DomainsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Route 53 API actions let you register domain names and perform related operations.

@@ -325,16 +327,16 @@ export class Route53DomainsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route-53-domains/runtimeConfig.browser.ts b/clients/client-route-53-domains/runtimeConfig.browser.ts index 20d16d59875c6..857dc9d72637a 100644 --- a/clients/client-route-53-domains/runtimeConfig.browser.ts +++ b/clients/client-route-53-domains/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route-53-domains/runtimeConfig.native.ts b/clients/client-route-53-domains/runtimeConfig.native.ts index cec0f17700e7d..bc2a62428f65c 100644 --- a/clients/client-route-53-domains/runtimeConfig.native.ts +++ b/clients/client-route-53-domains/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53DomainsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route-53-domains/runtimeConfig.ts b/clients/client-route-53-domains/runtimeConfig.ts index aff6ba976d8b7..b967440c767ec 100644 --- a/clients/client-route-53-domains/runtimeConfig.ts +++ b/clients/client-route-53-domains/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route-53/Route53Client.ts b/clients/client-route-53/Route53Client.ts index 2e451275f75e3..1435d8fb07d80 100644 --- a/clients/client-route-53/Route53Client.ts +++ b/clients/client-route-53/Route53Client.ts @@ -209,6 +209,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -219,6 +220,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -386,11 +388,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -432,6 +429,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type Route53ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -440,8 +442,8 @@ export type Route53ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -449,8 +451,8 @@ export type Route53ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service.

@@ -472,16 +474,16 @@ export class Route53Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route-53/runtimeConfig.browser.ts b/clients/client-route-53/runtimeConfig.browser.ts index 7d7799b09f66c..ecc7bebaa4b78 100644 --- a/clients/client-route-53/runtimeConfig.browser.ts +++ b/clients/client-route-53/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route-53/runtimeConfig.native.ts b/clients/client-route-53/runtimeConfig.native.ts index 5ae542c98f1a3..2b2235c56777b 100644 --- a/clients/client-route-53/runtimeConfig.native.ts +++ b/clients/client-route-53/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route-53/runtimeConfig.ts b/clients/client-route-53/runtimeConfig.ts index 1d788bdb042a4..1c87b97945291 100644 --- a/clients/client-route-53/runtimeConfig.ts +++ b/clients/client-route-53/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route53resolver/Route53ResolverClient.ts b/clients/client-route53resolver/Route53ResolverClient.ts index 179261dd3c6d1..6546d31645930 100644 --- a/clients/client-route53resolver/Route53ResolverClient.ts +++ b/clients/client-route53resolver/Route53ResolverClient.ts @@ -142,6 +142,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -152,6 +153,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type Route53ResolverClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +325,8 @@ export type Route53ResolverClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53ResolverClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +334,8 @@ export type Route53ResolverClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

When you create a VPC using Amazon VPC, you automatically get DNS resolution within the VPC from Route 53 Resolver. @@ -384,16 +386,16 @@ export class Route53ResolverClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route53resolver/runtimeConfig.browser.ts b/clients/client-route53resolver/runtimeConfig.browser.ts index 8227eab7f4b04..d83b058cbbb61 100644 --- a/clients/client-route53resolver/runtimeConfig.browser.ts +++ b/clients/client-route53resolver/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route53resolver/runtimeConfig.native.ts b/clients/client-route53resolver/runtimeConfig.native.ts index 8cf96cc7ad429..d1646c2c7e280 100644 --- a/clients/client-route53resolver/runtimeConfig.native.ts +++ b/clients/client-route53resolver/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53ResolverClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route53resolver/runtimeConfig.ts b/clients/client-route53resolver/runtimeConfig.ts index 8f905b163c681..32c4b9f83300a 100644 --- a/clients/client-route53resolver/runtimeConfig.ts +++ b/clients/client-route53resolver/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-s3-control/S3ControlClient.ts b/clients/client-s3-control/S3ControlClient.ts index b2347ab75ba3c..fd1cbdb858e53 100644 --- a/clients/client-s3-control/S3ControlClient.ts +++ b/clients/client-s3-control/S3ControlClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -277,11 +279,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -323,6 +320,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type S3ControlClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -331,9 +333,9 @@ export type S3ControlClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & - S3ControlInputConfig; + S3ControlInputConfig & + UserAgentInputConfig; export type S3ControlClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -341,9 +343,9 @@ export type S3ControlClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & - S3ControlResolvedConfig; + S3ControlResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -368,17 +370,17 @@ export class S3ControlClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveS3ControlConfig(_config_6); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveS3ControlConfig(_config_5); + let _config_7 = resolveUserAgentConfig(_config_6); super(_config_7); this.config = _config_7; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3-control/runtimeConfig.browser.ts b/clients/client-s3-control/runtimeConfig.browser.ts index 77cade9d06bbd..b2f4a04cbbad9 100644 --- a/clients/client-s3-control/runtimeConfig.browser.ts +++ b/clients/client-s3-control/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-s3-control/runtimeConfig.native.ts b/clients/client-s3-control/runtimeConfig.native.ts index d80b766e2815e..3b6f6952f670e 100644 --- a/clients/client-s3-control/runtimeConfig.native.ts +++ b/clients/client-s3-control/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3ControlClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3-control/runtimeConfig.ts b/clients/client-s3-control/runtimeConfig.ts index efc104aee1f11..d9907aebf2753 100644 --- a/clients/client-s3-control/runtimeConfig.ts +++ b/clients/client-s3-control/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-s3/S3Client.ts b/clients/client-s3/S3Client.ts index 8470e6d7778d1..b919224381516 100644 --- a/clients/client-s3/S3Client.ts +++ b/clients/client-s3/S3Client.ts @@ -301,6 +301,7 @@ import { StreamCollector as __StreamCollector, StreamHasher as __StreamHasher, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; import { Readable } from "stream"; @@ -537,11 +538,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -605,6 +601,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Whether to override the request region with the region inferred from requested resource's ARN. Defaults to false. */ useArnRegion?: boolean | Provider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -617,9 +618,9 @@ export type S3ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & BucketEndpointInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type S3ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -628,9 +629,9 @@ export type S3ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & BucketEndpointResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -653,21 +654,21 @@ export class S3Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveBucketEndpointConfig(_config_6); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveBucketEndpointConfig(_config_5); + let _config_7 = resolveUserAgentConfig(_config_6); let _config_8 = resolveEventStreamSerdeConfig(_config_7); super(_config_8); this.config = _config_8; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getValidateBucketNamePlugin(this.config)); this.middlewareStack.use(getUseRegionalEndpointPlugin(this.config)); this.middlewareStack.use(getAddExpectContinuePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3/runtimeConfig.browser.ts b/clients/client-s3/runtimeConfig.browser.ts index 3e7ed9ca99e35..a73e79a313e0d 100644 --- a/clients/client-s3/runtimeConfig.browser.ts +++ b/clients/client-s3/runtimeConfig.browser.ts @@ -25,7 +25,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, md5: Md5, diff --git a/clients/client-s3/runtimeConfig.native.ts b/clients/client-s3/runtimeConfig.native.ts index 4011cbdb3c47a..3982fdd7d24b5 100644 --- a/clients/client-s3/runtimeConfig.native.ts +++ b/clients/client-s3/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3/runtimeConfig.ts b/clients/client-s3/runtimeConfig.ts index 50a05de926d4c..d035e0e399d6a 100644 --- a/clients/client-s3/runtimeConfig.ts +++ b/clients/client-s3/runtimeConfig.ts @@ -28,7 +28,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), md5: Hash.bind(null, "md5"), diff --git a/clients/client-s3outposts/S3OutpostsClient.ts b/clients/client-s3outposts/S3OutpostsClient.ts index ddb0e63df8459..6a954771056ee 100644 --- a/clients/client-s3outposts/S3OutpostsClient.ts +++ b/clients/client-s3outposts/S3OutpostsClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = CreateEndpointCommandInput | DeleteEndpointCommandInput | ListEndpointsCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type S3OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +157,8 @@ export type S3OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type S3OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +166,8 @@ export type S3OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon S3 on Outposts provides access to S3 on Outposts operations.

@@ -187,16 +189,16 @@ export class S3OutpostsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3outposts/runtimeConfig.browser.ts b/clients/client-s3outposts/runtimeConfig.browser.ts index 6ae63da72eba8..72b6b64e2028d 100644 --- a/clients/client-s3outposts/runtimeConfig.browser.ts +++ b/clients/client-s3outposts/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-s3outposts/runtimeConfig.native.ts b/clients/client-s3outposts/runtimeConfig.native.ts index 0a755860d14d7..dace87cef6b2d 100644 --- a/clients/client-s3outposts/runtimeConfig.native.ts +++ b/clients/client-s3outposts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3OutpostsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3outposts/runtimeConfig.ts b/clients/client-s3outposts/runtimeConfig.ts index d739f7bd78d2a..5a5f251a9a7ee 100644 --- a/clients/client-s3outposts/runtimeConfig.ts +++ b/clients/client-s3outposts/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts b/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts index e60180315db47..c155886f2fddb 100644 --- a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts +++ b/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SageMakerA2IRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +169,8 @@ export type SageMakerA2IRuntimeClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerA2IRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +178,8 @@ export type SageMakerA2IRuntimeClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -228,16 +230,16 @@ export class SageMakerA2IRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts index a292984f97877..14904b771b8e9 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts index 49248f418db66..80117347da1d8 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerA2IRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts index 6df54fcbdcf69..6d207a48bd0bf 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-edge/SagemakerEdgeClient.ts b/clients/client-sagemaker-edge/SagemakerEdgeClient.ts index d769accc9d3d7..3919c72cd77a8 100644 --- a/clients/client-sagemaker-edge/SagemakerEdgeClient.ts +++ b/clients/client-sagemaker-edge/SagemakerEdgeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetDeviceRegistrationCommandInput | SendHeartbeatCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SagemakerEdgeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +159,8 @@ export type SagemakerEdgeClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SagemakerEdgeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +168,8 @@ export type SagemakerEdgeClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

SageMaker Edge Manager dataplane service for communicating with active agents.

@@ -189,16 +191,16 @@ export class SagemakerEdgeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-edge/runtimeConfig.browser.ts b/clients/client-sagemaker-edge/runtimeConfig.browser.ts index b95d7c41ca791..56501e25c9395 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-edge/runtimeConfig.native.ts b/clients/client-sagemaker-edge/runtimeConfig.native.ts index b486e532174d2..6ca52bb341edc 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.native.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SagemakerEdgeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-edge/runtimeConfig.ts b/clients/client-sagemaker-edge/runtimeConfig.ts index 89e3b964d59ef..ba9a276427b71 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts b/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts index 09733c0a9a26b..b9335f04a2c86 100644 --- a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts +++ b/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DeleteRecordCommandInput | GetRecordCommandInput | PutRecordCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SageMakerFeatureStoreRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +157,8 @@ export type SageMakerFeatureStoreRuntimeClientConfig = Partial<__SmithyConfigura EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerFeatureStoreRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +166,8 @@ export type SageMakerFeatureStoreRuntimeClientResolvedConfig = __SmithyResolvedC EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Contains all data plane API operations and data types for the Amazon SageMaker Feature @@ -213,16 +215,16 @@ export class SageMakerFeatureStoreRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts index 14f48f2b1c9b2..9547c9be8c8d4 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts index ab1868223d045..ed2f094a6ab9e 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerFeatureStoreRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts index 4f8fa9b74adcb..ad3c33cb2c57d 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts b/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts index 30b90bbf9b741..232f57cd10aed 100644 --- a/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts +++ b/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = InvokeEndpointCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SageMakerRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +155,8 @@ export type SageMakerRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +164,8 @@ export type SageMakerRuntimeClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon SageMaker runtime API.

@@ -185,16 +187,16 @@ export class SageMakerRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-runtime/runtimeConfig.browser.ts index ff82f4baef703..9d824f7dbef05 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-runtime/runtimeConfig.native.ts index 2261c4f642faa..cdaeb8c508c4c 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-runtime/runtimeConfig.ts b/clients/client-sagemaker-runtime/runtimeConfig.ts index 66eeb877f6c0f..27ff49818d2cc 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker/SageMakerClient.ts b/clients/client-sagemaker/SageMakerClient.ts index dc613c3984c99..ce9fbdac0fbdd 100644 --- a/clients/client-sagemaker/SageMakerClient.ts +++ b/clients/client-sagemaker/SageMakerClient.ts @@ -601,6 +601,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -611,6 +612,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -1130,11 +1132,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1176,6 +1173,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SageMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1184,8 +1186,8 @@ export type SageMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1193,8 +1195,8 @@ export type SageMakerClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon SageMaker resources.

@@ -1231,16 +1233,16 @@ export class SageMakerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker/runtimeConfig.browser.ts b/clients/client-sagemaker/runtimeConfig.browser.ts index 0b3a61ed323d1..34c6d5be81af5 100644 --- a/clients/client-sagemaker/runtimeConfig.browser.ts +++ b/clients/client-sagemaker/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker/runtimeConfig.native.ts b/clients/client-sagemaker/runtimeConfig.native.ts index 6dfb2f325c43c..3741f42cc11ee 100644 --- a/clients/client-sagemaker/runtimeConfig.native.ts +++ b/clients/client-sagemaker/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker/runtimeConfig.ts b/clients/client-sagemaker/runtimeConfig.ts index 7f42cb25dea1a..43525c78c1ef0 100644 --- a/clients/client-sagemaker/runtimeConfig.ts +++ b/clients/client-sagemaker/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-savingsplans/SavingsplansClient.ts b/clients/client-savingsplans/SavingsplansClient.ts index b5095fa5a77e9..0e34749cc8cd4 100644 --- a/clients/client-savingsplans/SavingsplansClient.ts +++ b/clients/client-savingsplans/SavingsplansClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -143,11 +145,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -189,6 +186,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SavingsplansClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -197,8 +199,8 @@ export type SavingsplansClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SavingsplansClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -206,8 +208,8 @@ export type SavingsplansClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Savings Plans are a pricing model that offer significant savings on AWS usage (for @@ -232,16 +234,16 @@ export class SavingsplansClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-savingsplans/runtimeConfig.browser.ts b/clients/client-savingsplans/runtimeConfig.browser.ts index de7d8132f165a..b1f0f38d6c0c8 100644 --- a/clients/client-savingsplans/runtimeConfig.browser.ts +++ b/clients/client-savingsplans/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-savingsplans/runtimeConfig.native.ts b/clients/client-savingsplans/runtimeConfig.native.ts index 43fd9d4d9fc51..c91d78dd62dcd 100644 --- a/clients/client-savingsplans/runtimeConfig.native.ts +++ b/clients/client-savingsplans/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SavingsplansClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-savingsplans/runtimeConfig.ts b/clients/client-savingsplans/runtimeConfig.ts index 06130fe386e90..50b4ee2718bf2 100644 --- a/clients/client-savingsplans/runtimeConfig.ts +++ b/clients/client-savingsplans/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-schemas/SchemasClient.ts b/clients/client-schemas/SchemasClient.ts index acbd6fda9d8a0..b2cf4120cd745 100644 --- a/clients/client-schemas/SchemasClient.ts +++ b/clients/client-schemas/SchemasClient.ts @@ -84,6 +84,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -94,6 +95,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SchemasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +265,8 @@ export type SchemasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SchemasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +274,8 @@ export type SchemasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge Schema Registry

@@ -295,16 +297,16 @@ export class SchemasClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-schemas/runtimeConfig.browser.ts b/clients/client-schemas/runtimeConfig.browser.ts index e9a919557cbe9..728552235f4b3 100644 --- a/clients/client-schemas/runtimeConfig.browser.ts +++ b/clients/client-schemas/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-schemas/runtimeConfig.native.ts b/clients/client-schemas/runtimeConfig.native.ts index 6ec04bfab8deb..51138d3693735 100644 --- a/clients/client-schemas/runtimeConfig.native.ts +++ b/clients/client-schemas/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SchemasClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-schemas/runtimeConfig.ts b/clients/client-schemas/runtimeConfig.ts index f553aec4d19bd..4f698c8808dba 100644 --- a/clients/client-schemas/runtimeConfig.ts +++ b/clients/client-schemas/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-secrets-manager/SecretsManagerClient.ts b/clients/client-secrets-manager/SecretsManagerClient.ts index b42a55d3449bd..0ab1dc453d08e 100644 --- a/clients/client-secrets-manager/SecretsManagerClient.ts +++ b/clients/client-secrets-manager/SecretsManagerClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SecretsManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +223,8 @@ export type SecretsManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SecretsManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +232,8 @@ export type SecretsManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Secrets Manager API Reference @@ -315,16 +317,16 @@ export class SecretsManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-secrets-manager/runtimeConfig.browser.ts b/clients/client-secrets-manager/runtimeConfig.browser.ts index 2dddda132a68f..981a67f036b76 100644 --- a/clients/client-secrets-manager/runtimeConfig.browser.ts +++ b/clients/client-secrets-manager/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-secrets-manager/runtimeConfig.native.ts b/clients/client-secrets-manager/runtimeConfig.native.ts index 657c775b8f3f7..ceed11dc98bfd 100644 --- a/clients/client-secrets-manager/runtimeConfig.native.ts +++ b/clients/client-secrets-manager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SecretsManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-secrets-manager/runtimeConfig.ts b/clients/client-secrets-manager/runtimeConfig.ts index 8f54fe76eb283..69c56badf4ff3 100644 --- a/clients/client-secrets-manager/runtimeConfig.ts +++ b/clients/client-secrets-manager/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-securityhub/SecurityHubClient.ts b/clients/client-securityhub/SecurityHubClient.ts index c6da8a7cc61bc..cd4f3aea6af7e 100644 --- a/clients/client-securityhub/SecurityHubClient.ts +++ b/clients/client-securityhub/SecurityHubClient.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -305,11 +307,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -351,6 +348,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SecurityHubClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -359,8 +361,8 @@ export type SecurityHubClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SecurityHubClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -368,8 +370,8 @@ export type SecurityHubClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Security Hub provides you with a comprehensive view of the security state of your AWS @@ -445,16 +447,16 @@ export class SecurityHubClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-securityhub/runtimeConfig.browser.ts b/clients/client-securityhub/runtimeConfig.browser.ts index 895ae6aafc3a7..2acc5789d6cfa 100644 --- a/clients/client-securityhub/runtimeConfig.browser.ts +++ b/clients/client-securityhub/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-securityhub/runtimeConfig.native.ts b/clients/client-securityhub/runtimeConfig.native.ts index 3521fd7b35c73..dd9d2e7caab33 100644 --- a/clients/client-securityhub/runtimeConfig.native.ts +++ b/clients/client-securityhub/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SecurityHubClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-securityhub/runtimeConfig.ts b/clients/client-securityhub/runtimeConfig.ts index ae21fc35654d0..388ed1b9f1032 100644 --- a/clients/client-securityhub/runtimeConfig.ts +++ b/clients/client-securityhub/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts b/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts index bb4bc7e1bad67..db4f9607f6d3a 100644 --- a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts +++ b/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts @@ -73,6 +73,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -83,6 +84,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ServerlessApplicationRepositoryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +220,8 @@ export type ServerlessApplicationRepositoryClientConfig = Partial<__SmithyConfig EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServerlessApplicationRepositoryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +229,8 @@ export type ServerlessApplicationRepositoryClientResolvedConfig = __SmithyResolv EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Serverless Application Repository makes it easy for developers and enterprises to quickly find @@ -269,16 +271,16 @@ export class ServerlessApplicationRepositoryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts index 0fedf8d4dc24f..9ea1ea45235a0 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts index cf2754a217ee9..1c230fb24295f 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServerlessApplicationRepositoryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.ts index ca18348b4e876..9ec4366a299a6 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts b/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts index 5092cbcbeb025..b75a410b97d9e 100644 --- a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts +++ b/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts @@ -84,6 +84,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -94,6 +95,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ServiceCatalogAppRegistryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +241,8 @@ export type ServiceCatalogAppRegistryClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceCatalogAppRegistryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +250,8 @@ export type ServiceCatalogAppRegistryClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Service Catalog AppRegistry enables organizations to understand the application context of their AWS resources. AppRegistry provides a repository of your applications, their resources, and the application metadata that you use within your enterprise.

@@ -271,16 +273,16 @@ export class ServiceCatalogAppRegistryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts b/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts index 4f451273696f7..d752905a02de5 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.native.ts b/clients/client-service-catalog-appregistry/runtimeConfig.native.ts index ee600010499f3..9f3a125df0eed 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.native.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceCatalogAppRegistryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.ts b/clients/client-service-catalog-appregistry/runtimeConfig.ts index 78c8f1cd32c71..bb2c89e4f34e8 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-catalog/ServiceCatalogClient.ts b/clients/client-service-catalog/ServiceCatalogClient.ts index bec6c821a9170..14af8ec1bfb44 100644 --- a/clients/client-service-catalog/ServiceCatalogClient.ts +++ b/clients/client-service-catalog/ServiceCatalogClient.ts @@ -300,6 +300,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -310,6 +311,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -533,11 +535,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -579,6 +576,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ServiceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -587,8 +589,8 @@ export type ServiceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -596,8 +598,8 @@ export type ServiceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Service Catalog @@ -625,16 +627,16 @@ export class ServiceCatalogClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-catalog/runtimeConfig.browser.ts b/clients/client-service-catalog/runtimeConfig.browser.ts index afd0157c051b5..bd6333cea168e 100644 --- a/clients/client-service-catalog/runtimeConfig.browser.ts +++ b/clients/client-service-catalog/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-catalog/runtimeConfig.native.ts b/clients/client-service-catalog/runtimeConfig.native.ts index 64f4d2e33b09c..6e6b7c049f125 100644 --- a/clients/client-service-catalog/runtimeConfig.native.ts +++ b/clients/client-service-catalog/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceCatalogClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-catalog/runtimeConfig.ts b/clients/client-service-catalog/runtimeConfig.ts index 9d47538a9ce3a..07a8fc5369b08 100644 --- a/clients/client-service-catalog/runtimeConfig.ts +++ b/clients/client-service-catalog/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-quotas/ServiceQuotasClient.ts b/clients/client-service-quotas/ServiceQuotasClient.ts index 678437a9809a6..65f190bca7928 100644 --- a/clients/client-service-quotas/ServiceQuotasClient.ts +++ b/clients/client-service-quotas/ServiceQuotasClient.ts @@ -90,6 +90,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -100,6 +101,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ServiceQuotasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +241,8 @@ export type ServiceQuotasClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceQuotasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +250,8 @@ export type ServiceQuotasClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Service Quotas is a web service that you can use to manage many of your AWS service @@ -282,16 +284,16 @@ export class ServiceQuotasClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-quotas/runtimeConfig.browser.ts b/clients/client-service-quotas/runtimeConfig.browser.ts index 458ce3ce4e711..4c2530d44711a 100644 --- a/clients/client-service-quotas/runtimeConfig.browser.ts +++ b/clients/client-service-quotas/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-quotas/runtimeConfig.native.ts b/clients/client-service-quotas/runtimeConfig.native.ts index 30fe2aecdc136..48a66cb351d54 100644 --- a/clients/client-service-quotas/runtimeConfig.native.ts +++ b/clients/client-service-quotas/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceQuotasClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-quotas/runtimeConfig.ts b/clients/client-service-quotas/runtimeConfig.ts index 91e9eefda9741..c2fdff91ba5cc 100644 --- a/clients/client-service-quotas/runtimeConfig.ts +++ b/clients/client-service-quotas/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-servicediscovery/ServiceDiscoveryClient.ts b/clients/client-servicediscovery/ServiceDiscoveryClient.ts index d020d85f32a11..06b4bee3c5b28 100644 --- a/clients/client-servicediscovery/ServiceDiscoveryClient.ts +++ b/clients/client-servicediscovery/ServiceDiscoveryClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ServiceDiscoveryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +241,8 @@ export type ServiceDiscoveryClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceDiscoveryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +250,8 @@ export type ServiceDiscoveryClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Cloud Map lets you configure public DNS, private DNS, or HTTP namespaces that your microservice applications @@ -275,16 +277,16 @@ export class ServiceDiscoveryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-servicediscovery/runtimeConfig.browser.ts b/clients/client-servicediscovery/runtimeConfig.browser.ts index 994ee89c31f0a..ea0862b9b9986 100644 --- a/clients/client-servicediscovery/runtimeConfig.browser.ts +++ b/clients/client-servicediscovery/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-servicediscovery/runtimeConfig.native.ts b/clients/client-servicediscovery/runtimeConfig.native.ts index 944f125275e08..acaccf3a0df37 100644 --- a/clients/client-servicediscovery/runtimeConfig.native.ts +++ b/clients/client-servicediscovery/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceDiscoveryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-servicediscovery/runtimeConfig.ts b/clients/client-servicediscovery/runtimeConfig.ts index b7ee53509b50c..6cd56a0abcfef 100644 --- a/clients/client-servicediscovery/runtimeConfig.ts +++ b/clients/client-servicediscovery/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ses/SESClient.ts b/clients/client-ses/SESClient.ts index a5907055bcd98..6c43098d25177 100644 --- a/clients/client-ses/SESClient.ts +++ b/clients/client-ses/SESClient.ts @@ -256,6 +256,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -266,6 +267,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -461,11 +463,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -507,6 +504,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SESClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -515,8 +517,8 @@ export type SESClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SESClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -524,8 +526,8 @@ export type SESClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Email Service @@ -555,16 +557,16 @@ export class SESClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ses/runtimeConfig.browser.ts b/clients/client-ses/runtimeConfig.browser.ts index 26eb616cdfb73..112b4c409eefc 100644 --- a/clients/client-ses/runtimeConfig.browser.ts +++ b/clients/client-ses/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ses/runtimeConfig.native.ts b/clients/client-ses/runtimeConfig.native.ts index 51f65df33326e..1bb017439ca7a 100644 --- a/clients/client-ses/runtimeConfig.native.ts +++ b/clients/client-ses/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SESClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ses/runtimeConfig.ts b/clients/client-ses/runtimeConfig.ts index f014c7db40574..b8cae9fb2b305 100644 --- a/clients/client-ses/runtimeConfig.ts +++ b/clients/client-ses/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sesv2/SESv2Client.ts b/clients/client-sesv2/SESv2Client.ts index aab8855655969..c72d47802a372 100644 --- a/clients/client-sesv2/SESv2Client.ts +++ b/clients/client-sesv2/SESv2Client.ts @@ -283,6 +283,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -293,6 +294,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -506,11 +508,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -552,6 +549,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SESv2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -560,8 +562,8 @@ export type SESv2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SESv2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -569,8 +571,8 @@ export type SESv2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon SES API v2 @@ -611,16 +613,16 @@ export class SESv2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sesv2/runtimeConfig.browser.ts b/clients/client-sesv2/runtimeConfig.browser.ts index a540a3f328022..ea6b1ecd610f9 100644 --- a/clients/client-sesv2/runtimeConfig.browser.ts +++ b/clients/client-sesv2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sesv2/runtimeConfig.native.ts b/clients/client-sesv2/runtimeConfig.native.ts index 643610f632566..de4ce746efe7c 100644 --- a/clients/client-sesv2/runtimeConfig.native.ts +++ b/clients/client-sesv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SESv2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sesv2/runtimeConfig.ts b/clients/client-sesv2/runtimeConfig.ts index 29dfbbbfe6c0c..449130336f14d 100644 --- a/clients/client-sesv2/runtimeConfig.ts +++ b/clients/client-sesv2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sfn/SFNClient.ts b/clients/client-sfn/SFNClient.ts index f900342f62369..e1ef4297b3155 100644 --- a/clients/client-sfn/SFNClient.ts +++ b/clients/client-sfn/SFNClient.ts @@ -70,6 +70,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -80,6 +81,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SFNClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +235,8 @@ export type SFNClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SFNClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +244,8 @@ export type SFNClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Step Functions @@ -280,16 +282,16 @@ export class SFNClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sfn/runtimeConfig.browser.ts b/clients/client-sfn/runtimeConfig.browser.ts index 29ff52e06066b..77db5490b882e 100644 --- a/clients/client-sfn/runtimeConfig.browser.ts +++ b/clients/client-sfn/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sfn/runtimeConfig.native.ts b/clients/client-sfn/runtimeConfig.native.ts index a7b55e5cb611b..00d159d01f9dc 100644 --- a/clients/client-sfn/runtimeConfig.native.ts +++ b/clients/client-sfn/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SFNClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sfn/runtimeConfig.ts b/clients/client-sfn/runtimeConfig.ts index afb547724557d..cb1b843eac41c 100644 --- a/clients/client-sfn/runtimeConfig.ts +++ b/clients/client-sfn/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-shield/ShieldClient.ts b/clients/client-shield/ShieldClient.ts index 927bd005b20e4..4f3ec7b564a1d 100644 --- a/clients/client-shield/ShieldClient.ts +++ b/clients/client-shield/ShieldClient.ts @@ -122,6 +122,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -132,6 +133,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type ShieldClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +301,8 @@ export type ShieldClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ShieldClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +310,8 @@ export type ShieldClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Shield Advanced @@ -334,16 +336,16 @@ export class ShieldClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-shield/runtimeConfig.browser.ts b/clients/client-shield/runtimeConfig.browser.ts index e68cfe313d51d..a8fbdedc13341 100644 --- a/clients/client-shield/runtimeConfig.browser.ts +++ b/clients/client-shield/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-shield/runtimeConfig.native.ts b/clients/client-shield/runtimeConfig.native.ts index 8c9823e405af8..0ec8cbf92b197 100644 --- a/clients/client-shield/runtimeConfig.native.ts +++ b/clients/client-shield/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ShieldClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-shield/runtimeConfig.ts b/clients/client-shield/runtimeConfig.ts index 947252f497821..c7d0173b8d658 100644 --- a/clients/client-shield/runtimeConfig.ts +++ b/clients/client-shield/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-signer/SignerClient.ts b/clients/client-signer/SignerClient.ts index 7ef9a065778f8..85aad02683c89 100644 --- a/clients/client-signer/SignerClient.ts +++ b/clients/client-signer/SignerClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -173,11 +175,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -219,6 +216,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SignerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -227,8 +229,8 @@ export type SignerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SignerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -236,8 +238,8 @@ export type SignerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Signer is a fully managed code signing service to help you ensure the trust and @@ -275,16 +277,16 @@ export class SignerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-signer/runtimeConfig.browser.ts b/clients/client-signer/runtimeConfig.browser.ts index 8a57aa7d2a725..cedeb3fcd334e 100644 --- a/clients/client-signer/runtimeConfig.browser.ts +++ b/clients/client-signer/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-signer/runtimeConfig.native.ts b/clients/client-signer/runtimeConfig.native.ts index fbd2cc504fa73..a4baf366b8948 100644 --- a/clients/client-signer/runtimeConfig.native.ts +++ b/clients/client-signer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SignerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-signer/runtimeConfig.ts b/clients/client-signer/runtimeConfig.ts index 50a3939ca2e94..d7b75f4214193 100644 --- a/clients/client-signer/runtimeConfig.ts +++ b/clients/client-signer/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sms/SMSClient.ts b/clients/client-sms/SMSClient.ts index de5f6db2966d1..f67c466feafab 100644 --- a/clients/client-sms/SMSClient.ts +++ b/clients/client-sms/SMSClient.ts @@ -130,6 +130,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -140,6 +141,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +319,8 @@ export type SMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +328,8 @@ export type SMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Server Migration Service @@ -365,16 +367,16 @@ export class SMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sms/runtimeConfig.browser.ts b/clients/client-sms/runtimeConfig.browser.ts index 8232328b3c511..4dd748f065e0d 100644 --- a/clients/client-sms/runtimeConfig.browser.ts +++ b/clients/client-sms/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sms/runtimeConfig.native.ts b/clients/client-sms/runtimeConfig.native.ts index 4bc1ab9e5b035..c95fc3ed6760f 100644 --- a/clients/client-sms/runtimeConfig.native.ts +++ b/clients/client-sms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sms/runtimeConfig.ts b/clients/client-sms/runtimeConfig.ts index eba8fc1d468f1..a614397e0c508 100644 --- a/clients/client-sms/runtimeConfig.ts +++ b/clients/client-sms/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-snowball/SnowballClient.ts b/clients/client-snowball/SnowballClient.ts index 8e4333a77d91d..02afef61061bb 100644 --- a/clients/client-snowball/SnowballClient.ts +++ b/clients/client-snowball/SnowballClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SnowballClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +232,8 @@ export type SnowballClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SnowballClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +241,8 @@ export type SnowballClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Snow Family is a petabyte-scale data transport solution that uses secure devices to @@ -268,16 +270,16 @@ export class SnowballClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-snowball/runtimeConfig.browser.ts b/clients/client-snowball/runtimeConfig.browser.ts index 6d4ae01f4a08f..895c3c9f54acd 100644 --- a/clients/client-snowball/runtimeConfig.browser.ts +++ b/clients/client-snowball/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-snowball/runtimeConfig.native.ts b/clients/client-snowball/runtimeConfig.native.ts index ec4eea64dda56..2d91706b1deba 100644 --- a/clients/client-snowball/runtimeConfig.native.ts +++ b/clients/client-snowball/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SnowballClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-snowball/runtimeConfig.ts b/clients/client-snowball/runtimeConfig.ts index 5bb03ff898395..df1d09486ed63 100644 --- a/clients/client-snowball/runtimeConfig.ts +++ b/clients/client-snowball/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sns/SNSClient.ts b/clients/client-sns/SNSClient.ts index 70e7b04843675..4dcb119a2583f 100644 --- a/clients/client-sns/SNSClient.ts +++ b/clients/client-sns/SNSClient.ts @@ -116,6 +116,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -126,6 +127,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SNSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +301,8 @@ export type SNSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SNSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +310,8 @@ export type SNSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Notification Service @@ -344,16 +346,16 @@ export class SNSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sns/runtimeConfig.browser.ts b/clients/client-sns/runtimeConfig.browser.ts index 7a32870c37435..452ed689c8de3 100644 --- a/clients/client-sns/runtimeConfig.browser.ts +++ b/clients/client-sns/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sns/runtimeConfig.native.ts b/clients/client-sns/runtimeConfig.native.ts index afffe39183728..d2f5fa43ba094 100644 --- a/clients/client-sns/runtimeConfig.native.ts +++ b/clients/client-sns/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SNSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sns/runtimeConfig.ts b/clients/client-sns/runtimeConfig.ts index 9cdebd29a8028..d4bb69d311fd8 100644 --- a/clients/client-sns/runtimeConfig.ts +++ b/clients/client-sns/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sqs/SQSClient.ts b/clients/client-sqs/SQSClient.ts index f046232304d7b..63faa4b01a358 100644 --- a/clients/client-sqs/SQSClient.ts +++ b/clients/client-sqs/SQSClient.ts @@ -64,6 +64,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -74,6 +75,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -219,6 +216,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * that computes MD5 hashes */ md5?: __HashConstructor; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SQSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -227,8 +229,8 @@ export type SQSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SQSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -236,8 +238,8 @@ export type SQSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the Amazon Simple Queue Service API Reference.

@@ -327,16 +329,16 @@ export class SQSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sqs/runtimeConfig.browser.ts b/clients/client-sqs/runtimeConfig.browser.ts index c7810b4c2efc3..f01a401349d15 100644 --- a/clients/client-sqs/runtimeConfig.browser.ts +++ b/clients/client-sqs/runtimeConfig.browser.ts @@ -23,7 +23,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, md5: Md5, region: invalidAsyncFunction("Region is missing") as any, diff --git a/clients/client-sqs/runtimeConfig.native.ts b/clients/client-sqs/runtimeConfig.native.ts index 382075f732688..747f3fc27b68d 100644 --- a/clients/client-sqs/runtimeConfig.native.ts +++ b/clients/client-sqs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SQSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sqs/runtimeConfig.ts b/clients/client-sqs/runtimeConfig.ts index 1bd7ef89c53b4..e07b48b8afd6f 100644 --- a/clients/client-sqs/runtimeConfig.ts +++ b/clients/client-sqs/runtimeConfig.ts @@ -25,7 +25,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), md5: Hash.bind(null, "md5"), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), diff --git a/clients/client-ssm/SSMClient.ts b/clients/client-ssm/SSMClient.ts index df1d89e3066d6..b3522c447d2af 100644 --- a/clients/client-ssm/SSMClient.ts +++ b/clients/client-ssm/SSMClient.ts @@ -411,6 +411,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -421,6 +422,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -728,11 +730,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -774,6 +771,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -782,8 +784,8 @@ export type SSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -791,8 +793,8 @@ export type SSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Systems Manager @@ -827,16 +829,16 @@ export class SSMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ssm/runtimeConfig.browser.ts b/clients/client-ssm/runtimeConfig.browser.ts index 188eb31b35b24..0c35f0bb7df9a 100644 --- a/clients/client-ssm/runtimeConfig.browser.ts +++ b/clients/client-ssm/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ssm/runtimeConfig.native.ts b/clients/client-ssm/runtimeConfig.native.ts index fc2dc4d37ef40..9152a78f57a4f 100644 --- a/clients/client-ssm/runtimeConfig.native.ts +++ b/clients/client-ssm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ssm/runtimeConfig.ts b/clients/client-ssm/runtimeConfig.ts index c6629bfe3fa02..3b902393d7e53 100644 --- a/clients/client-ssm/runtimeConfig.ts +++ b/clients/client-ssm/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso-admin/SSOAdminClient.ts b/clients/client-sso-admin/SSOAdminClient.ts index 4fbab42fab83f..aa48c776223c4 100644 --- a/clients/client-sso-admin/SSOAdminClient.ts +++ b/clients/client-sso-admin/SSOAdminClient.ts @@ -147,6 +147,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -157,6 +158,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SSOAdminClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +328,8 @@ export type SSOAdminClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOAdminClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +337,8 @@ export type SSOAdminClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class SSOAdminClient extends __Client< __HttpHandlerOptions, @@ -355,16 +357,16 @@ export class SSOAdminClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso-admin/runtimeConfig.browser.ts b/clients/client-sso-admin/runtimeConfig.browser.ts index ff78878335bc7..21a9dc8512028 100644 --- a/clients/client-sso-admin/runtimeConfig.browser.ts +++ b/clients/client-sso-admin/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso-admin/runtimeConfig.native.ts b/clients/client-sso-admin/runtimeConfig.native.ts index 65e01ed51b199..7f6c1a49eb890 100644 --- a/clients/client-sso-admin/runtimeConfig.native.ts +++ b/clients/client-sso-admin/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOAdminClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso-admin/runtimeConfig.ts b/clients/client-sso-admin/runtimeConfig.ts index 13a07e4a37c74..caac3779de3ac 100644 --- a/clients/client-sso-admin/runtimeConfig.ts +++ b/clients/client-sso-admin/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso-oidc/SSOOIDCClient.ts b/clients/client-sso-oidc/SSOOIDCClient.ts index c83e0ea341620..06363bb1c7843 100644 --- a/clients/client-sso-oidc/SSOOIDCClient.ts +++ b/clients/client-sso-oidc/SSOOIDCClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -105,11 +107,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -151,6 +148,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SSOOIDCClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -159,8 +161,8 @@ export type SSOOIDCClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOOIDCClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -168,8 +170,8 @@ export type SSOOIDCClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Single Sign-On (SSO) OpenID Connect (OIDC) is a web service that enables a client @@ -208,15 +210,15 @@ export class SSOOIDCClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso-oidc/runtimeConfig.browser.ts b/clients/client-sso-oidc/runtimeConfig.browser.ts index c1f6b89f069a0..92434b6f824b0 100644 --- a/clients/client-sso-oidc/runtimeConfig.browser.ts +++ b/clients/client-sso-oidc/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso-oidc/runtimeConfig.native.ts b/clients/client-sso-oidc/runtimeConfig.native.ts index 2d6edb1f73af6..ca0e0299d2f0e 100644 --- a/clients/client-sso-oidc/runtimeConfig.native.ts +++ b/clients/client-sso-oidc/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOOIDCClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso-oidc/runtimeConfig.ts b/clients/client-sso-oidc/runtimeConfig.ts index bb96ed7e71605..c6131625c8f91 100644 --- a/clients/client-sso-oidc/runtimeConfig.ts +++ b/clients/client-sso-oidc/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso/SSOClient.ts b/clients/client-sso/SSOClient.ts index 78f0f7250c8e0..2e82a80aaeba5 100644 --- a/clients/client-sso/SSOClient.ts +++ b/clients/client-sso/SSOClient.ts @@ -34,6 +34,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -44,6 +45,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -105,11 +107,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -151,6 +148,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SSOClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -159,8 +161,8 @@ export type SSOClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -168,8 +170,8 @@ export type SSOClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Single Sign-On Portal is a web service that makes it easy for you to assign user @@ -206,15 +208,15 @@ export class SSOClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso/runtimeConfig.browser.ts b/clients/client-sso/runtimeConfig.browser.ts index e0586f6519e2d..5d1a744643328 100644 --- a/clients/client-sso/runtimeConfig.browser.ts +++ b/clients/client-sso/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso/runtimeConfig.native.ts b/clients/client-sso/runtimeConfig.native.ts index d8ad68c511e87..3ad0db426b847 100644 --- a/clients/client-sso/runtimeConfig.native.ts +++ b/clients/client-sso/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso/runtimeConfig.ts b/clients/client-sso/runtimeConfig.ts index 789068a8fee1c..b494cdff30d23 100644 --- a/clients/client-sso/runtimeConfig.ts +++ b/clients/client-sso/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-storage-gateway/StorageGatewayClient.ts b/clients/client-storage-gateway/StorageGatewayClient.ts index e19ddd02316cb..888c18dbb117e 100644 --- a/clients/client-storage-gateway/StorageGatewayClient.ts +++ b/clients/client-storage-gateway/StorageGatewayClient.ts @@ -254,6 +254,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -264,6 +265,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -485,11 +487,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -531,6 +528,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type StorageGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -539,8 +541,8 @@ export type StorageGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type StorageGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -548,8 +550,8 @@ export type StorageGatewayClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Storage Gateway Service @@ -642,16 +644,16 @@ export class StorageGatewayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-storage-gateway/runtimeConfig.browser.ts b/clients/client-storage-gateway/runtimeConfig.browser.ts index 66830ce32ac70..5a64d6d948d00 100644 --- a/clients/client-storage-gateway/runtimeConfig.browser.ts +++ b/clients/client-storage-gateway/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-storage-gateway/runtimeConfig.native.ts b/clients/client-storage-gateway/runtimeConfig.native.ts index cc6d1c0ac637a..ce154893764f6 100644 --- a/clients/client-storage-gateway/runtimeConfig.native.ts +++ b/clients/client-storage-gateway/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./StorageGatewayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-storage-gateway/runtimeConfig.ts b/clients/client-storage-gateway/runtimeConfig.ts index 8c73ede9abd22..6963c09e410b8 100644 --- a/clients/client-storage-gateway/runtimeConfig.ts +++ b/clients/client-storage-gateway/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sts/STSClient.ts b/clients/client-sts/STSClient.ts index b5554ddbccc25..d8be5bd5c5aa5 100644 --- a/clients/client-sts/STSClient.ts +++ b/clients/client-sts/STSClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -123,11 +125,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -169,6 +166,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type STSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -177,8 +179,8 @@ export type STSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type STSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -186,8 +188,8 @@ export type STSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Security Token Service @@ -213,15 +215,15 @@ export class STSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sts/runtimeConfig.browser.ts b/clients/client-sts/runtimeConfig.browser.ts index 51151068b48d9..584448a5d9ff1 100644 --- a/clients/client-sts/runtimeConfig.browser.ts +++ b/clients/client-sts/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sts/runtimeConfig.native.ts b/clients/client-sts/runtimeConfig.native.ts index 5161b3c6ef3ed..18c5e144a2e0e 100644 --- a/clients/client-sts/runtimeConfig.native.ts +++ b/clients/client-sts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./STSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sts/runtimeConfig.ts b/clients/client-sts/runtimeConfig.ts index 7b79d9cf829bf..d65738134d112 100644 --- a/clients/client-sts/runtimeConfig.ts +++ b/clients/client-sts/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-support/SupportClient.ts b/clients/client-support/SupportClient.ts index effc949b286ab..6484cd5b2b76e 100644 --- a/clients/client-support/SupportClient.ts +++ b/clients/client-support/SupportClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SupportClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +223,8 @@ export type SupportClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SupportClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +232,8 @@ export type SupportClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Support @@ -329,16 +331,16 @@ export class SupportClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-support/runtimeConfig.browser.ts b/clients/client-support/runtimeConfig.browser.ts index 7263a91ad5627..570dba6d72021 100644 --- a/clients/client-support/runtimeConfig.browser.ts +++ b/clients/client-support/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-support/runtimeConfig.native.ts b/clients/client-support/runtimeConfig.native.ts index 91f90d7b10574..dc58990668d10 100644 --- a/clients/client-support/runtimeConfig.native.ts +++ b/clients/client-support/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SupportClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-support/runtimeConfig.ts b/clients/client-support/runtimeConfig.ts index 6eb899b68ab3d..0913bb982d598 100644 --- a/clients/client-support/runtimeConfig.ts +++ b/clients/client-support/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-swf/SWFClient.ts b/clients/client-swf/SWFClient.ts index 0bca73e993ffd..deeb675b974a2 100644 --- a/clients/client-swf/SWFClient.ts +++ b/clients/client-swf/SWFClient.ts @@ -156,6 +156,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -166,6 +167,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SWFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +349,8 @@ export type SWFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SWFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +358,8 @@ export type SWFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Workflow Service @@ -394,16 +396,16 @@ export class SWFClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-swf/runtimeConfig.browser.ts b/clients/client-swf/runtimeConfig.browser.ts index 59c0a7d26b5dd..3bc68a335a17d 100644 --- a/clients/client-swf/runtimeConfig.browser.ts +++ b/clients/client-swf/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-swf/runtimeConfig.native.ts b/clients/client-swf/runtimeConfig.native.ts index ff1e21573c415..2049ed2381d67 100644 --- a/clients/client-swf/runtimeConfig.native.ts +++ b/clients/client-swf/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SWFClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-swf/runtimeConfig.ts b/clients/client-swf/runtimeConfig.ts index 3e1b30d286a8c..81d1e5224f9b9 100644 --- a/clients/client-swf/runtimeConfig.ts +++ b/clients/client-swf/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-synthetics/SyntheticsClient.ts b/clients/client-synthetics/SyntheticsClient.ts index af58ef094e420..f762a58623275 100644 --- a/clients/client-synthetics/SyntheticsClient.ts +++ b/clients/client-synthetics/SyntheticsClient.ts @@ -57,6 +57,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -67,6 +68,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type SyntheticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +202,8 @@ export type SyntheticsClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SyntheticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +211,8 @@ export type SyntheticsClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudWatch Synthetics @@ -247,16 +249,16 @@ export class SyntheticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-synthetics/runtimeConfig.browser.ts b/clients/client-synthetics/runtimeConfig.browser.ts index 3178cc9c86a2a..5bed2acac5423 100644 --- a/clients/client-synthetics/runtimeConfig.browser.ts +++ b/clients/client-synthetics/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-synthetics/runtimeConfig.native.ts b/clients/client-synthetics/runtimeConfig.native.ts index e642b1b418320..4710dc382000b 100644 --- a/clients/client-synthetics/runtimeConfig.native.ts +++ b/clients/client-synthetics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SyntheticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-synthetics/runtimeConfig.ts b/clients/client-synthetics/runtimeConfig.ts index 56db6357918bb..96c7de3f1d791 100644 --- a/clients/client-synthetics/runtimeConfig.ts +++ b/clients/client-synthetics/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-textract/TextractClient.ts b/clients/client-textract/TextractClient.ts index f44c90ae41971..da6ff681a81aa 100644 --- a/clients/client-textract/TextractClient.ts +++ b/clients/client-textract/TextractClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type TextractClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +184,8 @@ export type TextractClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TextractClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +193,8 @@ export type TextractClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Textract detects and analyzes text in documents and converts it @@ -216,16 +218,16 @@ export class TextractClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-textract/runtimeConfig.browser.ts b/clients/client-textract/runtimeConfig.browser.ts index 7c9195aaf64e9..5cf8591557606 100644 --- a/clients/client-textract/runtimeConfig.browser.ts +++ b/clients/client-textract/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-textract/runtimeConfig.native.ts b/clients/client-textract/runtimeConfig.native.ts index 35710800d3e59..fed2a54e79dc7 100644 --- a/clients/client-textract/runtimeConfig.native.ts +++ b/clients/client-textract/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TextractClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-textract/runtimeConfig.ts b/clients/client-textract/runtimeConfig.ts index 6205f94126f6e..3b0a2d72ceac3 100644 --- a/clients/client-textract/runtimeConfig.ts +++ b/clients/client-textract/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-timestream-query/TimestreamQueryClient.ts b/clients/client-timestream-query/TimestreamQueryClient.ts index 2ba271e919db7..d4d8dcec36c07 100644 --- a/clients/client-timestream-query/TimestreamQueryClient.ts +++ b/clients/client-timestream-query/TimestreamQueryClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = CancelQueryCommandInput | DescribeEndpointsCommandInput | QueryCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type TimestreamQueryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +157,8 @@ export type TimestreamQueryClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TimestreamQueryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +166,8 @@ export type TimestreamQueryClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -189,16 +191,16 @@ export class TimestreamQueryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-timestream-query/runtimeConfig.browser.ts b/clients/client-timestream-query/runtimeConfig.browser.ts index 344860992f16d..ee26f2ac31d28 100644 --- a/clients/client-timestream-query/runtimeConfig.browser.ts +++ b/clients/client-timestream-query/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-timestream-query/runtimeConfig.native.ts b/clients/client-timestream-query/runtimeConfig.native.ts index f2dad327a3607..f1dc5f5891157 100644 --- a/clients/client-timestream-query/runtimeConfig.native.ts +++ b/clients/client-timestream-query/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TimestreamQueryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-timestream-query/runtimeConfig.ts b/clients/client-timestream-query/runtimeConfig.ts index 796e40438c88a..0559db23cb323 100644 --- a/clients/client-timestream-query/runtimeConfig.ts +++ b/clients/client-timestream-query/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-timestream-write/TimestreamWriteClient.ts b/clients/client-timestream-write/TimestreamWriteClient.ts index a0641cc2f60e2..73f8a3406d4f1 100644 --- a/clients/client-timestream-write/TimestreamWriteClient.ts +++ b/clients/client-timestream-write/TimestreamWriteClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type TimestreamWriteClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +202,8 @@ export type TimestreamWriteClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TimestreamWriteClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +211,8 @@ export type TimestreamWriteClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Timestream is a fast, scalable, fully managed time series database service that makes it easy to store and analyze trillions of time series data points per day. With Timestream, you can easily store and analyze IoT sensor data to derive insights from your IoT applications. You can analyze industrial telemetry to streamline equipment management and maintenance. You can also store and analyze log data and metrics to improve the performance and availability of your applications. Timestream is built from the ground up to effectively ingest, process, and store time series data. It organizes data to optimize query processing. It automatically scales based on the volume of data ingested and on the query volume to ensure you receive optimal performance while inserting and querying data. As your data grows over time, Timestream’s adaptive query processing engine spans across storage tiers to provide fast analysis while reducing costs.

@@ -232,16 +234,16 @@ export class TimestreamWriteClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-timestream-write/runtimeConfig.browser.ts b/clients/client-timestream-write/runtimeConfig.browser.ts index c9ababccb0dbd..6b152bb15a1e0 100644 --- a/clients/client-timestream-write/runtimeConfig.browser.ts +++ b/clients/client-timestream-write/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-timestream-write/runtimeConfig.native.ts b/clients/client-timestream-write/runtimeConfig.native.ts index 88055c11c8d4c..764bd1a272231 100644 --- a/clients/client-timestream-write/runtimeConfig.native.ts +++ b/clients/client-timestream-write/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TimestreamWriteClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-timestream-write/runtimeConfig.ts b/clients/client-timestream-write/runtimeConfig.ts index f0b8a1d5a275c..621ca0c0157fc 100644 --- a/clients/client-timestream-write/runtimeConfig.ts +++ b/clients/client-timestream-write/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-transcribe-streaming/TranscribeStreamingClient.ts b/clients/client-transcribe-streaming/TranscribeStreamingClient.ts index aa7ff40c3a8b7..c7340748b227b 100644 --- a/clients/client-transcribe-streaming/TranscribeStreamingClient.ts +++ b/clients/client-transcribe-streaming/TranscribeStreamingClient.ts @@ -59,6 +59,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = StartMedicalStreamTranscriptionCommandInput | StartStreamTranscriptionCommandInput; @@ -124,11 +126,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -176,6 +173,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ eventStreamPayloadHandlerProvider?: __EventStreamPayloadHandlerProvider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -188,10 +190,10 @@ export type TranscribeStreamingClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & EventStreamInputConfig & WebSocketInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type TranscribeStreamingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -200,10 +202,10 @@ export type TranscribeStreamingClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & EventStreamResolvedConfig & WebSocketResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -226,20 +228,20 @@ export class TranscribeStreamingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveEventStreamConfig(_config_6); - let _config_8 = resolveWebSocketConfig(_config_7); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveEventStreamConfig(_config_5); + let _config_7 = resolveWebSocketConfig(_config_6); + let _config_8 = resolveUserAgentConfig(_config_7); let _config_9 = resolveEventStreamSerdeConfig(_config_8); super(_config_9); this.config = _config_9; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getWebSocketPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transcribe-streaming/runtimeConfig.browser.ts b/clients/client-transcribe-streaming/runtimeConfig.browser.ts index 4657be4850b73..5b4fcc3d2202a 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.browser.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.browser.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: () => eventStreamPayloadHandler, eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, diff --git a/clients/client-transcribe-streaming/runtimeConfig.native.ts b/clients/client-transcribe-streaming/runtimeConfig.native.ts index e9dfb74bf5354..c5de4261d5734 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.native.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { WebSocketHandler, eventStreamPayloadHandler } from "@aws-sdk/middleware-sdk-transcribe-streaming"; import { parseUrl } from "@aws-sdk/url-parser-node"; @@ -12,7 +10,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, eventStreamPayloadHandlerProvider: () => eventStreamPayloadHandler, requestHandler: new WebSocketHandler(), sha256: Sha256, diff --git a/clients/client-transcribe-streaming/runtimeConfig.ts b/clients/client-transcribe-streaming/runtimeConfig.ts index 5af99a4b1355a..493b5892df7dd 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.ts @@ -26,7 +26,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider, eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), diff --git a/clients/client-transcribe/TranscribeClient.ts b/clients/client-transcribe/TranscribeClient.ts index 3bd7170fc4b34..8117f0394ccc0 100644 --- a/clients/client-transcribe/TranscribeClient.ts +++ b/clients/client-transcribe/TranscribeClient.ts @@ -125,6 +125,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -135,6 +136,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -242,11 +244,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -288,6 +285,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type TranscribeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -296,8 +298,8 @@ export type TranscribeClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TranscribeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -305,8 +307,8 @@ export type TranscribeClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Operations and objects for transcribing speech to text.

@@ -328,16 +330,16 @@ export class TranscribeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transcribe/runtimeConfig.browser.ts b/clients/client-transcribe/runtimeConfig.browser.ts index fe63667d11153..fe275d859be01 100644 --- a/clients/client-transcribe/runtimeConfig.browser.ts +++ b/clients/client-transcribe/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-transcribe/runtimeConfig.native.ts b/clients/client-transcribe/runtimeConfig.native.ts index 2f32f23632c6b..2e3c754e7de3d 100644 --- a/clients/client-transcribe/runtimeConfig.native.ts +++ b/clients/client-transcribe/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TranscribeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-transcribe/runtimeConfig.ts b/clients/client-transcribe/runtimeConfig.ts index de3621cfa373b..281fd9108fdc3 100644 --- a/clients/client-transcribe/runtimeConfig.ts +++ b/clients/client-transcribe/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-transfer/TransferClient.ts b/clients/client-transfer/TransferClient.ts index 8aea33e09ce80..834eec6872e8c 100644 --- a/clients/client-transfer/TransferClient.ts +++ b/clients/client-transfer/TransferClient.ts @@ -67,6 +67,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -77,6 +78,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type TransferClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +226,8 @@ export type TransferClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TransferClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +235,8 @@ export type TransferClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Transfer Family is a fully managed service that enables the transfer of files over the @@ -264,16 +266,16 @@ export class TransferClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transfer/runtimeConfig.browser.ts b/clients/client-transfer/runtimeConfig.browser.ts index 0d93781eac69d..7758b1023f377 100644 --- a/clients/client-transfer/runtimeConfig.browser.ts +++ b/clients/client-transfer/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-transfer/runtimeConfig.native.ts b/clients/client-transfer/runtimeConfig.native.ts index c862aa79ea005..b92ae70576e4e 100644 --- a/clients/client-transfer/runtimeConfig.native.ts +++ b/clients/client-transfer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TransferClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-transfer/runtimeConfig.ts b/clients/client-transfer/runtimeConfig.ts index 972871d41fabf..c1180f56813a9 100644 --- a/clients/client-transfer/runtimeConfig.ts +++ b/clients/client-transfer/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-translate/TranslateClient.ts b/clients/client-translate/TranslateClient.ts index 4329be8139ff3..c456666454aff 100644 --- a/clients/client-translate/TranslateClient.ts +++ b/clients/client-translate/TranslateClient.ts @@ -61,6 +61,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type TranslateClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +208,8 @@ export type TranslateClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TranslateClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +217,8 @@ export type TranslateClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides translation between one source language and another of the same set of @@ -239,16 +241,16 @@ export class TranslateClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-translate/runtimeConfig.browser.ts b/clients/client-translate/runtimeConfig.browser.ts index 3dc5a28957f9b..593f1346604f0 100644 --- a/clients/client-translate/runtimeConfig.browser.ts +++ b/clients/client-translate/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-translate/runtimeConfig.native.ts b/clients/client-translate/runtimeConfig.native.ts index e6bd39b75c175..6fdd202c6526e 100644 --- a/clients/client-translate/runtimeConfig.native.ts +++ b/clients/client-translate/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TranslateClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-translate/runtimeConfig.ts b/clients/client-translate/runtimeConfig.ts index 06c4382f37235..09d8f6d669cde 100644 --- a/clients/client-translate/runtimeConfig.ts +++ b/clients/client-translate/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-waf-regional/WAFRegionalClient.ts b/clients/client-waf-regional/WAFRegionalClient.ts index 997a77ed2c41d..0439927370ee8 100644 --- a/clients/client-waf-regional/WAFRegionalClient.ts +++ b/clients/client-waf-regional/WAFRegionalClient.ts @@ -221,6 +221,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -231,6 +232,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -446,11 +448,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -492,6 +489,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WAFRegionalClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -500,8 +502,8 @@ export type WAFRegionalClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFRegionalClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -509,8 +511,8 @@ export type WAFRegionalClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -542,16 +544,16 @@ export class WAFRegionalClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-waf-regional/runtimeConfig.browser.ts b/clients/client-waf-regional/runtimeConfig.browser.ts index 2607d15e90996..35bfa32c1ed36 100644 --- a/clients/client-waf-regional/runtimeConfig.browser.ts +++ b/clients/client-waf-regional/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-waf-regional/runtimeConfig.native.ts b/clients/client-waf-regional/runtimeConfig.native.ts index ada1c500934c4..bc6f447ea9bea 100644 --- a/clients/client-waf-regional/runtimeConfig.native.ts +++ b/clients/client-waf-regional/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFRegionalClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-waf-regional/runtimeConfig.ts b/clients/client-waf-regional/runtimeConfig.ts index 2527c39138444..eccb4b27ef73d 100644 --- a/clients/client-waf-regional/runtimeConfig.ts +++ b/clients/client-waf-regional/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-waf/WAFClient.ts b/clients/client-waf/WAFClient.ts index e42413b835940..dd0dfd898d9f3 100644 --- a/clients/client-waf/WAFClient.ts +++ b/clients/client-waf/WAFClient.ts @@ -211,6 +211,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -221,6 +222,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -428,11 +430,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -474,6 +471,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WAFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -482,8 +484,8 @@ export type WAFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -491,8 +493,8 @@ export type WAFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -524,16 +526,16 @@ export class WAFClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-waf/runtimeConfig.browser.ts b/clients/client-waf/runtimeConfig.browser.ts index f91cf67d9a882..3ee728231f15f 100644 --- a/clients/client-waf/runtimeConfig.browser.ts +++ b/clients/client-waf/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-waf/runtimeConfig.native.ts b/clients/client-waf/runtimeConfig.native.ts index 1f15f0fbe641a..c1e3c02236bbe 100644 --- a/clients/client-waf/runtimeConfig.native.ts +++ b/clients/client-waf/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-waf/runtimeConfig.ts b/clients/client-waf/runtimeConfig.ts index 2d058499eb910..4671d8c0212f9 100644 --- a/clients/client-waf/runtimeConfig.ts +++ b/clients/client-waf/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-wafv2/WAFV2Client.ts b/clients/client-wafv2/WAFV2Client.ts index 7b291054c4de2..5e191f4a270dc 100644 --- a/clients/client-wafv2/WAFV2Client.ts +++ b/clients/client-wafv2/WAFV2Client.ts @@ -129,6 +129,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -139,6 +140,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WAFV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +328,8 @@ export type WAFV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +337,8 @@ export type WAFV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -414,16 +416,16 @@ export class WAFV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-wafv2/runtimeConfig.browser.ts b/clients/client-wafv2/runtimeConfig.browser.ts index d724f23f635dd..046fed1862680 100644 --- a/clients/client-wafv2/runtimeConfig.browser.ts +++ b/clients/client-wafv2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-wafv2/runtimeConfig.native.ts b/clients/client-wafv2/runtimeConfig.native.ts index 6d4f6ffe94a1b..e8f9e21c4f94f 100644 --- a/clients/client-wafv2/runtimeConfig.native.ts +++ b/clients/client-wafv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-wafv2/runtimeConfig.ts b/clients/client-wafv2/runtimeConfig.ts index 938f7f6d8979d..c04426b795b56 100644 --- a/clients/client-wafv2/runtimeConfig.ts +++ b/clients/client-wafv2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workdocs/WorkDocsClient.ts b/clients/client-workdocs/WorkDocsClient.ts index bceaa86fe5f69..1c7c1bc1fa3ef 100644 --- a/clients/client-workdocs/WorkDocsClient.ts +++ b/clients/client-workdocs/WorkDocsClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WorkDocsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +325,8 @@ export type WorkDocsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkDocsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +334,8 @@ export type WorkDocsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The WorkDocs API is designed for the following use cases:

@@ -387,16 +389,16 @@ export class WorkDocsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workdocs/runtimeConfig.browser.ts b/clients/client-workdocs/runtimeConfig.browser.ts index e20215bf0c639..5f3bd2d5b9026 100644 --- a/clients/client-workdocs/runtimeConfig.browser.ts +++ b/clients/client-workdocs/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workdocs/runtimeConfig.native.ts b/clients/client-workdocs/runtimeConfig.native.ts index 8937246365f1b..5c9b238d1b67c 100644 --- a/clients/client-workdocs/runtimeConfig.native.ts +++ b/clients/client-workdocs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkDocsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workdocs/runtimeConfig.ts b/clients/client-workdocs/runtimeConfig.ts index 458f9b20e533a..a8a6899cf8b84 100644 --- a/clients/client-workdocs/runtimeConfig.ts +++ b/clients/client-workdocs/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-worklink/WorkLinkClient.ts b/clients/client-worklink/WorkLinkClient.ts index e9ae05b9e611f..d31f74f85453f 100644 --- a/clients/client-worklink/WorkLinkClient.ts +++ b/clients/client-worklink/WorkLinkClient.ts @@ -128,6 +128,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -138,6 +139,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -257,11 +259,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -303,6 +300,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WorkLinkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -311,8 +313,8 @@ export type WorkLinkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkLinkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -320,8 +322,8 @@ export type WorkLinkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon WorkLink is a cloud-based service that provides secure access @@ -349,16 +351,16 @@ export class WorkLinkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-worklink/runtimeConfig.browser.ts b/clients/client-worklink/runtimeConfig.browser.ts index 25670e2c8ea0e..b4fbea1cd968d 100644 --- a/clients/client-worklink/runtimeConfig.browser.ts +++ b/clients/client-worklink/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-worklink/runtimeConfig.native.ts b/clients/client-worklink/runtimeConfig.native.ts index abcc18ec5e853..b34e35b0027f8 100644 --- a/clients/client-worklink/runtimeConfig.native.ts +++ b/clients/client-worklink/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkLinkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-worklink/runtimeConfig.ts b/clients/client-worklink/runtimeConfig.ts index 5d88e326f001f..8a4a20641e01d 100644 --- a/clients/client-worklink/runtimeConfig.ts +++ b/clients/client-worklink/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workmail/WorkMailClient.ts b/clients/client-workmail/WorkMailClient.ts index a574302885f7b..783b668a3e07c 100644 --- a/clients/client-workmail/WorkMailClient.ts +++ b/clients/client-workmail/WorkMailClient.ts @@ -101,6 +101,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -111,6 +112,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -230,11 +232,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -276,6 +273,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WorkMailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -284,8 +286,8 @@ export type WorkMailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkMailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -293,8 +295,8 @@ export type WorkMailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon WorkMail is a secure, managed business email and calendaring service with support for @@ -350,16 +352,16 @@ export class WorkMailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workmail/runtimeConfig.browser.ts b/clients/client-workmail/runtimeConfig.browser.ts index 3e89fe07279bd..a50bdf43e8f9a 100644 --- a/clients/client-workmail/runtimeConfig.browser.ts +++ b/clients/client-workmail/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workmail/runtimeConfig.native.ts b/clients/client-workmail/runtimeConfig.native.ts index 267f6a91b508a..c4a1cc49ca210 100644 --- a/clients/client-workmail/runtimeConfig.native.ts +++ b/clients/client-workmail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkMailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workmail/runtimeConfig.ts b/clients/client-workmail/runtimeConfig.ts index c7312806cff04..2637959879407 100644 --- a/clients/client-workmail/runtimeConfig.ts +++ b/clients/client-workmail/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts b/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts index 909297966bd5c..7a0df1747f0bc 100644 --- a/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts +++ b/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetRawMessageContentCommandInput; @@ -102,11 +104,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -148,6 +145,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WorkMailMessageFlowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -156,8 +158,8 @@ export type WorkMailMessageFlowClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkMailMessageFlowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -165,8 +167,8 @@ export type WorkMailMessageFlowClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The WorkMail Message Flow API provides access to email messages as they are @@ -192,16 +194,16 @@ export class WorkMailMessageFlowClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workmailmessageflow/runtimeConfig.browser.ts b/clients/client-workmailmessageflow/runtimeConfig.browser.ts index 3455971ed8e0e..48ffdd532cd0f 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.browser.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workmailmessageflow/runtimeConfig.native.ts b/clients/client-workmailmessageflow/runtimeConfig.native.ts index 80b3d31ae9176..a7338b76ceaa0 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.native.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkMailMessageFlowClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workmailmessageflow/runtimeConfig.ts b/clients/client-workmailmessageflow/runtimeConfig.ts index f3a1a8530e1bc..a25c7a9ce8f65 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workspaces/WorkSpacesClient.ts b/clients/client-workspaces/WorkSpacesClient.ts index 312aa21640226..54780abf135cf 100644 --- a/clients/client-workspaces/WorkSpacesClient.ts +++ b/clients/client-workspaces/WorkSpacesClient.ts @@ -175,6 +175,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -185,6 +186,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -338,11 +340,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -384,6 +381,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type WorkSpacesClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -392,8 +394,8 @@ export type WorkSpacesClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkSpacesClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -401,8 +403,8 @@ export type WorkSpacesClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon WorkSpaces Service @@ -426,16 +428,16 @@ export class WorkSpacesClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workspaces/runtimeConfig.browser.ts b/clients/client-workspaces/runtimeConfig.browser.ts index df2b7c8083d0b..7815990eabdbd 100644 --- a/clients/client-workspaces/runtimeConfig.browser.ts +++ b/clients/client-workspaces/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workspaces/runtimeConfig.native.ts b/clients/client-workspaces/runtimeConfig.native.ts index cdc750bee2628..cbd244f45cc81 100644 --- a/clients/client-workspaces/runtimeConfig.native.ts +++ b/clients/client-workspaces/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkSpacesClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workspaces/runtimeConfig.ts b/clients/client-workspaces/runtimeConfig.ts index a92d954a69606..1e85b16d73696 100644 --- a/clients/client-workspaces/runtimeConfig.ts +++ b/clients/client-workspaces/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-xray/XRayClient.ts b/clients/client-xray/XRayClient.ts index fec4ca2d5183f..2dec2142d19e9 100644 --- a/clients/client-xray/XRayClient.ts +++ b/clients/client-xray/XRayClient.ts @@ -86,6 +86,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -96,6 +97,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -203,11 +205,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -249,6 +246,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type XRayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -257,8 +259,8 @@ export type XRayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type XRayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -266,8 +268,8 @@ export type XRayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS X-Ray provides APIs for managing debug traces and retrieving service maps @@ -290,16 +292,16 @@ export class XRayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-xray/runtimeConfig.browser.ts b/clients/client-xray/runtimeConfig.browser.ts index 79d9cf6f79af8..ba82aa794486f 100644 --- a/clients/client-xray/runtimeConfig.browser.ts +++ b/clients/client-xray/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-xray/runtimeConfig.native.ts b/clients/client-xray/runtimeConfig.native.ts index 98479b6c516da..3bae662eef742 100644 --- a/clients/client-xray/runtimeConfig.native.ts +++ b/clients/client-xray/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./XRayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-xray/runtimeConfig.ts b/clients/client-xray/runtimeConfig.ts index 513597ae3219f..2450a9ffdb05c 100644 --- a/clients/client-xray/runtimeConfig.ts +++ b/clients/client-xray/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-ec2/EC2ProtocolClient.ts b/protocol_tests/aws-ec2/EC2ProtocolClient.ts index a7150d12dfbcf..88958a8b91842 100644 --- a/protocol_tests/aws-ec2/EC2ProtocolClient.ts +++ b/protocol_tests/aws-ec2/EC2ProtocolClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type EC2ProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +220,8 @@ export type EC2ProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2ProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +229,8 @@ export type EC2ProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * An EC2 query service that sends query requests and XML responses. @@ -250,16 +252,16 @@ export class EC2ProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-ec2/runtimeConfig.browser.ts b/protocol_tests/aws-ec2/runtimeConfig.browser.ts index 6f536157708ec..116c57fbd9258 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.browser.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-ec2/runtimeConfig.native.ts b/protocol_tests/aws-ec2/runtimeConfig.native.ts index e260a640a0686..c2c8364ec2831 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.native.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2ProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-ec2/runtimeConfig.ts b/protocol_tests/aws-ec2/runtimeConfig.ts index ae050c8c75f8e..15a1f28dc97dc 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-json/JsonProtocolClient.ts b/protocol_tests/aws-json/JsonProtocolClient.ts index 3bfeb87c27bad..effd6fe8e5553 100644 --- a/protocol_tests/aws-json/JsonProtocolClient.ts +++ b/protocol_tests/aws-json/JsonProtocolClient.ts @@ -52,6 +52,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -62,6 +63,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type JsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +187,8 @@ export type JsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type JsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +196,8 @@ export type JsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class JsonProtocolClient extends __Client< __HttpHandlerOptions, @@ -214,16 +216,16 @@ export class JsonProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-json/runtimeConfig.browser.ts b/protocol_tests/aws-json/runtimeConfig.browser.ts index 495f92be689ea..f3ce2fcda941e 100644 --- a/protocol_tests/aws-json/runtimeConfig.browser.ts +++ b/protocol_tests/aws-json/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-json/runtimeConfig.native.ts b/protocol_tests/aws-json/runtimeConfig.native.ts index eecffc6983a39..b83f7ca69972b 100644 --- a/protocol_tests/aws-json/runtimeConfig.native.ts +++ b/protocol_tests/aws-json/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./JsonProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-json/runtimeConfig.ts b/protocol_tests/aws-json/runtimeConfig.ts index 312ebcb617713..d63db7bc9ae3b 100644 --- a/protocol_tests/aws-json/runtimeConfig.ts +++ b/protocol_tests/aws-json/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-query/QueryProtocolClient.ts b/protocol_tests/aws-query/QueryProtocolClient.ts index 185f8575e9e19..ceda9111b7ea8 100644 --- a/protocol_tests/aws-query/QueryProtocolClient.ts +++ b/protocol_tests/aws-query/QueryProtocolClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type QueryProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +250,8 @@ export type QueryProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QueryProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +259,8 @@ export type QueryProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A query service that sends query requests and XML responses. @@ -280,16 +282,16 @@ export class QueryProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-query/runtimeConfig.browser.ts b/protocol_tests/aws-query/runtimeConfig.browser.ts index 8e70f36a301c7..3cbbf13374eb1 100644 --- a/protocol_tests/aws-query/runtimeConfig.browser.ts +++ b/protocol_tests/aws-query/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-query/runtimeConfig.native.ts b/protocol_tests/aws-query/runtimeConfig.native.ts index 819b612eaeee6..b4506d8969582 100644 --- a/protocol_tests/aws-query/runtimeConfig.native.ts +++ b/protocol_tests/aws-query/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QueryProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-query/runtimeConfig.ts b/protocol_tests/aws-query/runtimeConfig.ts index b3943e52edade..cb0464d5786d3 100644 --- a/protocol_tests/aws-query/runtimeConfig.ts +++ b/protocol_tests/aws-query/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-restjson/RestJsonProtocolClient.ts b/protocol_tests/aws-restjson/RestJsonProtocolClient.ts index 39efc20e8bbbb..81e842d5dab23 100644 --- a/protocol_tests/aws-restjson/RestJsonProtocolClient.ts +++ b/protocol_tests/aws-restjson/RestJsonProtocolClient.ts @@ -135,6 +135,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -145,6 +146,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RestJsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +328,8 @@ export type RestJsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RestJsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +337,8 @@ export type RestJsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A REST JSON service that sends JSON requests and responses. @@ -358,16 +360,16 @@ export class RestJsonProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-restjson/runtimeConfig.browser.ts b/protocol_tests/aws-restjson/runtimeConfig.browser.ts index 5f24183b0bc2c..c8f189448a3b1 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.browser.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-restjson/runtimeConfig.native.ts b/protocol_tests/aws-restjson/runtimeConfig.native.ts index 98a833d6c3195..b3086035d8293 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.native.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RestJsonProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-restjson/runtimeConfig.ts b/protocol_tests/aws-restjson/runtimeConfig.ts index 83527f829a8b2..77f77839a4eaa 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-restxml/RestXmlProtocolClient.ts b/protocol_tests/aws-restxml/RestXmlProtocolClient.ts index 9c2d8d44418e1..fba57cd9f114d 100644 --- a/protocol_tests/aws-restxml/RestXmlProtocolClient.ts +++ b/protocol_tests/aws-restxml/RestXmlProtocolClient.ts @@ -147,6 +147,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -157,6 +158,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -296,11 +298,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -342,6 +339,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + */ + defaultUserAgent?: Provider<__UserAgent>; } export type RestXmlProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -350,8 +352,8 @@ export type RestXmlProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RestXmlProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -359,8 +361,8 @@ export type RestXmlProtocolClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A REST XML service that sends XML requests and responses. @@ -382,16 +384,16 @@ export class RestXmlProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-restxml/runtimeConfig.browser.ts b/protocol_tests/aws-restxml/runtimeConfig.browser.ts index fa5b8050b0f15..3e27b99ab3c1b 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.browser.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.browser.ts @@ -22,7 +22,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-restxml/runtimeConfig.native.ts b/protocol_tests/aws-restxml/runtimeConfig.native.ts index ec7124e99904f..cf729595d6e3a 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.native.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RestXmlProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-restxml/runtimeConfig.ts b/protocol_tests/aws-restxml/runtimeConfig.ts index 4a3c657f26d1d..7d9ebad681075 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.ts @@ -24,7 +24,7 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgent: defaultUserAgent({ serviceId: ClientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(),