Skip to content

Commit

Permalink
fix: remove changes to rds data client
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Dec 5, 2019
1 parent 56b206d commit 7b4a586
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 23 deletions.
35 changes: 22 additions & 13 deletions clients/client-rds-data/RdsDataServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
RollbackTransactionRequest,
RollbackTransactionResponse
} from "./models/index";
import { RDSDefaultValues } from "./runtimeConfig";
import { RDSRuntimeConfiguration } from "./runtimeConfig";
import {
Credentials,
Provider,
Expand Down Expand Up @@ -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
Expand All @@ -73,12 +73,11 @@ export type ServiceOutputTypes =
| ExecuteStatementResponse
| BatchExecuteStatementResponse;

export interface RDSDataDefaults
extends Partial<SmithyResolvedConfiguration<__HttpOptions>> {
// 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
Expand Down Expand Up @@ -139,27 +138,37 @@ 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 &
EndpointsInputConfig &
UserAgentInputConfig;

export type RdsDataServiceResolvedConfig = SmithyResolvedConfiguration<
__HttpOptions
__HttpHandlerOptions
> &
Required<RDSDataDefaults> &
Required<RDSDataRuntimeDependencies> &
AwsAuthResolvedConfig &
RegionResolvedConfig &
RetryResolvedConfig &
EndpointsResolvedConfig &
UserAgentResolvedConfig;

export class RdsDataService extends SmithyClient<
__HttpOptions,
__HttpHandlerOptions,
ServiceInputTypes,
ServiceOutputTypes,
RdsDataServiceResolvedConfig
Expand All @@ -168,7 +177,7 @@ export class RdsDataService extends SmithyClient<

constructor(configuration: RdsDataServiceConfig) {
const _config_0 = {
...RDSDefaultValues,
...RDSRuntimeConfiguration,
...configuration
};
let _config_1 = resolveRegionConfig(_config_0);
Expand Down
4 changes: 2 additions & 2 deletions clients/client-rds-data/commands/ExecuteStatementCommand.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -32,7 +32,7 @@ export class ExecuteStatementCommand extends Command<
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: RdsDataServiceResolvedConfig,
options?: HttpOptions
options?: __HttpHandlerOptions
): Handler<ExecuteStatementRequest, ExecuteStatementResponse> {
const { requestHandler } = configuration;

Expand Down
9 changes: 5 additions & 4 deletions clients/client-rds-data/runtimeConfig.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RDSDataDefaults> = {
...RDSDataSharedConfigDefaults,
export const RDSRuntimeConfiguration: Required<RDSDataRuntimeDependencies> = {
protocol: "aws.rest-json-1.1",
signingName: "rds-data",
service: "rds-data",
requestHandler: new FetchHttpHandler(),
sha256: Sha256,
credentialDefaultProvider: invalidFunction("Credential is missing") as any,
Expand Down
9 changes: 5 additions & 4 deletions clients/client-rds-data/runtimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RDSDataDefaults> = {
...RDSDataSharedConfig,
export const RDSRuntimeConfiguration: Required<RDSDataRuntimeDependencies> = {
protocol: "aws.rest-json-1.1",
signingName: "rds-data",
service: "rds-data",
requestHandler: new NodeHttpHandler(),
sha256: Hash.bind(null, "sha256"),
credentialDefaultProvider,
Expand Down

0 comments on commit 7b4a586

Please sign in to comment.