Skip to content

Commit 6a49116

Browse files
committed
chore: clients generation
1 parent b6521a2 commit 6a49116

File tree

4 files changed

+454
-337
lines changed

4 files changed

+454
-337
lines changed

private/aws-protocoltests-restjson-schema/src/schemas/schemas.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,8 +2046,8 @@ export var TimestampFormatHeadersIO = struct(
20462046
);
20472047
export var TopLevel = struct(n0, _TLo, 0, [_di, _dLi, _dMi], [() => Dialog, () => DialogList, () => DialogMap]);
20482048
export var UnionInputOutput = struct(n0, _UIO, 0, [_con], [() => MyUnion]);
2049-
export var GreetingStruct_n2 = struct(n2, _GS, 0, [_sa], [0]);
2050-
export var GreetingStruct = struct(n1, _GS, 0, [_hi], [0]);
2049+
export var GreetingStruct = struct(n2, _GS, 0, [_sa], [0]);
2050+
export var GreetingStruct_n1 = struct(n1, _GS, 0, [_hi], [0]);
20512051
export var Unit = "unit" as const;
20522052

20532053
export var RestJsonProtocolServiceException = error(
@@ -2110,7 +2110,7 @@ export var DenseNumberMap = 128 | 1;
21102110
export var DenseSetMap = map(n0, _DSM, 0, 0, 64 | 0);
21112111
export var DenseStringMap = 128 | 0;
21122112

2113-
export var DenseStructMap = map(n0, _DSMe, 0, 0, () => GreetingStruct);
2113+
export var DenseStructMap = map(n0, _DSMe, 0, 0, () => GreetingStruct_n1);
21142114
export var DialogMap = map(n0, _DM, 0, 0, () => Dialog);
21152115
export var DocumentValuedMap = 128 | 15;
21162116

@@ -2150,7 +2150,7 @@ export var SparseStructMap = map(
21502150
[_sp]: 1,
21512151
},
21522152
0,
2153-
() => GreetingStruct
2153+
() => GreetingStruct_n1
21542154
);
21552155
export var TestStringMap = 128 | 0;
21562156

@@ -2175,7 +2175,7 @@ export var MyUnion = uni(
21752175
_MU,
21762176
0,
21772177
[_sV, _bVo, _nVu, _bVl, _tV, _eV, _lVi, _mV, _sVt, _rSV],
2178-
[0, 2, 1, 21, 4, 0, 64 | 0, 128 | 0, () => GreetingStruct, () => GreetingStruct_n2]
2178+
[0, 2, 1, 21, 4, 0, 64 | 0, 128 | 0, () => GreetingStruct_n1, () => GreetingStruct]
21792179
);
21802180
export var PlayerAction = uni(n0, _PA, 0, [_qu], [() => Unit]);
21812181
export var SimpleUnion = uni(n0, _SU, 0, [_int, _st], [1, 0]);
@@ -2570,7 +2570,7 @@ export var MalformedAcceptWithBody = op(
25702570
[_ht]: ["POST", "/MalformedAcceptWithBody", 200],
25712571
},
25722572
() => Unit,
2573-
() => GreetingStruct
2573+
() => GreetingStruct_n1
25742574
);
25752575
export var MalformedAcceptWithGenericString = op(
25762576
n0,
@@ -2623,7 +2623,7 @@ export var MalformedContentTypeWithBody = op(
26232623
{
26242624
[_ht]: ["POST", "/MalformedContentTypeWithBody", 200],
26252625
},
2626-
() => GreetingStruct,
2626+
() => GreetingStruct_n1,
26272627
() => Unit
26282628
);
26292629
export var MalformedContentTypeWithGenericString = op(

private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2785,6 +2785,40 @@ it("RestJsonHttpPayloadWithStructure:Response", async () => {
27852785
});
27862786
});
27872787

2788+
/**
2789+
* Serializes a structure in the payload
2790+
*/
2791+
it("RestJsonHttpPayloadWithStructureAndEmptyResponseBody:Response", async () => {
2792+
const client = new RestJsonProtocolClient({
2793+
...clientParams,
2794+
requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``),
2795+
});
2796+
2797+
const params: any = {};
2798+
const command = new HttpPayloadWithStructureCommand(params);
2799+
2800+
let r: any;
2801+
try {
2802+
r = await client.send(command);
2803+
} catch (err) {
2804+
fail("Expected a valid response to be returned, got " + err);
2805+
return;
2806+
}
2807+
expect(r["$metadata"].httpStatusCode).toBe(200);
2808+
const paramsToValidate: any = [
2809+
{
2810+
nested: null,
2811+
},
2812+
][0];
2813+
Object.keys(paramsToValidate).forEach((param) => {
2814+
expect(
2815+
r[param],
2816+
`The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`
2817+
).toBeDefined();
2818+
expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);
2819+
});
2820+
});
2821+
27882822
/**
27892823
* Serializes a union in the payload.
27902824
*/

private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2785,6 +2785,40 @@ it("RestJsonHttpPayloadWithStructure:Response", async () => {
27852785
});
27862786
});
27872787

2788+
/**
2789+
* Serializes a structure in the payload
2790+
*/
2791+
it("RestJsonHttpPayloadWithStructureAndEmptyResponseBody:Response", async () => {
2792+
const client = new RestJsonProtocolClient({
2793+
...clientParams,
2794+
requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``),
2795+
});
2796+
2797+
const params: any = {};
2798+
const command = new HttpPayloadWithStructureCommand(params);
2799+
2800+
let r: any;
2801+
try {
2802+
r = await client.send(command);
2803+
} catch (err) {
2804+
fail("Expected a valid response to be returned, got " + err);
2805+
return;
2806+
}
2807+
expect(r["$metadata"].httpStatusCode).toBe(200);
2808+
const paramsToValidate: any = [
2809+
{
2810+
nested: null,
2811+
},
2812+
][0];
2813+
Object.keys(paramsToValidate).forEach((param) => {
2814+
expect(
2815+
r[param],
2816+
`The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`
2817+
).toBeDefined();
2818+
expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);
2819+
});
2820+
});
2821+
27882822
/**
27892823
* Serializes a union in the payload.
27902824
*/

0 commit comments

Comments
 (0)