Skip to content

Commit

Permalink
chore(codegen): pin smithy to minor version 1.7.x (#2197)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Apr 14, 2021
1 parent 5fe8ed6 commit da2c085
Show file tree
Hide file tree
Showing 18 changed files with 1,147 additions and 22 deletions.
2 changes: 1 addition & 1 deletion codegen/protocol-test-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
}

dependencies {
implementation("software.amazon.smithy:smithy-aws-protocol-tests:[1.6.0, 1.7.0[")
implementation("software.amazon.smithy:smithy-aws-protocol-tests:[1.7.0, 1.8.0[")
compile(project(":smithy-aws-typescript-codegen"))
}

Expand Down
6 changes: 3 additions & 3 deletions codegen/smithy-aws-typescript-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ extra["displayName"] = "Smithy :: AWS :: Typescript :: Codegen"
extra["moduleName"] = "software.amazon.smithy.aws.typescript.codegen"

dependencies {
api("software.amazon.smithy:smithy-aws-traits:[1.6.0, 1.7.0[")
api("software.amazon.smithy:smithy-waiters:[1.6.0, 1.7.0[")
api("software.amazon.smithy:smithy-aws-iam-traits:[1.6.0, 1.7.0[")
api("software.amazon.smithy:smithy-aws-traits:[1.7.0, 1.8.0[")
api("software.amazon.smithy:smithy-waiters:[1.7.0, 1.8.0[")
api("software.amazon.smithy:smithy-aws-iam-traits:[1.7.0, 1.8.0[")
api("software.amazon.smithy:smithy-typescript-codegen:0.3.0")
}
68 changes: 68 additions & 0 deletions protocol_tests/aws-restjson/RestJsonProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ import {
QueryIdempotencyTokenAutoFillCommandInput,
QueryIdempotencyTokenAutoFillCommandOutput,
} from "./commands/QueryIdempotencyTokenAutoFillCommand";
import {
QueryParamsAsStringListMapCommand,
QueryParamsAsStringListMapCommandInput,
QueryParamsAsStringListMapCommandOutput,
} from "./commands/QueryParamsAsStringListMapCommand";
import {
QueryPrecedenceCommand,
QueryPrecedenceCommandInput,
QueryPrecedenceCommandOutput,
} from "./commands/QueryPrecedenceCommand";
import {
RecursiveShapesCommand,
RecursiveShapesCommandInput,
Expand Down Expand Up @@ -1238,6 +1248,64 @@ export class RestJsonProtocol extends RestJsonProtocolClient {
}
}

