@anweather/game-plugin-ssdk 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist-cjs/runtime/defaultService.js +18 -0
  2. package/dist-cjs/runtime/express.js +39 -0
  3. package/dist-cjs/runtime/index.js +7 -0
  4. package/dist-cjs/src/endpoint/EndpointParameters.js +12 -0
  5. package/dist-cjs/src/endpoint/endpointResolver.js +16 -0
  6. package/dist-cjs/src/endpoint/ruleset.js +38 -0
  7. package/dist-cjs/src/index.js +7 -0
  8. package/dist-cjs/src/models/index.js +4 -0
  9. package/dist-cjs/src/models/models_0.js +860 -0
  10. package/dist-cjs/src/protocols/Aws_restJson1.js +1077 -0
  11. package/dist-cjs/src/server/GamePluginService.js +231 -0
  12. package/dist-cjs/src/server/index.js +5 -0
  13. package/dist-cjs/src/server/operations/ApplyMove.js +109 -0
  14. package/dist-cjs/src/server/operations/ApplySaveFileEdit.js +109 -0
  15. package/dist-cjs/src/server/operations/AssignParticipants.js +101 -0
  16. package/dist-cjs/src/server/operations/DescribeSaveFile.js +101 -0
  17. package/dist-cjs/src/server/operations/GetGameResult.js +101 -0
  18. package/dist-cjs/src/server/operations/GetGameStatus.js +101 -0
  19. package/dist-cjs/src/server/operations/GetMetadata.js +99 -0
  20. package/dist-cjs/src/server/operations/GetPlayerView.js +101 -0
  21. package/dist-cjs/src/server/operations/GetSaveFileEditorState.js +101 -0
  22. package/dist-cjs/src/server/operations/Health.js +99 -0
  23. package/dist-cjs/src/server/operations/InitializeGame.js +101 -0
  24. package/dist-cjs/src/server/operations/IsConfigMove.js +101 -0
  25. package/dist-cjs/src/server/operations/IsOutOfTurnMove.js +101 -0
  26. package/dist-cjs/src/server/operations/SelectBotMove.js +101 -0
  27. package/dist-cjs/src/server/operations/ValidateMove.js +101 -0
  28. package/dist-cjs/src/server/operations/index.js +18 -0
  29. package/dist-cjs/tsconfig.cjs.tsbuildinfo +1 -0
  30. package/dist-es/runtime/defaultService.js +15 -0
  31. package/dist-es/runtime/express.js +36 -0
  32. package/dist-es/runtime/index.js +2 -0
  33. package/dist-es/src/endpoint/EndpointParameters.js +8 -0
  34. package/dist-es/src/endpoint/endpointResolver.js +12 -0
  35. package/dist-es/src/endpoint/ruleset.js +35 -0
  36. package/dist-es/src/index.js +3 -0
  37. package/dist-es/src/models/index.js +1 -0
  38. package/dist-es/src/models/models_0.js +855 -0
  39. package/dist-es/src/protocols/Aws_restJson1.js +1041 -0
  40. package/dist-es/src/server/GamePluginService.js +226 -0
  41. package/dist-es/src/server/index.js +2 -0
  42. package/dist-es/src/server/operations/ApplyMove.js +103 -0
  43. package/dist-es/src/server/operations/ApplySaveFileEdit.js +103 -0
  44. package/dist-es/src/server/operations/AssignParticipants.js +95 -0
  45. package/dist-es/src/server/operations/DescribeSaveFile.js +95 -0
  46. package/dist-es/src/server/operations/GetGameResult.js +95 -0
  47. package/dist-es/src/server/operations/GetGameStatus.js +95 -0
  48. package/dist-es/src/server/operations/GetMetadata.js +93 -0
  49. package/dist-es/src/server/operations/GetPlayerView.js +95 -0
  50. package/dist-es/src/server/operations/GetSaveFileEditorState.js +95 -0
  51. package/dist-es/src/server/operations/Health.js +93 -0
  52. package/dist-es/src/server/operations/InitializeGame.js +95 -0
  53. package/dist-es/src/server/operations/IsConfigMove.js +95 -0
  54. package/dist-es/src/server/operations/IsOutOfTurnMove.js +95 -0
  55. package/dist-es/src/server/operations/SelectBotMove.js +95 -0
  56. package/dist-es/src/server/operations/ValidateMove.js +95 -0
  57. package/dist-es/src/server/operations/index.js +15 -0
  58. package/dist-es/tsconfig.es.tsbuildinfo +1 -0
  59. package/dist-types/runtime/defaultService.d.ts +9 -0
  60. package/dist-types/runtime/express.d.ts +12 -0
  61. package/dist-types/runtime/index.d.ts +3 -0
  62. package/dist-types/src/endpoint/EndpointParameters.d.ts +20 -0
  63. package/dist-types/src/endpoint/endpointResolver.d.ts +5 -0
  64. package/dist-types/src/endpoint/ruleset.d.ts +2 -0
  65. package/dist-types/src/index.d.ts +22 -0
  66. package/dist-types/src/models/index.d.ts +1 -0
  67. package/dist-types/src/models/models_0.d.ts +402 -0
  68. package/dist-types/src/protocols/Aws_restJson1.d.ts +52 -0
  69. package/dist-types/src/server/GamePluginService.d.ts +54 -0
  70. package/dist-types/src/server/index.d.ts +2 -0
  71. package/dist-types/src/server/operations/ApplyMove.d.ts +41 -0
  72. package/dist-types/src/server/operations/ApplySaveFileEdit.d.ts +41 -0
  73. package/dist-types/src/server/operations/AssignParticipants.d.ts +41 -0
  74. package/dist-types/src/server/operations/DescribeSaveFile.d.ts +41 -0
  75. package/dist-types/src/server/operations/GetGameResult.d.ts +41 -0
  76. package/dist-types/src/server/operations/GetGameStatus.d.ts +41 -0
  77. package/dist-types/src/server/operations/GetMetadata.d.ts +41 -0
  78. package/dist-types/src/server/operations/GetPlayerView.d.ts +41 -0
  79. package/dist-types/src/server/operations/GetSaveFileEditorState.d.ts +41 -0
  80. package/dist-types/src/server/operations/Health.d.ts +41 -0
  81. package/dist-types/src/server/operations/InitializeGame.d.ts +41 -0
  82. package/dist-types/src/server/operations/IsConfigMove.d.ts +41 -0
  83. package/dist-types/src/server/operations/IsOutOfTurnMove.d.ts +41 -0
  84. package/dist-types/src/server/operations/SelectBotMove.d.ts +41 -0
  85. package/dist-types/src/server/operations/ValidateMove.d.ts +41 -0
  86. package/dist-types/src/server/operations/index.d.ts +15 -0
  87. package/package.json +88 -0
  88. package/runtime/package.json +5 -0
