From 7b4a586096918c01a4e3f46404280c673501cace Mon Sep 17 00:00:00 2001 From: Allan Zheng Date: Thu, 5 Dec 2019 13:05:57 -0800 Subject: [PATCH] fix: remove changes to rds data client --- .../client-rds-data/RdsDataServiceClient.ts | 35 ++++++++++++------- .../commands/ExecuteStatementCommand.ts | 4 +-- .../client-rds-data/runtimeConfig.browser.ts | 9 ++--- clients/client-rds-data/runtimeConfig.ts | 9 ++--- 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/clients/client-rds-data/RdsDataServiceClient.ts b/clients/client-rds-data/RdsDataServiceClient.ts index 18b092e7b31dd..8ed6878d89aad 100644 --- a/clients/client-rds-data/RdsDataServiceClient.ts +++ b/clients/client-rds-data/RdsDataServiceClient.ts @@ -12,7 +12,7 @@ import { RollbackTransactionRequest, RollbackTransactionResponse } from "./models/index"; -import { RDSDefaultValues } from "./runtimeConfig"; +import { RDSRuntimeConfiguration } from "./runtimeConfig"; import { Credentials, Provider, @@ -55,7 +55,7 @@ import { Client as SmithyClient, SmithyResolvedConfiguration } from "@aws-sdk/smithy-client"; -import { HttpOptions as __HttpOptions } from "@aws-sdk/types"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; export type ServiceInputTypes = | RollbackTransactionRequest @@ -73,12 +73,11 @@ export type ServiceOutputTypes = | ExecuteStatementResponse | BatchExecuteStatementResponse; -export interface RDSDataDefaults - extends Partial> { - // protocol?: string; - signingName?: string; - // apiVersion?: string; - service?: string; +export interface RDSDataRuntimeDependencies { + /** + * The function that will be used to populate serializing protocol + */ + protocol: string; /** * The HTTP handler to use. Fetch in browser and Https in Nodejs @@ -139,9 +138,19 @@ export interface RDSDataDefaults * The function that will be used to populate default value in 'User-Agent' header */ defaultUserAgent?: string; + + /** + * The service name with which to sign requests. + */ + signingName?: string; + + /** + * The service name with which to construct endpoints. + */ + service?: string; } -export type RdsDataServiceConfig = RDSDataDefaults & +export type RdsDataServiceConfig = RDSDataRuntimeDependencies & AwsAuthInputConfig & RegionInputConfig & RetryInputConfig & @@ -149,9 +158,9 @@ export type RdsDataServiceConfig = RDSDataDefaults & UserAgentInputConfig; export type RdsDataServiceResolvedConfig = SmithyResolvedConfiguration< - __HttpOptions + __HttpHandlerOptions > & - Required & + Required & AwsAuthResolvedConfig & RegionResolvedConfig & RetryResolvedConfig & @@ -159,7 +168,7 @@ export type RdsDataServiceResolvedConfig = SmithyResolvedConfiguration< UserAgentResolvedConfig; export class RdsDataService extends SmithyClient< - __HttpOptions, + __HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, RdsDataServiceResolvedConfig @@ -168,7 +177,7 @@ export class RdsDataService extends SmithyClient< constructor(configuration: RdsDataServiceConfig) { const _config_0 = { - ...RDSDefaultValues, + ...RDSRuntimeConfiguration, ...configuration }; let _config_1 = resolveRegionConfig(_config_0); diff --git a/clients/client-rds-data/commands/ExecuteStatementCommand.ts b/clients/client-rds-data/commands/ExecuteStatementCommand.ts index 8ee83794f6125..e024bdb93f000 100644 --- a/clients/client-rds-data/commands/ExecuteStatementCommand.ts +++ b/clients/client-rds-data/commands/ExecuteStatementCommand.ts @@ -1,7 +1,7 @@ import { Command } from "@aws-sdk/smithy-client"; import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { - HttpOptions, + HttpHandlerOptions as __HttpHandlerOptions, Handler, HandlerExecutionContext, FinalizeHandlerArguments, @@ -32,7 +32,7 @@ export class ExecuteStatementCommand extends Command< resolveMiddleware( clientStack: MiddlewareStack, configuration: RdsDataServiceResolvedConfig, - options?: HttpOptions + options?: __HttpHandlerOptions ): Handler { const { requestHandler } = configuration; diff --git a/clients/client-rds-data/runtimeConfig.browser.ts b/clients/client-rds-data/runtimeConfig.browser.ts index f4728ce13e09a..b4faad01236c8 100644 --- a/clients/client-rds-data/runtimeConfig.browser.ts +++ b/clients/client-rds-data/runtimeConfig.browser.ts @@ -8,11 +8,12 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; import { name, version } from "./package.json"; -import { RDSDataDefaults } from "./RdsDataServiceClient"; -import { RDSDataSharedConfigDefaults } from "./sharedConfig"; +import { RDSDataRuntimeDependencies } from "./RdsDataServiceClient"; -export const RDSRuntimeConfiguration: Required = { - ...RDSDataSharedConfigDefaults, +export const RDSRuntimeConfiguration: Required = { + protocol: "aws.rest-json-1.1", + signingName: "rds-data", + service: "rds-data", requestHandler: new FetchHttpHandler(), sha256: Sha256, credentialDefaultProvider: invalidFunction("Credential is missing") as any, diff --git a/clients/client-rds-data/runtimeConfig.ts b/clients/client-rds-data/runtimeConfig.ts index 2a174c0c3ed89..4131d4d6d6e44 100644 --- a/clients/client-rds-data/runtimeConfig.ts +++ b/clients/client-rds-data/runtimeConfig.ts @@ -9,11 +9,12 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; import { name, version } from "./package.json"; -import { RDSDataDefaults } from "./RdsDataServiceClient"; -import { RDSDataSharedConfig } from "./sharedConfig"; +import { RDSDataRuntimeDependencies } from "./RdsDataServiceClient"; -export const RDSDefaultValues: Required = { - ...RDSDataSharedConfig, +export const RDSRuntimeConfiguration: Required = { + protocol: "aws.rest-json-1.1", + signingName: "rds-data", + service: "rds-data", requestHandler: new NodeHttpHandler(), sha256: Hash.bind(null, "sha256"), credentialDefaultProvider,