Skip to content

Commit f04fb7a

Browse files
committed
feat: mode runtime shared config to own interface
1 parent 220e375 commit f04fb7a

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

clients/client-rds-data/RdsDataServiceClient.ts

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,25 @@ export type ServiceOutputTypes =
7373
| ExecuteStatementResponse
7474
| BatchExecuteStatementResponse;
7575

76-
export interface RDSDataRuntimeDependencies {
76+
export interface RDSDataSharedConfig {
7777
/**
7878
* The function that will be used to populate serializing protocol
7979
*/
80-
protocol: string;
81-
80+
protocol?: string;
81+
/**
82+
* The service name with which to sign requests.
83+
*/
84+
signingName?: string;
85+
/**
86+
* The service name with which to construct endpoints.
87+
*/
88+
service?: string;
89+
/**
90+
* Major version of the API model in YYYY-MM-DD format
91+
*/
92+
apiVersion?: string;
93+
}
94+
export interface RDSDataRuntimeDependencies {
8295
/**
8396
* The HTTP handler to use. Fetch in browser and Https in Nodejs
8497
*/
@@ -138,19 +151,10 @@ export interface RDSDataRuntimeDependencies {
138151
* The function that will be used to populate default value in 'User-Agent' header
139152
*/
140153
defaultUserAgent?: string;
141-
142-
/**
143-
* The service name with which to sign requests.
144-
*/
145-
signingName?: string;
146-
147-
/**
148-
* The service name with which to construct endpoints.
149-
*/
150-
service?: string;
151154
}
152155

153-
export type RdsDataServiceConfig = RDSDataRuntimeDependencies &
156+
export type RdsDataServiceConfig = RDSDataSharedConfig &
157+
RDSDataRuntimeDependencies &
154158
AwsAuthInputConfig &
155159
RegionInputConfig &
156160
RetryInputConfig &
@@ -160,6 +164,7 @@ export type RdsDataServiceConfig = RDSDataRuntimeDependencies &
160164
export type RdsDataServiceResolvedConfig = SmithyResolvedConfiguration<
161165
__HttpOptions
162166
> &
167+
Required<RDSDataSharedConfig> &
163168
Required<RDSDataRuntimeDependencies> &
164169
AwsAuthResolvedConfig &
165170
RegionResolvedConfig &
@@ -177,6 +182,10 @@ export class RdsDataService extends SmithyClient<
177182

178183
constructor(configuration: RdsDataServiceConfig) {
179184
const _config_0 = {
185+
apiVersion: "2018-08-01",
186+
protocol: "aws.rest-json-1.1",
187+
signingName: "rds-data", //TODO: signing name and service should not be generated as they will be populated by RIP
188+
service: "rds-data",
180189
...RDSRuntimeConfiguration,
181190
...configuration
182191
};

clients/client-rds-data/runtimeConfig.browser.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import { name, version } from "./package.json";
1111
import { RDSDataRuntimeDependencies } from "./RdsDataServiceClient";
1212

1313
export const RDSRuntimeConfiguration: Required<RDSDataRuntimeDependencies> = {
14-
protocol: "aws.rest-json-1.1",
15-
signingName: "rds-data",
16-
service: "rds-data",
1714
requestHandler: new FetchHttpHandler(),
1815
sha256: Sha256,
1916
credentialDefaultProvider: invalidFunction("Credential is missing") as any,

clients/client-rds-data/runtimeConfig.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import { name, version } from "./package.json";
1212
import { RDSDataRuntimeDependencies } from "./RdsDataServiceClient";
1313

1414
export const RDSRuntimeConfiguration: Required<RDSDataRuntimeDependencies> = {
15-
protocol: "aws.rest-json-1.1",
16-
signingName: "rds-data",
17-
service: "rds-data",
1815
requestHandler: new NodeHttpHandler(),
1916
sha256: Hash.bind(null, "sha256"),
2017
credentialDefaultProvider,

packages/smithy-client/src/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88

99
export interface SmithyConfiguration<HandlerOptions> {
1010
requestHandler: RequestHandler<any, any, HandlerOptions>;
11+
readonly apiVersion: string;
1112
}
1213

1314
export type SmithyResolvedConfiguration<HandlerOptions> = SmithyConfiguration<

0 commit comments

Comments
 (0)