Skip to content

Commit 60ef7d6

Browse files
committed
chore(api-gateway): simplify request query string for httpQueryParams trait
1 parent def70f0 commit 60ef7d6

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

clients/client-api-gateway/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,11 +2339,7 @@ export const serializeAws_restJson1GetExportCommand = async (
23392339
throw new Error("No value provided for input HTTP label: exportType.");
23402340
}
23412341
const query: any = {
2342-
...(input.parameters !== undefined &&
2343-
Object.entries(input.parameters || {}).reduce(
2344-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
2345-
{}
2346-
)),
2342+
...(input.parameters !== undefined && input.parameters),
23472343
};
23482344
let body: any;
23492345
const { hostname, protocol = "https", port } = await context.endpoint();
@@ -2974,11 +2970,7 @@ export const serializeAws_restJson1GetSdkCommand = async (
29742970
throw new Error("No value provided for input HTTP label: sdkType.");
29752971
}
29762972
const query: any = {
2977-
...(input.parameters !== undefined &&
2978-
Object.entries(input.parameters || {}).reduce(
2979-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
2980-
{}
2981-
)),
2973+
...(input.parameters !== undefined && input.parameters),
29822974
};
29832975
let body: any;
29842976
const { hostname, protocol = "https", port } = await context.endpoint();
@@ -3438,11 +3430,7 @@ export const serializeAws_restJson1ImportRestApiCommand = async (
34383430
let resolvedPath = "/restapis";
34393431
const query: any = {
34403432
mode: "import",
3441-
...(input.parameters !== undefined &&
3442-
Object.entries(input.parameters || {}).reduce(
3443-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
3444-
{}
3445-
)),
3433+
...(input.parameters !== undefined && input.parameters),
34463434
...(input.failOnWarnings !== undefined && { failonwarnings: input.failOnWarnings.toString() }),
34473435
};
34483436
let body: any;
@@ -3819,11 +3807,7 @@ export const serializeAws_restJson1PutRestApiCommand = async (
38193807
throw new Error("No value provided for input HTTP label: restApiId.");
38203808
}
38213809
const query: any = {
3822-
...(input.parameters !== undefined &&
3823-
Object.entries(input.parameters || {}).reduce(
3824-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
3825-
{}
3826-
)),
3810+
...(input.parameters !== undefined && input.parameters),
38273811
...(input.mode !== undefined && { mode: input.mode }),
38283812
...(input.failOnWarnings !== undefined && { failonwarnings: input.failOnWarnings.toString() }),
38293813
};

0 commit comments

Comments
 (0)