Skip to content

Commit

Permalink
chore(codegen): generate clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Yuan committed Jan 5, 2024
1 parent 347df59 commit 8895586
Show file tree
Hide file tree
Showing 21 changed files with 63 additions and 810 deletions.
2 changes: 1 addition & 1 deletion clients/client-ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@aws-sdk/middleware-logger": "*",
"@aws-sdk/middleware-recursion-detection": "*",
"@aws-sdk/middleware-sdk-ec2": "*",
"@aws-sdk/middleware-signing": "*",
"@aws-sdk/middleware-user-agent": "*",
"@aws-sdk/region-config-resolver": "*",
"@aws-sdk/types": "*",
Expand Down Expand Up @@ -55,7 +56,6 @@
"@smithy/util-defaults-mode-browser": "^2.0.24",
"@smithy/util-defaults-mode-node": "^2.0.32",
"@smithy/util-endpoints": "^1.0.8",
"@smithy/util-middleware": "^2.0.9",
"@smithy/util-retry": "^2.0.9",
"@smithy/util-utf8": "^2.0.2",
"@smithy/util-waiter": "^2.0.16",
Expand Down
61 changes: 19 additions & 42 deletions clients/client-ec2/src/EC2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ import {
} from "@aws-sdk/middleware-host-header";
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
import {
AwsAuthInputConfig,
AwsAuthResolvedConfig,
getAwsAuthPlugin,
resolveAwsAuthConfig,
} from "@aws-sdk/middleware-signing";
import {
getUserAgentPlugin,
resolveUserAgentConfig,
UserAgentInputConfig,
UserAgentResolvedConfig,
} from "@aws-sdk/middleware-user-agent";
import { Credentials as __Credentials } from "@aws-sdk/types";
import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver";
import {
DefaultIdentityProviderConfig,
getHttpAuthSchemeEndpointRuleSetPlugin,
getHttpSigningPlugin,
} from "@smithy/core";
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint";
import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
Expand All @@ -30,7 +32,6 @@ import {
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
} from "@smithy/smithy-client";
import {
AwsCredentialIdentityProvider,
BodyLengthCalculator as __BodyLengthCalculator,
CheckOptionalClientConfig as __CheckOptionalClientConfig,
ChecksumConstructor as __ChecksumConstructor,
Expand All @@ -47,12 +48,6 @@ import {
UserAgent as __UserAgent,
} from "@smithy/types";

import {
defaultEC2HttpAuthSchemeParametersProvider,
HttpAuthSchemeInputConfig,
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import {
AcceptAddressTransferCommandInput,
AcceptAddressTransferCommandOutput,
Expand Down Expand Up @@ -3469,23 +3464,22 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
*/
useFipsEndpoint?: boolean | __Provider<boolean>;

/**
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
* @internal
*/
defaultUserAgentProvider?: Provider<__UserAgent>;

/**
* The AWS region to which this client will send requests
*/
region?: string | __Provider<string>;

/**
* Default credentials provider; Not available in browser runtime.
* @deprecated
* @internal
*/
credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;

/**
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
* @internal
*/
defaultUserAgentProvider?: Provider<__UserAgent>;

/**
* Value for how many times a request will be made at most in case of retry.
Expand Down Expand Up @@ -3524,8 +3518,8 @@ export type EC2ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOpt
EndpointInputConfig<EndpointParameters> &
RetryInputConfig &
HostHeaderInputConfig &
AwsAuthInputConfig &
UserAgentInputConfig &
HttpAuthSchemeInputConfig &
ClientInputEndpointParameters;
/**
* @public
Expand All @@ -3544,8 +3538,8 @@ export type EC2ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHa
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
HostHeaderResolvedConfig &
AwsAuthResolvedConfig &
UserAgentResolvedConfig &
HttpAuthSchemeResolvedConfig &
ClientResolvedEndpointParameters;
/**
* @public
Expand Down Expand Up @@ -3594,26 +3588,15 @@ export class EC2Client extends __Client<
*/
readonly config: EC2ClientResolvedConfig;

private getDefaultHttpAuthSchemeParametersProvider() {
return defaultEC2HttpAuthSchemeParametersProvider;
}

private getIdentityProviderConfigProvider() {
return async (config: EC2ClientResolvedConfig) =>
new DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials,
});
}

constructor(...[configuration]: __CheckOptionalClientConfig<EC2ClientConfig>) {
const _config_0 = __getRuntimeConfig(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = resolveRegionConfig(_config_1);
const _config_3 = resolveEndpointConfig(_config_2);
const _config_4 = resolveRetryConfig(_config_3);
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveUserAgentConfig(_config_5);
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
Expand All @@ -3622,14 +3605,8 @@ export class EC2Client extends __Client<
this.middlewareStack.use(getHostHeaderPlugin(this.config));
this.middlewareStack.use(getLoggerPlugin(this.config));
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
this.middlewareStack.use(getAwsAuthPlugin(this.config));
this.middlewareStack.use(getUserAgentPlugin(this.config));
this.middlewareStack.use(
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
})
);
this.middlewareStack.use(getHttpSigningPlugin(this.config));
}

/**
Expand Down
72 changes: 0 additions & 72 deletions clients/client-ec2/src/auth/httpAuthExtensionConfiguration.ts

This file was deleted.

137 changes: 0 additions & 137 deletions clients/client-ec2/src/auth/httpAuthSchemeProvider.ts

This file was deleted.

5 changes: 1 addition & 4 deletions clients/client-ec2/src/extensionConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
import { DefaultExtensionConfiguration } from "@smithy/types";

import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";

/**
* @internal
*/
export interface EC2ExtensionConfiguration
extends HttpHandlerExtensionConfiguration,
DefaultExtensionConfiguration,
AwsRegionExtensionConfiguration,
HttpAuthExtensionConfiguration {}
AwsRegionExtensionConfiguration {}
Loading

0 comments on commit 8895586

Please sign in to comment.