Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(clients): codegen update for runtime extensions #5103

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 10 additions & 2 deletions clients/client-accessanalyzer/src/AccessAnalyzerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ import {
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";

export { __Client };

Expand Down Expand Up @@ -296,6 +297,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
*/
logger?: __Logger;

/**
* Optional extensions
*/
extensions?: RuntimeExtension[];

/**
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
Expand Down Expand Up @@ -326,6 +332,7 @@ export interface AccessAnalyzerClientConfig extends AccessAnalyzerClientConfigTy
*/
export type AccessAnalyzerClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
Required<ClientDefaults> &
RuntimeExtensionsConfig &
RegionResolvedConfig &
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
Expand Down Expand Up @@ -372,8 +379,9 @@ export class AccessAnalyzerClient extends __Client<
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
super(_config_7);
this.config = _config_7;
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(getHostHeaderPlugin(this.config));
Expand Down
7 changes: 7 additions & 0 deletions clients/client-accessanalyzer/src/clientConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// smithy-typescript generated code
import { DefaultClientConfiguration } from "@smithy/types";

/**
* @internal
*/
export interface AccessAnalyzerClientConfiguration extends DefaultClientConfiguration {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => ({
base64Encoder: config?.base64Encoder ?? toBase64,
disableHostPrefix: config?.disableHostPrefix ?? false,
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
extensions: config?.extensions ?? [],
logger: config?.logger ?? new NoOpLogger(),
serviceId: config?.serviceId ?? "AccessAnalyzer",
urlParser: config?.urlParser ?? parseUrl,
Expand Down
36 changes: 36 additions & 0 deletions clients/client-accessanalyzer/src/runtimeExtensions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// smithy-typescript generated code
import { getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "@smithy/types";

import { AccessAnalyzerClientConfiguration } from "./clientConfiguration";

/**
* @public
*/
export interface RuntimeExtension {
configureClient(clientConfiguration: AccessAnalyzerClientConfiguration): void;
}

/**
* @public
*/
export interface RuntimeExtensionsConfig {
extensions: RuntimeExtension[];
}

const asPartial = <T extends Partial<AccessAnalyzerClientConfiguration>>(t: T) => t;

/**
* @internal
*/
export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {
const clientConfiguration: AccessAnalyzerClientConfiguration = {
...asPartial(getDefaultClientConfiguration(runtimeConfig)),
};

extensions.forEach((extension) => extension.configureClient(clientConfiguration));

return {
...runtimeConfig,
...resolveDefaultRuntimeConfig(clientConfiguration),
};
};
12 changes: 10 additions & 2 deletions clients/client-account/src/AccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import {
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";

export { __Client };

Expand Down Expand Up @@ -230,6 +231,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
*/
logger?: __Logger;

/**
* Optional extensions
*/
extensions?: RuntimeExtension[];

/**
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
Expand Down Expand Up @@ -260,6 +266,7 @@ export interface AccountClientConfig extends AccountClientConfigType {}
*/
export type AccountClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
Required<ClientDefaults> &
RuntimeExtensionsConfig &
RegionResolvedConfig &
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
Expand Down Expand Up @@ -298,8 +305,9 @@ export class AccountClient extends __Client<
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
super(_config_7);
this.config = _config_7;
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(getHostHeaderPlugin(this.config));
Expand Down
7 changes: 7 additions & 0 deletions clients/client-account/src/clientConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// smithy-typescript generated code
import { DefaultClientConfiguration } from "@smithy/types";

/**
* @internal
*/
export interface AccountClientConfiguration extends DefaultClientConfiguration {}
1 change: 1 addition & 0 deletions clients/client-account/src/runtimeConfig.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const getRuntimeConfig = (config: AccountClientConfig) => ({
base64Encoder: config?.base64Encoder ?? toBase64,
disableHostPrefix: config?.disableHostPrefix ?? false,
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
extensions: config?.extensions ?? [],
logger: config?.logger ?? new NoOpLogger(),
serviceId: config?.serviceId ?? "Account",
urlParser: config?.urlParser ?? parseUrl,
Expand Down
36 changes: 36 additions & 0 deletions clients/client-account/src/runtimeExtensions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// smithy-typescript generated code
import { getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "@smithy/types";

import { AccountClientConfiguration } from "./clientConfiguration";

/**
* @public
*/
export interface RuntimeExtension {
configureClient(clientConfiguration: AccountClientConfiguration): void;
}

/**
* @public
*/
export interface RuntimeExtensionsConfig {
extensions: RuntimeExtension[];
}

const asPartial = <T extends Partial<AccountClientConfiguration>>(t: T) => t;

/**
* @internal
*/
export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {
const clientConfiguration: AccountClientConfiguration = {
...asPartial(getDefaultClientConfiguration(runtimeConfig)),
};

extensions.forEach((extension) => extension.configureClient(clientConfiguration));

return {
...runtimeConfig,
...resolveDefaultRuntimeConfig(clientConfiguration),
};
};
12 changes: 10 additions & 2 deletions clients/client-acm-pca/src/ACMPCAClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ import {
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";

export { __Client };

Expand Down Expand Up @@ -296,6 +297,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
*/
logger?: __Logger;

/**
* Optional extensions
*/
extensions?: RuntimeExtension[];

/**
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
Expand Down Expand Up @@ -326,6 +332,7 @@ export interface ACMPCAClientConfig extends ACMPCAClientConfigType {}
*/
export type ACMPCAClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
Required<ClientDefaults> &
RuntimeExtensionsConfig &
RegionResolvedConfig &
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
Expand Down Expand Up @@ -379,8 +386,9 @@ export class ACMPCAClient extends __Client<
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
super(_config_7);
this.config = _config_7;
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(getHostHeaderPlugin(this.config));
Expand Down
7 changes: 7 additions & 0 deletions clients/client-acm-pca/src/clientConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// smithy-typescript generated code
import { DefaultClientConfiguration } from "@smithy/types";

/**
* @internal
*/
export interface ACMPCAClientConfiguration extends DefaultClientConfiguration {}
1 change: 1 addition & 0 deletions clients/client-acm-pca/src/runtimeConfig.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const getRuntimeConfig = (config: ACMPCAClientConfig) => ({
base64Encoder: config?.base64Encoder ?? toBase64,
disableHostPrefix: config?.disableHostPrefix ?? false,
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
extensions: config?.extensions ?? [],
logger: config?.logger ?? new NoOpLogger(),
serviceId: config?.serviceId ?? "ACM PCA",
urlParser: config?.urlParser ?? parseUrl,
Expand Down
36 changes: 36 additions & 0 deletions clients/client-acm-pca/src/runtimeExtensions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// smithy-typescript generated code
import { getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "@smithy/types";

import { ACMPCAClientConfiguration } from "./clientConfiguration";

/**
* @public
*/
export interface RuntimeExtension {
configureClient(clientConfiguration: ACMPCAClientConfiguration): void;
}

/**
* @public
*/
export interface RuntimeExtensionsConfig {
extensions: RuntimeExtension[];
}

const asPartial = <T extends Partial<ACMPCAClientConfiguration>>(t: T) => t;

/**
* @internal
*/
export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {
const clientConfiguration: ACMPCAClientConfiguration = {
...asPartial(getDefaultClientConfiguration(runtimeConfig)),
};

extensions.forEach((extension) => extension.configureClient(clientConfiguration));

return {
...runtimeConfig,
...resolveDefaultRuntimeConfig(clientConfiguration),
};
};
12 changes: 10 additions & 2 deletions clients/client-acm/src/ACMClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ import {
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";

export { __Client };

Expand Down Expand Up @@ -257,6 +258,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
*/
logger?: __Logger;

/**
* Optional extensions
*/
extensions?: RuntimeExtension[];

/**
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
Expand Down Expand Up @@ -287,6 +293,7 @@ export interface ACMClientConfig extends ACMClientConfigType {}
*/
export type ACMClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
Required<ClientDefaults> &
RuntimeExtensionsConfig &
RegionResolvedConfig &
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
Expand Down Expand Up @@ -327,8 +334,9 @@ export class ACMClient extends __Client<
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
super(_config_7);
this.config = _config_7;
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(getHostHeaderPlugin(this.config));
Expand Down
7 changes: 7 additions & 0 deletions clients/client-acm/src/clientConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// smithy-typescript generated code
import { DefaultClientConfiguration } from "@smithy/types";

/**
* @internal
*/
export interface ACMClientConfiguration extends DefaultClientConfiguration {}
1 change: 1 addition & 0 deletions clients/client-acm/src/runtimeConfig.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const getRuntimeConfig = (config: ACMClientConfig) => ({
base64Encoder: config?.base64Encoder ?? toBase64,
disableHostPrefix: config?.disableHostPrefix ?? false,
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
extensions: config?.extensions ?? [],
logger: config?.logger ?? new NoOpLogger(),
serviceId: config?.serviceId ?? "ACM",
urlParser: config?.urlParser ?? parseUrl,
Expand Down
36 changes: 36 additions & 0 deletions clients/client-acm/src/runtimeExtensions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// smithy-typescript generated code
import { getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "@smithy/types";

import { ACMClientConfiguration } from "./clientConfiguration";

/**
* @public
*/
export interface RuntimeExtension {
configureClient(clientConfiguration: ACMClientConfiguration): void;
}

/**
* @public
*/
export interface RuntimeExtensionsConfig {
extensions: RuntimeExtension[];
}

const asPartial = <T extends Partial<ACMClientConfiguration>>(t: T) => t;

/**
* @internal
*/
export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {
const clientConfiguration: ACMClientConfiguration = {
...asPartial(getDefaultClientConfiguration(runtimeConfig)),
};

extensions.forEach((extension) => extension.configureClient(clientConfiguration));

return {
...runtimeConfig,
...resolveDefaultRuntimeConfig(clientConfiguration),
};
};
Loading