Skip to content

Commit

Permalink
chore: set prettier-vscode as default formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Oct 21, 2019
1 parent 2a4e609 commit a7b4ef8
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": true
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
32 changes: 22 additions & 10 deletions clients/node/client-rds-data-node/RDSDataClient.ts
Original file line number Diff line number Diff line change
@@ -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<HttpOptions, InputTypesUnion, OutputTypesUnion> {
export class RDSDataClient extends SmithyClient<
HttpOptions,
InputTypesUnion,
OutputTypesUnion
> {
readonly config: RDSDataResolvedConfiguration;

constructor(configuration: RDSDataConfiguration) {
Expand All @@ -36,9 +50,7 @@ export class RDSDataClient extends SmithyClient<HttpOptions, InputTypesUnion, Ou
}

destroy(): void {
if (
typeof this.config.httpHandler.destroy === 'function'
) {
if (typeof this.config.httpHandler.destroy === "function") {
this.config.httpHandler.destroy();
}
}
Expand Down
1 change: 1 addition & 0 deletions clients/node/client-rds-data-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## Description

<fullname>Amazon RDS Data Service</fullname>

<p>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.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type OutputTypesUnion = any;
export class ExecuteStatementCommand extends Command<
ExecuteStatementRequest,
ExecuteStatementResponse
> {
> {
constructor(readonly input: ExecuteStatementRequest) {
super();
}
Expand All @@ -28,13 +28,18 @@ export class ExecuteStatementCommand extends Command<
clientStack: MiddlewareStack<InputTypesUnion, OutputTypesUnion>,
configuration: RDSDataResolvedConfiguration,
options?: HttpOptions
): Handler<
ExecuteStatementRequest,
ExecuteStatementResponse
> {
const { protocol: { handler } } = configuration;
): Handler<ExecuteStatementRequest, ExecuteStatementResponse> {
const {
protocol: { handler }
} = configuration;

this.use(serdePlugin(configuration, executeStatementSerializer, executeStatementDeserializer));
this.use(
serdePlugin(
configuration,
executeStatementSerializer,
executeStatementDeserializer
)
);

const stack = clientStack.concat(this.middlewareStack);

Expand Down
2 changes: 1 addition & 1 deletion clients/node/client-rds-data-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
"typedoc": "^0.14.2",
"typescript": "^3.7.0-dev.20190926"
}
}
}
55 changes: 43 additions & 12 deletions clients/node/client-rds-data-node/protocol/AwsRestJson1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -134,16 +137,24 @@ const sqlParameterListAwsRestJson1_1Serialize = (
utils: SerializerUtils
): Array<SqlParameter> =>
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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -281,19 +295,33 @@ const fieldAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): a
}
});

const generatedFieldsAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): Array<Field> =>
input && input.map((field: any) => fieldAwsRestJson1_1Deserialize(field, utils));
const generatedFieldsAwsRestJson1_1Deserialize = (
input: any,
utils: DeserializerUtils
): Array<Field> =>
input &&
input.map((field: any) => fieldAwsRestJson1_1Deserialize(field, utils));

const recordsAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): Array<Array<Field>> =>
const recordsAwsRestJson1_1Deserialize = (
input: any,
utils: DeserializerUtils
): Array<Array<Field>> =>
input &&
input.map((recordsList: any) =>
recordsListAwsRestJson1_1Deserialize(recordsList, utils)
);

const recordsListAwsRestJson1_1Deserialize = (input: any, utils: DeserializerUtils): Array<Field> =>
input && input.map((field: any) => fieldAwsRestJson1_1Deserialize(field, utils));
const recordsListAwsRestJson1_1Deserialize = (
input: any,
utils: DeserializerUtils
): Array<Field> =>
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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export async function executeStatementDeserializer(
default:
throw new Error("Unknown protocol, use aws.rest-json-1.1");
}
}
}
2 changes: 1 addition & 1 deletion clients/node/client-rds-data-node/tsconfig.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
],
"outDir": "dist/es"
}
}
}
2 changes: 1 addition & 1 deletion clients/node/client-rds-data-node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"out": "./docs",
"plugin": "@aws-sdk/client-documentation-generator"
}
}
}

0 comments on commit a7b4ef8

Please sign in to comment.