From a7b4ef899941b431612866c6bee45e4e45e1a3b9 Mon Sep 17 00:00:00 2001 From: Allan Zheng Date: Mon, 21 Oct 2019 11:29:46 -0700 Subject: [PATCH] chore: set prettier-vscode as default formatter --- .vscode/settings.json | 3 +- .../client-rds-data-node/RDSDataClient.ts | 32 +++++++---- clients/node/client-rds-data-node/README.md | 1 + .../commands/ExecuteStatementCommand.ts | 19 ++++--- .../node/client-rds-data-node/package.json | 2 +- .../protocol/AwsRestJson1_1.ts | 55 +++++++++++++++---- .../protocol/ExecuteStatement.ts | 2 +- .../client-rds-data-node/tsconfig.es.json | 2 +- .../node/client-rds-data-node/tsconfig.json | 2 +- 9 files changed, 84 insertions(+), 34 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e6cb6bba58b1..de93269a3abf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { "editor.tabSize": 2, - "editor.formatOnSave": true + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" } diff --git a/clients/node/client-rds-data-node/RDSDataClient.ts b/clients/node/client-rds-data-node/RDSDataClient.ts index 24bae51cc541..557826e5cee8 100644 --- a/clients/node/client-rds-data-node/RDSDataClient.ts +++ b/clients/node/client-rds-data-node/RDSDataClient.ts @@ -1,20 +1,34 @@ import { contentLengthPlugin } from "@aws-sdk/middleware-content-length"; -import { userAgentPlugin, UserAgentConfig } from "@aws-sdk/middleware-user-agent"; +import { + userAgentPlugin, + UserAgentConfig +} from "@aws-sdk/middleware-user-agent"; import { retryPlugin, RetryConfig } from "@aws-sdk/retry-middleware"; -import { awsAuthPlugin, AwsAuthConfiguration } from "@aws-sdk/signing-middleware"; +import { + awsAuthPlugin, + AwsAuthConfiguration +} from "@aws-sdk/signing-middleware"; import { RDSDataConfiguration, - RDSDataResolvedConfiguration, + RDSDataResolvedConfiguration } from "./RDSDataConfiguration"; -import { RDSRuntimeConfiguration } from './runtimeConfig'; -import { RegionConfiguration, EndpointsConfig, ProtocolConfig } from '@aws-sdk/config-resolver'; -import { HttpOptions, MetadataBearer } from '@aws-sdk/types'; +import { RDSRuntimeConfiguration } from "./runtimeConfig"; +import { + RegionConfiguration, + EndpointsConfig, + ProtocolConfig +} from "@aws-sdk/config-resolver"; +import { HttpOptions, MetadataBearer } from "@aws-sdk/types"; import { Client as SmithyClient } from "@aws-sdk/smithy-client"; type InputTypesUnion = any; type OutputTypesUnion = MetadataBearer; -export class RDSDataClient extends SmithyClient { +export class RDSDataClient extends SmithyClient< + HttpOptions, + InputTypesUnion, + OutputTypesUnion +> { readonly config: RDSDataResolvedConfiguration; constructor(configuration: RDSDataConfiguration) { @@ -36,9 +50,7 @@ export class RDSDataClient extends SmithyClientAmazon RDS Data Service +

Amazon RDS provides an HTTP endpoint to run SQL statements on an Amazon Aurora Serverless DB cluster. To run these statements, you work with the Data Service API.

diff --git a/clients/node/client-rds-data-node/commands/ExecuteStatementCommand.ts b/clients/node/client-rds-data-node/commands/ExecuteStatementCommand.ts index 7cdbdb7e3bcd..ad9f4765b4af 100644 --- a/clients/node/client-rds-data-node/commands/ExecuteStatementCommand.ts +++ b/clients/node/client-rds-data-node/commands/ExecuteStatementCommand.ts @@ -19,7 +19,7 @@ type OutputTypesUnion = any; export class ExecuteStatementCommand extends Command< ExecuteStatementRequest, ExecuteStatementResponse - > { +> { constructor(readonly input: ExecuteStatementRequest) { super(); } @@ -28,13 +28,18 @@ export class ExecuteStatementCommand extends Command< clientStack: MiddlewareStack, configuration: RDSDataResolvedConfiguration, options?: HttpOptions - ): Handler< - ExecuteStatementRequest, - ExecuteStatementResponse - > { - const { protocol: { handler } } = configuration; + ): Handler { + const { + protocol: { handler } + } = configuration; - this.use(serdePlugin(configuration, executeStatementSerializer, executeStatementDeserializer)); + this.use( + serdePlugin( + configuration, + executeStatementSerializer, + executeStatementDeserializer + ) + ); const stack = clientStack.concat(this.middlewareStack); diff --git a/clients/node/client-rds-data-node/package.json b/clients/node/client-rds-data-node/package.json index 2717bcd14662..0b02f9f33ef1 100644 --- a/clients/node/client-rds-data-node/package.json +++ b/clients/node/client-rds-data-node/package.json @@ -69,4 +69,4 @@ "typedoc": "^0.14.2", "typescript": "^3.7.0-dev.20190926" } -} \ No newline at end of file +} diff --git a/clients/node/client-rds-data-node/protocol/AwsRestJson1_1.ts b/clients/node/client-rds-data-node/protocol/AwsRestJson1_1.ts index 2acf0b56323e..0525aae2260c 100644 --- a/clients/node/client-rds-data-node/protocol/AwsRestJson1_1.ts +++ b/clients/node/client-rds-data-node/protocol/AwsRestJson1_1.ts @@ -40,7 +40,10 @@ export function executeStatementAwsRestJson1_1Serialize( } if (input.parameters !== undefined) { - body.parameters = sqlParameterListAwsRestJson1_1Serialize(input.parameters, utils); + body.parameters = sqlParameterListAwsRestJson1_1Serialize( + input.parameters, + utils + ); } if (input.transactionId !== undefined) { @@ -134,16 +137,24 @@ const sqlParameterListAwsRestJson1_1Serialize = ( utils: SerializerUtils ): Array => input && - input.map(sqlParameter => sqlParameterAwsRestJson1_1Serialize(sqlParameter, utils)); + input.map(sqlParameter => + sqlParameterAwsRestJson1_1Serialize(sqlParameter, utils) + ); -const sqlParameterAwsRestJson1_1Serialize = (input: SqlParameter, utils: SerializerUtils): any => +const sqlParameterAwsRestJson1_1Serialize = ( + input: SqlParameter, + utils: SerializerUtils +): any => input.name && input.value && { name: input.name, value: fieldAwsRestJson1_1Serialize(input.value, utils) }; -const fieldAwsRestJson1_1Serialize = (input: Field, utils: SerializerUtils): any => +const fieldAwsRestJson1_1Serialize = ( + input: Field, + utils: SerializerUtils +): any => Field.visit(input, { blobValue: value => { value; @@ -250,7 +261,10 @@ const columnMetadataListAwsRestJson1_1Deserialize = ( columnMetadataAwsRestJson1_1Deserialize(columnMetadata, utils) ); -const fieldAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): any => +const fieldAwsRestJson1_1Deserialize = ( + input: any, + utils: DeserializerUtils +): any => Field.visit(input, { blobValue: value => { value; @@ -281,19 +295,33 @@ const fieldAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): a } }); -const generatedFieldsAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): Array => - input && input.map((field: any) => fieldAwsRestJson1_1Deserialize(field, utils)); +const generatedFieldsAwsRestJson1_1Deserialize = ( + input: any, + utils: DeserializerUtils +): Array => + input && + input.map((field: any) => fieldAwsRestJson1_1Deserialize(field, utils)); -const recordsAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): Array> => +const recordsAwsRestJson1_1Deserialize = ( + input: any, + utils: DeserializerUtils +): Array> => input && input.map((recordsList: any) => recordsListAwsRestJson1_1Deserialize(recordsList, utils) ); -const recordsListAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): Array => - input && input.map((field: any) => fieldAwsRestJson1_1Deserialize(field, utils)); +const recordsListAwsRestJson1_1Deserialize = ( + input: any, + utils: DeserializerUtils +): Array => + input && + input.map((field: any) => fieldAwsRestJson1_1Deserialize(field, utils)); -const badRequestExceptionDeserialize = (input: any, utils: DeserializerUtils): BadRequestException => ({ +const badRequestExceptionDeserialize = ( + input: any, + utils: DeserializerUtils +): BadRequestException => ({ __type: "com.amazon.rdsdataservice#BadRequestException", $name: "BadRequestException", $fault: "client", @@ -311,7 +339,10 @@ const statementTimeoutExceptionDeserialize = ( dbConnectionId: input.dbConnectionId }); -const forbiddenExceptionDeserialize = (input: any, utils: DeserializerUtils): ForbiddenException => ({ +const forbiddenExceptionDeserialize = ( + input: any, + utils: DeserializerUtils +): ForbiddenException => ({ __type: "com.amazon.rdsdataservice#ForbiddenException", $name: "ForbiddenException", $fault: "client", diff --git a/clients/node/client-rds-data-node/protocol/ExecuteStatement.ts b/clients/node/client-rds-data-node/protocol/ExecuteStatement.ts index 804b2115e99a..498067f87428 100644 --- a/clients/node/client-rds-data-node/protocol/ExecuteStatement.ts +++ b/clients/node/client-rds-data-node/protocol/ExecuteStatement.ts @@ -33,4 +33,4 @@ export async function executeStatementDeserializer( default: throw new Error("Unknown protocol, use aws.rest-json-1.1"); } -} \ No newline at end of file +} diff --git a/clients/node/client-rds-data-node/tsconfig.es.json b/clients/node/client-rds-data-node/tsconfig.es.json index 7692b3069926..60e5ef3e90cd 100644 --- a/clients/node/client-rds-data-node/tsconfig.es.json +++ b/clients/node/client-rds-data-node/tsconfig.es.json @@ -15,4 +15,4 @@ ], "outDir": "dist/es" } -} \ No newline at end of file +} diff --git a/clients/node/client-rds-data-node/tsconfig.json b/clients/node/client-rds-data-node/tsconfig.json index 181286d5daef..d0d1a7e6f04f 100644 --- a/clients/node/client-rds-data-node/tsconfig.json +++ b/clients/node/client-rds-data-node/tsconfig.json @@ -25,4 +25,4 @@ "out": "./docs", "plugin": "@aws-sdk/client-documentation-generator" } -} \ No newline at end of file +}