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