public queryParamsAsStringListMap(
args: QueryParamsAsStringListMapCommandInput,
options?: __HttpHandlerOptions
): Promise<QueryParamsAsStringListMapCommandOutput>;
public queryParamsAsStringListMap(
args: QueryParamsAsStringListMapCommandInput,
cb: (err: any, data?: QueryParamsAsStringListMapCommandOutput) => void
): void;
public queryParamsAsStringListMap(
args: QueryParamsAsStringListMapCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: QueryParamsAsStringListMapCommandOutput) => void
): void;
public queryParamsAsStringListMap(
args: QueryParamsAsStringListMapCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: QueryParamsAsStringListMapCommandOutput) => void),
cb?: (err: any, data?: QueryParamsAsStringListMapCommandOutput) => void
): Promise<QueryParamsAsStringListMapCommandOutput> | void {
const command = new QueryParamsAsStringListMapCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

public queryPrecedence(
args: QueryPrecedenceCommandInput,
options?: __HttpHandlerOptions
): Promise<QueryPrecedenceCommandOutput>;
public queryPrecedence(
args: QueryPrecedenceCommandInput,
cb: (err: any, data?: QueryPrecedenceCommandOutput) => void
): void;
public queryPrecedence(
args: QueryPrecedenceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: QueryPrecedenceCommandOutput) => void
): void;
public queryPrecedence(
args: QueryPrecedenceCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: QueryPrecedenceCommandOutput) => void),
cb?: (err: any, data?: QueryPrecedenceCommandOutput) => void
): Promise<QueryPrecedenceCommandOutput> | void {
const command = new QueryPrecedenceCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* Recursive shapes
*/
Expand Down
9 changes: 9 additions & 0 deletions protocol_tests/aws-restjson/RestJsonProtocolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ import {
QueryIdempotencyTokenAutoFillCommandInput,
QueryIdempotencyTokenAutoFillCommandOutput,
} from "./commands/QueryIdempotencyTokenAutoFillCommand";
import {
QueryParamsAsStringListMapCommandInput,
QueryParamsAsStringListMapCommandOutput,
} from "./commands/QueryParamsAsStringListMapCommand";
import { QueryPrecedenceCommandInput, QueryPrecedenceCommandOutput } from "./commands/QueryPrecedenceCommand";
import { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from "./commands/RecursiveShapesCommand";
import {
SimpleScalarPropertiesCommandInput,
Expand Down Expand Up @@ -188,6 +193,8 @@ export type ServiceInputTypes =
| NullAndEmptyHeadersServerCommandInput
| OmitsNullSerializesEmptyStringCommandInput
| QueryIdempotencyTokenAutoFillCommandInput
| QueryParamsAsStringListMapCommandInput
| QueryPrecedenceCommandInput
| RecursiveShapesCommandInput
| SimpleScalarPropertiesCommandInput
| StreamingTraitsCommandInput
Expand Down Expand Up @@ -229,6 +236,8 @@ export type ServiceOutputTypes =
| NullAndEmptyHeadersServerCommandOutput
| OmitsNullSerializesEmptyStringCommandOutput
| QueryIdempotencyTokenAutoFillCommandOutput
| QueryParamsAsStringListMapCommandOutput
| QueryPrecedenceCommandOutput
| RecursiveShapesCommandOutput
| SimpleScalarPropertiesCommandOutput
| StreamingTraitsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient";
import { QueryParamsAsStringListMapInput } from "../models/models_0";
import {
deserializeAws_restJson1QueryParamsAsStringListMapCommand,
serializeAws_restJson1QueryParamsAsStringListMapCommand,
} from "../protocols/Aws_restJson1";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
MiddlewareStack,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

export type QueryParamsAsStringListMapCommandInput = QueryParamsAsStringListMapInput;
export type QueryParamsAsStringListMapCommandOutput = __MetadataBearer;

export class QueryParamsAsStringListMapCommand extends $Command<
QueryParamsAsStringListMapCommandInput,
QueryParamsAsStringListMapCommandOutput,
RestJsonProtocolClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: QueryParamsAsStringListMapCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: RestJsonProtocolClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<QueryParamsAsStringListMapCommandInput, QueryParamsAsStringListMapCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

const { logger } = configuration;
const clientName = "RestJsonProtocolClient";
const commandName = "QueryParamsAsStringListMapCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: QueryParamsAsStringListMapInput.filterSensitiveLog,
outputFilterSensitiveLog: (output: any) => output,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: QueryParamsAsStringListMapCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1QueryParamsAsStringListMapCommand(input, context);
}

private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<QueryParamsAsStringListMapCommandOutput> {
return deserializeAws_restJson1QueryParamsAsStringListMapCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
77 changes: 77 additions & 0 deletions protocol_tests/aws-restjson/commands/QueryPrecedenceCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient";
import { QueryPrecedenceInput } from "../models/models_0";
import {
deserializeAws_restJson1QueryPrecedenceCommand,
serializeAws_restJson1QueryPrecedenceCommand,
} from "../protocols/Aws_restJson1";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
MiddlewareStack,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

export type QueryPrecedenceCommandInput = QueryPrecedenceInput;
export type QueryPrecedenceCommandOutput = __MetadataBearer;

export class QueryPrecedenceCommand extends $Command<
QueryPrecedenceCommandInput,
QueryPrecedenceCommandOutput,
RestJsonProtocolClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: QueryPrecedenceCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: RestJsonProtocolClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<QueryPrecedenceCommandInput, QueryPrecedenceCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

const { logger } = configuration;
const clientName = "RestJsonProtocolClient";
const commandName = "QueryPrecedenceCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: QueryPrecedenceInput.filterSensitiveLog,
outputFilterSensitiveLog: (output: any) => output,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: QueryPrecedenceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1QueryPrecedenceCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<QueryPrecedenceCommandOutput> {
return deserializeAws_restJson1QueryPrecedenceCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
2 changes: 2 additions & 0 deletions protocol_tests/aws-restjson/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export * from "./commands/NullAndEmptyHeadersClientCommand";
export * from "./commands/NullAndEmptyHeadersServerCommand";
export * from "./commands/OmitsNullSerializesEmptyStringCommand";
export * from "./commands/QueryIdempotencyTokenAutoFillCommand";
export * from "./commands/QueryParamsAsStringListMapCommand";
export * from "./commands/QueryPrecedenceCommand";
export * from "./commands/RecursiveShapesCommand";
export * from "./commands/SimpleScalarPropertiesCommand";
export * from "./commands/StreamingTraitsCommand";
Expand Down

0 comments on commit da2c085

Please sign in to comment.