@@ -0,0 +1,1077 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeSaveFileEditRejectedErrorError = exports.serializeInvalidMoveErrorError = exports.serializeFrameworkException = exports.serializeValidateMoveResponse = exports.serializeSelectBotMoveResponse = exports.serializeIsOutOfTurnMoveResponse = exports.serializeIsConfigMoveResponse = exports.serializeInitializeGameResponse = exports.serializeHealthResponse = exports.serializeGetSaveFileEditorStateResponse = exports.serializeGetPlayerViewResponse = exports.serializeGetMetadataResponse = exports.serializeGetGameStatusResponse = exports.serializeGetGameResultResponse = exports.serializeDescribeSaveFileResponse = exports.serializeAssignParticipantsResponse = exports.serializeApplySaveFileEditResponse = exports.serializeApplyMoveResponse = exports.deserializeValidateMoveRequest = exports.deserializeSelectBotMoveRequest = exports.deserializeIsOutOfTurnMoveRequest = exports.deserializeIsConfigMoveRequest = exports.deserializeInitializeGameRequest = exports.deserializeHealthRequest = exports.deserializeGetSaveFileEditorStateRequest = exports.deserializeGetPlayerViewRequest = exports.deserializeGetMetadataRequest = exports.deserializeGetGameStatusRequest = exports.deserializeGetGameResultRequest = exports.deserializeDescribeSaveFileRequest = exports.deserializeAssignParticipantsRequest = exports.deserializeApplySaveFileEditRequest = exports.deserializeApplyMoveRequest = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const server_common_1 = require("@aws-smithy/server-common");
6
+ const protocol_http_1 = require("@smithy/protocol-http");
7
+ const smithy_client_1 = require("@smithy/smithy-client");
8
+ const util_body_length_node_1 = require("@smithy/util-body-length-node");
9
+ const deserializeApplyMoveRequest = async (output, context) => {
10
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
11
+ if (contentTypeHeaderKey != null) {
12
+ const contentType = output.headers[contentTypeHeaderKey];
13
+ if (contentType !== undefined && contentType !== "application/json") {
14
+ throw new server_common_1.UnsupportedMediaTypeException();
15
+ }
16
+ ;
17
+ }
18
+ ;
19
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
20
+ if (acceptHeaderKey != null) {
21
+ const accept = output.headers[acceptHeaderKey];
22
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
23
+ throw new server_common_1.NotAcceptableException();
24
+ }
25
+ ;
26
+ }
27
+ ;
28
+ const contents = (0, smithy_client_1.map)({});
29
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
30
+ const doc = (0, smithy_client_1.take)(data, {
31
+ 'move': _ => de_Move(_, context),
32
+ 'pluginState': _ => de_Document(_, context),
33
+ });
34
+ Object.assign(contents, doc);
35
+ return contents;
36
+ };
37
+ exports.deserializeApplyMoveRequest = deserializeApplyMoveRequest;
38
+ const deserializeApplySaveFileEditRequest = async (output, context) => {
39
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
40
+ if (contentTypeHeaderKey != null) {
41
+ const contentType = output.headers[contentTypeHeaderKey];
42
+ if (contentType !== undefined && contentType !== "application/json") {
43
+ throw new server_common_1.UnsupportedMediaTypeException();
44
+ }
45
+ ;
46
+ }
47
+ ;
48
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
49
+ if (acceptHeaderKey != null) {
50
+ const accept = output.headers[acceptHeaderKey];
51
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
52
+ throw new server_common_1.NotAcceptableException();
53
+ }
54
+ ;
55
+ }
56
+ ;
57
+ const contents = (0, smithy_client_1.map)({});
58
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
59
+ const doc = (0, smithy_client_1.take)(data, {
60
+ 'edit': _ => de_Document(_, context),
61
+ 'profile': _ => de_Document(_, context),
62
+ });
63
+ Object.assign(contents, doc);
64
+ return contents;
65
+ };
66
+ exports.deserializeApplySaveFileEditRequest = deserializeApplySaveFileEditRequest;
67
+ const deserializeAssignParticipantsRequest = async (output, context) => {
68
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
69
+ if (contentTypeHeaderKey != null) {
70
+ const contentType = output.headers[contentTypeHeaderKey];
71
+ if (contentType !== undefined && contentType !== "application/json") {
72
+ throw new server_common_1.UnsupportedMediaTypeException();
73
+ }
74
+ ;
75
+ }
76
+ ;
77
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
78
+ if (acceptHeaderKey != null) {
79
+ const accept = output.headers[acceptHeaderKey];
80
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
81
+ throw new server_common_1.NotAcceptableException();
82
+ }
83
+ ;
84
+ }
85
+ ;
86
+ const contents = (0, smithy_client_1.map)({});
87
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
88
+ const doc = (0, smithy_client_1.take)(data, {
89
+ 'config': _ => de_Document(_, context),
90
+ 'participants': _ => de_ParticipantIdList(_, context),
91
+ });
92
+ Object.assign(contents, doc);
93
+ return contents;
94
+ };
95
+ exports.deserializeAssignParticipantsRequest = deserializeAssignParticipantsRequest;
96
+ const deserializeDescribeSaveFileRequest = async (output, context) => {
97
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
98
+ if (contentTypeHeaderKey != null) {
99
+ const contentType = output.headers[contentTypeHeaderKey];
100
+ if (contentType !== undefined && contentType !== "application/json") {
101
+ throw new server_common_1.UnsupportedMediaTypeException();
102
+ }
103
+ ;
104
+ }
105
+ ;
106
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
107
+ if (acceptHeaderKey != null) {
108
+ const accept = output.headers[acceptHeaderKey];
109
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
110
+ throw new server_common_1.NotAcceptableException();
111
+ }
112
+ ;
113
+ }
114
+ ;
115
+ const contents = (0, smithy_client_1.map)({});
116
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
117
+ const doc = (0, smithy_client_1.take)(data, {
118
+ 'profile': _ => de_Document(_, context),
119
+ });
120
+ Object.assign(contents, doc);
121
+ return contents;
122
+ };
123
+ exports.deserializeDescribeSaveFileRequest = deserializeDescribeSaveFileRequest;
124
+ const deserializeGetGameResultRequest = async (output, context) => {
125
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
126
+ if (contentTypeHeaderKey != null) {
127
+ const contentType = output.headers[contentTypeHeaderKey];
128
+ if (contentType !== undefined && contentType !== "application/json") {
129
+ throw new server_common_1.UnsupportedMediaTypeException();
130
+ }
131
+ ;
132
+ }
133
+ ;
134
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
135
+ if (acceptHeaderKey != null) {
136
+ const accept = output.headers[acceptHeaderKey];
137
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
138
+ throw new server_common_1.NotAcceptableException();
139
+ }
140
+ ;
141
+ }
142
+ ;
143
+ const contents = (0, smithy_client_1.map)({});
144
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
145
+ const doc = (0, smithy_client_1.take)(data, {
146
+ 'pluginState': _ => de_Document(_, context),
147
+ });
148
+ Object.assign(contents, doc);
149
+ return contents;
150
+ };
151
+ exports.deserializeGetGameResultRequest = deserializeGetGameResultRequest;
152
+ const deserializeGetGameStatusRequest = async (output, context) => {
153
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
154
+ if (contentTypeHeaderKey != null) {
155
+ const contentType = output.headers[contentTypeHeaderKey];
156
+ if (contentType !== undefined && contentType !== "application/json") {
157
+ throw new server_common_1.UnsupportedMediaTypeException();
158
+ }
159
+ ;
160
+ }
161
+ ;
162
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
163
+ if (acceptHeaderKey != null) {
164
+ const accept = output.headers[acceptHeaderKey];
165
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
166
+ throw new server_common_1.NotAcceptableException();
167
+ }
168
+ ;
169
+ }
170
+ ;
171
+ const contents = (0, smithy_client_1.map)({});
172
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
173
+ const doc = (0, smithy_client_1.take)(data, {
174
+ 'pluginState': _ => de_Document(_, context),
175
+ });
176
+ Object.assign(contents, doc);
177
+ return contents;
178
+ };
179
+ exports.deserializeGetGameStatusRequest = deserializeGetGameStatusRequest;
180
+ const deserializeGetMetadataRequest = async (output, context) => {
181
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
182
+ if (contentTypeHeaderKey != null) {
183
+ const contentType = output.headers[contentTypeHeaderKey];
184
+ if (contentType !== undefined) {
185
+ throw new server_common_1.UnsupportedMediaTypeException();
186
+ }
187
+ ;
188
+ }
189
+ ;
190
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
191
+ if (acceptHeaderKey != null) {
192
+ const accept = output.headers[acceptHeaderKey];
193
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
194
+ throw new server_common_1.NotAcceptableException();
195
+ }
196
+ ;
197
+ }
198
+ ;
199
+ const contents = (0, smithy_client_1.map)({});
200
+ await (0, smithy_client_1.collectBody)(output.body, context);
201
+ return contents;
202
+ };
203
+ exports.deserializeGetMetadataRequest = deserializeGetMetadataRequest;
204
+ const deserializeGetPlayerViewRequest = async (output, context) => {
205
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
206
+ if (contentTypeHeaderKey != null) {
207
+ const contentType = output.headers[contentTypeHeaderKey];
208
+ if (contentType !== undefined && contentType !== "application/json") {
209
+ throw new server_common_1.UnsupportedMediaTypeException();
210
+ }
211
+ ;
212
+ }
213
+ ;
214
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
215
+ if (acceptHeaderKey != null) {
216
+ const accept = output.headers[acceptHeaderKey];
217
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
218
+ throw new server_common_1.NotAcceptableException();
219
+ }
220
+ ;
221
+ }
222
+ ;
223
+ const contents = (0, smithy_client_1.map)({});
224
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
225
+ const doc = (0, smithy_client_1.take)(data, {
226
+ 'participantId': smithy_client_1.expectString,
227
+ 'pluginState': _ => de_Document(_, context),
228
+ });
229
+ Object.assign(contents, doc);
230
+ return contents;
231
+ };
232
+ exports.deserializeGetPlayerViewRequest = deserializeGetPlayerViewRequest;
233
+ const deserializeGetSaveFileEditorStateRequest = async (output, context) => {
234
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
235
+ if (contentTypeHeaderKey != null) {
236
+ const contentType = output.headers[contentTypeHeaderKey];
237
+ if (contentType !== undefined && contentType !== "application/json") {
238
+ throw new server_common_1.UnsupportedMediaTypeException();
239
+ }
240
+ ;
241
+ }
242
+ ;
243
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
244
+ if (acceptHeaderKey != null) {
245
+ const accept = output.headers[acceptHeaderKey];
246
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
247
+ throw new server_common_1.NotAcceptableException();
248
+ }
249
+ ;
250
+ }
251
+ ;
252
+ const contents = (0, smithy_client_1.map)({});
253
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
254
+ const doc = (0, smithy_client_1.take)(data, {
255
+ 'profile': _ => de_Document(_, context),
256
+ });
257
+ Object.assign(contents, doc);
258
+ return contents;
259
+ };
260
+ exports.deserializeGetSaveFileEditorStateRequest = deserializeGetSaveFileEditorStateRequest;
261
+ const deserializeHealthRequest = async (output, context) => {
262
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
263
+ if (contentTypeHeaderKey != null) {
264
+ const contentType = output.headers[contentTypeHeaderKey];
265
+ if (contentType !== undefined) {
266
+ throw new server_common_1.UnsupportedMediaTypeException();
267
+ }
268
+ ;
269
+ }
270
+ ;
271
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
272
+ if (acceptHeaderKey != null) {
273
+ const accept = output.headers[acceptHeaderKey];
274
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
275
+ throw new server_common_1.NotAcceptableException();
276
+ }
277
+ ;
278
+ }
279
+ ;
280
+ const contents = (0, smithy_client_1.map)({});
281
+ await (0, smithy_client_1.collectBody)(output.body, context);
282
+ return contents;
283
+ };
284
+ exports.deserializeHealthRequest = deserializeHealthRequest;
285
+ const deserializeInitializeGameRequest = async (output, context) => {
286
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
287
+ if (contentTypeHeaderKey != null) {
288
+ const contentType = output.headers[contentTypeHeaderKey];
289
+ if (contentType !== undefined && contentType !== "application/json") {
290
+ throw new server_common_1.UnsupportedMediaTypeException();
291
+ }
292
+ ;
293
+ }
294
+ ;
295
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
296
+ if (acceptHeaderKey != null) {
297
+ const accept = output.headers[acceptHeaderKey];
298
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
299
+ throw new server_common_1.NotAcceptableException();
300
+ }
301
+ ;
302
+ }
303
+ ;
304
+ const contents = (0, smithy_client_1.map)({});
305
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
306
+ const doc = (0, smithy_client_1.take)(data, {
307
+ 'config': _ => de_Document(_, context),
308
+ 'participants': _ => de_ParticipantIdList(_, context),
309
+ });
310
+ Object.assign(contents, doc);
311
+ return contents;
312
+ };
313
+ exports.deserializeInitializeGameRequest = deserializeInitializeGameRequest;
314
+ const deserializeIsConfigMoveRequest = async (output, context) => {
315
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
316
+ if (contentTypeHeaderKey != null) {
317
+ const contentType = output.headers[contentTypeHeaderKey];
318
+ if (contentType !== undefined && contentType !== "application/json") {
319
+ throw new server_common_1.UnsupportedMediaTypeException();
320
+ }
321
+ ;
322
+ }
323
+ ;
324
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
325
+ if (acceptHeaderKey != null) {
326
+ const accept = output.headers[acceptHeaderKey];
327
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
328
+ throw new server_common_1.NotAcceptableException();
329
+ }
330
+ ;
331
+ }
332
+ ;
333
+ const contents = (0, smithy_client_1.map)({});
334
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
335
+ const doc = (0, smithy_client_1.take)(data, {
336
+ 'payload': _ => de_Document(_, context),
337
+ });
338
+ Object.assign(contents, doc);
339
+ return contents;
340
+ };
341
+ exports.deserializeIsConfigMoveRequest = deserializeIsConfigMoveRequest;
342
+ const deserializeIsOutOfTurnMoveRequest = async (output, context) => {
343
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
344
+ if (contentTypeHeaderKey != null) {
345
+ const contentType = output.headers[contentTypeHeaderKey];
346
+ if (contentType !== undefined && contentType !== "application/json") {
347
+ throw new server_common_1.UnsupportedMediaTypeException();
348
+ }
349
+ ;
350
+ }
351
+ ;
352
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
353
+ if (acceptHeaderKey != null) {
354
+ const accept = output.headers[acceptHeaderKey];
355
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
356
+ throw new server_common_1.NotAcceptableException();
357
+ }
358
+ ;
359
+ }
360
+ ;
361
+ const contents = (0, smithy_client_1.map)({});
362
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
363
+ const doc = (0, smithy_client_1.take)(data, {
364
+ 'payload': _ => de_Document(_, context),
365
+ });
366
+ Object.assign(contents, doc);
367
+ return contents;
368
+ };
369
+ exports.deserializeIsOutOfTurnMoveRequest = deserializeIsOutOfTurnMoveRequest;
370
+ const deserializeSelectBotMoveRequest = async (output, context) => {
371
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
372
+ if (contentTypeHeaderKey != null) {
373
+ const contentType = output.headers[contentTypeHeaderKey];
374
+ if (contentType !== undefined && contentType !== "application/json") {
375
+ throw new server_common_1.UnsupportedMediaTypeException();
376
+ }
377
+ ;
378
+ }
379
+ ;
380
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
381
+ if (acceptHeaderKey != null) {
382
+ const accept = output.headers[acceptHeaderKey];
383
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
384
+ throw new server_common_1.NotAcceptableException();
385
+ }
386
+ ;
387
+ }
388
+ ;
389
+ const contents = (0, smithy_client_1.map)({});
390
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
391
+ const doc = (0, smithy_client_1.take)(data, {
392
+ 'participantId': smithy_client_1.expectString,
393
+ 'pluginState': _ => de_Document(_, context),
394
+ 'skillLevel': smithy_client_1.expectString,
395
+ });
396
+ Object.assign(contents, doc);
397
+ return contents;
398
+ };
399
+ exports.deserializeSelectBotMoveRequest = deserializeSelectBotMoveRequest;
400
+ const deserializeValidateMoveRequest = async (output, context) => {
401
+ const contentTypeHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'content-type');
402
+ if (contentTypeHeaderKey != null) {
403
+ const contentType = output.headers[contentTypeHeaderKey];
404
+ if (contentType !== undefined && contentType !== "application/json") {
405
+ throw new server_common_1.UnsupportedMediaTypeException();
406
+ }
407
+ ;
408
+ }
409
+ ;
410
+ const acceptHeaderKey = Object.keys(output.headers).find(key => key.toLowerCase() === 'accept');
411
+ if (acceptHeaderKey != null) {
412
+ const accept = output.headers[acceptHeaderKey];
413
+ if (!(0, server_common_1.acceptMatches)(accept, "application/json")) {
414
+ throw new server_common_1.NotAcceptableException();
415
+ }
416
+ ;
417
+ }
418
+ ;
419
+ const contents = (0, smithy_client_1.map)({});
420
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
421
+ const doc = (0, smithy_client_1.take)(data, {
422
+ 'move': _ => de_Move(_, context),
423
+ 'participantId': smithy_client_1.expectString,
424
+ 'pluginState': _ => de_Document(_, context),
425
+ });
426
+ Object.assign(contents, doc);
427
+ return contents;
428
+ };
429
+ exports.deserializeValidateMoveRequest = deserializeValidateMoveRequest;
430
+ const serializeApplyMoveResponse = async (input, ctx) => {
431
+ const context = {
432
+ ...ctx,
433
+ endpoint: () => Promise.resolve({
434
+ protocol: '',
435
+ hostname: '',
436
+ path: '',
437
+ }),
438
+ };
439
+ let statusCode = 200;
440
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
441
+ 'content-type': 'application/json',
442
+ });
443
+ let body;
444
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
445
+ 'nextTurnParticipantId': [],
446
+ 'pluginState': _ => se_Document(_, context),
447
+ }));
448
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
449
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
450
+ if (length !== undefined) {
451
+ headers = { ...headers, 'content-length': String(length) };
452
+ }
453
+ }
454
+ return new protocol_http_1.HttpResponse({
455
+ headers,
456
+ body,
457
+ statusCode,
458
+ });
459
+ };
460
+ exports.serializeApplyMoveResponse = serializeApplyMoveResponse;
461
+ const serializeApplySaveFileEditResponse = async (input, ctx) => {
462
+ const context = {
463
+ ...ctx,
464
+ endpoint: () => Promise.resolve({
465
+ protocol: '',
466
+ hostname: '',
467
+ path: '',
468
+ }),
469
+ };
470
+ let statusCode = 200;
471
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
472
+ 'content-type': 'application/json',
473
+ });
474
+ let body;
475
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
476
+ 'profile': _ => se_Document(_, context),
477
+ 'state': _ => se_Document(_, context),
478
+ }));
479
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
480
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
481
+ if (length !== undefined) {
482
+ headers = { ...headers, 'content-length': String(length) };
483
+ }
484
+ }
485
+ return new protocol_http_1.HttpResponse({
486
+ headers,
487
+ body,
488
+ statusCode,
489
+ });
490
+ };
491
+ exports.serializeApplySaveFileEditResponse = serializeApplySaveFileEditResponse;
492
+ const serializeAssignParticipantsResponse = async (input, ctx) => {
493
+ const context = {
494
+ ...ctx,
495
+ endpoint: () => Promise.resolve({
496
+ protocol: '',
497
+ hostname: '',
498
+ path: '',
499
+ }),
500
+ };
501
+ let statusCode = 200;
502
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
503
+ 'content-type': 'application/json',
504
+ });
505
+ let body;
506
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
507
+ 'participants': _ => se_ParticipantIdList(_, context),
508
+ }));
509
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
510
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
511
+ if (length !== undefined) {
512
+ headers = { ...headers, 'content-length': String(length) };
513
+ }
514
+ }
515
+ return new protocol_http_1.HttpResponse({
516
+ headers,
517
+ body,
518
+ statusCode,
519
+ });
520
+ };
521
+ exports.serializeAssignParticipantsResponse = serializeAssignParticipantsResponse;
522
+ const serializeDescribeSaveFileResponse = async (input, ctx) => {
523
+ const context = {
524
+ ...ctx,
525
+ endpoint: () => Promise.resolve({
526
+ protocol: '',
527
+ hostname: '',
528
+ path: '',
529
+ }),
530
+ };
531
+ let statusCode = 200;
532
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
533
+ 'content-type': 'application/json',
534
+ });
535
+ let body;
536
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
537
+ 'summary': [],
538
+ }));
539
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
540
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
541
+ if (length !== undefined) {
542
+ headers = { ...headers, 'content-length': String(length) };
543
+ }
544
+ }
545
+ return new protocol_http_1.HttpResponse({
546
+ headers,
547
+ body,
548
+ statusCode,
549
+ });
550
+ };
551
+ exports.serializeDescribeSaveFileResponse = serializeDescribeSaveFileResponse;
552
+ const serializeGetGameResultResponse = async (input, ctx) => {
553
+ const context = {
554
+ ...ctx,
555
+ endpoint: () => Promise.resolve({
556
+ protocol: '',
557
+ hostname: '',
558
+ path: '',
559
+ }),
560
+ };
561
+ let statusCode = 200;
562
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
563
+ 'content-type': 'application/json',
564
+ });
565
+ let body;
566
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
567
+ 'outcome': [],
568
+ 'winners': _ => se_ParticipantIdList(_, context),
569
+ }));
570
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
571
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
572
+ if (length !== undefined) {
573
+ headers = { ...headers, 'content-length': String(length) };
574
+ }
575
+ }
576
+ return new protocol_http_1.HttpResponse({
577
+ headers,
578
+ body,
579
+ statusCode,
580
+ });
581
+ };
582
+ exports.serializeGetGameResultResponse = serializeGetGameResultResponse;
583
+ const serializeGetGameStatusResponse = async (input, ctx) => {
584
+ const context = {
585
+ ...ctx,
586
+ endpoint: () => Promise.resolve({
587
+ protocol: '',
588
+ hostname: '',
589
+ path: '',
590
+ }),
591
+ };
592
+ let statusCode = 200;
593
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
594
+ 'content-type': 'application/json',
595
+ });
596
+ let body;
597
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
598
+ 'isGameOver': [],
599
+ }));
600
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
601
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
602
+ if (length !== undefined) {
603
+ headers = { ...headers, 'content-length': String(length) };
604
+ }
605
+ }
606
+ return new protocol_http_1.HttpResponse({
607
+ headers,
608
+ body,
609
+ statusCode,
610
+ });
611
+ };
612
+ exports.serializeGetGameStatusResponse = serializeGetGameStatusResponse;
613
+ const serializeGetMetadataResponse = async (input, ctx) => {
614
+ const context = {
615
+ ...ctx,
616
+ endpoint: () => Promise.resolve({
617
+ protocol: '',
618
+ hostname: '',
619
+ path: '',
620
+ }),
621
+ };
622
+ let statusCode = 200;
623
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
624
+ 'content-type': 'application/json',
625
+ });
626
+ let body;
627
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
628
+ 'botSkillLevels': _ => se_BotSkillLevelList(_, context),
629
+ 'configSchema': _ => se_Document(_, context),
630
+ 'displayName': [],
631
+ 'hasBotStrategy': [],
632
+ 'hasConfigMove': [],
633
+ 'hasCustomPlayerView': [],
634
+ 'hasOutOfTurnMove': [],
635
+ 'hasSaveFileEditor': [],
636
+ 'hasSaveFiles': [],
637
+ 'hasSaveSummary': [],
638
+ 'id': [],
639
+ 'maxPlayers': [],
640
+ 'minPlayers': [],
641
+ 'spectatorSafe': [],
642
+ 'teamPlay': [],
643
+ }));
644
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
645
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
646
+ if (length !== undefined) {
647
+ headers = { ...headers, 'content-length': String(length) };
648
+ }
649
+ }
650
+ return new protocol_http_1.HttpResponse({
651
+ headers,
652
+ body,
653
+ statusCode,
654
+ });
655
+ };
656
+ exports.serializeGetMetadataResponse = serializeGetMetadataResponse;
657
+ const serializeGetPlayerViewResponse = async (input, ctx) => {
658
+ const context = {
659
+ ...ctx,
660
+ endpoint: () => Promise.resolve({
661
+ protocol: '',
662
+ hostname: '',
663
+ path: '',
664
+ }),
665
+ };
666
+ let statusCode = 200;
667
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
668
+ 'content-type': 'application/json',
669
+ });
670
+ let body;
671
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
672
+ 'pluginState': _ => se_Document(_, context),
673
+ }));
674
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
675
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
676
+ if (length !== undefined) {
677
+ headers = { ...headers, 'content-length': String(length) };
678
+ }
679
+ }
680
+ return new protocol_http_1.HttpResponse({
681
+ headers,
682
+ body,
683
+ statusCode,
684
+ });
685
+ };
686
+ exports.serializeGetPlayerViewResponse = serializeGetPlayerViewResponse;
687
+ const serializeGetSaveFileEditorStateResponse = async (input, ctx) => {
688
+ const context = {
689
+ ...ctx,
690
+ endpoint: () => Promise.resolve({
691
+ protocol: '',
692
+ hostname: '',
693
+ path: '',
694
+ }),
695
+ };
696
+ let statusCode = 200;
697
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
698
+ 'content-type': 'application/json',
699
+ });
700
+ let body;
701
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
702
+ 'state': _ => se_Document(_, context),
703
+ }));
704
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
705
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
706
+ if (length !== undefined) {
707
+ headers = { ...headers, 'content-length': String(length) };
708
+ }
709
+ }
710
+ return new protocol_http_1.HttpResponse({
711
+ headers,
712
+ body,
713
+ statusCode,
714
+ });
715
+ };
716
+ exports.serializeGetSaveFileEditorStateResponse = serializeGetSaveFileEditorStateResponse;
717
+ const serializeHealthResponse = async (input, ctx) => {
718
+ const context = {
719
+ ...ctx,
720
+ endpoint: () => Promise.resolve({
721
+ protocol: '',
722
+ hostname: '',
723
+ path: '',
724
+ }),
725
+ };
726
+ let statusCode = 200;
727
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
728
+ 'content-type': 'application/json',
729
+ });
730
+ let body;
731
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
732
+ 'gameType': [],
733
+ 'protocolVersion': [],
734
+ 'status': [],
735
+ }));
736
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
737
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
738
+ if (length !== undefined) {
739
+ headers = { ...headers, 'content-length': String(length) };
740
+ }
741
+ }
742
+ return new protocol_http_1.HttpResponse({
743
+ headers,
744
+ body,
745
+ statusCode,
746
+ });
747
+ };
748
+ exports.serializeHealthResponse = serializeHealthResponse;
749
+ const serializeInitializeGameResponse = async (input, ctx) => {
750
+ const context = {
751
+ ...ctx,
752
+ endpoint: () => Promise.resolve({
753
+ protocol: '',
754
+ hostname: '',
755
+ path: '',
756
+ }),
757
+ };
758
+ let statusCode = 200;
759
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
760
+ 'content-type': 'application/json',
761
+ });
762
+ let body;
763
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
764
+ 'nextTurnParticipantId': [],
765
+ 'pluginState': _ => se_Document(_, context),
766
+ }));
767
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
768
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
769
+ if (length !== undefined) {
770
+ headers = { ...headers, 'content-length': String(length) };
771
+ }
772
+ }
773
+ return new protocol_http_1.HttpResponse({
774
+ headers,
775
+ body,
776
+ statusCode,
777
+ });
778
+ };
779
+ exports.serializeInitializeGameResponse = serializeInitializeGameResponse;
780
+ const serializeIsConfigMoveResponse = async (input, ctx) => {
781
+ const context = {
782
+ ...ctx,
783
+ endpoint: () => Promise.resolve({
784
+ protocol: '',
785
+ hostname: '',
786
+ path: '',
787
+ }),
788
+ };
789
+ let statusCode = 200;
790
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
791
+ 'content-type': 'application/json',
792
+ });
793
+ let body;
794
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
795
+ 'isConfigMove': [],
796
+ }));
797
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
798
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
799
+ if (length !== undefined) {
800
+ headers = { ...headers, 'content-length': String(length) };
801
+ }
802
+ }
803
+ return new protocol_http_1.HttpResponse({
804
+ headers,
805
+ body,
806
+ statusCode,
807
+ });
808
+ };
809
+ exports.serializeIsConfigMoveResponse = serializeIsConfigMoveResponse;
810
+ const serializeIsOutOfTurnMoveResponse = async (input, ctx) => {
811
+ const context = {
812
+ ...ctx,
813
+ endpoint: () => Promise.resolve({
814
+ protocol: '',
815
+ hostname: '',
816
+ path: '',
817
+ }),
818
+ };
819
+ let statusCode = 200;
820
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
821
+ 'content-type': 'application/json',
822
+ });
823
+ let body;
824
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
825
+ 'isOutOfTurnMove': [],
826
+ }));
827
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
828
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
829
+ if (length !== undefined) {
830
+ headers = { ...headers, 'content-length': String(length) };
831
+ }
832
+ }
833
+ return new protocol_http_1.HttpResponse({
834
+ headers,
835
+ body,
836
+ statusCode,
837
+ });
838
+ };
839
+ exports.serializeIsOutOfTurnMoveResponse = serializeIsOutOfTurnMoveResponse;
840
+ const serializeSelectBotMoveResponse = async (input, ctx) => {
841
+ const context = {
842
+ ...ctx,
843
+ endpoint: () => Promise.resolve({
844
+ protocol: '',
845
+ hostname: '',
846
+ path: '',
847
+ }),
848
+ };
849
+ let statusCode = 200;
850
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
851
+ 'content-type': 'application/json',
852
+ });
853
+ let body;
854
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
855
+ 'payload': _ => se_Document(_, context),
856
+ }));
857
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
858
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
859
+ if (length !== undefined) {
860
+ headers = { ...headers, 'content-length': String(length) };
861
+ }
862
+ }
863
+ return new protocol_http_1.HttpResponse({
864
+ headers,
865
+ body,
866
+ statusCode,
867
+ });
868
+ };
869
+ exports.serializeSelectBotMoveResponse = serializeSelectBotMoveResponse;
870
+ const serializeValidateMoveResponse = async (input, ctx) => {
871
+ const context = {
872
+ ...ctx,
873
+ endpoint: () => Promise.resolve({
874
+ protocol: '',
875
+ hostname: '',
876
+ path: '',
877
+ }),
878
+ };
879
+ let statusCode = 200;
880
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
881
+ 'content-type': 'application/json',
882
+ });
883
+ let body;
884
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
885
+ 'reason': [],
886
+ 'valid': [],
887
+ }));
888
+ if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf('content-length') === -1) {
889
+ const length = (0, util_body_length_node_1.calculateBodyLength)(body);
890
+ if (length !== undefined) {
891
+ headers = { ...headers, 'content-length': String(length) };
892
+ }
893
+ }
894
+ return new protocol_http_1.HttpResponse({
895
+ headers,
896
+ body,
897
+ statusCode,
898
+ });
899
+ };
900
+ exports.serializeValidateMoveResponse = serializeValidateMoveResponse;
901
+ const serializeFrameworkException = async (input, ctx) => {
902
+ const context = {
903
+ ...ctx,
904
+ endpoint: () => Promise.resolve({
905
+ protocol: '',
906
+ hostname: '',
907
+ path: '',
908
+ }),
909
+ };
910
+ switch (input.name) {
911
+ case "InternalFailure": {
912
+ const statusCode = 500;
913
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
914
+ 'x-amzn-errortype': "InternalFailure",
915
+ 'content-type': 'application/json',
916
+ });
917
+ let body;
918
+ body = "{}";
919
+ return new protocol_http_1.HttpResponse({
920
+ headers,
921
+ body,
922
+ statusCode,
923
+ });
924
+ }
925
+ case "NotAcceptableException": {
926
+ const statusCode = 406;
927
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
928
+ 'x-amzn-errortype': "NotAcceptableException",
929
+ 'content-type': 'application/json',
930
+ });
931
+ let body;
932
+ body = "{}";
933
+ return new protocol_http_1.HttpResponse({
934
+ headers,
935
+ body,
936
+ statusCode,
937
+ });
938
+ }
939
+ case "SerializationException": {
940
+ const statusCode = 400;
941
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
942
+ 'x-amzn-errortype': "SerializationException",
943
+ 'content-type': 'application/json',
944
+ });
945
+ let body;
946
+ body = "{}";
947
+ return new protocol_http_1.HttpResponse({
948
+ headers,
949
+ body,
950
+ statusCode,
951
+ });
952
+ }
953
+ case "UnknownOperationException": {
954
+ const statusCode = 404;
955
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
956
+ 'x-amzn-errortype': "UnknownOperationException",
957
+ 'content-type': 'application/json',
958
+ });
959
+ let body;
960
+ body = "{}";
961
+ return new protocol_http_1.HttpResponse({
962
+ headers,
963
+ body,
964
+ statusCode,
965
+ });
966
+ }
967
+ case "UnsupportedMediaTypeException": {
968
+ const statusCode = 415;
969
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
970
+ 'x-amzn-errortype': "UnsupportedMediaTypeException",
971
+ 'content-type': 'application/json',
972
+ });
973
+ let body;
974
+ body = "{}";
975
+ return new protocol_http_1.HttpResponse({
976
+ headers,
977
+ body,
978
+ statusCode,
979
+ });
980
+ }
981
+ }
982
+ };
983
+ exports.serializeFrameworkException = serializeFrameworkException;
984
+ const serializeInvalidMoveErrorError = async (input, ctx) => {
985
+ const context = {
986
+ ...ctx,
987
+ endpoint: () => Promise.resolve({
988
+ protocol: '',
989
+ hostname: '',
990
+ path: '',
991
+ }),
992
+ };
993
+ const statusCode = 400;
994
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
995
+ 'x-amzn-errortype': "InvalidMoveError",
996
+ 'content-type': 'application/json',
997
+ });
998
+ let body;
999
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1000
+ 'message': [],
1001
+ }));
1002
+ return new protocol_http_1.HttpResponse({
1003
+ headers,
1004
+ body,
1005
+ statusCode,
1006
+ });
1007
+ };
1008
+ exports.serializeInvalidMoveErrorError = serializeInvalidMoveErrorError;
1009
+ const serializeSaveFileEditRejectedErrorError = async (input, ctx) => {
1010
+ const context = {
1011
+ ...ctx,
1012
+ endpoint: () => Promise.resolve({
1013
+ protocol: '',
1014
+ hostname: '',
1015
+ path: '',
1016
+ }),
1017
+ };
1018
+ const statusCode = 400;
1019
+ let headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
1020
+ 'x-amzn-errortype': "SaveFileEditRejectedError",
1021
+ 'content-type': 'application/json',
1022
+ });
1023
+ let body;
1024
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
1025
+ 'reason': [],
1026
+ }));
1027
+ return new protocol_http_1.HttpResponse({
1028
+ headers,
1029
+ body,
1030
+ statusCode,
1031
+ });
1032
+ };
1033
+ exports.serializeSaveFileEditRejectedErrorError = serializeSaveFileEditRejectedErrorError;
1034
+ const se_BotSkillLevelEntry = (input, context) => {
1035
+ return (0, smithy_client_1.take)(input, {
1036
+ 'displayName': [],
1037
+ 'id': [],
1038
+ });
1039
+ };
1040
+ const se_BotSkillLevelList = (input, context) => {
1041
+ return input.filter((e) => e != null).map(entry => {
1042
+ return se_BotSkillLevelEntry(entry, context);
1043
+ });
1044
+ };
1045
+ const se_ParticipantIdList = (input, context) => {
1046
+ return input.filter((e) => e != null);
1047
+ };
1048
+ const se_Document = (input, context) => {
1049
+ return input;
1050
+ };
1051
+ const de_Move = (output, context) => {
1052
+ return (0, smithy_client_1.take)(output, {
1053
+ 'participantId': smithy_client_1.expectString,
1054
+ 'payload': (_) => de_Document(_, context),
1055
+ 'sequenceNumber': smithy_client_1.expectInt32,
1056
+ 'timestamp': (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(_)),
1057
+ });
1058
+ };
1059
+ const de_ParticipantIdList = (output, context) => {
1060
+ const retVal = (output || []).map((entry) => {
1061
+ if (entry === null) {
1062
+ throw new TypeError('All elements of the non-sparse list "com.boardgame.plugin#ParticipantIdList" must be non-null.');
1063
+ }
1064
+ return (0, smithy_client_1.expectString)(entry);
1065
+ });
1066
+ return retVal;
1067
+ };
1068
+ const de_Document = (output, context) => {
1069
+ return output;
1070
+ };
1071
+ const deserializeMetadata = (output) => ({
1072
+ httpStatusCode: output.statusCode,
1073
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1074
+ extendedRequestId: output.headers["x-amz-id-2"],
1075
+ cfId: output.headers["x-amz-cf-id"],
1076
+ });
1077
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));