Skip to content

Commit 88b99e8

Browse files
committed
chore(protocol_tests): consume httpQueryParams trait
1 parent cb0d4ed commit 88b99e8

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

protocol_tests/aws-restjson/protocols/Aws_restJson1.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ export const serializeAws_restJson1AllQueryStringTypesCommand = async (
150150
const headers: any = {};
151151
let resolvedPath = "/AllQueryStringTypesInput";
152152
const query: any = {
153+
...(input.queryParamsMapOfStrings !== undefined &&
154+
Object.entries(input.queryParamsMapOfStrings || {}).reduce(
155+
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
156+
{}
157+
)),
153158
...(input.queryString !== undefined && { String: input.queryString }),
154159
...(input.queryStringList !== undefined && { StringList: (input.queryStringList || []).map((_entry) => _entry) }),
155160
...(input.queryStringSet !== undefined && {
@@ -1233,6 +1238,11 @@ export const serializeAws_restJson1QueryParamsAsStringListMapCommand = async (
12331238
const headers: any = {};
12341239
let resolvedPath = "/StringListMap";
12351240
const query: any = {
1241+
...(input.foo !== undefined &&
1242+
Object.entries(input.foo || {}).reduce(
1243+
(acc: any, [key, value]: [string, string[]]) => ({ ...acc, [key]: (value || []).map((_entry) => _entry) }),
1244+
{}
1245+
)),
12361246
...(input.qux !== undefined && { corge: input.qux }),
12371247
};
12381248
let body: any;
@@ -1256,6 +1266,11 @@ export const serializeAws_restJson1QueryPrecedenceCommand = async (
12561266
const headers: any = {};
12571267
let resolvedPath = "/Precedence";
12581268
const query: any = {
1269+
...(input.baz !== undefined &&
1270+
Object.entries(input.baz || {}).reduce(
1271+
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
1272+
{}
1273+
)),
12591274
...(input.foo !== undefined && { bar: input.foo }),
12601275
};
12611276
let body: any;

protocol_tests/aws-restxml/protocols/Aws_restXml.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ export const serializeAws_restXmlAllQueryStringTypesCommand = async (
173173
const headers: any = {};
174174
let resolvedPath = "/AllQueryStringTypesInput";
175175
const query: any = {
176+
...(input.queryParamsMapOfStrings !== undefined &&
177+
Object.entries(input.queryParamsMapOfStrings || {}).reduce(
178+
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
179+
{}
180+
)),
176181
...(input.queryString !== undefined && { String: input.queryString }),
177182
...(input.queryStringList !== undefined && { StringList: (input.queryStringList || []).map((_entry) => _entry) }),
178183
...(input.queryStringSet !== undefined && {
@@ -1148,6 +1153,11 @@ export const serializeAws_restXmlQueryParamsAsStringListMapCommand = async (
11481153
const headers: any = {};
11491154
let resolvedPath = "/StringListMap";
11501155
const query: any = {
1156+
...(input.foo !== undefined &&
1157+
Object.entries(input.foo || {}).reduce(
1158+
(acc: any, [key, value]: [string, string[]]) => ({ ...acc, [key]: (value || []).map((_entry) => _entry) }),
1159+
{}
1160+
)),
11511161
...(input.qux !== undefined && { corge: input.qux }),
11521162
};
11531163
let body: any;
@@ -1171,6 +1181,11 @@ export const serializeAws_restXmlQueryPrecedenceCommand = async (
11711181
const headers: any = {};
11721182
let resolvedPath = "/Precedence";
11731183
const query: any = {
1184+
...(input.baz !== undefined &&
1185+
Object.entries(input.baz || {}).reduce(
1186+
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
1187+
{}
1188+
)),
11741189
...(input.foo !== undefined && { bar: input.foo }),
11751190
};
11761191
let body: any;

0 commit comments

Comments
 (0)