@aws-sdk/client-translate 3.186.0 → 3.190.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/CHANGELOG.md +16 -0
- package/README.md +1 -2
- package/dist-es/Translate.js +74 -81
- package/dist-es/TranslateClient.js +22 -28
- package/dist-es/commands/CreateParallelDataCommand.js +21 -28
- package/dist-es/commands/DeleteParallelDataCommand.js +21 -28
- package/dist-es/commands/DeleteTerminologyCommand.js +22 -29
- package/dist-es/commands/DescribeTextTranslationJobCommand.js +21 -28
- package/dist-es/commands/GetParallelDataCommand.js +21 -28
- package/dist-es/commands/GetTerminologyCommand.js +21 -28
- package/dist-es/commands/ImportTerminologyCommand.js +21 -28
- package/dist-es/commands/ListLanguagesCommand.js +21 -28
- package/dist-es/commands/ListParallelDataCommand.js +21 -28
- package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
- package/dist-es/commands/ListTerminologiesCommand.js +21 -28
- package/dist-es/commands/ListTextTranslationJobsCommand.js +21 -28
- package/dist-es/commands/StartTextTranslationJobCommand.js +21 -28
- package/dist-es/commands/StopTextTranslationJobCommand.js +21 -28
- package/dist-es/commands/TagResourceCommand.js +21 -28
- package/dist-es/commands/TranslateTextCommand.js +21 -28
- package/dist-es/commands/UntagResourceCommand.js +21 -28
- package/dist-es/commands/UpdateParallelDataCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/TranslateServiceException.js +5 -10
- package/dist-es/models/models_0.js +342 -237
- package/dist-es/pagination/ListLanguagesPaginator.js +25 -68
- package/dist-es/pagination/ListParallelDataPaginator.js +25 -68
- package/dist-es/pagination/ListTerminologiesPaginator.js +25 -68
- package/dist-es/pagination/ListTextTranslationJobsPaginator.js +25 -68
- package/dist-es/protocols/Aws_json1_1.js +1407 -1765
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/dist-types/Translate.d.ts +25 -6
- package/dist-types/TranslateClient.d.ts +1 -2
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +19 -0
- package/dist-types/commands/StartTextTranslationJobCommand.d.ts +7 -3
- package/dist-types/commands/TagResourceCommand.d.ts +20 -0
- package/dist-types/commands/TranslateTextCommand.d.ts +1 -1
- package/dist-types/commands/UntagResourceCommand.d.ts +19 -0
- package/dist-types/models/models_0.d.ts +94 -22
- package/package.json +33 -33
|
@@ -1,1671 +1,1336 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
4
|
import { ConcurrentModificationException, ConflictException, DetectedLanguageLowConfidenceException, InternalServerException, InvalidFilterException, InvalidParameterValueException, InvalidRequestException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, TextSizeLimitExceededException, TooManyRequestsException, TooManyTagsException, UnsupportedDisplayLanguageCodeException, UnsupportedLanguagePairException, } from "../models/models_0";
|
|
6
5
|
import { TranslateServiceException as __BaseException } from "../models/TranslateServiceException";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
export
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return [4, collectBody(output.body, context)];
|
|
356
|
-
case 1:
|
|
357
|
-
_a.sent();
|
|
358
|
-
response = {
|
|
359
|
-
$metadata: deserializeMetadata(output),
|
|
360
|
-
};
|
|
361
|
-
return [2, Promise.resolve(response)];
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
}); };
|
|
365
|
-
var deserializeAws_json1_1DeleteTerminologyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
366
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
367
|
-
var _c;
|
|
368
|
-
return __generator(this, function (_d) {
|
|
369
|
-
switch (_d.label) {
|
|
370
|
-
case 0:
|
|
371
|
-
_a = [__assign({}, output)];
|
|
372
|
-
_c = {};
|
|
373
|
-
return [4, parseErrorBody(output.body, context)];
|
|
374
|
-
case 1:
|
|
375
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
376
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
377
|
-
_b = errorCode;
|
|
378
|
-
switch (_b) {
|
|
379
|
-
case "InternalServerException": return [3, 2];
|
|
380
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
381
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
382
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
383
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
384
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 6];
|
|
385
|
-
case "TooManyRequestsException": return [3, 8];
|
|
386
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 8];
|
|
387
|
-
}
|
|
388
|
-
return [3, 10];
|
|
389
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
390
|
-
case 3: throw _d.sent();
|
|
391
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
392
|
-
case 5: throw _d.sent();
|
|
393
|
-
case 6: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
394
|
-
case 7: throw _d.sent();
|
|
395
|
-
case 8: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
396
|
-
case 9: throw _d.sent();
|
|
397
|
-
case 10:
|
|
398
|
-
parsedBody = parsedOutput.body;
|
|
399
|
-
throwDefaultError({
|
|
400
|
-
output: output,
|
|
401
|
-
parsedBody: parsedBody,
|
|
402
|
-
exceptionCtor: __BaseException,
|
|
403
|
-
errorCode: errorCode,
|
|
404
|
-
});
|
|
405
|
-
_d.label = 11;
|
|
406
|
-
case 11: return [2];
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
}); };
|
|
410
|
-
export var deserializeAws_json1_1DescribeTextTranslationJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
411
|
-
var data, contents, response;
|
|
412
|
-
return __generator(this, function (_a) {
|
|
413
|
-
switch (_a.label) {
|
|
414
|
-
case 0:
|
|
415
|
-
if (output.statusCode >= 300) {
|
|
416
|
-
return [2, deserializeAws_json1_1DescribeTextTranslationJobCommandError(output, context)];
|
|
417
|
-
}
|
|
418
|
-
return [4, parseBody(output.body, context)];
|
|
419
|
-
case 1:
|
|
420
|
-
data = _a.sent();
|
|
421
|
-
contents = {};
|
|
422
|
-
contents = deserializeAws_json1_1DescribeTextTranslationJobResponse(data, context);
|
|
423
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
424
|
-
return [2, Promise.resolve(response)];
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
}); };
|
|
428
|
-
var deserializeAws_json1_1DescribeTextTranslationJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
429
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
430
|
-
var _c;
|
|
431
|
-
return __generator(this, function (_d) {
|
|
432
|
-
switch (_d.label) {
|
|
433
|
-
case 0:
|
|
434
|
-
_a = [__assign({}, output)];
|
|
435
|
-
_c = {};
|
|
436
|
-
return [4, parseErrorBody(output.body, context)];
|
|
437
|
-
case 1:
|
|
438
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
439
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
440
|
-
_b = errorCode;
|
|
441
|
-
switch (_b) {
|
|
442
|
-
case "InternalServerException": return [3, 2];
|
|
443
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
444
|
-
case "ResourceNotFoundException": return [3, 4];
|
|
445
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 4];
|
|
446
|
-
case "TooManyRequestsException": return [3, 6];
|
|
447
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 6];
|
|
448
|
-
}
|
|
449
|
-
return [3, 8];
|
|
450
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
451
|
-
case 3: throw _d.sent();
|
|
452
|
-
case 4: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
453
|
-
case 5: throw _d.sent();
|
|
454
|
-
case 6: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
455
|
-
case 7: throw _d.sent();
|
|
456
|
-
case 8:
|
|
457
|
-
parsedBody = parsedOutput.body;
|
|
458
|
-
throwDefaultError({
|
|
459
|
-
output: output,
|
|
460
|
-
parsedBody: parsedBody,
|
|
461
|
-
exceptionCtor: __BaseException,
|
|
462
|
-
errorCode: errorCode,
|
|
463
|
-
});
|
|
464
|
-
_d.label = 9;
|
|
465
|
-
case 9: return [2];
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
}); };
|
|
469
|
-
export var deserializeAws_json1_1GetParallelDataCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
470
|
-
var data, contents, response;
|
|
471
|
-
return __generator(this, function (_a) {
|
|
472
|
-
switch (_a.label) {
|
|
473
|
-
case 0:
|
|
474
|
-
if (output.statusCode >= 300) {
|
|
475
|
-
return [2, deserializeAws_json1_1GetParallelDataCommandError(output, context)];
|
|
476
|
-
}
|
|
477
|
-
return [4, parseBody(output.body, context)];
|
|
478
|
-
case 1:
|
|
479
|
-
data = _a.sent();
|
|
480
|
-
contents = {};
|
|
481
|
-
contents = deserializeAws_json1_1GetParallelDataResponse(data, context);
|
|
482
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
483
|
-
return [2, Promise.resolve(response)];
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
}); };
|
|
487
|
-
var deserializeAws_json1_1GetParallelDataCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
488
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
489
|
-
var _c;
|
|
490
|
-
return __generator(this, function (_d) {
|
|
491
|
-
switch (_d.label) {
|
|
492
|
-
case 0:
|
|
493
|
-
_a = [__assign({}, output)];
|
|
494
|
-
_c = {};
|
|
495
|
-
return [4, parseErrorBody(output.body, context)];
|
|
496
|
-
case 1:
|
|
497
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
498
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
499
|
-
_b = errorCode;
|
|
500
|
-
switch (_b) {
|
|
501
|
-
case "InternalServerException": return [3, 2];
|
|
502
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
503
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
504
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
505
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
506
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 6];
|
|
507
|
-
case "TooManyRequestsException": return [3, 8];
|
|
508
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 8];
|
|
509
|
-
}
|
|
510
|
-
return [3, 10];
|
|
511
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
512
|
-
case 3: throw _d.sent();
|
|
513
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
514
|
-
case 5: throw _d.sent();
|
|
515
|
-
case 6: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
516
|
-
case 7: throw _d.sent();
|
|
517
|
-
case 8: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
518
|
-
case 9: throw _d.sent();
|
|
519
|
-
case 10:
|
|
520
|
-
parsedBody = parsedOutput.body;
|
|
521
|
-
throwDefaultError({
|
|
522
|
-
output: output,
|
|
523
|
-
parsedBody: parsedBody,
|
|
524
|
-
exceptionCtor: __BaseException,
|
|
525
|
-
errorCode: errorCode,
|
|
526
|
-
});
|
|
527
|
-
_d.label = 11;
|
|
528
|
-
case 11: return [2];
|
|
529
|
-
}
|
|
530
|
-
});
|
|
531
|
-
}); };
|
|
532
|
-
export var deserializeAws_json1_1GetTerminologyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
533
|
-
var data, contents, response;
|
|
534
|
-
return __generator(this, function (_a) {
|
|
535
|
-
switch (_a.label) {
|
|
536
|
-
case 0:
|
|
537
|
-
if (output.statusCode >= 300) {
|
|
538
|
-
return [2, deserializeAws_json1_1GetTerminologyCommandError(output, context)];
|
|
539
|
-
}
|
|
540
|
-
return [4, parseBody(output.body, context)];
|
|
541
|
-
case 1:
|
|
542
|
-
data = _a.sent();
|
|
543
|
-
contents = {};
|
|
544
|
-
contents = deserializeAws_json1_1GetTerminologyResponse(data, context);
|
|
545
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
546
|
-
return [2, Promise.resolve(response)];
|
|
547
|
-
}
|
|
548
|
-
});
|
|
549
|
-
}); };
|
|
550
|
-
var deserializeAws_json1_1GetTerminologyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
551
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
552
|
-
var _c;
|
|
553
|
-
return __generator(this, function (_d) {
|
|
554
|
-
switch (_d.label) {
|
|
555
|
-
case 0:
|
|
556
|
-
_a = [__assign({}, output)];
|
|
557
|
-
_c = {};
|
|
558
|
-
return [4, parseErrorBody(output.body, context)];
|
|
559
|
-
case 1:
|
|
560
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
561
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
562
|
-
_b = errorCode;
|
|
563
|
-
switch (_b) {
|
|
564
|
-
case "InternalServerException": return [3, 2];
|
|
565
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
566
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
567
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
568
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
569
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 6];
|
|
570
|
-
case "TooManyRequestsException": return [3, 8];
|
|
571
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 8];
|
|
572
|
-
}
|
|
573
|
-
return [3, 10];
|
|
574
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
575
|
-
case 3: throw _d.sent();
|
|
576
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
577
|
-
case 5: throw _d.sent();
|
|
578
|
-
case 6: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
579
|
-
case 7: throw _d.sent();
|
|
580
|
-
case 8: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
581
|
-
case 9: throw _d.sent();
|
|
582
|
-
case 10:
|
|
583
|
-
parsedBody = parsedOutput.body;
|
|
584
|
-
throwDefaultError({
|
|
585
|
-
output: output,
|
|
586
|
-
parsedBody: parsedBody,
|
|
587
|
-
exceptionCtor: __BaseException,
|
|
588
|
-
errorCode: errorCode,
|
|
589
|
-
});
|
|
590
|
-
_d.label = 11;
|
|
591
|
-
case 11: return [2];
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
}); };
|
|
595
|
-
export var deserializeAws_json1_1ImportTerminologyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
596
|
-
var data, contents, response;
|
|
597
|
-
return __generator(this, function (_a) {
|
|
598
|
-
switch (_a.label) {
|
|
599
|
-
case 0:
|
|
600
|
-
if (output.statusCode >= 300) {
|
|
601
|
-
return [2, deserializeAws_json1_1ImportTerminologyCommandError(output, context)];
|
|
602
|
-
}
|
|
603
|
-
return [4, parseBody(output.body, context)];
|
|
604
|
-
case 1:
|
|
605
|
-
data = _a.sent();
|
|
606
|
-
contents = {};
|
|
607
|
-
contents = deserializeAws_json1_1ImportTerminologyResponse(data, context);
|
|
608
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
609
|
-
return [2, Promise.resolve(response)];
|
|
610
|
-
}
|
|
611
|
-
});
|
|
612
|
-
}); };
|
|
613
|
-
var deserializeAws_json1_1ImportTerminologyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
614
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
615
|
-
var _c;
|
|
616
|
-
return __generator(this, function (_d) {
|
|
617
|
-
switch (_d.label) {
|
|
618
|
-
case 0:
|
|
619
|
-
_a = [__assign({}, output)];
|
|
620
|
-
_c = {};
|
|
621
|
-
return [4, parseErrorBody(output.body, context)];
|
|
622
|
-
case 1:
|
|
623
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
624
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
625
|
-
_b = errorCode;
|
|
626
|
-
switch (_b) {
|
|
627
|
-
case "ConcurrentModificationException": return [3, 2];
|
|
628
|
-
case "com.amazonaws.translate#ConcurrentModificationException": return [3, 2];
|
|
629
|
-
case "InternalServerException": return [3, 4];
|
|
630
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 4];
|
|
631
|
-
case "InvalidParameterValueException": return [3, 6];
|
|
632
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 6];
|
|
633
|
-
case "LimitExceededException": return [3, 8];
|
|
634
|
-
case "com.amazonaws.translate#LimitExceededException": return [3, 8];
|
|
635
|
-
case "TooManyRequestsException": return [3, 10];
|
|
636
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 10];
|
|
637
|
-
case "TooManyTagsException": return [3, 12];
|
|
638
|
-
case "com.amazonaws.translate#TooManyTagsException": return [3, 12];
|
|
639
|
-
}
|
|
640
|
-
return [3, 14];
|
|
641
|
-
case 2: return [4, deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)];
|
|
642
|
-
case 3: throw _d.sent();
|
|
643
|
-
case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
644
|
-
case 5: throw _d.sent();
|
|
645
|
-
case 6: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
646
|
-
case 7: throw _d.sent();
|
|
647
|
-
case 8: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
648
|
-
case 9: throw _d.sent();
|
|
649
|
-
case 10: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
650
|
-
case 11: throw _d.sent();
|
|
651
|
-
case 12: return [4, deserializeAws_json1_1TooManyTagsExceptionResponse(parsedOutput, context)];
|
|
652
|
-
case 13: throw _d.sent();
|
|
653
|
-
case 14:
|
|
654
|
-
parsedBody = parsedOutput.body;
|
|
655
|
-
throwDefaultError({
|
|
656
|
-
output: output,
|
|
657
|
-
parsedBody: parsedBody,
|
|
658
|
-
exceptionCtor: __BaseException,
|
|
659
|
-
errorCode: errorCode,
|
|
660
|
-
});
|
|
661
|
-
_d.label = 15;
|
|
662
|
-
case 15: return [2];
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
}); };
|
|
666
|
-
export var deserializeAws_json1_1ListLanguagesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
667
|
-
var data, contents, response;
|
|
668
|
-
return __generator(this, function (_a) {
|
|
669
|
-
switch (_a.label) {
|
|
670
|
-
case 0:
|
|
671
|
-
if (output.statusCode >= 300) {
|
|
672
|
-
return [2, deserializeAws_json1_1ListLanguagesCommandError(output, context)];
|
|
673
|
-
}
|
|
674
|
-
return [4, parseBody(output.body, context)];
|
|
675
|
-
case 1:
|
|
676
|
-
data = _a.sent();
|
|
677
|
-
contents = {};
|
|
678
|
-
contents = deserializeAws_json1_1ListLanguagesResponse(data, context);
|
|
679
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
680
|
-
return [2, Promise.resolve(response)];
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
}); };
|
|
684
|
-
var deserializeAws_json1_1ListLanguagesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
685
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
686
|
-
var _c;
|
|
687
|
-
return __generator(this, function (_d) {
|
|
688
|
-
switch (_d.label) {
|
|
689
|
-
case 0:
|
|
690
|
-
_a = [__assign({}, output)];
|
|
691
|
-
_c = {};
|
|
692
|
-
return [4, parseErrorBody(output.body, context)];
|
|
693
|
-
case 1:
|
|
694
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
695
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
696
|
-
_b = errorCode;
|
|
697
|
-
switch (_b) {
|
|
698
|
-
case "InternalServerException": return [3, 2];
|
|
699
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
700
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
701
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
702
|
-
case "TooManyRequestsException": return [3, 6];
|
|
703
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 6];
|
|
704
|
-
case "UnsupportedDisplayLanguageCodeException": return [3, 8];
|
|
705
|
-
case "com.amazonaws.translate#UnsupportedDisplayLanguageCodeException": return [3, 8];
|
|
706
|
-
}
|
|
707
|
-
return [3, 10];
|
|
708
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
709
|
-
case 3: throw _d.sent();
|
|
710
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
711
|
-
case 5: throw _d.sent();
|
|
712
|
-
case 6: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
713
|
-
case 7: throw _d.sent();
|
|
714
|
-
case 8: return [4, deserializeAws_json1_1UnsupportedDisplayLanguageCodeExceptionResponse(parsedOutput, context)];
|
|
715
|
-
case 9: throw _d.sent();
|
|
716
|
-
case 10:
|
|
717
|
-
parsedBody = parsedOutput.body;
|
|
718
|
-
throwDefaultError({
|
|
719
|
-
output: output,
|
|
720
|
-
parsedBody: parsedBody,
|
|
721
|
-
exceptionCtor: __BaseException,
|
|
722
|
-
errorCode: errorCode,
|
|
723
|
-
});
|
|
724
|
-
_d.label = 11;
|
|
725
|
-
case 11: return [2];
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
}); };
|
|
729
|
-
export var deserializeAws_json1_1ListParallelDataCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
730
|
-
var data, contents, response;
|
|
731
|
-
return __generator(this, function (_a) {
|
|
732
|
-
switch (_a.label) {
|
|
733
|
-
case 0:
|
|
734
|
-
if (output.statusCode >= 300) {
|
|
735
|
-
return [2, deserializeAws_json1_1ListParallelDataCommandError(output, context)];
|
|
736
|
-
}
|
|
737
|
-
return [4, parseBody(output.body, context)];
|
|
738
|
-
case 1:
|
|
739
|
-
data = _a.sent();
|
|
740
|
-
contents = {};
|
|
741
|
-
contents = deserializeAws_json1_1ListParallelDataResponse(data, context);
|
|
742
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
743
|
-
return [2, Promise.resolve(response)];
|
|
744
|
-
}
|
|
745
|
-
});
|
|
746
|
-
}); };
|
|
747
|
-
var deserializeAws_json1_1ListParallelDataCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
748
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
749
|
-
var _c;
|
|
750
|
-
return __generator(this, function (_d) {
|
|
751
|
-
switch (_d.label) {
|
|
752
|
-
case 0:
|
|
753
|
-
_a = [__assign({}, output)];
|
|
754
|
-
_c = {};
|
|
755
|
-
return [4, parseErrorBody(output.body, context)];
|
|
756
|
-
case 1:
|
|
757
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
758
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
759
|
-
_b = errorCode;
|
|
760
|
-
switch (_b) {
|
|
761
|
-
case "InternalServerException": return [3, 2];
|
|
762
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
763
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
764
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
765
|
-
case "TooManyRequestsException": return [3, 6];
|
|
766
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 6];
|
|
767
|
-
}
|
|
768
|
-
return [3, 8];
|
|
769
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
770
|
-
case 3: throw _d.sent();
|
|
771
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
772
|
-
case 5: throw _d.sent();
|
|
773
|
-
case 6: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
774
|
-
case 7: throw _d.sent();
|
|
775
|
-
case 8:
|
|
776
|
-
parsedBody = parsedOutput.body;
|
|
777
|
-
throwDefaultError({
|
|
778
|
-
output: output,
|
|
779
|
-
parsedBody: parsedBody,
|
|
780
|
-
exceptionCtor: __BaseException,
|
|
781
|
-
errorCode: errorCode,
|
|
782
|
-
});
|
|
783
|
-
_d.label = 9;
|
|
784
|
-
case 9: return [2];
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
}); };
|
|
788
|
-
export var deserializeAws_json1_1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
789
|
-
var data, contents, response;
|
|
790
|
-
return __generator(this, function (_a) {
|
|
791
|
-
switch (_a.label) {
|
|
792
|
-
case 0:
|
|
793
|
-
if (output.statusCode >= 300) {
|
|
794
|
-
return [2, deserializeAws_json1_1ListTagsForResourceCommandError(output, context)];
|
|
795
|
-
}
|
|
796
|
-
return [4, parseBody(output.body, context)];
|
|
797
|
-
case 1:
|
|
798
|
-
data = _a.sent();
|
|
799
|
-
contents = {};
|
|
800
|
-
contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);
|
|
801
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
802
|
-
return [2, Promise.resolve(response)];
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
}); };
|
|
806
|
-
var deserializeAws_json1_1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
807
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
808
|
-
var _c;
|
|
809
|
-
return __generator(this, function (_d) {
|
|
810
|
-
switch (_d.label) {
|
|
811
|
-
case 0:
|
|
812
|
-
_a = [__assign({}, output)];
|
|
813
|
-
_c = {};
|
|
814
|
-
return [4, parseErrorBody(output.body, context)];
|
|
815
|
-
case 1:
|
|
816
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
817
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
818
|
-
_b = errorCode;
|
|
819
|
-
switch (_b) {
|
|
820
|
-
case "InternalServerException": return [3, 2];
|
|
821
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
822
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
823
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
824
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
825
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 6];
|
|
826
|
-
}
|
|
827
|
-
return [3, 8];
|
|
828
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
829
|
-
case 3: throw _d.sent();
|
|
830
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
831
|
-
case 5: throw _d.sent();
|
|
832
|
-
case 6: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
833
|
-
case 7: throw _d.sent();
|
|
834
|
-
case 8:
|
|
835
|
-
parsedBody = parsedOutput.body;
|
|
836
|
-
throwDefaultError({
|
|
837
|
-
output: output,
|
|
838
|
-
parsedBody: parsedBody,
|
|
839
|
-
exceptionCtor: __BaseException,
|
|
840
|
-
errorCode: errorCode,
|
|
841
|
-
});
|
|
842
|
-
_d.label = 9;
|
|
843
|
-
case 9: return [2];
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
}); };
|
|
847
|
-
export var deserializeAws_json1_1ListTerminologiesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
848
|
-
var data, contents, response;
|
|
849
|
-
return __generator(this, function (_a) {
|
|
850
|
-
switch (_a.label) {
|
|
851
|
-
case 0:
|
|
852
|
-
if (output.statusCode >= 300) {
|
|
853
|
-
return [2, deserializeAws_json1_1ListTerminologiesCommandError(output, context)];
|
|
854
|
-
}
|
|
855
|
-
return [4, parseBody(output.body, context)];
|
|
856
|
-
case 1:
|
|
857
|
-
data = _a.sent();
|
|
858
|
-
contents = {};
|
|
859
|
-
contents = deserializeAws_json1_1ListTerminologiesResponse(data, context);
|
|
860
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
861
|
-
return [2, Promise.resolve(response)];
|
|
862
|
-
}
|
|
863
|
-
});
|
|
864
|
-
}); };
|
|
865
|
-
var deserializeAws_json1_1ListTerminologiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
866
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
867
|
-
var _c;
|
|
868
|
-
return __generator(this, function (_d) {
|
|
869
|
-
switch (_d.label) {
|
|
870
|
-
case 0:
|
|
871
|
-
_a = [__assign({}, output)];
|
|
872
|
-
_c = {};
|
|
873
|
-
return [4, parseErrorBody(output.body, context)];
|
|
874
|
-
case 1:
|
|
875
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
876
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
877
|
-
_b = errorCode;
|
|
878
|
-
switch (_b) {
|
|
879
|
-
case "InternalServerException": return [3, 2];
|
|
880
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
881
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
882
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
883
|
-
case "TooManyRequestsException": return [3, 6];
|
|
884
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 6];
|
|
885
|
-
}
|
|
886
|
-
return [3, 8];
|
|
887
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
888
|
-
case 3: throw _d.sent();
|
|
889
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
890
|
-
case 5: throw _d.sent();
|
|
891
|
-
case 6: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
892
|
-
case 7: throw _d.sent();
|
|
893
|
-
case 8:
|
|
894
|
-
parsedBody = parsedOutput.body;
|
|
895
|
-
throwDefaultError({
|
|
896
|
-
output: output,
|
|
897
|
-
parsedBody: parsedBody,
|
|
898
|
-
exceptionCtor: __BaseException,
|
|
899
|
-
errorCode: errorCode,
|
|
900
|
-
});
|
|
901
|
-
_d.label = 9;
|
|
902
|
-
case 9: return [2];
|
|
903
|
-
}
|
|
904
|
-
});
|
|
905
|
-
}); };
|
|
906
|
-
export var deserializeAws_json1_1ListTextTranslationJobsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
907
|
-
var data, contents, response;
|
|
908
|
-
return __generator(this, function (_a) {
|
|
909
|
-
switch (_a.label) {
|
|
910
|
-
case 0:
|
|
911
|
-
if (output.statusCode >= 300) {
|
|
912
|
-
return [2, deserializeAws_json1_1ListTextTranslationJobsCommandError(output, context)];
|
|
913
|
-
}
|
|
914
|
-
return [4, parseBody(output.body, context)];
|
|
915
|
-
case 1:
|
|
916
|
-
data = _a.sent();
|
|
917
|
-
contents = {};
|
|
918
|
-
contents = deserializeAws_json1_1ListTextTranslationJobsResponse(data, context);
|
|
919
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
920
|
-
return [2, Promise.resolve(response)];
|
|
921
|
-
}
|
|
922
|
-
});
|
|
923
|
-
}); };
|
|
924
|
-
var deserializeAws_json1_1ListTextTranslationJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
925
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
926
|
-
var _c;
|
|
927
|
-
return __generator(this, function (_d) {
|
|
928
|
-
switch (_d.label) {
|
|
929
|
-
case 0:
|
|
930
|
-
_a = [__assign({}, output)];
|
|
931
|
-
_c = {};
|
|
932
|
-
return [4, parseErrorBody(output.body, context)];
|
|
933
|
-
case 1:
|
|
934
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
935
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
936
|
-
_b = errorCode;
|
|
937
|
-
switch (_b) {
|
|
938
|
-
case "InternalServerException": return [3, 2];
|
|
939
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
940
|
-
case "InvalidFilterException": return [3, 4];
|
|
941
|
-
case "com.amazonaws.translate#InvalidFilterException": return [3, 4];
|
|
942
|
-
case "InvalidRequestException": return [3, 6];
|
|
943
|
-
case "com.amazonaws.translate#InvalidRequestException": return [3, 6];
|
|
944
|
-
case "TooManyRequestsException": return [3, 8];
|
|
945
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 8];
|
|
946
|
-
}
|
|
947
|
-
return [3, 10];
|
|
948
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
949
|
-
case 3: throw _d.sent();
|
|
950
|
-
case 4: return [4, deserializeAws_json1_1InvalidFilterExceptionResponse(parsedOutput, context)];
|
|
951
|
-
case 5: throw _d.sent();
|
|
952
|
-
case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
953
|
-
case 7: throw _d.sent();
|
|
954
|
-
case 8: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
955
|
-
case 9: throw _d.sent();
|
|
956
|
-
case 10:
|
|
957
|
-
parsedBody = parsedOutput.body;
|
|
958
|
-
throwDefaultError({
|
|
959
|
-
output: output,
|
|
960
|
-
parsedBody: parsedBody,
|
|
961
|
-
exceptionCtor: __BaseException,
|
|
962
|
-
errorCode: errorCode,
|
|
963
|
-
});
|
|
964
|
-
_d.label = 11;
|
|
965
|
-
case 11: return [2];
|
|
966
|
-
}
|
|
967
|
-
});
|
|
968
|
-
}); };
|
|
969
|
-
export var deserializeAws_json1_1StartTextTranslationJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
970
|
-
var data, contents, response;
|
|
971
|
-
return __generator(this, function (_a) {
|
|
972
|
-
switch (_a.label) {
|
|
973
|
-
case 0:
|
|
974
|
-
if (output.statusCode >= 300) {
|
|
975
|
-
return [2, deserializeAws_json1_1StartTextTranslationJobCommandError(output, context)];
|
|
976
|
-
}
|
|
977
|
-
return [4, parseBody(output.body, context)];
|
|
978
|
-
case 1:
|
|
979
|
-
data = _a.sent();
|
|
980
|
-
contents = {};
|
|
981
|
-
contents = deserializeAws_json1_1StartTextTranslationJobResponse(data, context);
|
|
982
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
983
|
-
return [2, Promise.resolve(response)];
|
|
984
|
-
}
|
|
985
|
-
});
|
|
986
|
-
}); };
|
|
987
|
-
var deserializeAws_json1_1StartTextTranslationJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
988
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
989
|
-
var _c;
|
|
990
|
-
return __generator(this, function (_d) {
|
|
991
|
-
switch (_d.label) {
|
|
992
|
-
case 0:
|
|
993
|
-
_a = [__assign({}, output)];
|
|
994
|
-
_c = {};
|
|
995
|
-
return [4, parseErrorBody(output.body, context)];
|
|
996
|
-
case 1:
|
|
997
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
998
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
999
|
-
_b = errorCode;
|
|
1000
|
-
switch (_b) {
|
|
1001
|
-
case "InternalServerException": return [3, 2];
|
|
1002
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
1003
|
-
case "InvalidParameterValueException": return [3, 4];
|
|
1004
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 4];
|
|
1005
|
-
case "InvalidRequestException": return [3, 6];
|
|
1006
|
-
case "com.amazonaws.translate#InvalidRequestException": return [3, 6];
|
|
1007
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
1008
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 8];
|
|
1009
|
-
case "TooManyRequestsException": return [3, 10];
|
|
1010
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 10];
|
|
1011
|
-
case "UnsupportedLanguagePairException": return [3, 12];
|
|
1012
|
-
case "com.amazonaws.translate#UnsupportedLanguagePairException": return [3, 12];
|
|
1013
|
-
}
|
|
1014
|
-
return [3, 14];
|
|
1015
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1016
|
-
case 3: throw _d.sent();
|
|
1017
|
-
case 4: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
1018
|
-
case 5: throw _d.sent();
|
|
1019
|
-
case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
1020
|
-
case 7: throw _d.sent();
|
|
1021
|
-
case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1022
|
-
case 9: throw _d.sent();
|
|
1023
|
-
case 10: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
1024
|
-
case 11: throw _d.sent();
|
|
1025
|
-
case 12: return [4, deserializeAws_json1_1UnsupportedLanguagePairExceptionResponse(parsedOutput, context)];
|
|
1026
|
-
case 13: throw _d.sent();
|
|
1027
|
-
case 14:
|
|
1028
|
-
parsedBody = parsedOutput.body;
|
|
1029
|
-
throwDefaultError({
|
|
1030
|
-
output: output,
|
|
1031
|
-
parsedBody: parsedBody,
|
|
1032
|
-
exceptionCtor: __BaseException,
|
|
1033
|
-
errorCode: errorCode,
|
|
1034
|
-
});
|
|
1035
|
-
_d.label = 15;
|
|
1036
|
-
case 15: return [2];
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
}); };
|
|
1040
|
-
export var deserializeAws_json1_1StopTextTranslationJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1041
|
-
var data, contents, response;
|
|
1042
|
-
return __generator(this, function (_a) {
|
|
1043
|
-
switch (_a.label) {
|
|
1044
|
-
case 0:
|
|
1045
|
-
if (output.statusCode >= 300) {
|
|
1046
|
-
return [2, deserializeAws_json1_1StopTextTranslationJobCommandError(output, context)];
|
|
1047
|
-
}
|
|
1048
|
-
return [4, parseBody(output.body, context)];
|
|
1049
|
-
case 1:
|
|
1050
|
-
data = _a.sent();
|
|
1051
|
-
contents = {};
|
|
1052
|
-
contents = deserializeAws_json1_1StopTextTranslationJobResponse(data, context);
|
|
1053
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
1054
|
-
return [2, Promise.resolve(response)];
|
|
1055
|
-
}
|
|
1056
|
-
});
|
|
1057
|
-
}); };
|
|
1058
|
-
var deserializeAws_json1_1StopTextTranslationJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1059
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
1060
|
-
var _c;
|
|
1061
|
-
return __generator(this, function (_d) {
|
|
1062
|
-
switch (_d.label) {
|
|
1063
|
-
case 0:
|
|
1064
|
-
_a = [__assign({}, output)];
|
|
1065
|
-
_c = {};
|
|
1066
|
-
return [4, parseErrorBody(output.body, context)];
|
|
1067
|
-
case 1:
|
|
1068
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
1069
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1070
|
-
_b = errorCode;
|
|
1071
|
-
switch (_b) {
|
|
1072
|
-
case "InternalServerException": return [3, 2];
|
|
1073
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 2];
|
|
1074
|
-
case "ResourceNotFoundException": return [3, 4];
|
|
1075
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 4];
|
|
1076
|
-
case "TooManyRequestsException": return [3, 6];
|
|
1077
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 6];
|
|
1078
|
-
}
|
|
1079
|
-
return [3, 8];
|
|
1080
|
-
case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1081
|
-
case 3: throw _d.sent();
|
|
1082
|
-
case 4: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1083
|
-
case 5: throw _d.sent();
|
|
1084
|
-
case 6: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
1085
|
-
case 7: throw _d.sent();
|
|
1086
|
-
case 8:
|
|
1087
|
-
parsedBody = parsedOutput.body;
|
|
1088
|
-
throwDefaultError({
|
|
1089
|
-
output: output,
|
|
1090
|
-
parsedBody: parsedBody,
|
|
1091
|
-
exceptionCtor: __BaseException,
|
|
1092
|
-
errorCode: errorCode,
|
|
1093
|
-
});
|
|
1094
|
-
_d.label = 9;
|
|
1095
|
-
case 9: return [2];
|
|
1096
|
-
}
|
|
1097
|
-
});
|
|
1098
|
-
}); };
|
|
1099
|
-
export var deserializeAws_json1_1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1100
|
-
var data, contents, response;
|
|
1101
|
-
return __generator(this, function (_a) {
|
|
1102
|
-
switch (_a.label) {
|
|
1103
|
-
case 0:
|
|
1104
|
-
if (output.statusCode >= 300) {
|
|
1105
|
-
return [2, deserializeAws_json1_1TagResourceCommandError(output, context)];
|
|
1106
|
-
}
|
|
1107
|
-
return [4, parseBody(output.body, context)];
|
|
1108
|
-
case 1:
|
|
1109
|
-
data = _a.sent();
|
|
1110
|
-
contents = {};
|
|
1111
|
-
contents = deserializeAws_json1_1TagResourceResponse(data, context);
|
|
1112
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
1113
|
-
return [2, Promise.resolve(response)];
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1116
|
-
}); };
|
|
1117
|
-
var deserializeAws_json1_1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1118
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
1119
|
-
var _c;
|
|
1120
|
-
return __generator(this, function (_d) {
|
|
1121
|
-
switch (_d.label) {
|
|
1122
|
-
case 0:
|
|
1123
|
-
_a = [__assign({}, output)];
|
|
1124
|
-
_c = {};
|
|
1125
|
-
return [4, parseErrorBody(output.body, context)];
|
|
1126
|
-
case 1:
|
|
1127
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
1128
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1129
|
-
_b = errorCode;
|
|
1130
|
-
switch (_b) {
|
|
1131
|
-
case "ConcurrentModificationException": return [3, 2];
|
|
1132
|
-
case "com.amazonaws.translate#ConcurrentModificationException": return [3, 2];
|
|
1133
|
-
case "InternalServerException": return [3, 4];
|
|
1134
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 4];
|
|
1135
|
-
case "InvalidParameterValueException": return [3, 6];
|
|
1136
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 6];
|
|
1137
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
1138
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 8];
|
|
1139
|
-
case "TooManyTagsException": return [3, 10];
|
|
1140
|
-
case "com.amazonaws.translate#TooManyTagsException": return [3, 10];
|
|
1141
|
-
}
|
|
1142
|
-
return [3, 12];
|
|
1143
|
-
case 2: return [4, deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)];
|
|
1144
|
-
case 3: throw _d.sent();
|
|
1145
|
-
case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1146
|
-
case 5: throw _d.sent();
|
|
1147
|
-
case 6: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
1148
|
-
case 7: throw _d.sent();
|
|
1149
|
-
case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1150
|
-
case 9: throw _d.sent();
|
|
1151
|
-
case 10: return [4, deserializeAws_json1_1TooManyTagsExceptionResponse(parsedOutput, context)];
|
|
1152
|
-
case 11: throw _d.sent();
|
|
1153
|
-
case 12:
|
|
1154
|
-
parsedBody = parsedOutput.body;
|
|
1155
|
-
throwDefaultError({
|
|
1156
|
-
output: output,
|
|
1157
|
-
parsedBody: parsedBody,
|
|
1158
|
-
exceptionCtor: __BaseException,
|
|
1159
|
-
errorCode: errorCode,
|
|
1160
|
-
});
|
|
1161
|
-
_d.label = 13;
|
|
1162
|
-
case 13: return [2];
|
|
1163
|
-
}
|
|
1164
|
-
});
|
|
1165
|
-
}); };
|
|
1166
|
-
export var deserializeAws_json1_1TranslateTextCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1167
|
-
var data, contents, response;
|
|
1168
|
-
return __generator(this, function (_a) {
|
|
1169
|
-
switch (_a.label) {
|
|
1170
|
-
case 0:
|
|
1171
|
-
if (output.statusCode >= 300) {
|
|
1172
|
-
return [2, deserializeAws_json1_1TranslateTextCommandError(output, context)];
|
|
1173
|
-
}
|
|
1174
|
-
return [4, parseBody(output.body, context)];
|
|
1175
|
-
case 1:
|
|
1176
|
-
data = _a.sent();
|
|
1177
|
-
contents = {};
|
|
1178
|
-
contents = deserializeAws_json1_1TranslateTextResponse(data, context);
|
|
1179
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
1180
|
-
return [2, Promise.resolve(response)];
|
|
1181
|
-
}
|
|
1182
|
-
});
|
|
1183
|
-
}); };
|
|
1184
|
-
var deserializeAws_json1_1TranslateTextCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1185
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
1186
|
-
var _c;
|
|
1187
|
-
return __generator(this, function (_d) {
|
|
1188
|
-
switch (_d.label) {
|
|
1189
|
-
case 0:
|
|
1190
|
-
_a = [__assign({}, output)];
|
|
1191
|
-
_c = {};
|
|
1192
|
-
return [4, parseErrorBody(output.body, context)];
|
|
1193
|
-
case 1:
|
|
1194
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
1195
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1196
|
-
_b = errorCode;
|
|
1197
|
-
switch (_b) {
|
|
1198
|
-
case "DetectedLanguageLowConfidenceException": return [3, 2];
|
|
1199
|
-
case "com.amazonaws.translate#DetectedLanguageLowConfidenceException": return [3, 2];
|
|
1200
|
-
case "InternalServerException": return [3, 4];
|
|
1201
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 4];
|
|
1202
|
-
case "InvalidRequestException": return [3, 6];
|
|
1203
|
-
case "com.amazonaws.translate#InvalidRequestException": return [3, 6];
|
|
1204
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
1205
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 8];
|
|
1206
|
-
case "ServiceUnavailableException": return [3, 10];
|
|
1207
|
-
case "com.amazonaws.translate#ServiceUnavailableException": return [3, 10];
|
|
1208
|
-
case "TextSizeLimitExceededException": return [3, 12];
|
|
1209
|
-
case "com.amazonaws.translate#TextSizeLimitExceededException": return [3, 12];
|
|
1210
|
-
case "TooManyRequestsException": return [3, 14];
|
|
1211
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 14];
|
|
1212
|
-
case "UnsupportedLanguagePairException": return [3, 16];
|
|
1213
|
-
case "com.amazonaws.translate#UnsupportedLanguagePairException": return [3, 16];
|
|
1214
|
-
}
|
|
1215
|
-
return [3, 18];
|
|
1216
|
-
case 2: return [4, deserializeAws_json1_1DetectedLanguageLowConfidenceExceptionResponse(parsedOutput, context)];
|
|
1217
|
-
case 3: throw _d.sent();
|
|
1218
|
-
case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1219
|
-
case 5: throw _d.sent();
|
|
1220
|
-
case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
1221
|
-
case 7: throw _d.sent();
|
|
1222
|
-
case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1223
|
-
case 9: throw _d.sent();
|
|
1224
|
-
case 10: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
1225
|
-
case 11: throw _d.sent();
|
|
1226
|
-
case 12: return [4, deserializeAws_json1_1TextSizeLimitExceededExceptionResponse(parsedOutput, context)];
|
|
1227
|
-
case 13: throw _d.sent();
|
|
1228
|
-
case 14: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
1229
|
-
case 15: throw _d.sent();
|
|
1230
|
-
case 16: return [4, deserializeAws_json1_1UnsupportedLanguagePairExceptionResponse(parsedOutput, context)];
|
|
1231
|
-
case 17: throw _d.sent();
|
|
1232
|
-
case 18:
|
|
1233
|
-
parsedBody = parsedOutput.body;
|
|
1234
|
-
throwDefaultError({
|
|
1235
|
-
output: output,
|
|
1236
|
-
parsedBody: parsedBody,
|
|
1237
|
-
exceptionCtor: __BaseException,
|
|
1238
|
-
errorCode: errorCode,
|
|
1239
|
-
});
|
|
1240
|
-
_d.label = 19;
|
|
1241
|
-
case 19: return [2];
|
|
1242
|
-
}
|
|
1243
|
-
});
|
|
1244
|
-
}); };
|
|
1245
|
-
export var deserializeAws_json1_1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1246
|
-
var data, contents, response;
|
|
1247
|
-
return __generator(this, function (_a) {
|
|
1248
|
-
switch (_a.label) {
|
|
1249
|
-
case 0:
|
|
1250
|
-
if (output.statusCode >= 300) {
|
|
1251
|
-
return [2, deserializeAws_json1_1UntagResourceCommandError(output, context)];
|
|
1252
|
-
}
|
|
1253
|
-
return [4, parseBody(output.body, context)];
|
|
1254
|
-
case 1:
|
|
1255
|
-
data = _a.sent();
|
|
1256
|
-
contents = {};
|
|
1257
|
-
contents = deserializeAws_json1_1UntagResourceResponse(data, context);
|
|
1258
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
1259
|
-
return [2, Promise.resolve(response)];
|
|
1260
|
-
}
|
|
1261
|
-
});
|
|
1262
|
-
}); };
|
|
1263
|
-
var deserializeAws_json1_1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1264
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
1265
|
-
var _c;
|
|
1266
|
-
return __generator(this, function (_d) {
|
|
1267
|
-
switch (_d.label) {
|
|
1268
|
-
case 0:
|
|
1269
|
-
_a = [__assign({}, output)];
|
|
1270
|
-
_c = {};
|
|
1271
|
-
return [4, parseErrorBody(output.body, context)];
|
|
1272
|
-
case 1:
|
|
1273
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
1274
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1275
|
-
_b = errorCode;
|
|
1276
|
-
switch (_b) {
|
|
1277
|
-
case "ConcurrentModificationException": return [3, 2];
|
|
1278
|
-
case "com.amazonaws.translate#ConcurrentModificationException": return [3, 2];
|
|
1279
|
-
case "InternalServerException": return [3, 4];
|
|
1280
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 4];
|
|
1281
|
-
case "InvalidParameterValueException": return [3, 6];
|
|
1282
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 6];
|
|
1283
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
1284
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 8];
|
|
1285
|
-
}
|
|
1286
|
-
return [3, 10];
|
|
1287
|
-
case 2: return [4, deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)];
|
|
1288
|
-
case 3: throw _d.sent();
|
|
1289
|
-
case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1290
|
-
case 5: throw _d.sent();
|
|
1291
|
-
case 6: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
1292
|
-
case 7: throw _d.sent();
|
|
1293
|
-
case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1294
|
-
case 9: throw _d.sent();
|
|
1295
|
-
case 10:
|
|
1296
|
-
parsedBody = parsedOutput.body;
|
|
1297
|
-
throwDefaultError({
|
|
1298
|
-
output: output,
|
|
1299
|
-
parsedBody: parsedBody,
|
|
1300
|
-
exceptionCtor: __BaseException,
|
|
1301
|
-
errorCode: errorCode,
|
|
1302
|
-
});
|
|
1303
|
-
_d.label = 11;
|
|
1304
|
-
case 11: return [2];
|
|
1305
|
-
}
|
|
1306
|
-
});
|
|
1307
|
-
}); };
|
|
1308
|
-
export var deserializeAws_json1_1UpdateParallelDataCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1309
|
-
var data, contents, response;
|
|
1310
|
-
return __generator(this, function (_a) {
|
|
1311
|
-
switch (_a.label) {
|
|
1312
|
-
case 0:
|
|
1313
|
-
if (output.statusCode >= 300) {
|
|
1314
|
-
return [2, deserializeAws_json1_1UpdateParallelDataCommandError(output, context)];
|
|
1315
|
-
}
|
|
1316
|
-
return [4, parseBody(output.body, context)];
|
|
1317
|
-
case 1:
|
|
1318
|
-
data = _a.sent();
|
|
1319
|
-
contents = {};
|
|
1320
|
-
contents = deserializeAws_json1_1UpdateParallelDataResponse(data, context);
|
|
1321
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
1322
|
-
return [2, Promise.resolve(response)];
|
|
1323
|
-
}
|
|
1324
|
-
});
|
|
1325
|
-
}); };
|
|
1326
|
-
var deserializeAws_json1_1UpdateParallelDataCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1327
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
1328
|
-
var _c;
|
|
1329
|
-
return __generator(this, function (_d) {
|
|
1330
|
-
switch (_d.label) {
|
|
1331
|
-
case 0:
|
|
1332
|
-
_a = [__assign({}, output)];
|
|
1333
|
-
_c = {};
|
|
1334
|
-
return [4, parseErrorBody(output.body, context)];
|
|
1335
|
-
case 1:
|
|
1336
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
1337
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1338
|
-
_b = errorCode;
|
|
1339
|
-
switch (_b) {
|
|
1340
|
-
case "ConcurrentModificationException": return [3, 2];
|
|
1341
|
-
case "com.amazonaws.translate#ConcurrentModificationException": return [3, 2];
|
|
1342
|
-
case "ConflictException": return [3, 4];
|
|
1343
|
-
case "com.amazonaws.translate#ConflictException": return [3, 4];
|
|
1344
|
-
case "InternalServerException": return [3, 6];
|
|
1345
|
-
case "com.amazonaws.translate#InternalServerException": return [3, 6];
|
|
1346
|
-
case "InvalidParameterValueException": return [3, 8];
|
|
1347
|
-
case "com.amazonaws.translate#InvalidParameterValueException": return [3, 8];
|
|
1348
|
-
case "InvalidRequestException": return [3, 10];
|
|
1349
|
-
case "com.amazonaws.translate#InvalidRequestException": return [3, 10];
|
|
1350
|
-
case "LimitExceededException": return [3, 12];
|
|
1351
|
-
case "com.amazonaws.translate#LimitExceededException": return [3, 12];
|
|
1352
|
-
case "ResourceNotFoundException": return [3, 14];
|
|
1353
|
-
case "com.amazonaws.translate#ResourceNotFoundException": return [3, 14];
|
|
1354
|
-
case "TooManyRequestsException": return [3, 16];
|
|
1355
|
-
case "com.amazonaws.translate#TooManyRequestsException": return [3, 16];
|
|
1356
|
-
}
|
|
1357
|
-
return [3, 18];
|
|
1358
|
-
case 2: return [4, deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)];
|
|
1359
|
-
case 3: throw _d.sent();
|
|
1360
|
-
case 4: return [4, deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)];
|
|
1361
|
-
case 5: throw _d.sent();
|
|
1362
|
-
case 6: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
|
|
1363
|
-
case 7: throw _d.sent();
|
|
1364
|
-
case 8: return [4, deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context)];
|
|
1365
|
-
case 9: throw _d.sent();
|
|
1366
|
-
case 10: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
1367
|
-
case 11: throw _d.sent();
|
|
1368
|
-
case 12: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
1369
|
-
case 13: throw _d.sent();
|
|
1370
|
-
case 14: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
1371
|
-
case 15: throw _d.sent();
|
|
1372
|
-
case 16: return [4, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
1373
|
-
case 17: throw _d.sent();
|
|
1374
|
-
case 18:
|
|
1375
|
-
parsedBody = parsedOutput.body;
|
|
1376
|
-
throwDefaultError({
|
|
1377
|
-
output: output,
|
|
1378
|
-
parsedBody: parsedBody,
|
|
1379
|
-
exceptionCtor: __BaseException,
|
|
1380
|
-
errorCode: errorCode,
|
|
1381
|
-
});
|
|
1382
|
-
_d.label = 19;
|
|
1383
|
-
case 19: return [2];
|
|
1384
|
-
}
|
|
1385
|
-
});
|
|
1386
|
-
}); };
|
|
1387
|
-
var deserializeAws_json1_1ConcurrentModificationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1388
|
-
var body, deserialized, exception;
|
|
1389
|
-
return __generator(this, function (_a) {
|
|
1390
|
-
body = parsedOutput.body;
|
|
1391
|
-
deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context);
|
|
1392
|
-
exception = new ConcurrentModificationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1393
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1394
|
-
});
|
|
1395
|
-
}); };
|
|
1396
|
-
var deserializeAws_json1_1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1397
|
-
var body, deserialized, exception;
|
|
1398
|
-
return __generator(this, function (_a) {
|
|
1399
|
-
body = parsedOutput.body;
|
|
1400
|
-
deserialized = deserializeAws_json1_1ConflictException(body, context);
|
|
1401
|
-
exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1402
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1403
|
-
});
|
|
1404
|
-
}); };
|
|
1405
|
-
var deserializeAws_json1_1DetectedLanguageLowConfidenceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1406
|
-
var body, deserialized, exception;
|
|
1407
|
-
return __generator(this, function (_a) {
|
|
1408
|
-
body = parsedOutput.body;
|
|
1409
|
-
deserialized = deserializeAws_json1_1DetectedLanguageLowConfidenceException(body, context);
|
|
1410
|
-
exception = new DetectedLanguageLowConfidenceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1411
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1412
|
-
});
|
|
1413
|
-
}); };
|
|
1414
|
-
var deserializeAws_json1_1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1415
|
-
var body, deserialized, exception;
|
|
1416
|
-
return __generator(this, function (_a) {
|
|
1417
|
-
body = parsedOutput.body;
|
|
1418
|
-
deserialized = deserializeAws_json1_1InternalServerException(body, context);
|
|
1419
|
-
exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1420
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1421
|
-
});
|
|
1422
|
-
}); };
|
|
1423
|
-
var deserializeAws_json1_1InvalidFilterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1424
|
-
var body, deserialized, exception;
|
|
1425
|
-
return __generator(this, function (_a) {
|
|
1426
|
-
body = parsedOutput.body;
|
|
1427
|
-
deserialized = deserializeAws_json1_1InvalidFilterException(body, context);
|
|
1428
|
-
exception = new InvalidFilterException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1429
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1430
|
-
});
|
|
1431
|
-
}); };
|
|
1432
|
-
var deserializeAws_json1_1InvalidParameterValueExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1433
|
-
var body, deserialized, exception;
|
|
1434
|
-
return __generator(this, function (_a) {
|
|
1435
|
-
body = parsedOutput.body;
|
|
1436
|
-
deserialized = deserializeAws_json1_1InvalidParameterValueException(body, context);
|
|
1437
|
-
exception = new InvalidParameterValueException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1438
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1439
|
-
});
|
|
1440
|
-
}); };
|
|
1441
|
-
var deserializeAws_json1_1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1442
|
-
var body, deserialized, exception;
|
|
1443
|
-
return __generator(this, function (_a) {
|
|
1444
|
-
body = parsedOutput.body;
|
|
1445
|
-
deserialized = deserializeAws_json1_1InvalidRequestException(body, context);
|
|
1446
|
-
exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1447
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1448
|
-
});
|
|
1449
|
-
}); };
|
|
1450
|
-
var deserializeAws_json1_1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1451
|
-
var body, deserialized, exception;
|
|
1452
|
-
return __generator(this, function (_a) {
|
|
1453
|
-
body = parsedOutput.body;
|
|
1454
|
-
deserialized = deserializeAws_json1_1LimitExceededException(body, context);
|
|
1455
|
-
exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1456
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1457
|
-
});
|
|
1458
|
-
}); };
|
|
1459
|
-
var deserializeAws_json1_1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1460
|
-
var body, deserialized, exception;
|
|
1461
|
-
return __generator(this, function (_a) {
|
|
1462
|
-
body = parsedOutput.body;
|
|
1463
|
-
deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
|
|
1464
|
-
exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1465
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1466
|
-
});
|
|
1467
|
-
}); };
|
|
1468
|
-
var deserializeAws_json1_1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1469
|
-
var body, deserialized, exception;
|
|
1470
|
-
return __generator(this, function (_a) {
|
|
1471
|
-
body = parsedOutput.body;
|
|
1472
|
-
deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
|
|
1473
|
-
exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1474
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1475
|
-
});
|
|
1476
|
-
}); };
|
|
1477
|
-
var deserializeAws_json1_1TextSizeLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1478
|
-
var body, deserialized, exception;
|
|
1479
|
-
return __generator(this, function (_a) {
|
|
1480
|
-
body = parsedOutput.body;
|
|
1481
|
-
deserialized = deserializeAws_json1_1TextSizeLimitExceededException(body, context);
|
|
1482
|
-
exception = new TextSizeLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1483
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1484
|
-
});
|
|
1485
|
-
}); };
|
|
1486
|
-
var deserializeAws_json1_1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1487
|
-
var body, deserialized, exception;
|
|
1488
|
-
return __generator(this, function (_a) {
|
|
1489
|
-
body = parsedOutput.body;
|
|
1490
|
-
deserialized = deserializeAws_json1_1TooManyRequestsException(body, context);
|
|
1491
|
-
exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1492
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1493
|
-
});
|
|
1494
|
-
}); };
|
|
1495
|
-
var deserializeAws_json1_1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1496
|
-
var body, deserialized, exception;
|
|
1497
|
-
return __generator(this, function (_a) {
|
|
1498
|
-
body = parsedOutput.body;
|
|
1499
|
-
deserialized = deserializeAws_json1_1TooManyTagsException(body, context);
|
|
1500
|
-
exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1501
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1502
|
-
});
|
|
1503
|
-
}); };
|
|
1504
|
-
var deserializeAws_json1_1UnsupportedDisplayLanguageCodeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1505
|
-
var body, deserialized, exception;
|
|
1506
|
-
return __generator(this, function (_a) {
|
|
1507
|
-
body = parsedOutput.body;
|
|
1508
|
-
deserialized = deserializeAws_json1_1UnsupportedDisplayLanguageCodeException(body, context);
|
|
1509
|
-
exception = new UnsupportedDisplayLanguageCodeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1510
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1511
|
-
});
|
|
1512
|
-
}); };
|
|
1513
|
-
var deserializeAws_json1_1UnsupportedLanguagePairExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1514
|
-
var body, deserialized, exception;
|
|
1515
|
-
return __generator(this, function (_a) {
|
|
1516
|
-
body = parsedOutput.body;
|
|
1517
|
-
deserialized = deserializeAws_json1_1UnsupportedLanguagePairException(body, context);
|
|
1518
|
-
exception = new UnsupportedLanguagePairException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
1519
|
-
return [2, __decorateServiceException(exception, body)];
|
|
1520
|
-
});
|
|
1521
|
-
}); };
|
|
1522
|
-
var serializeAws_json1_1CreateParallelDataRequest = function (input, context) {
|
|
1523
|
-
var _a;
|
|
1524
|
-
return __assign(__assign(__assign(__assign(__assign({ ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.Description != null && { Description: input.Description })), (input.EncryptionKey != null && {
|
|
1525
|
-
EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context),
|
|
1526
|
-
})), (input.Name != null && { Name: input.Name })), (input.ParallelDataConfig != null && {
|
|
1527
|
-
ParallelDataConfig: serializeAws_json1_1ParallelDataConfig(input.ParallelDataConfig, context),
|
|
1528
|
-
})), (input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }));
|
|
6
|
+
export const serializeAws_json1_1CreateParallelDataCommand = async (input, context) => {
|
|
7
|
+
const headers = {
|
|
8
|
+
"content-type": "application/x-amz-json-1.1",
|
|
9
|
+
"x-amz-target": "AWSShineFrontendService_20170701.CreateParallelData",
|
|
10
|
+
};
|
|
11
|
+
let body;
|
|
12
|
+
body = JSON.stringify(serializeAws_json1_1CreateParallelDataRequest(input, context));
|
|
13
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
14
|
+
};
|
|
15
|
+
export const serializeAws_json1_1DeleteParallelDataCommand = async (input, context) => {
|
|
16
|
+
const headers = {
|
|
17
|
+
"content-type": "application/x-amz-json-1.1",
|
|
18
|
+
"x-amz-target": "AWSShineFrontendService_20170701.DeleteParallelData",
|
|
19
|
+
};
|
|
20
|
+
let body;
|
|
21
|
+
body = JSON.stringify(serializeAws_json1_1DeleteParallelDataRequest(input, context));
|
|
22
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
23
|
+
};
|
|
24
|
+
export const serializeAws_json1_1DeleteTerminologyCommand = async (input, context) => {
|
|
25
|
+
const headers = {
|
|
26
|
+
"content-type": "application/x-amz-json-1.1",
|
|
27
|
+
"x-amz-target": "AWSShineFrontendService_20170701.DeleteTerminology",
|
|
28
|
+
};
|
|
29
|
+
let body;
|
|
30
|
+
body = JSON.stringify(serializeAws_json1_1DeleteTerminologyRequest(input, context));
|
|
31
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
32
|
+
};
|
|
33
|
+
export const serializeAws_json1_1DescribeTextTranslationJobCommand = async (input, context) => {
|
|
34
|
+
const headers = {
|
|
35
|
+
"content-type": "application/x-amz-json-1.1",
|
|
36
|
+
"x-amz-target": "AWSShineFrontendService_20170701.DescribeTextTranslationJob",
|
|
37
|
+
};
|
|
38
|
+
let body;
|
|
39
|
+
body = JSON.stringify(serializeAws_json1_1DescribeTextTranslationJobRequest(input, context));
|
|
40
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
41
|
+
};
|
|
42
|
+
export const serializeAws_json1_1GetParallelDataCommand = async (input, context) => {
|
|
43
|
+
const headers = {
|
|
44
|
+
"content-type": "application/x-amz-json-1.1",
|
|
45
|
+
"x-amz-target": "AWSShineFrontendService_20170701.GetParallelData",
|
|
46
|
+
};
|
|
47
|
+
let body;
|
|
48
|
+
body = JSON.stringify(serializeAws_json1_1GetParallelDataRequest(input, context));
|
|
49
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
50
|
+
};
|
|
51
|
+
export const serializeAws_json1_1GetTerminologyCommand = async (input, context) => {
|
|
52
|
+
const headers = {
|
|
53
|
+
"content-type": "application/x-amz-json-1.1",
|
|
54
|
+
"x-amz-target": "AWSShineFrontendService_20170701.GetTerminology",
|
|
55
|
+
};
|
|
56
|
+
let body;
|
|
57
|
+
body = JSON.stringify(serializeAws_json1_1GetTerminologyRequest(input, context));
|
|
58
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
59
|
+
};
|
|
60
|
+
export const serializeAws_json1_1ImportTerminologyCommand = async (input, context) => {
|
|
61
|
+
const headers = {
|
|
62
|
+
"content-type": "application/x-amz-json-1.1",
|
|
63
|
+
"x-amz-target": "AWSShineFrontendService_20170701.ImportTerminology",
|
|
64
|
+
};
|
|
65
|
+
let body;
|
|
66
|
+
body = JSON.stringify(serializeAws_json1_1ImportTerminologyRequest(input, context));
|
|
67
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
68
|
+
};
|
|
69
|
+
export const serializeAws_json1_1ListLanguagesCommand = async (input, context) => {
|
|
70
|
+
const headers = {
|
|
71
|
+
"content-type": "application/x-amz-json-1.1",
|
|
72
|
+
"x-amz-target": "AWSShineFrontendService_20170701.ListLanguages",
|
|
73
|
+
};
|
|
74
|
+
let body;
|
|
75
|
+
body = JSON.stringify(serializeAws_json1_1ListLanguagesRequest(input, context));
|
|
76
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
77
|
+
};
|
|
78
|
+
export const serializeAws_json1_1ListParallelDataCommand = async (input, context) => {
|
|
79
|
+
const headers = {
|
|
80
|
+
"content-type": "application/x-amz-json-1.1",
|
|
81
|
+
"x-amz-target": "AWSShineFrontendService_20170701.ListParallelData",
|
|
82
|
+
};
|
|
83
|
+
let body;
|
|
84
|
+
body = JSON.stringify(serializeAws_json1_1ListParallelDataRequest(input, context));
|
|
85
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
86
|
+
};
|
|
87
|
+
export const serializeAws_json1_1ListTagsForResourceCommand = async (input, context) => {
|
|
88
|
+
const headers = {
|
|
89
|
+
"content-type": "application/x-amz-json-1.1",
|
|
90
|
+
"x-amz-target": "AWSShineFrontendService_20170701.ListTagsForResource",
|
|
91
|
+
};
|
|
92
|
+
let body;
|
|
93
|
+
body = JSON.stringify(serializeAws_json1_1ListTagsForResourceRequest(input, context));
|
|
94
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
95
|
+
};
|
|
96
|
+
export const serializeAws_json1_1ListTerminologiesCommand = async (input, context) => {
|
|
97
|
+
const headers = {
|
|
98
|
+
"content-type": "application/x-amz-json-1.1",
|
|
99
|
+
"x-amz-target": "AWSShineFrontendService_20170701.ListTerminologies",
|
|
100
|
+
};
|
|
101
|
+
let body;
|
|
102
|
+
body = JSON.stringify(serializeAws_json1_1ListTerminologiesRequest(input, context));
|
|
103
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
104
|
+
};
|
|
105
|
+
export const serializeAws_json1_1ListTextTranslationJobsCommand = async (input, context) => {
|
|
106
|
+
const headers = {
|
|
107
|
+
"content-type": "application/x-amz-json-1.1",
|
|
108
|
+
"x-amz-target": "AWSShineFrontendService_20170701.ListTextTranslationJobs",
|
|
109
|
+
};
|
|
110
|
+
let body;
|
|
111
|
+
body = JSON.stringify(serializeAws_json1_1ListTextTranslationJobsRequest(input, context));
|
|
112
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
113
|
+
};
|
|
114
|
+
export const serializeAws_json1_1StartTextTranslationJobCommand = async (input, context) => {
|
|
115
|
+
const headers = {
|
|
116
|
+
"content-type": "application/x-amz-json-1.1",
|
|
117
|
+
"x-amz-target": "AWSShineFrontendService_20170701.StartTextTranslationJob",
|
|
118
|
+
};
|
|
119
|
+
let body;
|
|
120
|
+
body = JSON.stringify(serializeAws_json1_1StartTextTranslationJobRequest(input, context));
|
|
121
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
122
|
+
};
|
|
123
|
+
export const serializeAws_json1_1StopTextTranslationJobCommand = async (input, context) => {
|
|
124
|
+
const headers = {
|
|
125
|
+
"content-type": "application/x-amz-json-1.1",
|
|
126
|
+
"x-amz-target": "AWSShineFrontendService_20170701.StopTextTranslationJob",
|
|
127
|
+
};
|
|
128
|
+
let body;
|
|
129
|
+
body = JSON.stringify(serializeAws_json1_1StopTextTranslationJobRequest(input, context));
|
|
130
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
131
|
+
};
|
|
132
|
+
export const serializeAws_json1_1TagResourceCommand = async (input, context) => {
|
|
133
|
+
const headers = {
|
|
134
|
+
"content-type": "application/x-amz-json-1.1",
|
|
135
|
+
"x-amz-target": "AWSShineFrontendService_20170701.TagResource",
|
|
136
|
+
};
|
|
137
|
+
let body;
|
|
138
|
+
body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context));
|
|
139
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
140
|
+
};
|
|
141
|
+
export const serializeAws_json1_1TranslateTextCommand = async (input, context) => {
|
|
142
|
+
const headers = {
|
|
143
|
+
"content-type": "application/x-amz-json-1.1",
|
|
144
|
+
"x-amz-target": "AWSShineFrontendService_20170701.TranslateText",
|
|
145
|
+
};
|
|
146
|
+
let body;
|
|
147
|
+
body = JSON.stringify(serializeAws_json1_1TranslateTextRequest(input, context));
|
|
148
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
149
|
+
};
|
|
150
|
+
export const serializeAws_json1_1UntagResourceCommand = async (input, context) => {
|
|
151
|
+
const headers = {
|
|
152
|
+
"content-type": "application/x-amz-json-1.1",
|
|
153
|
+
"x-amz-target": "AWSShineFrontendService_20170701.UntagResource",
|
|
154
|
+
};
|
|
155
|
+
let body;
|
|
156
|
+
body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context));
|
|
157
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
158
|
+
};
|
|
159
|
+
export const serializeAws_json1_1UpdateParallelDataCommand = async (input, context) => {
|
|
160
|
+
const headers = {
|
|
161
|
+
"content-type": "application/x-amz-json-1.1",
|
|
162
|
+
"x-amz-target": "AWSShineFrontendService_20170701.UpdateParallelData",
|
|
163
|
+
};
|
|
164
|
+
let body;
|
|
165
|
+
body = JSON.stringify(serializeAws_json1_1UpdateParallelDataRequest(input, context));
|
|
166
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
167
|
+
};
|
|
168
|
+
export const deserializeAws_json1_1CreateParallelDataCommand = async (output, context) => {
|
|
169
|
+
if (output.statusCode >= 300) {
|
|
170
|
+
return deserializeAws_json1_1CreateParallelDataCommandError(output, context);
|
|
171
|
+
}
|
|
172
|
+
const data = await parseBody(output.body, context);
|
|
173
|
+
let contents = {};
|
|
174
|
+
contents = deserializeAws_json1_1CreateParallelDataResponse(data, context);
|
|
175
|
+
const response = {
|
|
176
|
+
$metadata: deserializeMetadata(output),
|
|
177
|
+
...contents,
|
|
178
|
+
};
|
|
179
|
+
return Promise.resolve(response);
|
|
180
|
+
};
|
|
181
|
+
const deserializeAws_json1_1CreateParallelDataCommandError = async (output, context) => {
|
|
182
|
+
const parsedOutput = {
|
|
183
|
+
...output,
|
|
184
|
+
body: await parseErrorBody(output.body, context),
|
|
185
|
+
};
|
|
186
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
187
|
+
switch (errorCode) {
|
|
188
|
+
case "ConcurrentModificationException":
|
|
189
|
+
case "com.amazonaws.translate#ConcurrentModificationException":
|
|
190
|
+
throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
191
|
+
case "ConflictException":
|
|
192
|
+
case "com.amazonaws.translate#ConflictException":
|
|
193
|
+
throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
|
|
194
|
+
case "InternalServerException":
|
|
195
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
196
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
197
|
+
case "InvalidParameterValueException":
|
|
198
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
199
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
200
|
+
case "InvalidRequestException":
|
|
201
|
+
case "com.amazonaws.translate#InvalidRequestException":
|
|
202
|
+
throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
203
|
+
case "LimitExceededException":
|
|
204
|
+
case "com.amazonaws.translate#LimitExceededException":
|
|
205
|
+
throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
|
|
206
|
+
case "TooManyRequestsException":
|
|
207
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
208
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
209
|
+
case "TooManyTagsException":
|
|
210
|
+
case "com.amazonaws.translate#TooManyTagsException":
|
|
211
|
+
throw await deserializeAws_json1_1TooManyTagsExceptionResponse(parsedOutput, context);
|
|
212
|
+
default:
|
|
213
|
+
const parsedBody = parsedOutput.body;
|
|
214
|
+
throwDefaultError({
|
|
215
|
+
output,
|
|
216
|
+
parsedBody,
|
|
217
|
+
exceptionCtor: __BaseException,
|
|
218
|
+
errorCode,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
export const deserializeAws_json1_1DeleteParallelDataCommand = async (output, context) => {
|
|
223
|
+
if (output.statusCode >= 300) {
|
|
224
|
+
return deserializeAws_json1_1DeleteParallelDataCommandError(output, context);
|
|
225
|
+
}
|
|
226
|
+
const data = await parseBody(output.body, context);
|
|
227
|
+
let contents = {};
|
|
228
|
+
contents = deserializeAws_json1_1DeleteParallelDataResponse(data, context);
|
|
229
|
+
const response = {
|
|
230
|
+
$metadata: deserializeMetadata(output),
|
|
231
|
+
...contents,
|
|
232
|
+
};
|
|
233
|
+
return Promise.resolve(response);
|
|
234
|
+
};
|
|
235
|
+
const deserializeAws_json1_1DeleteParallelDataCommandError = async (output, context) => {
|
|
236
|
+
const parsedOutput = {
|
|
237
|
+
...output,
|
|
238
|
+
body: await parseErrorBody(output.body, context),
|
|
239
|
+
};
|
|
240
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
241
|
+
switch (errorCode) {
|
|
242
|
+
case "ConcurrentModificationException":
|
|
243
|
+
case "com.amazonaws.translate#ConcurrentModificationException":
|
|
244
|
+
throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
245
|
+
case "InternalServerException":
|
|
246
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
247
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
248
|
+
case "ResourceNotFoundException":
|
|
249
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
250
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
251
|
+
case "TooManyRequestsException":
|
|
252
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
253
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
254
|
+
default:
|
|
255
|
+
const parsedBody = parsedOutput.body;
|
|
256
|
+
throwDefaultError({
|
|
257
|
+
output,
|
|
258
|
+
parsedBody,
|
|
259
|
+
exceptionCtor: __BaseException,
|
|
260
|
+
errorCode,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
export const deserializeAws_json1_1DeleteTerminologyCommand = async (output, context) => {
|
|
265
|
+
if (output.statusCode >= 300) {
|
|
266
|
+
return deserializeAws_json1_1DeleteTerminologyCommandError(output, context);
|
|
267
|
+
}
|
|
268
|
+
await collectBody(output.body, context);
|
|
269
|
+
const response = {
|
|
270
|
+
$metadata: deserializeMetadata(output),
|
|
271
|
+
};
|
|
272
|
+
return Promise.resolve(response);
|
|
273
|
+
};
|
|
274
|
+
const deserializeAws_json1_1DeleteTerminologyCommandError = async (output, context) => {
|
|
275
|
+
const parsedOutput = {
|
|
276
|
+
...output,
|
|
277
|
+
body: await parseErrorBody(output.body, context),
|
|
278
|
+
};
|
|
279
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
280
|
+
switch (errorCode) {
|
|
281
|
+
case "InternalServerException":
|
|
282
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
283
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
284
|
+
case "InvalidParameterValueException":
|
|
285
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
286
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
287
|
+
case "ResourceNotFoundException":
|
|
288
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
289
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
290
|
+
case "TooManyRequestsException":
|
|
291
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
292
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
293
|
+
default:
|
|
294
|
+
const parsedBody = parsedOutput.body;
|
|
295
|
+
throwDefaultError({
|
|
296
|
+
output,
|
|
297
|
+
parsedBody,
|
|
298
|
+
exceptionCtor: __BaseException,
|
|
299
|
+
errorCode,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
export const deserializeAws_json1_1DescribeTextTranslationJobCommand = async (output, context) => {
|
|
304
|
+
if (output.statusCode >= 300) {
|
|
305
|
+
return deserializeAws_json1_1DescribeTextTranslationJobCommandError(output, context);
|
|
306
|
+
}
|
|
307
|
+
const data = await parseBody(output.body, context);
|
|
308
|
+
let contents = {};
|
|
309
|
+
contents = deserializeAws_json1_1DescribeTextTranslationJobResponse(data, context);
|
|
310
|
+
const response = {
|
|
311
|
+
$metadata: deserializeMetadata(output),
|
|
312
|
+
...contents,
|
|
313
|
+
};
|
|
314
|
+
return Promise.resolve(response);
|
|
315
|
+
};
|
|
316
|
+
const deserializeAws_json1_1DescribeTextTranslationJobCommandError = async (output, context) => {
|
|
317
|
+
const parsedOutput = {
|
|
318
|
+
...output,
|
|
319
|
+
body: await parseErrorBody(output.body, context),
|
|
320
|
+
};
|
|
321
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
322
|
+
switch (errorCode) {
|
|
323
|
+
case "InternalServerException":
|
|
324
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
325
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
326
|
+
case "ResourceNotFoundException":
|
|
327
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
328
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
329
|
+
case "TooManyRequestsException":
|
|
330
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
331
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
332
|
+
default:
|
|
333
|
+
const parsedBody = parsedOutput.body;
|
|
334
|
+
throwDefaultError({
|
|
335
|
+
output,
|
|
336
|
+
parsedBody,
|
|
337
|
+
exceptionCtor: __BaseException,
|
|
338
|
+
errorCode,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
export const deserializeAws_json1_1GetParallelDataCommand = async (output, context) => {
|
|
343
|
+
if (output.statusCode >= 300) {
|
|
344
|
+
return deserializeAws_json1_1GetParallelDataCommandError(output, context);
|
|
345
|
+
}
|
|
346
|
+
const data = await parseBody(output.body, context);
|
|
347
|
+
let contents = {};
|
|
348
|
+
contents = deserializeAws_json1_1GetParallelDataResponse(data, context);
|
|
349
|
+
const response = {
|
|
350
|
+
$metadata: deserializeMetadata(output),
|
|
351
|
+
...contents,
|
|
352
|
+
};
|
|
353
|
+
return Promise.resolve(response);
|
|
1529
354
|
};
|
|
1530
|
-
|
|
1531
|
-
|
|
355
|
+
const deserializeAws_json1_1GetParallelDataCommandError = async (output, context) => {
|
|
356
|
+
const parsedOutput = {
|
|
357
|
+
...output,
|
|
358
|
+
body: await parseErrorBody(output.body, context),
|
|
359
|
+
};
|
|
360
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
361
|
+
switch (errorCode) {
|
|
362
|
+
case "InternalServerException":
|
|
363
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
364
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
365
|
+
case "InvalidParameterValueException":
|
|
366
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
367
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
368
|
+
case "ResourceNotFoundException":
|
|
369
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
370
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
371
|
+
case "TooManyRequestsException":
|
|
372
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
373
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
374
|
+
default:
|
|
375
|
+
const parsedBody = parsedOutput.body;
|
|
376
|
+
throwDefaultError({
|
|
377
|
+
output,
|
|
378
|
+
parsedBody,
|
|
379
|
+
exceptionCtor: __BaseException,
|
|
380
|
+
errorCode,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
export const deserializeAws_json1_1GetTerminologyCommand = async (output, context) => {
|
|
385
|
+
if (output.statusCode >= 300) {
|
|
386
|
+
return deserializeAws_json1_1GetTerminologyCommandError(output, context);
|
|
387
|
+
}
|
|
388
|
+
const data = await parseBody(output.body, context);
|
|
389
|
+
let contents = {};
|
|
390
|
+
contents = deserializeAws_json1_1GetTerminologyResponse(data, context);
|
|
391
|
+
const response = {
|
|
392
|
+
$metadata: deserializeMetadata(output),
|
|
393
|
+
...contents,
|
|
394
|
+
};
|
|
395
|
+
return Promise.resolve(response);
|
|
396
|
+
};
|
|
397
|
+
const deserializeAws_json1_1GetTerminologyCommandError = async (output, context) => {
|
|
398
|
+
const parsedOutput = {
|
|
399
|
+
...output,
|
|
400
|
+
body: await parseErrorBody(output.body, context),
|
|
401
|
+
};
|
|
402
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
403
|
+
switch (errorCode) {
|
|
404
|
+
case "InternalServerException":
|
|
405
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
406
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
407
|
+
case "InvalidParameterValueException":
|
|
408
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
409
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
410
|
+
case "ResourceNotFoundException":
|
|
411
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
412
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
413
|
+
case "TooManyRequestsException":
|
|
414
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
415
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
416
|
+
default:
|
|
417
|
+
const parsedBody = parsedOutput.body;
|
|
418
|
+
throwDefaultError({
|
|
419
|
+
output,
|
|
420
|
+
parsedBody,
|
|
421
|
+
exceptionCtor: __BaseException,
|
|
422
|
+
errorCode,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
export const deserializeAws_json1_1ImportTerminologyCommand = async (output, context) => {
|
|
427
|
+
if (output.statusCode >= 300) {
|
|
428
|
+
return deserializeAws_json1_1ImportTerminologyCommandError(output, context);
|
|
429
|
+
}
|
|
430
|
+
const data = await parseBody(output.body, context);
|
|
431
|
+
let contents = {};
|
|
432
|
+
contents = deserializeAws_json1_1ImportTerminologyResponse(data, context);
|
|
433
|
+
const response = {
|
|
434
|
+
$metadata: deserializeMetadata(output),
|
|
435
|
+
...contents,
|
|
436
|
+
};
|
|
437
|
+
return Promise.resolve(response);
|
|
438
|
+
};
|
|
439
|
+
const deserializeAws_json1_1ImportTerminologyCommandError = async (output, context) => {
|
|
440
|
+
const parsedOutput = {
|
|
441
|
+
...output,
|
|
442
|
+
body: await parseErrorBody(output.body, context),
|
|
443
|
+
};
|
|
444
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
445
|
+
switch (errorCode) {
|
|
446
|
+
case "ConcurrentModificationException":
|
|
447
|
+
case "com.amazonaws.translate#ConcurrentModificationException":
|
|
448
|
+
throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
449
|
+
case "InternalServerException":
|
|
450
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
451
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
452
|
+
case "InvalidParameterValueException":
|
|
453
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
454
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
455
|
+
case "LimitExceededException":
|
|
456
|
+
case "com.amazonaws.translate#LimitExceededException":
|
|
457
|
+
throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
|
|
458
|
+
case "TooManyRequestsException":
|
|
459
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
460
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
461
|
+
case "TooManyTagsException":
|
|
462
|
+
case "com.amazonaws.translate#TooManyTagsException":
|
|
463
|
+
throw await deserializeAws_json1_1TooManyTagsExceptionResponse(parsedOutput, context);
|
|
464
|
+
default:
|
|
465
|
+
const parsedBody = parsedOutput.body;
|
|
466
|
+
throwDefaultError({
|
|
467
|
+
output,
|
|
468
|
+
parsedBody,
|
|
469
|
+
exceptionCtor: __BaseException,
|
|
470
|
+
errorCode,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
export const deserializeAws_json1_1ListLanguagesCommand = async (output, context) => {
|
|
475
|
+
if (output.statusCode >= 300) {
|
|
476
|
+
return deserializeAws_json1_1ListLanguagesCommandError(output, context);
|
|
477
|
+
}
|
|
478
|
+
const data = await parseBody(output.body, context);
|
|
479
|
+
let contents = {};
|
|
480
|
+
contents = deserializeAws_json1_1ListLanguagesResponse(data, context);
|
|
481
|
+
const response = {
|
|
482
|
+
$metadata: deserializeMetadata(output),
|
|
483
|
+
...contents,
|
|
484
|
+
};
|
|
485
|
+
return Promise.resolve(response);
|
|
486
|
+
};
|
|
487
|
+
const deserializeAws_json1_1ListLanguagesCommandError = async (output, context) => {
|
|
488
|
+
const parsedOutput = {
|
|
489
|
+
...output,
|
|
490
|
+
body: await parseErrorBody(output.body, context),
|
|
491
|
+
};
|
|
492
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
493
|
+
switch (errorCode) {
|
|
494
|
+
case "InternalServerException":
|
|
495
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
496
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
497
|
+
case "InvalidParameterValueException":
|
|
498
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
499
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
500
|
+
case "TooManyRequestsException":
|
|
501
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
502
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
503
|
+
case "UnsupportedDisplayLanguageCodeException":
|
|
504
|
+
case "com.amazonaws.translate#UnsupportedDisplayLanguageCodeException":
|
|
505
|
+
throw await deserializeAws_json1_1UnsupportedDisplayLanguageCodeExceptionResponse(parsedOutput, context);
|
|
506
|
+
default:
|
|
507
|
+
const parsedBody = parsedOutput.body;
|
|
508
|
+
throwDefaultError({
|
|
509
|
+
output,
|
|
510
|
+
parsedBody,
|
|
511
|
+
exceptionCtor: __BaseException,
|
|
512
|
+
errorCode,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
export const deserializeAws_json1_1ListParallelDataCommand = async (output, context) => {
|
|
517
|
+
if (output.statusCode >= 300) {
|
|
518
|
+
return deserializeAws_json1_1ListParallelDataCommandError(output, context);
|
|
519
|
+
}
|
|
520
|
+
const data = await parseBody(output.body, context);
|
|
521
|
+
let contents = {};
|
|
522
|
+
contents = deserializeAws_json1_1ListParallelDataResponse(data, context);
|
|
523
|
+
const response = {
|
|
524
|
+
$metadata: deserializeMetadata(output),
|
|
525
|
+
...contents,
|
|
526
|
+
};
|
|
527
|
+
return Promise.resolve(response);
|
|
528
|
+
};
|
|
529
|
+
const deserializeAws_json1_1ListParallelDataCommandError = async (output, context) => {
|
|
530
|
+
const parsedOutput = {
|
|
531
|
+
...output,
|
|
532
|
+
body: await parseErrorBody(output.body, context),
|
|
533
|
+
};
|
|
534
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
535
|
+
switch (errorCode) {
|
|
536
|
+
case "InternalServerException":
|
|
537
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
538
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
539
|
+
case "InvalidParameterValueException":
|
|
540
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
541
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
542
|
+
case "TooManyRequestsException":
|
|
543
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
544
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
545
|
+
default:
|
|
546
|
+
const parsedBody = parsedOutput.body;
|
|
547
|
+
throwDefaultError({
|
|
548
|
+
output,
|
|
549
|
+
parsedBody,
|
|
550
|
+
exceptionCtor: __BaseException,
|
|
551
|
+
errorCode,
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
export const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => {
|
|
556
|
+
if (output.statusCode >= 300) {
|
|
557
|
+
return deserializeAws_json1_1ListTagsForResourceCommandError(output, context);
|
|
558
|
+
}
|
|
559
|
+
const data = await parseBody(output.body, context);
|
|
560
|
+
let contents = {};
|
|
561
|
+
contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);
|
|
562
|
+
const response = {
|
|
563
|
+
$metadata: deserializeMetadata(output),
|
|
564
|
+
...contents,
|
|
565
|
+
};
|
|
566
|
+
return Promise.resolve(response);
|
|
567
|
+
};
|
|
568
|
+
const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, context) => {
|
|
569
|
+
const parsedOutput = {
|
|
570
|
+
...output,
|
|
571
|
+
body: await parseErrorBody(output.body, context),
|
|
572
|
+
};
|
|
573
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
574
|
+
switch (errorCode) {
|
|
575
|
+
case "InternalServerException":
|
|
576
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
577
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
578
|
+
case "InvalidParameterValueException":
|
|
579
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
580
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
581
|
+
case "ResourceNotFoundException":
|
|
582
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
583
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
584
|
+
default:
|
|
585
|
+
const parsedBody = parsedOutput.body;
|
|
586
|
+
throwDefaultError({
|
|
587
|
+
output,
|
|
588
|
+
parsedBody,
|
|
589
|
+
exceptionCtor: __BaseException,
|
|
590
|
+
errorCode,
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
export const deserializeAws_json1_1ListTerminologiesCommand = async (output, context) => {
|
|
595
|
+
if (output.statusCode >= 300) {
|
|
596
|
+
return deserializeAws_json1_1ListTerminologiesCommandError(output, context);
|
|
597
|
+
}
|
|
598
|
+
const data = await parseBody(output.body, context);
|
|
599
|
+
let contents = {};
|
|
600
|
+
contents = deserializeAws_json1_1ListTerminologiesResponse(data, context);
|
|
601
|
+
const response = {
|
|
602
|
+
$metadata: deserializeMetadata(output),
|
|
603
|
+
...contents,
|
|
604
|
+
};
|
|
605
|
+
return Promise.resolve(response);
|
|
606
|
+
};
|
|
607
|
+
const deserializeAws_json1_1ListTerminologiesCommandError = async (output, context) => {
|
|
608
|
+
const parsedOutput = {
|
|
609
|
+
...output,
|
|
610
|
+
body: await parseErrorBody(output.body, context),
|
|
611
|
+
};
|
|
612
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
613
|
+
switch (errorCode) {
|
|
614
|
+
case "InternalServerException":
|
|
615
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
616
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
617
|
+
case "InvalidParameterValueException":
|
|
618
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
619
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
620
|
+
case "TooManyRequestsException":
|
|
621
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
622
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
623
|
+
default:
|
|
624
|
+
const parsedBody = parsedOutput.body;
|
|
625
|
+
throwDefaultError({
|
|
626
|
+
output,
|
|
627
|
+
parsedBody,
|
|
628
|
+
exceptionCtor: __BaseException,
|
|
629
|
+
errorCode,
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
export const deserializeAws_json1_1ListTextTranslationJobsCommand = async (output, context) => {
|
|
634
|
+
if (output.statusCode >= 300) {
|
|
635
|
+
return deserializeAws_json1_1ListTextTranslationJobsCommandError(output, context);
|
|
636
|
+
}
|
|
637
|
+
const data = await parseBody(output.body, context);
|
|
638
|
+
let contents = {};
|
|
639
|
+
contents = deserializeAws_json1_1ListTextTranslationJobsResponse(data, context);
|
|
640
|
+
const response = {
|
|
641
|
+
$metadata: deserializeMetadata(output),
|
|
642
|
+
...contents,
|
|
643
|
+
};
|
|
644
|
+
return Promise.resolve(response);
|
|
645
|
+
};
|
|
646
|
+
const deserializeAws_json1_1ListTextTranslationJobsCommandError = async (output, context) => {
|
|
647
|
+
const parsedOutput = {
|
|
648
|
+
...output,
|
|
649
|
+
body: await parseErrorBody(output.body, context),
|
|
650
|
+
};
|
|
651
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
652
|
+
switch (errorCode) {
|
|
653
|
+
case "InternalServerException":
|
|
654
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
655
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
656
|
+
case "InvalidFilterException":
|
|
657
|
+
case "com.amazonaws.translate#InvalidFilterException":
|
|
658
|
+
throw await deserializeAws_json1_1InvalidFilterExceptionResponse(parsedOutput, context);
|
|
659
|
+
case "InvalidRequestException":
|
|
660
|
+
case "com.amazonaws.translate#InvalidRequestException":
|
|
661
|
+
throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
662
|
+
case "TooManyRequestsException":
|
|
663
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
664
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
665
|
+
default:
|
|
666
|
+
const parsedBody = parsedOutput.body;
|
|
667
|
+
throwDefaultError({
|
|
668
|
+
output,
|
|
669
|
+
parsedBody,
|
|
670
|
+
exceptionCtor: __BaseException,
|
|
671
|
+
errorCode,
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
export const deserializeAws_json1_1StartTextTranslationJobCommand = async (output, context) => {
|
|
676
|
+
if (output.statusCode >= 300) {
|
|
677
|
+
return deserializeAws_json1_1StartTextTranslationJobCommandError(output, context);
|
|
678
|
+
}
|
|
679
|
+
const data = await parseBody(output.body, context);
|
|
680
|
+
let contents = {};
|
|
681
|
+
contents = deserializeAws_json1_1StartTextTranslationJobResponse(data, context);
|
|
682
|
+
const response = {
|
|
683
|
+
$metadata: deserializeMetadata(output),
|
|
684
|
+
...contents,
|
|
685
|
+
};
|
|
686
|
+
return Promise.resolve(response);
|
|
687
|
+
};
|
|
688
|
+
const deserializeAws_json1_1StartTextTranslationJobCommandError = async (output, context) => {
|
|
689
|
+
const parsedOutput = {
|
|
690
|
+
...output,
|
|
691
|
+
body: await parseErrorBody(output.body, context),
|
|
692
|
+
};
|
|
693
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
694
|
+
switch (errorCode) {
|
|
695
|
+
case "InternalServerException":
|
|
696
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
697
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
698
|
+
case "InvalidParameterValueException":
|
|
699
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
700
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
701
|
+
case "InvalidRequestException":
|
|
702
|
+
case "com.amazonaws.translate#InvalidRequestException":
|
|
703
|
+
throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
704
|
+
case "ResourceNotFoundException":
|
|
705
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
706
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
707
|
+
case "TooManyRequestsException":
|
|
708
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
709
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
710
|
+
case "UnsupportedLanguagePairException":
|
|
711
|
+
case "com.amazonaws.translate#UnsupportedLanguagePairException":
|
|
712
|
+
throw await deserializeAws_json1_1UnsupportedLanguagePairExceptionResponse(parsedOutput, context);
|
|
713
|
+
default:
|
|
714
|
+
const parsedBody = parsedOutput.body;
|
|
715
|
+
throwDefaultError({
|
|
716
|
+
output,
|
|
717
|
+
parsedBody,
|
|
718
|
+
exceptionCtor: __BaseException,
|
|
719
|
+
errorCode,
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
export const deserializeAws_json1_1StopTextTranslationJobCommand = async (output, context) => {
|
|
724
|
+
if (output.statusCode >= 300) {
|
|
725
|
+
return deserializeAws_json1_1StopTextTranslationJobCommandError(output, context);
|
|
726
|
+
}
|
|
727
|
+
const data = await parseBody(output.body, context);
|
|
728
|
+
let contents = {};
|
|
729
|
+
contents = deserializeAws_json1_1StopTextTranslationJobResponse(data, context);
|
|
730
|
+
const response = {
|
|
731
|
+
$metadata: deserializeMetadata(output),
|
|
732
|
+
...contents,
|
|
733
|
+
};
|
|
734
|
+
return Promise.resolve(response);
|
|
735
|
+
};
|
|
736
|
+
const deserializeAws_json1_1StopTextTranslationJobCommandError = async (output, context) => {
|
|
737
|
+
const parsedOutput = {
|
|
738
|
+
...output,
|
|
739
|
+
body: await parseErrorBody(output.body, context),
|
|
740
|
+
};
|
|
741
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
742
|
+
switch (errorCode) {
|
|
743
|
+
case "InternalServerException":
|
|
744
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
745
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
746
|
+
case "ResourceNotFoundException":
|
|
747
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
748
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
749
|
+
case "TooManyRequestsException":
|
|
750
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
751
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
752
|
+
default:
|
|
753
|
+
const parsedBody = parsedOutput.body;
|
|
754
|
+
throwDefaultError({
|
|
755
|
+
output,
|
|
756
|
+
parsedBody,
|
|
757
|
+
exceptionCtor: __BaseException,
|
|
758
|
+
errorCode,
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
export const deserializeAws_json1_1TagResourceCommand = async (output, context) => {
|
|
763
|
+
if (output.statusCode >= 300) {
|
|
764
|
+
return deserializeAws_json1_1TagResourceCommandError(output, context);
|
|
765
|
+
}
|
|
766
|
+
const data = await parseBody(output.body, context);
|
|
767
|
+
let contents = {};
|
|
768
|
+
contents = deserializeAws_json1_1TagResourceResponse(data, context);
|
|
769
|
+
const response = {
|
|
770
|
+
$metadata: deserializeMetadata(output),
|
|
771
|
+
...contents,
|
|
772
|
+
};
|
|
773
|
+
return Promise.resolve(response);
|
|
774
|
+
};
|
|
775
|
+
const deserializeAws_json1_1TagResourceCommandError = async (output, context) => {
|
|
776
|
+
const parsedOutput = {
|
|
777
|
+
...output,
|
|
778
|
+
body: await parseErrorBody(output.body, context),
|
|
779
|
+
};
|
|
780
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
781
|
+
switch (errorCode) {
|
|
782
|
+
case "ConcurrentModificationException":
|
|
783
|
+
case "com.amazonaws.translate#ConcurrentModificationException":
|
|
784
|
+
throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
785
|
+
case "InternalServerException":
|
|
786
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
787
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
788
|
+
case "InvalidParameterValueException":
|
|
789
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
790
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
791
|
+
case "ResourceNotFoundException":
|
|
792
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
793
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
794
|
+
case "TooManyTagsException":
|
|
795
|
+
case "com.amazonaws.translate#TooManyTagsException":
|
|
796
|
+
throw await deserializeAws_json1_1TooManyTagsExceptionResponse(parsedOutput, context);
|
|
797
|
+
default:
|
|
798
|
+
const parsedBody = parsedOutput.body;
|
|
799
|
+
throwDefaultError({
|
|
800
|
+
output,
|
|
801
|
+
parsedBody,
|
|
802
|
+
exceptionCtor: __BaseException,
|
|
803
|
+
errorCode,
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
export const deserializeAws_json1_1TranslateTextCommand = async (output, context) => {
|
|
808
|
+
if (output.statusCode >= 300) {
|
|
809
|
+
return deserializeAws_json1_1TranslateTextCommandError(output, context);
|
|
810
|
+
}
|
|
811
|
+
const data = await parseBody(output.body, context);
|
|
812
|
+
let contents = {};
|
|
813
|
+
contents = deserializeAws_json1_1TranslateTextResponse(data, context);
|
|
814
|
+
const response = {
|
|
815
|
+
$metadata: deserializeMetadata(output),
|
|
816
|
+
...contents,
|
|
817
|
+
};
|
|
818
|
+
return Promise.resolve(response);
|
|
819
|
+
};
|
|
820
|
+
const deserializeAws_json1_1TranslateTextCommandError = async (output, context) => {
|
|
821
|
+
const parsedOutput = {
|
|
822
|
+
...output,
|
|
823
|
+
body: await parseErrorBody(output.body, context),
|
|
824
|
+
};
|
|
825
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
826
|
+
switch (errorCode) {
|
|
827
|
+
case "DetectedLanguageLowConfidenceException":
|
|
828
|
+
case "com.amazonaws.translate#DetectedLanguageLowConfidenceException":
|
|
829
|
+
throw await deserializeAws_json1_1DetectedLanguageLowConfidenceExceptionResponse(parsedOutput, context);
|
|
830
|
+
case "InternalServerException":
|
|
831
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
832
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
833
|
+
case "InvalidRequestException":
|
|
834
|
+
case "com.amazonaws.translate#InvalidRequestException":
|
|
835
|
+
throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
836
|
+
case "ResourceNotFoundException":
|
|
837
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
838
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
839
|
+
case "ServiceUnavailableException":
|
|
840
|
+
case "com.amazonaws.translate#ServiceUnavailableException":
|
|
841
|
+
throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
842
|
+
case "TextSizeLimitExceededException":
|
|
843
|
+
case "com.amazonaws.translate#TextSizeLimitExceededException":
|
|
844
|
+
throw await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse(parsedOutput, context);
|
|
845
|
+
case "TooManyRequestsException":
|
|
846
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
847
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
848
|
+
case "UnsupportedLanguagePairException":
|
|
849
|
+
case "com.amazonaws.translate#UnsupportedLanguagePairException":
|
|
850
|
+
throw await deserializeAws_json1_1UnsupportedLanguagePairExceptionResponse(parsedOutput, context);
|
|
851
|
+
default:
|
|
852
|
+
const parsedBody = parsedOutput.body;
|
|
853
|
+
throwDefaultError({
|
|
854
|
+
output,
|
|
855
|
+
parsedBody,
|
|
856
|
+
exceptionCtor: __BaseException,
|
|
857
|
+
errorCode,
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
export const deserializeAws_json1_1UntagResourceCommand = async (output, context) => {
|
|
862
|
+
if (output.statusCode >= 300) {
|
|
863
|
+
return deserializeAws_json1_1UntagResourceCommandError(output, context);
|
|
864
|
+
}
|
|
865
|
+
const data = await parseBody(output.body, context);
|
|
866
|
+
let contents = {};
|
|
867
|
+
contents = deserializeAws_json1_1UntagResourceResponse(data, context);
|
|
868
|
+
const response = {
|
|
869
|
+
$metadata: deserializeMetadata(output),
|
|
870
|
+
...contents,
|
|
871
|
+
};
|
|
872
|
+
return Promise.resolve(response);
|
|
873
|
+
};
|
|
874
|
+
const deserializeAws_json1_1UntagResourceCommandError = async (output, context) => {
|
|
875
|
+
const parsedOutput = {
|
|
876
|
+
...output,
|
|
877
|
+
body: await parseErrorBody(output.body, context),
|
|
878
|
+
};
|
|
879
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
880
|
+
switch (errorCode) {
|
|
881
|
+
case "ConcurrentModificationException":
|
|
882
|
+
case "com.amazonaws.translate#ConcurrentModificationException":
|
|
883
|
+
throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
884
|
+
case "InternalServerException":
|
|
885
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
886
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
887
|
+
case "InvalidParameterValueException":
|
|
888
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
889
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
890
|
+
case "ResourceNotFoundException":
|
|
891
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
892
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
893
|
+
default:
|
|
894
|
+
const parsedBody = parsedOutput.body;
|
|
895
|
+
throwDefaultError({
|
|
896
|
+
output,
|
|
897
|
+
parsedBody,
|
|
898
|
+
exceptionCtor: __BaseException,
|
|
899
|
+
errorCode,
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
export const deserializeAws_json1_1UpdateParallelDataCommand = async (output, context) => {
|
|
904
|
+
if (output.statusCode >= 300) {
|
|
905
|
+
return deserializeAws_json1_1UpdateParallelDataCommandError(output, context);
|
|
906
|
+
}
|
|
907
|
+
const data = await parseBody(output.body, context);
|
|
908
|
+
let contents = {};
|
|
909
|
+
contents = deserializeAws_json1_1UpdateParallelDataResponse(data, context);
|
|
910
|
+
const response = {
|
|
911
|
+
$metadata: deserializeMetadata(output),
|
|
912
|
+
...contents,
|
|
913
|
+
};
|
|
914
|
+
return Promise.resolve(response);
|
|
1532
915
|
};
|
|
1533
|
-
|
|
1534
|
-
|
|
916
|
+
const deserializeAws_json1_1UpdateParallelDataCommandError = async (output, context) => {
|
|
917
|
+
const parsedOutput = {
|
|
918
|
+
...output,
|
|
919
|
+
body: await parseErrorBody(output.body, context),
|
|
920
|
+
};
|
|
921
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
922
|
+
switch (errorCode) {
|
|
923
|
+
case "ConcurrentModificationException":
|
|
924
|
+
case "com.amazonaws.translate#ConcurrentModificationException":
|
|
925
|
+
throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
|
|
926
|
+
case "ConflictException":
|
|
927
|
+
case "com.amazonaws.translate#ConflictException":
|
|
928
|
+
throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
|
|
929
|
+
case "InternalServerException":
|
|
930
|
+
case "com.amazonaws.translate#InternalServerException":
|
|
931
|
+
throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
|
|
932
|
+
case "InvalidParameterValueException":
|
|
933
|
+
case "com.amazonaws.translate#InvalidParameterValueException":
|
|
934
|
+
throw await deserializeAws_json1_1InvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
935
|
+
case "InvalidRequestException":
|
|
936
|
+
case "com.amazonaws.translate#InvalidRequestException":
|
|
937
|
+
throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
938
|
+
case "LimitExceededException":
|
|
939
|
+
case "com.amazonaws.translate#LimitExceededException":
|
|
940
|
+
throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
|
|
941
|
+
case "ResourceNotFoundException":
|
|
942
|
+
case "com.amazonaws.translate#ResourceNotFoundException":
|
|
943
|
+
throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
944
|
+
case "TooManyRequestsException":
|
|
945
|
+
case "com.amazonaws.translate#TooManyRequestsException":
|
|
946
|
+
throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
947
|
+
default:
|
|
948
|
+
const parsedBody = parsedOutput.body;
|
|
949
|
+
throwDefaultError({
|
|
950
|
+
output,
|
|
951
|
+
parsedBody,
|
|
952
|
+
exceptionCtor: __BaseException,
|
|
953
|
+
errorCode,
|
|
954
|
+
});
|
|
955
|
+
}
|
|
1535
956
|
};
|
|
1536
|
-
|
|
1537
|
-
|
|
957
|
+
const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => {
|
|
958
|
+
const body = parsedOutput.body;
|
|
959
|
+
const deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context);
|
|
960
|
+
const exception = new ConcurrentModificationException({
|
|
961
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
962
|
+
...deserialized,
|
|
963
|
+
});
|
|
964
|
+
return __decorateServiceException(exception, body);
|
|
965
|
+
};
|
|
966
|
+
const deserializeAws_json1_1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
967
|
+
const body = parsedOutput.body;
|
|
968
|
+
const deserialized = deserializeAws_json1_1ConflictException(body, context);
|
|
969
|
+
const exception = new ConflictException({
|
|
970
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
971
|
+
...deserialized,
|
|
972
|
+
});
|
|
973
|
+
return __decorateServiceException(exception, body);
|
|
974
|
+
};
|
|
975
|
+
const deserializeAws_json1_1DetectedLanguageLowConfidenceExceptionResponse = async (parsedOutput, context) => {
|
|
976
|
+
const body = parsedOutput.body;
|
|
977
|
+
const deserialized = deserializeAws_json1_1DetectedLanguageLowConfidenceException(body, context);
|
|
978
|
+
const exception = new DetectedLanguageLowConfidenceException({
|
|
979
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
980
|
+
...deserialized,
|
|
981
|
+
});
|
|
982
|
+
return __decorateServiceException(exception, body);
|
|
983
|
+
};
|
|
984
|
+
const deserializeAws_json1_1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
985
|
+
const body = parsedOutput.body;
|
|
986
|
+
const deserialized = deserializeAws_json1_1InternalServerException(body, context);
|
|
987
|
+
const exception = new InternalServerException({
|
|
988
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
989
|
+
...deserialized,
|
|
990
|
+
});
|
|
991
|
+
return __decorateServiceException(exception, body);
|
|
992
|
+
};
|
|
993
|
+
const deserializeAws_json1_1InvalidFilterExceptionResponse = async (parsedOutput, context) => {
|
|
994
|
+
const body = parsedOutput.body;
|
|
995
|
+
const deserialized = deserializeAws_json1_1InvalidFilterException(body, context);
|
|
996
|
+
const exception = new InvalidFilterException({
|
|
997
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
998
|
+
...deserialized,
|
|
999
|
+
});
|
|
1000
|
+
return __decorateServiceException(exception, body);
|
|
1001
|
+
};
|
|
1002
|
+
const deserializeAws_json1_1InvalidParameterValueExceptionResponse = async (parsedOutput, context) => {
|
|
1003
|
+
const body = parsedOutput.body;
|
|
1004
|
+
const deserialized = deserializeAws_json1_1InvalidParameterValueException(body, context);
|
|
1005
|
+
const exception = new InvalidParameterValueException({
|
|
1006
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1007
|
+
...deserialized,
|
|
1008
|
+
});
|
|
1009
|
+
return __decorateServiceException(exception, body);
|
|
1010
|
+
};
|
|
1011
|
+
const deserializeAws_json1_1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
|
|
1012
|
+
const body = parsedOutput.body;
|
|
1013
|
+
const deserialized = deserializeAws_json1_1InvalidRequestException(body, context);
|
|
1014
|
+
const exception = new InvalidRequestException({
|
|
1015
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1016
|
+
...deserialized,
|
|
1017
|
+
});
|
|
1018
|
+
return __decorateServiceException(exception, body);
|
|
1019
|
+
};
|
|
1020
|
+
const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
1021
|
+
const body = parsedOutput.body;
|
|
1022
|
+
const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
|
|
1023
|
+
const exception = new LimitExceededException({
|
|
1024
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1025
|
+
...deserialized,
|
|
1026
|
+
});
|
|
1027
|
+
return __decorateServiceException(exception, body);
|
|
1028
|
+
};
|
|
1029
|
+
const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
1030
|
+
const body = parsedOutput.body;
|
|
1031
|
+
const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
|
|
1032
|
+
const exception = new ResourceNotFoundException({
|
|
1033
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1034
|
+
...deserialized,
|
|
1035
|
+
});
|
|
1036
|
+
return __decorateServiceException(exception, body);
|
|
1037
|
+
};
|
|
1038
|
+
const deserializeAws_json1_1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
|
|
1039
|
+
const body = parsedOutput.body;
|
|
1040
|
+
const deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
|
|
1041
|
+
const exception = new ServiceUnavailableException({
|
|
1042
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1043
|
+
...deserialized,
|
|
1044
|
+
});
|
|
1045
|
+
return __decorateServiceException(exception, body);
|
|
1046
|
+
};
|
|
1047
|
+
const deserializeAws_json1_1TextSizeLimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
1048
|
+
const body = parsedOutput.body;
|
|
1049
|
+
const deserialized = deserializeAws_json1_1TextSizeLimitExceededException(body, context);
|
|
1050
|
+
const exception = new TextSizeLimitExceededException({
|
|
1051
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1052
|
+
...deserialized,
|
|
1053
|
+
});
|
|
1054
|
+
return __decorateServiceException(exception, body);
|
|
1055
|
+
};
|
|
1056
|
+
const deserializeAws_json1_1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
|
|
1057
|
+
const body = parsedOutput.body;
|
|
1058
|
+
const deserialized = deserializeAws_json1_1TooManyRequestsException(body, context);
|
|
1059
|
+
const exception = new TooManyRequestsException({
|
|
1060
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1061
|
+
...deserialized,
|
|
1062
|
+
});
|
|
1063
|
+
return __decorateServiceException(exception, body);
|
|
1064
|
+
};
|
|
1065
|
+
const deserializeAws_json1_1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
|
|
1066
|
+
const body = parsedOutput.body;
|
|
1067
|
+
const deserialized = deserializeAws_json1_1TooManyTagsException(body, context);
|
|
1068
|
+
const exception = new TooManyTagsException({
|
|
1069
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1070
|
+
...deserialized,
|
|
1071
|
+
});
|
|
1072
|
+
return __decorateServiceException(exception, body);
|
|
1073
|
+
};
|
|
1074
|
+
const deserializeAws_json1_1UnsupportedDisplayLanguageCodeExceptionResponse = async (parsedOutput, context) => {
|
|
1075
|
+
const body = parsedOutput.body;
|
|
1076
|
+
const deserialized = deserializeAws_json1_1UnsupportedDisplayLanguageCodeException(body, context);
|
|
1077
|
+
const exception = new UnsupportedDisplayLanguageCodeException({
|
|
1078
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1079
|
+
...deserialized,
|
|
1080
|
+
});
|
|
1081
|
+
return __decorateServiceException(exception, body);
|
|
1082
|
+
};
|
|
1083
|
+
const deserializeAws_json1_1UnsupportedLanguagePairExceptionResponse = async (parsedOutput, context) => {
|
|
1084
|
+
const body = parsedOutput.body;
|
|
1085
|
+
const deserialized = deserializeAws_json1_1UnsupportedLanguagePairException(body, context);
|
|
1086
|
+
const exception = new UnsupportedLanguagePairException({
|
|
1087
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1088
|
+
...deserialized,
|
|
1089
|
+
});
|
|
1090
|
+
return __decorateServiceException(exception, body);
|
|
1091
|
+
};
|
|
1092
|
+
const serializeAws_json1_1CreateParallelDataRequest = (input, context) => {
|
|
1093
|
+
return {
|
|
1094
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
1095
|
+
...(input.Description != null && { Description: input.Description }),
|
|
1096
|
+
...(input.EncryptionKey != null && {
|
|
1097
|
+
EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context),
|
|
1098
|
+
}),
|
|
1099
|
+
...(input.Name != null && { Name: input.Name }),
|
|
1100
|
+
...(input.ParallelDataConfig != null && {
|
|
1101
|
+
ParallelDataConfig: serializeAws_json1_1ParallelDataConfig(input.ParallelDataConfig, context),
|
|
1102
|
+
}),
|
|
1103
|
+
...(input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
|
|
1104
|
+
};
|
|
1538
1105
|
};
|
|
1539
|
-
|
|
1540
|
-
return
|
|
1106
|
+
const serializeAws_json1_1DeleteParallelDataRequest = (input, context) => {
|
|
1107
|
+
return {
|
|
1108
|
+
...(input.Name != null && { Name: input.Name }),
|
|
1109
|
+
};
|
|
1541
1110
|
};
|
|
1542
|
-
|
|
1543
|
-
return
|
|
1111
|
+
const serializeAws_json1_1DeleteTerminologyRequest = (input, context) => {
|
|
1112
|
+
return {
|
|
1113
|
+
...(input.Name != null && { Name: input.Name }),
|
|
1114
|
+
};
|
|
1544
1115
|
};
|
|
1545
|
-
|
|
1546
|
-
return
|
|
1116
|
+
const serializeAws_json1_1DescribeTextTranslationJobRequest = (input, context) => {
|
|
1117
|
+
return {
|
|
1118
|
+
...(input.JobId != null && { JobId: input.JobId }),
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
const serializeAws_json1_1EncryptionKey = (input, context) => {
|
|
1122
|
+
return {
|
|
1123
|
+
...(input.Id != null && { Id: input.Id }),
|
|
1124
|
+
...(input.Type != null && { Type: input.Type }),
|
|
1125
|
+
};
|
|
1547
1126
|
};
|
|
1548
|
-
|
|
1549
|
-
return
|
|
1550
|
-
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1127
|
+
const serializeAws_json1_1GetParallelDataRequest = (input, context) => {
|
|
1128
|
+
return {
|
|
1129
|
+
...(input.Name != null && { Name: input.Name }),
|
|
1130
|
+
};
|
|
1131
|
+
};
|
|
1132
|
+
const serializeAws_json1_1GetTerminologyRequest = (input, context) => {
|
|
1133
|
+
return {
|
|
1134
|
+
...(input.Name != null && { Name: input.Name }),
|
|
1135
|
+
...(input.TerminologyDataFormat != null && { TerminologyDataFormat: input.TerminologyDataFormat }),
|
|
1136
|
+
};
|
|
1554
1137
|
};
|
|
1555
|
-
|
|
1556
|
-
return
|
|
1138
|
+
const serializeAws_json1_1ImportTerminologyRequest = (input, context) => {
|
|
1139
|
+
return {
|
|
1140
|
+
...(input.Description != null && { Description: input.Description }),
|
|
1141
|
+
...(input.EncryptionKey != null && {
|
|
1142
|
+
EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context),
|
|
1143
|
+
}),
|
|
1144
|
+
...(input.MergeStrategy != null && { MergeStrategy: input.MergeStrategy }),
|
|
1145
|
+
...(input.Name != null && { Name: input.Name }),
|
|
1146
|
+
...(input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
|
|
1147
|
+
...(input.TerminologyData != null && {
|
|
1148
|
+
TerminologyData: serializeAws_json1_1TerminologyData(input.TerminologyData, context),
|
|
1149
|
+
}),
|
|
1150
|
+
};
|
|
1557
1151
|
};
|
|
1558
|
-
|
|
1559
|
-
return
|
|
1152
|
+
const serializeAws_json1_1InputDataConfig = (input, context) => {
|
|
1153
|
+
return {
|
|
1154
|
+
...(input.ContentType != null && { ContentType: input.ContentType }),
|
|
1155
|
+
...(input.S3Uri != null && { S3Uri: input.S3Uri }),
|
|
1156
|
+
};
|
|
1560
1157
|
};
|
|
1561
|
-
|
|
1562
|
-
return
|
|
1158
|
+
const serializeAws_json1_1ListLanguagesRequest = (input, context) => {
|
|
1159
|
+
return {
|
|
1160
|
+
...(input.DisplayLanguageCode != null && { DisplayLanguageCode: input.DisplayLanguageCode }),
|
|
1161
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
1162
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
1163
|
+
};
|
|
1563
1164
|
};
|
|
1564
|
-
|
|
1565
|
-
return
|
|
1165
|
+
const serializeAws_json1_1ListParallelDataRequest = (input, context) => {
|
|
1166
|
+
return {
|
|
1167
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
1168
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
1169
|
+
};
|
|
1566
1170
|
};
|
|
1567
|
-
|
|
1568
|
-
return
|
|
1171
|
+
const serializeAws_json1_1ListTagsForResourceRequest = (input, context) => {
|
|
1172
|
+
return {
|
|
1173
|
+
...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
|
|
1174
|
+
};
|
|
1569
1175
|
};
|
|
1570
|
-
|
|
1571
|
-
return
|
|
1176
|
+
const serializeAws_json1_1ListTerminologiesRequest = (input, context) => {
|
|
1177
|
+
return {
|
|
1178
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
1179
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
1180
|
+
};
|
|
1572
1181
|
};
|
|
1573
|
-
|
|
1574
|
-
return
|
|
1575
|
-
|
|
1576
|
-
|
|
1182
|
+
const serializeAws_json1_1ListTextTranslationJobsRequest = (input, context) => {
|
|
1183
|
+
return {
|
|
1184
|
+
...(input.Filter != null && { Filter: serializeAws_json1_1TextTranslationJobFilter(input.Filter, context) }),
|
|
1185
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
1186
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
1187
|
+
};
|
|
1577
1188
|
};
|
|
1578
|
-
|
|
1579
|
-
return
|
|
1189
|
+
const serializeAws_json1_1OutputDataConfig = (input, context) => {
|
|
1190
|
+
return {
|
|
1191
|
+
...(input.EncryptionKey != null && {
|
|
1192
|
+
EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context),
|
|
1193
|
+
}),
|
|
1194
|
+
...(input.S3Uri != null && { S3Uri: input.S3Uri }),
|
|
1195
|
+
};
|
|
1580
1196
|
};
|
|
1581
|
-
|
|
1197
|
+
const serializeAws_json1_1ParallelDataConfig = (input, context) => {
|
|
1198
|
+
return {
|
|
1199
|
+
...(input.Format != null && { Format: input.Format }),
|
|
1200
|
+
...(input.S3Uri != null && { S3Uri: input.S3Uri }),
|
|
1201
|
+
};
|
|
1202
|
+
};
|
|
1203
|
+
const serializeAws_json1_1ResourceNameList = (input, context) => {
|
|
1582
1204
|
return input
|
|
1583
|
-
.filter(
|
|
1584
|
-
.map(
|
|
1205
|
+
.filter((e) => e != null)
|
|
1206
|
+
.map((entry) => {
|
|
1585
1207
|
return entry;
|
|
1586
1208
|
});
|
|
1587
1209
|
};
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1210
|
+
const serializeAws_json1_1StartTextTranslationJobRequest = (input, context) => {
|
|
1211
|
+
return {
|
|
1212
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
1213
|
+
...(input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn }),
|
|
1214
|
+
...(input.InputDataConfig != null && {
|
|
1215
|
+
InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context),
|
|
1216
|
+
}),
|
|
1217
|
+
...(input.JobName != null && { JobName: input.JobName }),
|
|
1218
|
+
...(input.OutputDataConfig != null && {
|
|
1219
|
+
OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context),
|
|
1220
|
+
}),
|
|
1221
|
+
...(input.ParallelDataNames != null && {
|
|
1222
|
+
ParallelDataNames: serializeAws_json1_1ResourceNameList(input.ParallelDataNames, context),
|
|
1223
|
+
}),
|
|
1224
|
+
...(input.Settings != null && { Settings: serializeAws_json1_1TranslationSettings(input.Settings, context) }),
|
|
1225
|
+
...(input.SourceLanguageCode != null && { SourceLanguageCode: input.SourceLanguageCode }),
|
|
1226
|
+
...(input.TargetLanguageCodes != null && {
|
|
1227
|
+
TargetLanguageCodes: serializeAws_json1_1TargetLanguageCodeStringList(input.TargetLanguageCodes, context),
|
|
1228
|
+
}),
|
|
1229
|
+
...(input.TerminologyNames != null && {
|
|
1230
|
+
TerminologyNames: serializeAws_json1_1ResourceNameList(input.TerminologyNames, context),
|
|
1231
|
+
}),
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1234
|
+
const serializeAws_json1_1StopTextTranslationJobRequest = (input, context) => {
|
|
1235
|
+
return {
|
|
1236
|
+
...(input.JobId != null && { JobId: input.JobId }),
|
|
1237
|
+
};
|
|
1238
|
+
};
|
|
1239
|
+
const serializeAws_json1_1Tag = (input, context) => {
|
|
1240
|
+
return {
|
|
1241
|
+
...(input.Key != null && { Key: input.Key }),
|
|
1242
|
+
...(input.Value != null && { Value: input.Value }),
|
|
1243
|
+
};
|
|
1244
|
+
};
|
|
1245
|
+
const serializeAws_json1_1TagKeyList = (input, context) => {
|
|
1609
1246
|
return input
|
|
1610
|
-
.filter(
|
|
1611
|
-
.map(
|
|
1247
|
+
.filter((e) => e != null)
|
|
1248
|
+
.map((entry) => {
|
|
1612
1249
|
return entry;
|
|
1613
1250
|
});
|
|
1614
1251
|
};
|
|
1615
|
-
|
|
1252
|
+
const serializeAws_json1_1TagList = (input, context) => {
|
|
1616
1253
|
return input
|
|
1617
|
-
.filter(
|
|
1618
|
-
.map(
|
|
1254
|
+
.filter((e) => e != null)
|
|
1255
|
+
.map((entry) => {
|
|
1619
1256
|
return serializeAws_json1_1Tag(entry, context);
|
|
1620
1257
|
});
|
|
1621
1258
|
};
|
|
1622
|
-
|
|
1623
|
-
return
|
|
1259
|
+
const serializeAws_json1_1TagResourceRequest = (input, context) => {
|
|
1260
|
+
return {
|
|
1261
|
+
...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
|
|
1262
|
+
...(input.Tags != null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
|
|
1263
|
+
};
|
|
1624
1264
|
};
|
|
1625
|
-
|
|
1265
|
+
const serializeAws_json1_1TargetLanguageCodeStringList = (input, context) => {
|
|
1626
1266
|
return input
|
|
1627
|
-
.filter(
|
|
1628
|
-
.map(
|
|
1267
|
+
.filter((e) => e != null)
|
|
1268
|
+
.map((entry) => {
|
|
1629
1269
|
return entry;
|
|
1630
1270
|
});
|
|
1631
1271
|
};
|
|
1632
|
-
|
|
1633
|
-
return
|
|
1272
|
+
const serializeAws_json1_1TerminologyData = (input, context) => {
|
|
1273
|
+
return {
|
|
1274
|
+
...(input.Directionality != null && { Directionality: input.Directionality }),
|
|
1275
|
+
...(input.File != null && { File: context.base64Encoder(input.File) }),
|
|
1276
|
+
...(input.Format != null && { Format: input.Format }),
|
|
1277
|
+
};
|
|
1634
1278
|
};
|
|
1635
|
-
|
|
1636
|
-
return
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1279
|
+
const serializeAws_json1_1TextTranslationJobFilter = (input, context) => {
|
|
1280
|
+
return {
|
|
1281
|
+
...(input.JobName != null && { JobName: input.JobName }),
|
|
1282
|
+
...(input.JobStatus != null && { JobStatus: input.JobStatus }),
|
|
1283
|
+
...(input.SubmittedAfterTime != null && {
|
|
1284
|
+
SubmittedAfterTime: Math.round(input.SubmittedAfterTime.getTime() / 1000),
|
|
1285
|
+
}),
|
|
1286
|
+
...(input.SubmittedBeforeTime != null && {
|
|
1287
|
+
SubmittedBeforeTime: Math.round(input.SubmittedBeforeTime.getTime() / 1000),
|
|
1288
|
+
}),
|
|
1289
|
+
};
|
|
1641
1290
|
};
|
|
1642
|
-
|
|
1643
|
-
return
|
|
1644
|
-
|
|
1645
|
-
|
|
1291
|
+
const serializeAws_json1_1TranslateTextRequest = (input, context) => {
|
|
1292
|
+
return {
|
|
1293
|
+
...(input.Settings != null && { Settings: serializeAws_json1_1TranslationSettings(input.Settings, context) }),
|
|
1294
|
+
...(input.SourceLanguageCode != null && { SourceLanguageCode: input.SourceLanguageCode }),
|
|
1295
|
+
...(input.TargetLanguageCode != null && { TargetLanguageCode: input.TargetLanguageCode }),
|
|
1296
|
+
...(input.TerminologyNames != null && {
|
|
1297
|
+
TerminologyNames: serializeAws_json1_1ResourceNameList(input.TerminologyNames, context),
|
|
1298
|
+
}),
|
|
1299
|
+
...(input.Text != null && { Text: input.Text }),
|
|
1300
|
+
};
|
|
1646
1301
|
};
|
|
1647
|
-
|
|
1648
|
-
return
|
|
1302
|
+
const serializeAws_json1_1TranslationSettings = (input, context) => {
|
|
1303
|
+
return {
|
|
1304
|
+
...(input.Formality != null && { Formality: input.Formality }),
|
|
1305
|
+
...(input.Profanity != null && { Profanity: input.Profanity }),
|
|
1306
|
+
};
|
|
1649
1307
|
};
|
|
1650
|
-
|
|
1651
|
-
return
|
|
1308
|
+
const serializeAws_json1_1UntagResourceRequest = (input, context) => {
|
|
1309
|
+
return {
|
|
1310
|
+
...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
|
|
1311
|
+
...(input.TagKeys != null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }),
|
|
1312
|
+
};
|
|
1652
1313
|
};
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1314
|
+
const serializeAws_json1_1UpdateParallelDataRequest = (input, context) => {
|
|
1315
|
+
return {
|
|
1316
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
1317
|
+
...(input.Description != null && { Description: input.Description }),
|
|
1318
|
+
...(input.Name != null && { Name: input.Name }),
|
|
1319
|
+
...(input.ParallelDataConfig != null && {
|
|
1320
|
+
ParallelDataConfig: serializeAws_json1_1ParallelDataConfig(input.ParallelDataConfig, context),
|
|
1321
|
+
}),
|
|
1322
|
+
};
|
|
1658
1323
|
};
|
|
1659
|
-
|
|
1324
|
+
const deserializeAws_json1_1AppliedTerminology = (output, context) => {
|
|
1660
1325
|
return {
|
|
1661
1326
|
Name: __expectString(output.Name),
|
|
1662
1327
|
Terms: output.Terms != null ? deserializeAws_json1_1TermList(output.Terms, context) : undefined,
|
|
1663
1328
|
};
|
|
1664
1329
|
};
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
.filter(
|
|
1668
|
-
.map(
|
|
1330
|
+
const deserializeAws_json1_1AppliedTerminologyList = (output, context) => {
|
|
1331
|
+
const retVal = (output || [])
|
|
1332
|
+
.filter((e) => e != null)
|
|
1333
|
+
.map((entry) => {
|
|
1669
1334
|
if (entry === null) {
|
|
1670
1335
|
return null;
|
|
1671
1336
|
}
|
|
@@ -1673,48 +1338,48 @@ var deserializeAws_json1_1AppliedTerminologyList = function (output, context) {
|
|
|
1673
1338
|
});
|
|
1674
1339
|
return retVal;
|
|
1675
1340
|
};
|
|
1676
|
-
|
|
1341
|
+
const deserializeAws_json1_1ConcurrentModificationException = (output, context) => {
|
|
1677
1342
|
return {
|
|
1678
1343
|
Message: __expectString(output.Message),
|
|
1679
1344
|
};
|
|
1680
1345
|
};
|
|
1681
|
-
|
|
1346
|
+
const deserializeAws_json1_1ConflictException = (output, context) => {
|
|
1682
1347
|
return {
|
|
1683
1348
|
Message: __expectString(output.Message),
|
|
1684
1349
|
};
|
|
1685
1350
|
};
|
|
1686
|
-
|
|
1351
|
+
const deserializeAws_json1_1CreateParallelDataResponse = (output, context) => {
|
|
1687
1352
|
return {
|
|
1688
1353
|
Name: __expectString(output.Name),
|
|
1689
1354
|
Status: __expectString(output.Status),
|
|
1690
1355
|
};
|
|
1691
1356
|
};
|
|
1692
|
-
|
|
1357
|
+
const deserializeAws_json1_1DeleteParallelDataResponse = (output, context) => {
|
|
1693
1358
|
return {
|
|
1694
1359
|
Name: __expectString(output.Name),
|
|
1695
1360
|
Status: __expectString(output.Status),
|
|
1696
1361
|
};
|
|
1697
1362
|
};
|
|
1698
|
-
|
|
1363
|
+
const deserializeAws_json1_1DescribeTextTranslationJobResponse = (output, context) => {
|
|
1699
1364
|
return {
|
|
1700
1365
|
TextTranslationJobProperties: output.TextTranslationJobProperties != null
|
|
1701
1366
|
? deserializeAws_json1_1TextTranslationJobProperties(output.TextTranslationJobProperties, context)
|
|
1702
1367
|
: undefined,
|
|
1703
1368
|
};
|
|
1704
1369
|
};
|
|
1705
|
-
|
|
1370
|
+
const deserializeAws_json1_1DetectedLanguageLowConfidenceException = (output, context) => {
|
|
1706
1371
|
return {
|
|
1707
1372
|
DetectedLanguageCode: __expectString(output.DetectedLanguageCode),
|
|
1708
1373
|
Message: __expectString(output.Message),
|
|
1709
1374
|
};
|
|
1710
1375
|
};
|
|
1711
|
-
|
|
1376
|
+
const deserializeAws_json1_1EncryptionKey = (output, context) => {
|
|
1712
1377
|
return {
|
|
1713
1378
|
Id: __expectString(output.Id),
|
|
1714
1379
|
Type: __expectString(output.Type),
|
|
1715
1380
|
};
|
|
1716
1381
|
};
|
|
1717
|
-
|
|
1382
|
+
const deserializeAws_json1_1GetParallelDataResponse = (output, context) => {
|
|
1718
1383
|
return {
|
|
1719
1384
|
AuxiliaryDataLocation: output.AuxiliaryDataLocation != null
|
|
1720
1385
|
? deserializeAws_json1_1ParallelDataDataLocation(output.AuxiliaryDataLocation, context)
|
|
@@ -1730,7 +1395,7 @@ var deserializeAws_json1_1GetParallelDataResponse = function (output, context) {
|
|
|
1730
1395
|
: undefined,
|
|
1731
1396
|
};
|
|
1732
1397
|
};
|
|
1733
|
-
|
|
1398
|
+
const deserializeAws_json1_1GetTerminologyResponse = (output, context) => {
|
|
1734
1399
|
return {
|
|
1735
1400
|
AuxiliaryDataLocation: output.AuxiliaryDataLocation != null
|
|
1736
1401
|
? deserializeAws_json1_1TerminologyDataLocation(output.AuxiliaryDataLocation, context)
|
|
@@ -1743,7 +1408,7 @@ var deserializeAws_json1_1GetTerminologyResponse = function (output, context) {
|
|
|
1743
1408
|
: undefined,
|
|
1744
1409
|
};
|
|
1745
1410
|
};
|
|
1746
|
-
|
|
1411
|
+
const deserializeAws_json1_1ImportTerminologyResponse = (output, context) => {
|
|
1747
1412
|
return {
|
|
1748
1413
|
AuxiliaryDataLocation: output.AuxiliaryDataLocation != null
|
|
1749
1414
|
? deserializeAws_json1_1TerminologyDataLocation(output.AuxiliaryDataLocation, context)
|
|
@@ -1753,49 +1418,49 @@ var deserializeAws_json1_1ImportTerminologyResponse = function (output, context)
|
|
|
1753
1418
|
: undefined,
|
|
1754
1419
|
};
|
|
1755
1420
|
};
|
|
1756
|
-
|
|
1421
|
+
const deserializeAws_json1_1InputDataConfig = (output, context) => {
|
|
1757
1422
|
return {
|
|
1758
1423
|
ContentType: __expectString(output.ContentType),
|
|
1759
1424
|
S3Uri: __expectString(output.S3Uri),
|
|
1760
1425
|
};
|
|
1761
1426
|
};
|
|
1762
|
-
|
|
1427
|
+
const deserializeAws_json1_1InternalServerException = (output, context) => {
|
|
1763
1428
|
return {
|
|
1764
1429
|
Message: __expectString(output.Message),
|
|
1765
1430
|
};
|
|
1766
1431
|
};
|
|
1767
|
-
|
|
1432
|
+
const deserializeAws_json1_1InvalidFilterException = (output, context) => {
|
|
1768
1433
|
return {
|
|
1769
1434
|
Message: __expectString(output.Message),
|
|
1770
1435
|
};
|
|
1771
1436
|
};
|
|
1772
|
-
|
|
1437
|
+
const deserializeAws_json1_1InvalidParameterValueException = (output, context) => {
|
|
1773
1438
|
return {
|
|
1774
1439
|
Message: __expectString(output.Message),
|
|
1775
1440
|
};
|
|
1776
1441
|
};
|
|
1777
|
-
|
|
1442
|
+
const deserializeAws_json1_1InvalidRequestException = (output, context) => {
|
|
1778
1443
|
return {
|
|
1779
1444
|
Message: __expectString(output.Message),
|
|
1780
1445
|
};
|
|
1781
1446
|
};
|
|
1782
|
-
|
|
1447
|
+
const deserializeAws_json1_1JobDetails = (output, context) => {
|
|
1783
1448
|
return {
|
|
1784
1449
|
DocumentsWithErrorsCount: __expectInt32(output.DocumentsWithErrorsCount),
|
|
1785
1450
|
InputDocumentsCount: __expectInt32(output.InputDocumentsCount),
|
|
1786
1451
|
TranslatedDocumentsCount: __expectInt32(output.TranslatedDocumentsCount),
|
|
1787
1452
|
};
|
|
1788
1453
|
};
|
|
1789
|
-
|
|
1454
|
+
const deserializeAws_json1_1Language = (output, context) => {
|
|
1790
1455
|
return {
|
|
1791
1456
|
LanguageCode: __expectString(output.LanguageCode),
|
|
1792
1457
|
LanguageName: __expectString(output.LanguageName),
|
|
1793
1458
|
};
|
|
1794
1459
|
};
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
.filter(
|
|
1798
|
-
.map(
|
|
1460
|
+
const deserializeAws_json1_1LanguageCodeStringList = (output, context) => {
|
|
1461
|
+
const retVal = (output || [])
|
|
1462
|
+
.filter((e) => e != null)
|
|
1463
|
+
.map((entry) => {
|
|
1799
1464
|
if (entry === null) {
|
|
1800
1465
|
return null;
|
|
1801
1466
|
}
|
|
@@ -1803,10 +1468,10 @@ var deserializeAws_json1_1LanguageCodeStringList = function (output, context) {
|
|
|
1803
1468
|
});
|
|
1804
1469
|
return retVal;
|
|
1805
1470
|
};
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
.filter(
|
|
1809
|
-
.map(
|
|
1471
|
+
const deserializeAws_json1_1LanguagesList = (output, context) => {
|
|
1472
|
+
const retVal = (output || [])
|
|
1473
|
+
.filter((e) => e != null)
|
|
1474
|
+
.map((entry) => {
|
|
1810
1475
|
if (entry === null) {
|
|
1811
1476
|
return null;
|
|
1812
1477
|
}
|
|
@@ -1814,19 +1479,19 @@ var deserializeAws_json1_1LanguagesList = function (output, context) {
|
|
|
1814
1479
|
});
|
|
1815
1480
|
return retVal;
|
|
1816
1481
|
};
|
|
1817
|
-
|
|
1482
|
+
const deserializeAws_json1_1LimitExceededException = (output, context) => {
|
|
1818
1483
|
return {
|
|
1819
1484
|
Message: __expectString(output.Message),
|
|
1820
1485
|
};
|
|
1821
1486
|
};
|
|
1822
|
-
|
|
1487
|
+
const deserializeAws_json1_1ListLanguagesResponse = (output, context) => {
|
|
1823
1488
|
return {
|
|
1824
1489
|
DisplayLanguageCode: __expectString(output.DisplayLanguageCode),
|
|
1825
1490
|
Languages: output.Languages != null ? deserializeAws_json1_1LanguagesList(output.Languages, context) : undefined,
|
|
1826
1491
|
NextToken: __expectString(output.NextToken),
|
|
1827
1492
|
};
|
|
1828
1493
|
};
|
|
1829
|
-
|
|
1494
|
+
const deserializeAws_json1_1ListParallelDataResponse = (output, context) => {
|
|
1830
1495
|
return {
|
|
1831
1496
|
NextToken: __expectString(output.NextToken),
|
|
1832
1497
|
ParallelDataPropertiesList: output.ParallelDataPropertiesList != null
|
|
@@ -1834,12 +1499,12 @@ var deserializeAws_json1_1ListParallelDataResponse = function (output, context)
|
|
|
1834
1499
|
: undefined,
|
|
1835
1500
|
};
|
|
1836
1501
|
};
|
|
1837
|
-
|
|
1502
|
+
const deserializeAws_json1_1ListTagsForResourceResponse = (output, context) => {
|
|
1838
1503
|
return {
|
|
1839
1504
|
Tags: output.Tags != null ? deserializeAws_json1_1TagList(output.Tags, context) : undefined,
|
|
1840
1505
|
};
|
|
1841
1506
|
};
|
|
1842
|
-
|
|
1507
|
+
const deserializeAws_json1_1ListTerminologiesResponse = (output, context) => {
|
|
1843
1508
|
return {
|
|
1844
1509
|
NextToken: __expectString(output.NextToken),
|
|
1845
1510
|
TerminologyPropertiesList: output.TerminologyPropertiesList != null
|
|
@@ -1847,7 +1512,7 @@ var deserializeAws_json1_1ListTerminologiesResponse = function (output, context)
|
|
|
1847
1512
|
: undefined,
|
|
1848
1513
|
};
|
|
1849
1514
|
};
|
|
1850
|
-
|
|
1515
|
+
const deserializeAws_json1_1ListTextTranslationJobsResponse = (output, context) => {
|
|
1851
1516
|
return {
|
|
1852
1517
|
NextToken: __expectString(output.NextToken),
|
|
1853
1518
|
TextTranslationJobPropertiesList: output.TextTranslationJobPropertiesList != null
|
|
@@ -1855,25 +1520,25 @@ var deserializeAws_json1_1ListTextTranslationJobsResponse = function (output, co
|
|
|
1855
1520
|
: undefined,
|
|
1856
1521
|
};
|
|
1857
1522
|
};
|
|
1858
|
-
|
|
1523
|
+
const deserializeAws_json1_1OutputDataConfig = (output, context) => {
|
|
1859
1524
|
return {
|
|
1860
1525
|
EncryptionKey: output.EncryptionKey != null ? deserializeAws_json1_1EncryptionKey(output.EncryptionKey, context) : undefined,
|
|
1861
1526
|
S3Uri: __expectString(output.S3Uri),
|
|
1862
1527
|
};
|
|
1863
1528
|
};
|
|
1864
|
-
|
|
1529
|
+
const deserializeAws_json1_1ParallelDataConfig = (output, context) => {
|
|
1865
1530
|
return {
|
|
1866
1531
|
Format: __expectString(output.Format),
|
|
1867
1532
|
S3Uri: __expectString(output.S3Uri),
|
|
1868
1533
|
};
|
|
1869
1534
|
};
|
|
1870
|
-
|
|
1535
|
+
const deserializeAws_json1_1ParallelDataDataLocation = (output, context) => {
|
|
1871
1536
|
return {
|
|
1872
1537
|
Location: __expectString(output.Location),
|
|
1873
1538
|
RepositoryType: __expectString(output.RepositoryType),
|
|
1874
1539
|
};
|
|
1875
1540
|
};
|
|
1876
|
-
|
|
1541
|
+
const deserializeAws_json1_1ParallelDataProperties = (output, context) => {
|
|
1877
1542
|
return {
|
|
1878
1543
|
Arn: __expectString(output.Arn),
|
|
1879
1544
|
CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
|
|
@@ -1902,10 +1567,10 @@ var deserializeAws_json1_1ParallelDataProperties = function (output, context) {
|
|
|
1902
1567
|
: undefined,
|
|
1903
1568
|
};
|
|
1904
1569
|
};
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
.filter(
|
|
1908
|
-
.map(
|
|
1570
|
+
const deserializeAws_json1_1ParallelDataPropertiesList = (output, context) => {
|
|
1571
|
+
const retVal = (output || [])
|
|
1572
|
+
.filter((e) => e != null)
|
|
1573
|
+
.map((entry) => {
|
|
1909
1574
|
if (entry === null) {
|
|
1910
1575
|
return null;
|
|
1911
1576
|
}
|
|
@@ -1913,10 +1578,10 @@ var deserializeAws_json1_1ParallelDataPropertiesList = function (output, context
|
|
|
1913
1578
|
});
|
|
1914
1579
|
return retVal;
|
|
1915
1580
|
};
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
.filter(
|
|
1919
|
-
.map(
|
|
1581
|
+
const deserializeAws_json1_1ResourceNameList = (output, context) => {
|
|
1582
|
+
const retVal = (output || [])
|
|
1583
|
+
.filter((e) => e != null)
|
|
1584
|
+
.map((entry) => {
|
|
1920
1585
|
if (entry === null) {
|
|
1921
1586
|
return null;
|
|
1922
1587
|
}
|
|
@@ -1924,38 +1589,38 @@ var deserializeAws_json1_1ResourceNameList = function (output, context) {
|
|
|
1924
1589
|
});
|
|
1925
1590
|
return retVal;
|
|
1926
1591
|
};
|
|
1927
|
-
|
|
1592
|
+
const deserializeAws_json1_1ResourceNotFoundException = (output, context) => {
|
|
1928
1593
|
return {
|
|
1929
1594
|
Message: __expectString(output.Message),
|
|
1930
1595
|
};
|
|
1931
1596
|
};
|
|
1932
|
-
|
|
1597
|
+
const deserializeAws_json1_1ServiceUnavailableException = (output, context) => {
|
|
1933
1598
|
return {
|
|
1934
1599
|
Message: __expectString(output.Message),
|
|
1935
1600
|
};
|
|
1936
1601
|
};
|
|
1937
|
-
|
|
1602
|
+
const deserializeAws_json1_1StartTextTranslationJobResponse = (output, context) => {
|
|
1938
1603
|
return {
|
|
1939
1604
|
JobId: __expectString(output.JobId),
|
|
1940
1605
|
JobStatus: __expectString(output.JobStatus),
|
|
1941
1606
|
};
|
|
1942
1607
|
};
|
|
1943
|
-
|
|
1608
|
+
const deserializeAws_json1_1StopTextTranslationJobResponse = (output, context) => {
|
|
1944
1609
|
return {
|
|
1945
1610
|
JobId: __expectString(output.JobId),
|
|
1946
1611
|
JobStatus: __expectString(output.JobStatus),
|
|
1947
1612
|
};
|
|
1948
1613
|
};
|
|
1949
|
-
|
|
1614
|
+
const deserializeAws_json1_1Tag = (output, context) => {
|
|
1950
1615
|
return {
|
|
1951
1616
|
Key: __expectString(output.Key),
|
|
1952
1617
|
Value: __expectString(output.Value),
|
|
1953
1618
|
};
|
|
1954
1619
|
};
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
.filter(
|
|
1958
|
-
.map(
|
|
1620
|
+
const deserializeAws_json1_1TagList = (output, context) => {
|
|
1621
|
+
const retVal = (output || [])
|
|
1622
|
+
.filter((e) => e != null)
|
|
1623
|
+
.map((entry) => {
|
|
1959
1624
|
if (entry === null) {
|
|
1960
1625
|
return null;
|
|
1961
1626
|
}
|
|
@@ -1963,13 +1628,13 @@ var deserializeAws_json1_1TagList = function (output, context) {
|
|
|
1963
1628
|
});
|
|
1964
1629
|
return retVal;
|
|
1965
1630
|
};
|
|
1966
|
-
|
|
1631
|
+
const deserializeAws_json1_1TagResourceResponse = (output, context) => {
|
|
1967
1632
|
return {};
|
|
1968
1633
|
};
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
.filter(
|
|
1972
|
-
.map(
|
|
1634
|
+
const deserializeAws_json1_1TargetLanguageCodeStringList = (output, context) => {
|
|
1635
|
+
const retVal = (output || [])
|
|
1636
|
+
.filter((e) => e != null)
|
|
1637
|
+
.map((entry) => {
|
|
1973
1638
|
if (entry === null) {
|
|
1974
1639
|
return null;
|
|
1975
1640
|
}
|
|
@@ -1977,19 +1642,19 @@ var deserializeAws_json1_1TargetLanguageCodeStringList = function (output, conte
|
|
|
1977
1642
|
});
|
|
1978
1643
|
return retVal;
|
|
1979
1644
|
};
|
|
1980
|
-
|
|
1645
|
+
const deserializeAws_json1_1Term = (output, context) => {
|
|
1981
1646
|
return {
|
|
1982
1647
|
SourceText: __expectString(output.SourceText),
|
|
1983
1648
|
TargetText: __expectString(output.TargetText),
|
|
1984
1649
|
};
|
|
1985
1650
|
};
|
|
1986
|
-
|
|
1651
|
+
const deserializeAws_json1_1TerminologyDataLocation = (output, context) => {
|
|
1987
1652
|
return {
|
|
1988
1653
|
Location: __expectString(output.Location),
|
|
1989
1654
|
RepositoryType: __expectString(output.RepositoryType),
|
|
1990
1655
|
};
|
|
1991
1656
|
};
|
|
1992
|
-
|
|
1657
|
+
const deserializeAws_json1_1TerminologyProperties = (output, context) => {
|
|
1993
1658
|
return {
|
|
1994
1659
|
Arn: __expectString(output.Arn),
|
|
1995
1660
|
CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
|
|
@@ -2011,10 +1676,10 @@ var deserializeAws_json1_1TerminologyProperties = function (output, context) {
|
|
|
2011
1676
|
TermCount: __expectInt32(output.TermCount),
|
|
2012
1677
|
};
|
|
2013
1678
|
};
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
.filter(
|
|
2017
|
-
.map(
|
|
1679
|
+
const deserializeAws_json1_1TerminologyPropertiesList = (output, context) => {
|
|
1680
|
+
const retVal = (output || [])
|
|
1681
|
+
.filter((e) => e != null)
|
|
1682
|
+
.map((entry) => {
|
|
2018
1683
|
if (entry === null) {
|
|
2019
1684
|
return null;
|
|
2020
1685
|
}
|
|
@@ -2022,10 +1687,10 @@ var deserializeAws_json1_1TerminologyPropertiesList = function (output, context)
|
|
|
2022
1687
|
});
|
|
2023
1688
|
return retVal;
|
|
2024
1689
|
};
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
.filter(
|
|
2028
|
-
.map(
|
|
1690
|
+
const deserializeAws_json1_1TermList = (output, context) => {
|
|
1691
|
+
const retVal = (output || [])
|
|
1692
|
+
.filter((e) => e != null)
|
|
1693
|
+
.map((entry) => {
|
|
2029
1694
|
if (entry === null) {
|
|
2030
1695
|
return null;
|
|
2031
1696
|
}
|
|
@@ -2033,12 +1698,12 @@ var deserializeAws_json1_1TermList = function (output, context) {
|
|
|
2033
1698
|
});
|
|
2034
1699
|
return retVal;
|
|
2035
1700
|
};
|
|
2036
|
-
|
|
1701
|
+
const deserializeAws_json1_1TextSizeLimitExceededException = (output, context) => {
|
|
2037
1702
|
return {
|
|
2038
1703
|
Message: __expectString(output.Message),
|
|
2039
1704
|
};
|
|
2040
1705
|
};
|
|
2041
|
-
|
|
1706
|
+
const deserializeAws_json1_1TextTranslationJobProperties = (output, context) => {
|
|
2042
1707
|
return {
|
|
2043
1708
|
DataAccessRoleArn: __expectString(output.DataAccessRoleArn),
|
|
2044
1709
|
EndTime: output.EndTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.EndTime))) : undefined,
|
|
@@ -2069,10 +1734,10 @@ var deserializeAws_json1_1TextTranslationJobProperties = function (output, conte
|
|
|
2069
1734
|
: undefined,
|
|
2070
1735
|
};
|
|
2071
1736
|
};
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
.filter(
|
|
2075
|
-
.map(
|
|
1737
|
+
const deserializeAws_json1_1TextTranslationJobPropertiesList = (output, context) => {
|
|
1738
|
+
const retVal = (output || [])
|
|
1739
|
+
.filter((e) => e != null)
|
|
1740
|
+
.map((entry) => {
|
|
2076
1741
|
if (entry === null) {
|
|
2077
1742
|
return null;
|
|
2078
1743
|
}
|
|
@@ -2080,18 +1745,18 @@ var deserializeAws_json1_1TextTranslationJobPropertiesList = function (output, c
|
|
|
2080
1745
|
});
|
|
2081
1746
|
return retVal;
|
|
2082
1747
|
};
|
|
2083
|
-
|
|
1748
|
+
const deserializeAws_json1_1TooManyRequestsException = (output, context) => {
|
|
2084
1749
|
return {
|
|
2085
1750
|
Message: __expectString(output.Message),
|
|
2086
1751
|
};
|
|
2087
1752
|
};
|
|
2088
|
-
|
|
1753
|
+
const deserializeAws_json1_1TooManyTagsException = (output, context) => {
|
|
2089
1754
|
return {
|
|
2090
1755
|
ResourceArn: __expectString(output.ResourceArn),
|
|
2091
1756
|
message: __expectString(output.message),
|
|
2092
1757
|
};
|
|
2093
1758
|
};
|
|
2094
|
-
|
|
1759
|
+
const deserializeAws_json1_1TranslateTextResponse = (output, context) => {
|
|
2095
1760
|
return {
|
|
2096
1761
|
AppliedSettings: output.AppliedSettings != null
|
|
2097
1762
|
? deserializeAws_json1_1TranslationSettings(output.AppliedSettings, context)
|
|
@@ -2104,29 +1769,29 @@ var deserializeAws_json1_1TranslateTextResponse = function (output, context) {
|
|
|
2104
1769
|
TranslatedText: __expectString(output.TranslatedText),
|
|
2105
1770
|
};
|
|
2106
1771
|
};
|
|
2107
|
-
|
|
1772
|
+
const deserializeAws_json1_1TranslationSettings = (output, context) => {
|
|
2108
1773
|
return {
|
|
2109
1774
|
Formality: __expectString(output.Formality),
|
|
2110
1775
|
Profanity: __expectString(output.Profanity),
|
|
2111
1776
|
};
|
|
2112
1777
|
};
|
|
2113
|
-
|
|
1778
|
+
const deserializeAws_json1_1UnsupportedDisplayLanguageCodeException = (output, context) => {
|
|
2114
1779
|
return {
|
|
2115
1780
|
DisplayLanguageCode: __expectString(output.DisplayLanguageCode),
|
|
2116
1781
|
Message: __expectString(output.Message),
|
|
2117
1782
|
};
|
|
2118
1783
|
};
|
|
2119
|
-
|
|
1784
|
+
const deserializeAws_json1_1UnsupportedLanguagePairException = (output, context) => {
|
|
2120
1785
|
return {
|
|
2121
1786
|
Message: __expectString(output.Message),
|
|
2122
1787
|
SourceLanguageCode: __expectString(output.SourceLanguageCode),
|
|
2123
1788
|
TargetLanguageCode: __expectString(output.TargetLanguageCode),
|
|
2124
1789
|
};
|
|
2125
1790
|
};
|
|
2126
|
-
|
|
1791
|
+
const deserializeAws_json1_1UntagResourceResponse = (output, context) => {
|
|
2127
1792
|
return {};
|
|
2128
1793
|
};
|
|
2129
|
-
|
|
1794
|
+
const deserializeAws_json1_1UpdateParallelDataResponse = (output, context) => {
|
|
2130
1795
|
return {
|
|
2131
1796
|
LatestUpdateAttemptAt: output.LatestUpdateAttemptAt != null
|
|
2132
1797
|
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LatestUpdateAttemptAt)))
|
|
@@ -2136,75 +1801,52 @@ var deserializeAws_json1_1UpdateParallelDataResponse = function (output, context
|
|
|
2136
1801
|
Status: __expectString(output.Status),
|
|
2137
1802
|
};
|
|
2138
1803
|
};
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
});
|
|
2147
|
-
};
|
|
2148
|
-
var collectBody = function (streamBody, context) {
|
|
2149
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
1804
|
+
const deserializeMetadata = (output) => ({
|
|
1805
|
+
httpStatusCode: output.statusCode,
|
|
1806
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
1807
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1808
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
1809
|
+
});
|
|
1810
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
2150
1811
|
if (streamBody instanceof Uint8Array) {
|
|
2151
1812
|
return Promise.resolve(streamBody);
|
|
2152
1813
|
}
|
|
2153
1814
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
2154
1815
|
};
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
};
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
if (resolvedHostname !== undefined) {
|
|
2174
|
-
contents.hostname = resolvedHostname;
|
|
2175
|
-
}
|
|
2176
|
-
if (body !== undefined) {
|
|
2177
|
-
contents.body = body;
|
|
2178
|
-
}
|
|
2179
|
-
return [2, new __HttpRequest(contents)];
|
|
2180
|
-
}
|
|
2181
|
-
});
|
|
2182
|
-
}); };
|
|
2183
|
-
var parseBody = function (streamBody, context) {
|
|
2184
|
-
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
2185
|
-
if (encoded.length) {
|
|
2186
|
-
return JSON.parse(encoded);
|
|
2187
|
-
}
|
|
2188
|
-
return {};
|
|
2189
|
-
});
|
|
1816
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1817
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
1818
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
1819
|
+
const contents = {
|
|
1820
|
+
protocol,
|
|
1821
|
+
hostname,
|
|
1822
|
+
port,
|
|
1823
|
+
method: "POST",
|
|
1824
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
1825
|
+
headers,
|
|
1826
|
+
};
|
|
1827
|
+
if (resolvedHostname !== undefined) {
|
|
1828
|
+
contents.hostname = resolvedHostname;
|
|
1829
|
+
}
|
|
1830
|
+
if (body !== undefined) {
|
|
1831
|
+
contents.body = body;
|
|
1832
|
+
}
|
|
1833
|
+
return new __HttpRequest(contents);
|
|
2190
1834
|
};
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
2207
|
-
var cleanValue = rawValue;
|
|
1835
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1836
|
+
if (encoded.length) {
|
|
1837
|
+
return JSON.parse(encoded);
|
|
1838
|
+
}
|
|
1839
|
+
return {};
|
|
1840
|
+
});
|
|
1841
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
1842
|
+
const value = await parseBody(errorBody, context);
|
|
1843
|
+
value.message = value.message ?? value.Message;
|
|
1844
|
+
return value;
|
|
1845
|
+
};
|
|
1846
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
1847
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1848
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
1849
|
+
let cleanValue = rawValue;
|
|
2208
1850
|
if (typeof cleanValue === "number") {
|
|
2209
1851
|
cleanValue = cleanValue.toString();
|
|
2210
1852
|
}
|
|
@@ -2219,7 +1861,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
2219
1861
|
}
|
|
2220
1862
|
return cleanValue;
|
|
2221
1863
|
};
|
|
2222
|
-
|
|
1864
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
2223
1865
|
if (headerKey !== undefined) {
|
|
2224
1866
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
2225
1867
|
}
|