Skip to content

Commit

Permalink
chore: use java text block
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Mar 14, 2024
1 parent aaf0c59 commit 70c5927
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
26 changes: 13 additions & 13 deletions smithy-typescript-codegen-test/model/weather/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ apply GetCity @httpResponseTests([
code: 200
body: """
{
"name": "Seattle",
"coordinates": {
"latitude": 12.34,
"longitude": -56.78
},
"city": {
"cityId": "123",
"name": "Seattle",
"number": "One",
"case": "Upper"
}
"name": "Seattle",
"coordinates": {
"latitude": 12.34,
"longitude": -56.78
},
"city": {
"cityId": "123",
"name": "Seattle",
"number": "One",
"case": "Upper"
}
}"""
bodyMediaType: "application/json"
params: {
Expand Down Expand Up @@ -259,8 +259,8 @@ apply NoSuchResource @httpResponseTests([
code: 404
body: """
{
"resourceType": "City",
"message": "Your custom message"
"resourceType": "City",
"message": "Your custom message"
}"""
bodyMediaType: "application/json"
params: { resourceType: "City", message: "Your custom message" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,24 @@ public void run() {
).orElse(true);
if (inputOptional) {
writer.addImport("OptionalParameter", null, TypeScriptDependency.SMITHY_TYPES);
writer.write("""
$L(): Promise<$T>;""", methodName, output);
writer.write("$L(): Promise<$T>;", methodName, output);
}
writer.write("""
$L(
args: $T,
options?: $T,
): Promise<$T>;""", methodName, input, applicationProtocol.getOptionsType(), output);
writer.write("""
$L(
args: $T,
cb: (err: any, data?: $T) => void
): void;""", methodName, input, output);
writer.write("""
$L(
args: $T,
options: $T,
cb: (err: any, data?: $T) => void
): void;""", methodName, input, applicationProtocol.getOptionsType(), output);
$1L(
args: $2T,
options?: $3T,
): Promise<$4T>;
$1L(
args: $2T,
cb: (err: any, data?: $4T) => void
): void;
$1L(
args: $2T,
options: $3T,
cb: (err: any, data?: $4T) => void
): void;""",
methodName, input, applicationProtocol.getOptionsType(), output
);
writer.write("");
}
});
Expand Down

0 comments on commit 70c5927

Please sign in to comment.