@aws-sdk/client-translate 3.490.0 → 3.496.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist-cjs/Translate.js +1 -49
  2. package/dist-cjs/TranslateClient.js +1 -43
  3. package/dist-cjs/commands/CreateParallelDataCommand.js +1 -28
  4. package/dist-cjs/commands/DeleteParallelDataCommand.js +1 -28
  5. package/dist-cjs/commands/DeleteTerminologyCommand.js +1 -28
  6. package/dist-cjs/commands/DescribeTextTranslationJobCommand.js +1 -28
  7. package/dist-cjs/commands/GetParallelDataCommand.js +1 -28
  8. package/dist-cjs/commands/GetTerminologyCommand.js +1 -28
  9. package/dist-cjs/commands/ImportTerminologyCommand.js +1 -29
  10. package/dist-cjs/commands/ListLanguagesCommand.js +1 -28
  11. package/dist-cjs/commands/ListParallelDataCommand.js +1 -28
  12. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  13. package/dist-cjs/commands/ListTerminologiesCommand.js +1 -28
  14. package/dist-cjs/commands/ListTextTranslationJobsCommand.js +1 -28
  15. package/dist-cjs/commands/StartTextTranslationJobCommand.js +1 -28
  16. package/dist-cjs/commands/StopTextTranslationJobCommand.js +1 -28
  17. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  18. package/dist-cjs/commands/TranslateDocumentCommand.js +1 -29
  19. package/dist-cjs/commands/TranslateTextCommand.js +1 -28
  20. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  21. package/dist-cjs/commands/UpdateParallelDataCommand.js +1 -28
  22. package/dist-cjs/commands/index.js +1 -22
  23. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  24. package/dist-cjs/extensionConfiguration.js +1 -2
  25. package/dist-cjs/index.js +2353 -11
  26. package/dist-cjs/models/TranslateServiceException.js +1 -12
  27. package/dist-cjs/models/index.js +1 -4
  28. package/dist-cjs/models/models_0.js +1 -307
  29. package/dist-cjs/pagination/Interfaces.js +1 -2
  30. package/dist-cjs/pagination/ListLanguagesPaginator.js +1 -7
  31. package/dist-cjs/pagination/ListParallelDataPaginator.js +1 -7
  32. package/dist-cjs/pagination/ListTerminologiesPaginator.js +1 -7
  33. package/dist-cjs/pagination/ListTextTranslationJobsPaginator.js +1 -7
  34. package/dist-cjs/pagination/index.js +1 -8
  35. package/dist-cjs/protocols/Aws_json1_1.js +1 -1415
  36. package/dist-cjs/runtimeExtensions.js +1 -22
  37. package/package.json +40 -40
@@ -1,1415 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateParallelDataCommand = exports.de_UntagResourceCommand = exports.de_TranslateTextCommand = exports.de_TranslateDocumentCommand = exports.de_TagResourceCommand = exports.de_StopTextTranslationJobCommand = exports.de_StartTextTranslationJobCommand = exports.de_ListTextTranslationJobsCommand = exports.de_ListTerminologiesCommand = exports.de_ListTagsForResourceCommand = exports.de_ListParallelDataCommand = exports.de_ListLanguagesCommand = exports.de_ImportTerminologyCommand = exports.de_GetTerminologyCommand = exports.de_GetParallelDataCommand = exports.de_DescribeTextTranslationJobCommand = exports.de_DeleteTerminologyCommand = exports.de_DeleteParallelDataCommand = exports.de_CreateParallelDataCommand = exports.se_UpdateParallelDataCommand = exports.se_UntagResourceCommand = exports.se_TranslateTextCommand = exports.se_TranslateDocumentCommand = exports.se_TagResourceCommand = exports.se_StopTextTranslationJobCommand = exports.se_StartTextTranslationJobCommand = exports.se_ListTextTranslationJobsCommand = exports.se_ListTerminologiesCommand = exports.se_ListTagsForResourceCommand = exports.se_ListParallelDataCommand = exports.se_ListLanguagesCommand = exports.se_ImportTerminologyCommand = exports.se_GetTerminologyCommand = exports.se_GetParallelDataCommand = exports.se_DescribeTextTranslationJobCommand = exports.se_DeleteTerminologyCommand = exports.se_DeleteParallelDataCommand = exports.se_CreateParallelDataCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const models_0_1 = require("../models/models_0");
8
- const TranslateServiceException_1 = require("../models/TranslateServiceException");
9
- const se_CreateParallelDataCommand = async (input, context) => {
10
- const headers = sharedHeaders("CreateParallelData");
11
- let body;
12
- body = JSON.stringify(se_CreateParallelDataRequest(input, context));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- exports.se_CreateParallelDataCommand = se_CreateParallelDataCommand;
16
- const se_DeleteParallelDataCommand = async (input, context) => {
17
- const headers = sharedHeaders("DeleteParallelData");
18
- let body;
19
- body = JSON.stringify((0, smithy_client_1._json)(input));
20
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
21
- };
22
- exports.se_DeleteParallelDataCommand = se_DeleteParallelDataCommand;
23
- const se_DeleteTerminologyCommand = async (input, context) => {
24
- const headers = sharedHeaders("DeleteTerminology");
25
- let body;
26
- body = JSON.stringify((0, smithy_client_1._json)(input));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- exports.se_DeleteTerminologyCommand = se_DeleteTerminologyCommand;
30
- const se_DescribeTextTranslationJobCommand = async (input, context) => {
31
- const headers = sharedHeaders("DescribeTextTranslationJob");
32
- let body;
33
- body = JSON.stringify((0, smithy_client_1._json)(input));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- exports.se_DescribeTextTranslationJobCommand = se_DescribeTextTranslationJobCommand;
37
- const se_GetParallelDataCommand = async (input, context) => {
38
- const headers = sharedHeaders("GetParallelData");
39
- let body;
40
- body = JSON.stringify((0, smithy_client_1._json)(input));
41
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
42
- };
43
- exports.se_GetParallelDataCommand = se_GetParallelDataCommand;
44
- const se_GetTerminologyCommand = async (input, context) => {
45
- const headers = sharedHeaders("GetTerminology");
46
- let body;
47
- body = JSON.stringify((0, smithy_client_1._json)(input));
48
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
- };
50
- exports.se_GetTerminologyCommand = se_GetTerminologyCommand;
51
- const se_ImportTerminologyCommand = async (input, context) => {
52
- const headers = sharedHeaders("ImportTerminology");
53
- let body;
54
- body = JSON.stringify(se_ImportTerminologyRequest(input, context));
55
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
56
- };
57
- exports.se_ImportTerminologyCommand = se_ImportTerminologyCommand;
58
- const se_ListLanguagesCommand = async (input, context) => {
59
- const headers = sharedHeaders("ListLanguages");
60
- let body;
61
- body = JSON.stringify((0, smithy_client_1._json)(input));
62
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
63
- };
64
- exports.se_ListLanguagesCommand = se_ListLanguagesCommand;
65
- const se_ListParallelDataCommand = async (input, context) => {
66
- const headers = sharedHeaders("ListParallelData");
67
- let body;
68
- body = JSON.stringify((0, smithy_client_1._json)(input));
69
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
- };
71
- exports.se_ListParallelDataCommand = se_ListParallelDataCommand;
72
- const se_ListTagsForResourceCommand = async (input, context) => {
73
- const headers = sharedHeaders("ListTagsForResource");
74
- let body;
75
- body = JSON.stringify((0, smithy_client_1._json)(input));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
79
- const se_ListTerminologiesCommand = async (input, context) => {
80
- const headers = sharedHeaders("ListTerminologies");
81
- let body;
82
- body = JSON.stringify((0, smithy_client_1._json)(input));
83
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
84
- };
85
- exports.se_ListTerminologiesCommand = se_ListTerminologiesCommand;
86
- const se_ListTextTranslationJobsCommand = async (input, context) => {
87
- const headers = sharedHeaders("ListTextTranslationJobs");
88
- let body;
89
- body = JSON.stringify(se_ListTextTranslationJobsRequest(input, context));
90
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
91
- };
92
- exports.se_ListTextTranslationJobsCommand = se_ListTextTranslationJobsCommand;
93
- const se_StartTextTranslationJobCommand = async (input, context) => {
94
- const headers = sharedHeaders("StartTextTranslationJob");
95
- let body;
96
- body = JSON.stringify(se_StartTextTranslationJobRequest(input, context));
97
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
98
- };
99
- exports.se_StartTextTranslationJobCommand = se_StartTextTranslationJobCommand;
100
- const se_StopTextTranslationJobCommand = async (input, context) => {
101
- const headers = sharedHeaders("StopTextTranslationJob");
102
- let body;
103
- body = JSON.stringify((0, smithy_client_1._json)(input));
104
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
105
- };
106
- exports.se_StopTextTranslationJobCommand = se_StopTextTranslationJobCommand;
107
- const se_TagResourceCommand = async (input, context) => {
108
- const headers = sharedHeaders("TagResource");
109
- let body;
110
- body = JSON.stringify((0, smithy_client_1._json)(input));
111
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
- };
113
- exports.se_TagResourceCommand = se_TagResourceCommand;
114
- const se_TranslateDocumentCommand = async (input, context) => {
115
- const headers = sharedHeaders("TranslateDocument");
116
- let body;
117
- body = JSON.stringify(se_TranslateDocumentRequest(input, context));
118
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
119
- };
120
- exports.se_TranslateDocumentCommand = se_TranslateDocumentCommand;
121
- const se_TranslateTextCommand = async (input, context) => {
122
- const headers = sharedHeaders("TranslateText");
123
- let body;
124
- body = JSON.stringify((0, smithy_client_1._json)(input));
125
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
126
- };
127
- exports.se_TranslateTextCommand = se_TranslateTextCommand;
128
- const se_UntagResourceCommand = async (input, context) => {
129
- const headers = sharedHeaders("UntagResource");
130
- let body;
131
- body = JSON.stringify((0, smithy_client_1._json)(input));
132
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
133
- };
134
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
135
- const se_UpdateParallelDataCommand = async (input, context) => {
136
- const headers = sharedHeaders("UpdateParallelData");
137
- let body;
138
- body = JSON.stringify(se_UpdateParallelDataRequest(input, context));
139
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
- };
141
- exports.se_UpdateParallelDataCommand = se_UpdateParallelDataCommand;
142
- const de_CreateParallelDataCommand = async (output, context) => {
143
- if (output.statusCode >= 300) {
144
- return de_CreateParallelDataCommandError(output, context);
145
- }
146
- const data = await parseBody(output.body, context);
147
- let contents = {};
148
- contents = (0, smithy_client_1._json)(data);
149
- const response = {
150
- $metadata: deserializeMetadata(output),
151
- ...contents,
152
- };
153
- return response;
154
- };
155
- exports.de_CreateParallelDataCommand = de_CreateParallelDataCommand;
156
- const de_CreateParallelDataCommandError = async (output, context) => {
157
- const parsedOutput = {
158
- ...output,
159
- body: await parseErrorBody(output.body, context),
160
- };
161
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
162
- switch (errorCode) {
163
- case "ConcurrentModificationException":
164
- case "com.amazonaws.translate#ConcurrentModificationException":
165
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
166
- case "ConflictException":
167
- case "com.amazonaws.translate#ConflictException":
168
- throw await de_ConflictExceptionRes(parsedOutput, context);
169
- case "InternalServerException":
170
- case "com.amazonaws.translate#InternalServerException":
171
- throw await de_InternalServerExceptionRes(parsedOutput, context);
172
- case "InvalidParameterValueException":
173
- case "com.amazonaws.translate#InvalidParameterValueException":
174
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
175
- case "InvalidRequestException":
176
- case "com.amazonaws.translate#InvalidRequestException":
177
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
178
- case "LimitExceededException":
179
- case "com.amazonaws.translate#LimitExceededException":
180
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
181
- case "TooManyRequestsException":
182
- case "com.amazonaws.translate#TooManyRequestsException":
183
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
184
- case "TooManyTagsException":
185
- case "com.amazonaws.translate#TooManyTagsException":
186
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
187
- default:
188
- const parsedBody = parsedOutput.body;
189
- return throwDefaultError({
190
- output,
191
- parsedBody,
192
- errorCode,
193
- });
194
- }
195
- };
196
- const de_DeleteParallelDataCommand = async (output, context) => {
197
- if (output.statusCode >= 300) {
198
- return de_DeleteParallelDataCommandError(output, context);
199
- }
200
- const data = await parseBody(output.body, context);
201
- let contents = {};
202
- contents = (0, smithy_client_1._json)(data);
203
- const response = {
204
- $metadata: deserializeMetadata(output),
205
- ...contents,
206
- };
207
- return response;
208
- };
209
- exports.de_DeleteParallelDataCommand = de_DeleteParallelDataCommand;
210
- const de_DeleteParallelDataCommandError = async (output, context) => {
211
- const parsedOutput = {
212
- ...output,
213
- body: await parseErrorBody(output.body, context),
214
- };
215
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
216
- switch (errorCode) {
217
- case "ConcurrentModificationException":
218
- case "com.amazonaws.translate#ConcurrentModificationException":
219
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
220
- case "InternalServerException":
221
- case "com.amazonaws.translate#InternalServerException":
222
- throw await de_InternalServerExceptionRes(parsedOutput, context);
223
- case "ResourceNotFoundException":
224
- case "com.amazonaws.translate#ResourceNotFoundException":
225
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
226
- case "TooManyRequestsException":
227
- case "com.amazonaws.translate#TooManyRequestsException":
228
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
229
- default:
230
- const parsedBody = parsedOutput.body;
231
- return throwDefaultError({
232
- output,
233
- parsedBody,
234
- errorCode,
235
- });
236
- }
237
- };
238
- const de_DeleteTerminologyCommand = async (output, context) => {
239
- if (output.statusCode >= 300) {
240
- return de_DeleteTerminologyCommandError(output, context);
241
- }
242
- await (0, smithy_client_1.collectBody)(output.body, context);
243
- const response = {
244
- $metadata: deserializeMetadata(output),
245
- };
246
- return response;
247
- };
248
- exports.de_DeleteTerminologyCommand = de_DeleteTerminologyCommand;
249
- const de_DeleteTerminologyCommandError = async (output, context) => {
250
- const parsedOutput = {
251
- ...output,
252
- body: await parseErrorBody(output.body, context),
253
- };
254
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
255
- switch (errorCode) {
256
- case "InternalServerException":
257
- case "com.amazonaws.translate#InternalServerException":
258
- throw await de_InternalServerExceptionRes(parsedOutput, context);
259
- case "InvalidParameterValueException":
260
- case "com.amazonaws.translate#InvalidParameterValueException":
261
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
262
- case "ResourceNotFoundException":
263
- case "com.amazonaws.translate#ResourceNotFoundException":
264
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
265
- case "TooManyRequestsException":
266
- case "com.amazonaws.translate#TooManyRequestsException":
267
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
268
- default:
269
- const parsedBody = parsedOutput.body;
270
- return throwDefaultError({
271
- output,
272
- parsedBody,
273
- errorCode,
274
- });
275
- }
276
- };
277
- const de_DescribeTextTranslationJobCommand = async (output, context) => {
278
- if (output.statusCode >= 300) {
279
- return de_DescribeTextTranslationJobCommandError(output, context);
280
- }
281
- const data = await parseBody(output.body, context);
282
- let contents = {};
283
- contents = de_DescribeTextTranslationJobResponse(data, context);
284
- const response = {
285
- $metadata: deserializeMetadata(output),
286
- ...contents,
287
- };
288
- return response;
289
- };
290
- exports.de_DescribeTextTranslationJobCommand = de_DescribeTextTranslationJobCommand;
291
- const de_DescribeTextTranslationJobCommandError = async (output, context) => {
292
- const parsedOutput = {
293
- ...output,
294
- body: await parseErrorBody(output.body, context),
295
- };
296
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
297
- switch (errorCode) {
298
- case "InternalServerException":
299
- case "com.amazonaws.translate#InternalServerException":
300
- throw await de_InternalServerExceptionRes(parsedOutput, context);
301
- case "ResourceNotFoundException":
302
- case "com.amazonaws.translate#ResourceNotFoundException":
303
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
304
- case "TooManyRequestsException":
305
- case "com.amazonaws.translate#TooManyRequestsException":
306
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
307
- default:
308
- const parsedBody = parsedOutput.body;
309
- return throwDefaultError({
310
- output,
311
- parsedBody,
312
- errorCode,
313
- });
314
- }
315
- };
316
- const de_GetParallelDataCommand = async (output, context) => {
317
- if (output.statusCode >= 300) {
318
- return de_GetParallelDataCommandError(output, context);
319
- }
320
- const data = await parseBody(output.body, context);
321
- let contents = {};
322
- contents = de_GetParallelDataResponse(data, context);
323
- const response = {
324
- $metadata: deserializeMetadata(output),
325
- ...contents,
326
- };
327
- return response;
328
- };
329
- exports.de_GetParallelDataCommand = de_GetParallelDataCommand;
330
- const de_GetParallelDataCommandError = async (output, context) => {
331
- const parsedOutput = {
332
- ...output,
333
- body: await parseErrorBody(output.body, context),
334
- };
335
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
336
- switch (errorCode) {
337
- case "InternalServerException":
338
- case "com.amazonaws.translate#InternalServerException":
339
- throw await de_InternalServerExceptionRes(parsedOutput, context);
340
- case "InvalidParameterValueException":
341
- case "com.amazonaws.translate#InvalidParameterValueException":
342
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
343
- case "ResourceNotFoundException":
344
- case "com.amazonaws.translate#ResourceNotFoundException":
345
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
346
- case "TooManyRequestsException":
347
- case "com.amazonaws.translate#TooManyRequestsException":
348
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
349
- default:
350
- const parsedBody = parsedOutput.body;
351
- return throwDefaultError({
352
- output,
353
- parsedBody,
354
- errorCode,
355
- });
356
- }
357
- };
358
- const de_GetTerminologyCommand = async (output, context) => {
359
- if (output.statusCode >= 300) {
360
- return de_GetTerminologyCommandError(output, context);
361
- }
362
- const data = await parseBody(output.body, context);
363
- let contents = {};
364
- contents = de_GetTerminologyResponse(data, context);
365
- const response = {
366
- $metadata: deserializeMetadata(output),
367
- ...contents,
368
- };
369
- return response;
370
- };
371
- exports.de_GetTerminologyCommand = de_GetTerminologyCommand;
372
- const de_GetTerminologyCommandError = async (output, context) => {
373
- const parsedOutput = {
374
- ...output,
375
- body: await parseErrorBody(output.body, context),
376
- };
377
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
378
- switch (errorCode) {
379
- case "InternalServerException":
380
- case "com.amazonaws.translate#InternalServerException":
381
- throw await de_InternalServerExceptionRes(parsedOutput, context);
382
- case "InvalidParameterValueException":
383
- case "com.amazonaws.translate#InvalidParameterValueException":
384
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
385
- case "ResourceNotFoundException":
386
- case "com.amazonaws.translate#ResourceNotFoundException":
387
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
388
- case "TooManyRequestsException":
389
- case "com.amazonaws.translate#TooManyRequestsException":
390
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
391
- default:
392
- const parsedBody = parsedOutput.body;
393
- return throwDefaultError({
394
- output,
395
- parsedBody,
396
- errorCode,
397
- });
398
- }
399
- };
400
- const de_ImportTerminologyCommand = async (output, context) => {
401
- if (output.statusCode >= 300) {
402
- return de_ImportTerminologyCommandError(output, context);
403
- }
404
- const data = await parseBody(output.body, context);
405
- let contents = {};
406
- contents = de_ImportTerminologyResponse(data, context);
407
- const response = {
408
- $metadata: deserializeMetadata(output),
409
- ...contents,
410
- };
411
- return response;
412
- };
413
- exports.de_ImportTerminologyCommand = de_ImportTerminologyCommand;
414
- const de_ImportTerminologyCommandError = async (output, context) => {
415
- const parsedOutput = {
416
- ...output,
417
- body: await parseErrorBody(output.body, context),
418
- };
419
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
420
- switch (errorCode) {
421
- case "ConcurrentModificationException":
422
- case "com.amazonaws.translate#ConcurrentModificationException":
423
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
424
- case "InternalServerException":
425
- case "com.amazonaws.translate#InternalServerException":
426
- throw await de_InternalServerExceptionRes(parsedOutput, context);
427
- case "InvalidParameterValueException":
428
- case "com.amazonaws.translate#InvalidParameterValueException":
429
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
430
- case "LimitExceededException":
431
- case "com.amazonaws.translate#LimitExceededException":
432
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
433
- case "TooManyRequestsException":
434
- case "com.amazonaws.translate#TooManyRequestsException":
435
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
436
- case "TooManyTagsException":
437
- case "com.amazonaws.translate#TooManyTagsException":
438
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
439
- default:
440
- const parsedBody = parsedOutput.body;
441
- return throwDefaultError({
442
- output,
443
- parsedBody,
444
- errorCode,
445
- });
446
- }
447
- };
448
- const de_ListLanguagesCommand = async (output, context) => {
449
- if (output.statusCode >= 300) {
450
- return de_ListLanguagesCommandError(output, context);
451
- }
452
- const data = await parseBody(output.body, context);
453
- let contents = {};
454
- contents = (0, smithy_client_1._json)(data);
455
- const response = {
456
- $metadata: deserializeMetadata(output),
457
- ...contents,
458
- };
459
- return response;
460
- };
461
- exports.de_ListLanguagesCommand = de_ListLanguagesCommand;
462
- const de_ListLanguagesCommandError = async (output, context) => {
463
- const parsedOutput = {
464
- ...output,
465
- body: await parseErrorBody(output.body, context),
466
- };
467
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
468
- switch (errorCode) {
469
- case "InternalServerException":
470
- case "com.amazonaws.translate#InternalServerException":
471
- throw await de_InternalServerExceptionRes(parsedOutput, context);
472
- case "InvalidParameterValueException":
473
- case "com.amazonaws.translate#InvalidParameterValueException":
474
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
475
- case "TooManyRequestsException":
476
- case "com.amazonaws.translate#TooManyRequestsException":
477
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
478
- case "UnsupportedDisplayLanguageCodeException":
479
- case "com.amazonaws.translate#UnsupportedDisplayLanguageCodeException":
480
- throw await de_UnsupportedDisplayLanguageCodeExceptionRes(parsedOutput, context);
481
- default:
482
- const parsedBody = parsedOutput.body;
483
- return throwDefaultError({
484
- output,
485
- parsedBody,
486
- errorCode,
487
- });
488
- }
489
- };
490
- const de_ListParallelDataCommand = async (output, context) => {
491
- if (output.statusCode >= 300) {
492
- return de_ListParallelDataCommandError(output, context);
493
- }
494
- const data = await parseBody(output.body, context);
495
- let contents = {};
496
- contents = de_ListParallelDataResponse(data, context);
497
- const response = {
498
- $metadata: deserializeMetadata(output),
499
- ...contents,
500
- };
501
- return response;
502
- };
503
- exports.de_ListParallelDataCommand = de_ListParallelDataCommand;
504
- const de_ListParallelDataCommandError = async (output, context) => {
505
- const parsedOutput = {
506
- ...output,
507
- body: await parseErrorBody(output.body, context),
508
- };
509
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
510
- switch (errorCode) {
511
- case "InternalServerException":
512
- case "com.amazonaws.translate#InternalServerException":
513
- throw await de_InternalServerExceptionRes(parsedOutput, context);
514
- case "InvalidParameterValueException":
515
- case "com.amazonaws.translate#InvalidParameterValueException":
516
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
517
- case "TooManyRequestsException":
518
- case "com.amazonaws.translate#TooManyRequestsException":
519
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
520
- default:
521
- const parsedBody = parsedOutput.body;
522
- return throwDefaultError({
523
- output,
524
- parsedBody,
525
- errorCode,
526
- });
527
- }
528
- };
529
- const de_ListTagsForResourceCommand = async (output, context) => {
530
- if (output.statusCode >= 300) {
531
- return de_ListTagsForResourceCommandError(output, context);
532
- }
533
- const data = await parseBody(output.body, context);
534
- let contents = {};
535
- contents = (0, smithy_client_1._json)(data);
536
- const response = {
537
- $metadata: deserializeMetadata(output),
538
- ...contents,
539
- };
540
- return response;
541
- };
542
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
543
- const de_ListTagsForResourceCommandError = async (output, context) => {
544
- const parsedOutput = {
545
- ...output,
546
- body: await parseErrorBody(output.body, context),
547
- };
548
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
549
- switch (errorCode) {
550
- case "InternalServerException":
551
- case "com.amazonaws.translate#InternalServerException":
552
- throw await de_InternalServerExceptionRes(parsedOutput, context);
553
- case "InvalidParameterValueException":
554
- case "com.amazonaws.translate#InvalidParameterValueException":
555
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
556
- case "ResourceNotFoundException":
557
- case "com.amazonaws.translate#ResourceNotFoundException":
558
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
559
- default:
560
- const parsedBody = parsedOutput.body;
561
- return throwDefaultError({
562
- output,
563
- parsedBody,
564
- errorCode,
565
- });
566
- }
567
- };
568
- const de_ListTerminologiesCommand = async (output, context) => {
569
- if (output.statusCode >= 300) {
570
- return de_ListTerminologiesCommandError(output, context);
571
- }
572
- const data = await parseBody(output.body, context);
573
- let contents = {};
574
- contents = de_ListTerminologiesResponse(data, context);
575
- const response = {
576
- $metadata: deserializeMetadata(output),
577
- ...contents,
578
- };
579
- return response;
580
- };
581
- exports.de_ListTerminologiesCommand = de_ListTerminologiesCommand;
582
- const de_ListTerminologiesCommandError = async (output, context) => {
583
- const parsedOutput = {
584
- ...output,
585
- body: await parseErrorBody(output.body, context),
586
- };
587
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
588
- switch (errorCode) {
589
- case "InternalServerException":
590
- case "com.amazonaws.translate#InternalServerException":
591
- throw await de_InternalServerExceptionRes(parsedOutput, context);
592
- case "InvalidParameterValueException":
593
- case "com.amazonaws.translate#InvalidParameterValueException":
594
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
595
- case "TooManyRequestsException":
596
- case "com.amazonaws.translate#TooManyRequestsException":
597
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
598
- default:
599
- const parsedBody = parsedOutput.body;
600
- return throwDefaultError({
601
- output,
602
- parsedBody,
603
- errorCode,
604
- });
605
- }
606
- };
607
- const de_ListTextTranslationJobsCommand = async (output, context) => {
608
- if (output.statusCode >= 300) {
609
- return de_ListTextTranslationJobsCommandError(output, context);
610
- }
611
- const data = await parseBody(output.body, context);
612
- let contents = {};
613
- contents = de_ListTextTranslationJobsResponse(data, context);
614
- const response = {
615
- $metadata: deserializeMetadata(output),
616
- ...contents,
617
- };
618
- return response;
619
- };
620
- exports.de_ListTextTranslationJobsCommand = de_ListTextTranslationJobsCommand;
621
- const de_ListTextTranslationJobsCommandError = async (output, context) => {
622
- const parsedOutput = {
623
- ...output,
624
- body: await parseErrorBody(output.body, context),
625
- };
626
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
627
- switch (errorCode) {
628
- case "InternalServerException":
629
- case "com.amazonaws.translate#InternalServerException":
630
- throw await de_InternalServerExceptionRes(parsedOutput, context);
631
- case "InvalidFilterException":
632
- case "com.amazonaws.translate#InvalidFilterException":
633
- throw await de_InvalidFilterExceptionRes(parsedOutput, context);
634
- case "InvalidRequestException":
635
- case "com.amazonaws.translate#InvalidRequestException":
636
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
637
- case "TooManyRequestsException":
638
- case "com.amazonaws.translate#TooManyRequestsException":
639
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
640
- default:
641
- const parsedBody = parsedOutput.body;
642
- return throwDefaultError({
643
- output,
644
- parsedBody,
645
- errorCode,
646
- });
647
- }
648
- };
649
- const de_StartTextTranslationJobCommand = async (output, context) => {
650
- if (output.statusCode >= 300) {
651
- return de_StartTextTranslationJobCommandError(output, context);
652
- }
653
- const data = await parseBody(output.body, context);
654
- let contents = {};
655
- contents = (0, smithy_client_1._json)(data);
656
- const response = {
657
- $metadata: deserializeMetadata(output),
658
- ...contents,
659
- };
660
- return response;
661
- };
662
- exports.de_StartTextTranslationJobCommand = de_StartTextTranslationJobCommand;
663
- const de_StartTextTranslationJobCommandError = async (output, context) => {
664
- const parsedOutput = {
665
- ...output,
666
- body: await parseErrorBody(output.body, context),
667
- };
668
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
669
- switch (errorCode) {
670
- case "InternalServerException":
671
- case "com.amazonaws.translate#InternalServerException":
672
- throw await de_InternalServerExceptionRes(parsedOutput, context);
673
- case "InvalidParameterValueException":
674
- case "com.amazonaws.translate#InvalidParameterValueException":
675
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
676
- case "InvalidRequestException":
677
- case "com.amazonaws.translate#InvalidRequestException":
678
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
679
- case "ResourceNotFoundException":
680
- case "com.amazonaws.translate#ResourceNotFoundException":
681
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
682
- case "TooManyRequestsException":
683
- case "com.amazonaws.translate#TooManyRequestsException":
684
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
685
- case "UnsupportedLanguagePairException":
686
- case "com.amazonaws.translate#UnsupportedLanguagePairException":
687
- throw await de_UnsupportedLanguagePairExceptionRes(parsedOutput, context);
688
- default:
689
- const parsedBody = parsedOutput.body;
690
- return throwDefaultError({
691
- output,
692
- parsedBody,
693
- errorCode,
694
- });
695
- }
696
- };
697
- const de_StopTextTranslationJobCommand = async (output, context) => {
698
- if (output.statusCode >= 300) {
699
- return de_StopTextTranslationJobCommandError(output, context);
700
- }
701
- const data = await parseBody(output.body, context);
702
- let contents = {};
703
- contents = (0, smithy_client_1._json)(data);
704
- const response = {
705
- $metadata: deserializeMetadata(output),
706
- ...contents,
707
- };
708
- return response;
709
- };
710
- exports.de_StopTextTranslationJobCommand = de_StopTextTranslationJobCommand;
711
- const de_StopTextTranslationJobCommandError = async (output, context) => {
712
- const parsedOutput = {
713
- ...output,
714
- body: await parseErrorBody(output.body, context),
715
- };
716
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
717
- switch (errorCode) {
718
- case "InternalServerException":
719
- case "com.amazonaws.translate#InternalServerException":
720
- throw await de_InternalServerExceptionRes(parsedOutput, context);
721
- case "ResourceNotFoundException":
722
- case "com.amazonaws.translate#ResourceNotFoundException":
723
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
724
- case "TooManyRequestsException":
725
- case "com.amazonaws.translate#TooManyRequestsException":
726
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
727
- default:
728
- const parsedBody = parsedOutput.body;
729
- return throwDefaultError({
730
- output,
731
- parsedBody,
732
- errorCode,
733
- });
734
- }
735
- };
736
- const de_TagResourceCommand = async (output, context) => {
737
- if (output.statusCode >= 300) {
738
- return de_TagResourceCommandError(output, context);
739
- }
740
- const data = await parseBody(output.body, context);
741
- let contents = {};
742
- contents = (0, smithy_client_1._json)(data);
743
- const response = {
744
- $metadata: deserializeMetadata(output),
745
- ...contents,
746
- };
747
- return response;
748
- };
749
- exports.de_TagResourceCommand = de_TagResourceCommand;
750
- const de_TagResourceCommandError = async (output, context) => {
751
- const parsedOutput = {
752
- ...output,
753
- body: await parseErrorBody(output.body, context),
754
- };
755
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
756
- switch (errorCode) {
757
- case "ConcurrentModificationException":
758
- case "com.amazonaws.translate#ConcurrentModificationException":
759
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
760
- case "InternalServerException":
761
- case "com.amazonaws.translate#InternalServerException":
762
- throw await de_InternalServerExceptionRes(parsedOutput, context);
763
- case "InvalidParameterValueException":
764
- case "com.amazonaws.translate#InvalidParameterValueException":
765
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
766
- case "ResourceNotFoundException":
767
- case "com.amazonaws.translate#ResourceNotFoundException":
768
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
769
- case "TooManyTagsException":
770
- case "com.amazonaws.translate#TooManyTagsException":
771
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
772
- default:
773
- const parsedBody = parsedOutput.body;
774
- return throwDefaultError({
775
- output,
776
- parsedBody,
777
- errorCode,
778
- });
779
- }
780
- };
781
- const de_TranslateDocumentCommand = async (output, context) => {
782
- if (output.statusCode >= 300) {
783
- return de_TranslateDocumentCommandError(output, context);
784
- }
785
- const data = await parseBody(output.body, context);
786
- let contents = {};
787
- contents = de_TranslateDocumentResponse(data, context);
788
- const response = {
789
- $metadata: deserializeMetadata(output),
790
- ...contents,
791
- };
792
- return response;
793
- };
794
- exports.de_TranslateDocumentCommand = de_TranslateDocumentCommand;
795
- const de_TranslateDocumentCommandError = async (output, context) => {
796
- const parsedOutput = {
797
- ...output,
798
- body: await parseErrorBody(output.body, context),
799
- };
800
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
801
- switch (errorCode) {
802
- case "InternalServerException":
803
- case "com.amazonaws.translate#InternalServerException":
804
- throw await de_InternalServerExceptionRes(parsedOutput, context);
805
- case "InvalidRequestException":
806
- case "com.amazonaws.translate#InvalidRequestException":
807
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
808
- case "LimitExceededException":
809
- case "com.amazonaws.translate#LimitExceededException":
810
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
811
- case "ResourceNotFoundException":
812
- case "com.amazonaws.translate#ResourceNotFoundException":
813
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
814
- case "ServiceUnavailableException":
815
- case "com.amazonaws.translate#ServiceUnavailableException":
816
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
817
- case "TooManyRequestsException":
818
- case "com.amazonaws.translate#TooManyRequestsException":
819
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
820
- case "UnsupportedLanguagePairException":
821
- case "com.amazonaws.translate#UnsupportedLanguagePairException":
822
- throw await de_UnsupportedLanguagePairExceptionRes(parsedOutput, context);
823
- default:
824
- const parsedBody = parsedOutput.body;
825
- return throwDefaultError({
826
- output,
827
- parsedBody,
828
- errorCode,
829
- });
830
- }
831
- };
832
- const de_TranslateTextCommand = async (output, context) => {
833
- if (output.statusCode >= 300) {
834
- return de_TranslateTextCommandError(output, context);
835
- }
836
- const data = await parseBody(output.body, context);
837
- let contents = {};
838
- contents = (0, smithy_client_1._json)(data);
839
- const response = {
840
- $metadata: deserializeMetadata(output),
841
- ...contents,
842
- };
843
- return response;
844
- };
845
- exports.de_TranslateTextCommand = de_TranslateTextCommand;
846
- const de_TranslateTextCommandError = async (output, context) => {
847
- const parsedOutput = {
848
- ...output,
849
- body: await parseErrorBody(output.body, context),
850
- };
851
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
852
- switch (errorCode) {
853
- case "DetectedLanguageLowConfidenceException":
854
- case "com.amazonaws.translate#DetectedLanguageLowConfidenceException":
855
- throw await de_DetectedLanguageLowConfidenceExceptionRes(parsedOutput, context);
856
- case "InternalServerException":
857
- case "com.amazonaws.translate#InternalServerException":
858
- throw await de_InternalServerExceptionRes(parsedOutput, context);
859
- case "InvalidRequestException":
860
- case "com.amazonaws.translate#InvalidRequestException":
861
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
862
- case "ResourceNotFoundException":
863
- case "com.amazonaws.translate#ResourceNotFoundException":
864
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
865
- case "ServiceUnavailableException":
866
- case "com.amazonaws.translate#ServiceUnavailableException":
867
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
868
- case "TextSizeLimitExceededException":
869
- case "com.amazonaws.translate#TextSizeLimitExceededException":
870
- throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context);
871
- case "TooManyRequestsException":
872
- case "com.amazonaws.translate#TooManyRequestsException":
873
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
874
- case "UnsupportedLanguagePairException":
875
- case "com.amazonaws.translate#UnsupportedLanguagePairException":
876
- throw await de_UnsupportedLanguagePairExceptionRes(parsedOutput, context);
877
- default:
878
- const parsedBody = parsedOutput.body;
879
- return throwDefaultError({
880
- output,
881
- parsedBody,
882
- errorCode,
883
- });
884
- }
885
- };
886
- const de_UntagResourceCommand = async (output, context) => {
887
- if (output.statusCode >= 300) {
888
- return de_UntagResourceCommandError(output, context);
889
- }
890
- const data = await parseBody(output.body, context);
891
- let contents = {};
892
- contents = (0, smithy_client_1._json)(data);
893
- const response = {
894
- $metadata: deserializeMetadata(output),
895
- ...contents,
896
- };
897
- return response;
898
- };
899
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
900
- const de_UntagResourceCommandError = async (output, context) => {
901
- const parsedOutput = {
902
- ...output,
903
- body: await parseErrorBody(output.body, context),
904
- };
905
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
906
- switch (errorCode) {
907
- case "ConcurrentModificationException":
908
- case "com.amazonaws.translate#ConcurrentModificationException":
909
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
910
- case "InternalServerException":
911
- case "com.amazonaws.translate#InternalServerException":
912
- throw await de_InternalServerExceptionRes(parsedOutput, context);
913
- case "InvalidParameterValueException":
914
- case "com.amazonaws.translate#InvalidParameterValueException":
915
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
916
- case "ResourceNotFoundException":
917
- case "com.amazonaws.translate#ResourceNotFoundException":
918
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
919
- default:
920
- const parsedBody = parsedOutput.body;
921
- return throwDefaultError({
922
- output,
923
- parsedBody,
924
- errorCode,
925
- });
926
- }
927
- };
928
- const de_UpdateParallelDataCommand = async (output, context) => {
929
- if (output.statusCode >= 300) {
930
- return de_UpdateParallelDataCommandError(output, context);
931
- }
932
- const data = await parseBody(output.body, context);
933
- let contents = {};
934
- contents = de_UpdateParallelDataResponse(data, context);
935
- const response = {
936
- $metadata: deserializeMetadata(output),
937
- ...contents,
938
- };
939
- return response;
940
- };
941
- exports.de_UpdateParallelDataCommand = de_UpdateParallelDataCommand;
942
- const de_UpdateParallelDataCommandError = async (output, context) => {
943
- const parsedOutput = {
944
- ...output,
945
- body: await parseErrorBody(output.body, context),
946
- };
947
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
948
- switch (errorCode) {
949
- case "ConcurrentModificationException":
950
- case "com.amazonaws.translate#ConcurrentModificationException":
951
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
952
- case "ConflictException":
953
- case "com.amazonaws.translate#ConflictException":
954
- throw await de_ConflictExceptionRes(parsedOutput, context);
955
- case "InternalServerException":
956
- case "com.amazonaws.translate#InternalServerException":
957
- throw await de_InternalServerExceptionRes(parsedOutput, context);
958
- case "InvalidParameterValueException":
959
- case "com.amazonaws.translate#InvalidParameterValueException":
960
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
961
- case "InvalidRequestException":
962
- case "com.amazonaws.translate#InvalidRequestException":
963
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
964
- case "LimitExceededException":
965
- case "com.amazonaws.translate#LimitExceededException":
966
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
967
- case "ResourceNotFoundException":
968
- case "com.amazonaws.translate#ResourceNotFoundException":
969
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
970
- case "TooManyRequestsException":
971
- case "com.amazonaws.translate#TooManyRequestsException":
972
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
973
- default:
974
- const parsedBody = parsedOutput.body;
975
- return throwDefaultError({
976
- output,
977
- parsedBody,
978
- errorCode,
979
- });
980
- }
981
- };
982
- const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
983
- const body = parsedOutput.body;
984
- const deserialized = (0, smithy_client_1._json)(body);
985
- const exception = new models_0_1.ConcurrentModificationException({
986
- $metadata: deserializeMetadata(parsedOutput),
987
- ...deserialized,
988
- });
989
- return (0, smithy_client_1.decorateServiceException)(exception, body);
990
- };
991
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
992
- const body = parsedOutput.body;
993
- const deserialized = (0, smithy_client_1._json)(body);
994
- const exception = new models_0_1.ConflictException({
995
- $metadata: deserializeMetadata(parsedOutput),
996
- ...deserialized,
997
- });
998
- return (0, smithy_client_1.decorateServiceException)(exception, body);
999
- };
1000
- const de_DetectedLanguageLowConfidenceExceptionRes = async (parsedOutput, context) => {
1001
- const body = parsedOutput.body;
1002
- const deserialized = (0, smithy_client_1._json)(body);
1003
- const exception = new models_0_1.DetectedLanguageLowConfidenceException({
1004
- $metadata: deserializeMetadata(parsedOutput),
1005
- ...deserialized,
1006
- });
1007
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1008
- };
1009
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1010
- const body = parsedOutput.body;
1011
- const deserialized = (0, smithy_client_1._json)(body);
1012
- const exception = new models_0_1.InternalServerException({
1013
- $metadata: deserializeMetadata(parsedOutput),
1014
- ...deserialized,
1015
- });
1016
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1017
- };
1018
- const de_InvalidFilterExceptionRes = async (parsedOutput, context) => {
1019
- const body = parsedOutput.body;
1020
- const deserialized = (0, smithy_client_1._json)(body);
1021
- const exception = new models_0_1.InvalidFilterException({
1022
- $metadata: deserializeMetadata(parsedOutput),
1023
- ...deserialized,
1024
- });
1025
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1026
- };
1027
- const de_InvalidParameterValueExceptionRes = async (parsedOutput, context) => {
1028
- const body = parsedOutput.body;
1029
- const deserialized = (0, smithy_client_1._json)(body);
1030
- const exception = new models_0_1.InvalidParameterValueException({
1031
- $metadata: deserializeMetadata(parsedOutput),
1032
- ...deserialized,
1033
- });
1034
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1035
- };
1036
- const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
1037
- const body = parsedOutput.body;
1038
- const deserialized = (0, smithy_client_1._json)(body);
1039
- const exception = new models_0_1.InvalidRequestException({
1040
- $metadata: deserializeMetadata(parsedOutput),
1041
- ...deserialized,
1042
- });
1043
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1044
- };
1045
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
1046
- const body = parsedOutput.body;
1047
- const deserialized = (0, smithy_client_1._json)(body);
1048
- const exception = new models_0_1.LimitExceededException({
1049
- $metadata: deserializeMetadata(parsedOutput),
1050
- ...deserialized,
1051
- });
1052
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1053
- };
1054
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1055
- const body = parsedOutput.body;
1056
- const deserialized = (0, smithy_client_1._json)(body);
1057
- const exception = new models_0_1.ResourceNotFoundException({
1058
- $metadata: deserializeMetadata(parsedOutput),
1059
- ...deserialized,
1060
- });
1061
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1062
- };
1063
- const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
1064
- const body = parsedOutput.body;
1065
- const deserialized = (0, smithy_client_1._json)(body);
1066
- const exception = new models_0_1.ServiceUnavailableException({
1067
- $metadata: deserializeMetadata(parsedOutput),
1068
- ...deserialized,
1069
- });
1070
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1071
- };
1072
- const de_TextSizeLimitExceededExceptionRes = async (parsedOutput, context) => {
1073
- const body = parsedOutput.body;
1074
- const deserialized = (0, smithy_client_1._json)(body);
1075
- const exception = new models_0_1.TextSizeLimitExceededException({
1076
- $metadata: deserializeMetadata(parsedOutput),
1077
- ...deserialized,
1078
- });
1079
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1080
- };
1081
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
1082
- const body = parsedOutput.body;
1083
- const deserialized = (0, smithy_client_1._json)(body);
1084
- const exception = new models_0_1.TooManyRequestsException({
1085
- $metadata: deserializeMetadata(parsedOutput),
1086
- ...deserialized,
1087
- });
1088
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1089
- };
1090
- const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
1091
- const body = parsedOutput.body;
1092
- const deserialized = (0, smithy_client_1._json)(body);
1093
- const exception = new models_0_1.TooManyTagsException({
1094
- $metadata: deserializeMetadata(parsedOutput),
1095
- ...deserialized,
1096
- });
1097
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1098
- };
1099
- const de_UnsupportedDisplayLanguageCodeExceptionRes = async (parsedOutput, context) => {
1100
- const body = parsedOutput.body;
1101
- const deserialized = (0, smithy_client_1._json)(body);
1102
- const exception = new models_0_1.UnsupportedDisplayLanguageCodeException({
1103
- $metadata: deserializeMetadata(parsedOutput),
1104
- ...deserialized,
1105
- });
1106
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1107
- };
1108
- const de_UnsupportedLanguagePairExceptionRes = async (parsedOutput, context) => {
1109
- const body = parsedOutput.body;
1110
- const deserialized = (0, smithy_client_1._json)(body);
1111
- const exception = new models_0_1.UnsupportedLanguagePairException({
1112
- $metadata: deserializeMetadata(parsedOutput),
1113
- ...deserialized,
1114
- });
1115
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1116
- };
1117
- const se_CreateParallelDataRequest = (input, context) => {
1118
- return (0, smithy_client_1.take)(input, {
1119
- ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1120
- Description: [],
1121
- EncryptionKey: smithy_client_1._json,
1122
- Name: [],
1123
- ParallelDataConfig: smithy_client_1._json,
1124
- Tags: smithy_client_1._json,
1125
- });
1126
- };
1127
- const se_Document = (input, context) => {
1128
- return (0, smithy_client_1.take)(input, {
1129
- Content: context.base64Encoder,
1130
- ContentType: [],
1131
- });
1132
- };
1133
- const se_ImportTerminologyRequest = (input, context) => {
1134
- return (0, smithy_client_1.take)(input, {
1135
- Description: [],
1136
- EncryptionKey: smithy_client_1._json,
1137
- MergeStrategy: [],
1138
- Name: [],
1139
- Tags: smithy_client_1._json,
1140
- TerminologyData: (_) => se_TerminologyData(_, context),
1141
- });
1142
- };
1143
- const se_ListTextTranslationJobsRequest = (input, context) => {
1144
- return (0, smithy_client_1.take)(input, {
1145
- Filter: (_) => se_TextTranslationJobFilter(_, context),
1146
- MaxResults: [],
1147
- NextToken: [],
1148
- });
1149
- };
1150
- const se_StartTextTranslationJobRequest = (input, context) => {
1151
- return (0, smithy_client_1.take)(input, {
1152
- ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1153
- DataAccessRoleArn: [],
1154
- InputDataConfig: smithy_client_1._json,
1155
- JobName: [],
1156
- OutputDataConfig: smithy_client_1._json,
1157
- ParallelDataNames: smithy_client_1._json,
1158
- Settings: smithy_client_1._json,
1159
- SourceLanguageCode: [],
1160
- TargetLanguageCodes: smithy_client_1._json,
1161
- TerminologyNames: smithy_client_1._json,
1162
- });
1163
- };
1164
- const se_TerminologyData = (input, context) => {
1165
- return (0, smithy_client_1.take)(input, {
1166
- Directionality: [],
1167
- File: context.base64Encoder,
1168
- Format: [],
1169
- });
1170
- };
1171
- const se_TextTranslationJobFilter = (input, context) => {
1172
- return (0, smithy_client_1.take)(input, {
1173
- JobName: [],
1174
- JobStatus: [],
1175
- SubmittedAfterTime: (_) => Math.round(_.getTime() / 1000),
1176
- SubmittedBeforeTime: (_) => Math.round(_.getTime() / 1000),
1177
- });
1178
- };
1179
- const se_TranslateDocumentRequest = (input, context) => {
1180
- return (0, smithy_client_1.take)(input, {
1181
- Document: (_) => se_Document(_, context),
1182
- Settings: smithy_client_1._json,
1183
- SourceLanguageCode: [],
1184
- TargetLanguageCode: [],
1185
- TerminologyNames: smithy_client_1._json,
1186
- });
1187
- };
1188
- const se_UpdateParallelDataRequest = (input, context) => {
1189
- return (0, smithy_client_1.take)(input, {
1190
- ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1191
- Description: [],
1192
- Name: [],
1193
- ParallelDataConfig: smithy_client_1._json,
1194
- });
1195
- };
1196
- const de_DescribeTextTranslationJobResponse = (output, context) => {
1197
- return (0, smithy_client_1.take)(output, {
1198
- TextTranslationJobProperties: (_) => de_TextTranslationJobProperties(_, context),
1199
- });
1200
- };
1201
- const de_GetParallelDataResponse = (output, context) => {
1202
- return (0, smithy_client_1.take)(output, {
1203
- AuxiliaryDataLocation: smithy_client_1._json,
1204
- DataLocation: smithy_client_1._json,
1205
- LatestUpdateAttemptAuxiliaryDataLocation: smithy_client_1._json,
1206
- ParallelDataProperties: (_) => de_ParallelDataProperties(_, context),
1207
- });
1208
- };
1209
- const de_GetTerminologyResponse = (output, context) => {
1210
- return (0, smithy_client_1.take)(output, {
1211
- AuxiliaryDataLocation: smithy_client_1._json,
1212
- TerminologyDataLocation: smithy_client_1._json,
1213
- TerminologyProperties: (_) => de_TerminologyProperties(_, context),
1214
- });
1215
- };
1216
- const de_ImportTerminologyResponse = (output, context) => {
1217
- return (0, smithy_client_1.take)(output, {
1218
- AuxiliaryDataLocation: smithy_client_1._json,
1219
- TerminologyProperties: (_) => de_TerminologyProperties(_, context),
1220
- });
1221
- };
1222
- const de_ListParallelDataResponse = (output, context) => {
1223
- return (0, smithy_client_1.take)(output, {
1224
- NextToken: smithy_client_1.expectString,
1225
- ParallelDataPropertiesList: (_) => de_ParallelDataPropertiesList(_, context),
1226
- });
1227
- };
1228
- const de_ListTerminologiesResponse = (output, context) => {
1229
- return (0, smithy_client_1.take)(output, {
1230
- NextToken: smithy_client_1.expectString,
1231
- TerminologyPropertiesList: (_) => de_TerminologyPropertiesList(_, context),
1232
- });
1233
- };
1234
- const de_ListTextTranslationJobsResponse = (output, context) => {
1235
- return (0, smithy_client_1.take)(output, {
1236
- NextToken: smithy_client_1.expectString,
1237
- TextTranslationJobPropertiesList: (_) => de_TextTranslationJobPropertiesList(_, context),
1238
- });
1239
- };
1240
- const de_ParallelDataProperties = (output, context) => {
1241
- return (0, smithy_client_1.take)(output, {
1242
- Arn: smithy_client_1.expectString,
1243
- CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1244
- Description: smithy_client_1.expectString,
1245
- EncryptionKey: smithy_client_1._json,
1246
- FailedRecordCount: smithy_client_1.expectLong,
1247
- ImportedDataSize: smithy_client_1.expectLong,
1248
- ImportedRecordCount: smithy_client_1.expectLong,
1249
- LastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1250
- LatestUpdateAttemptAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1251
- LatestUpdateAttemptStatus: smithy_client_1.expectString,
1252
- Message: smithy_client_1.expectString,
1253
- Name: smithy_client_1.expectString,
1254
- ParallelDataConfig: smithy_client_1._json,
1255
- SkippedRecordCount: smithy_client_1.expectLong,
1256
- SourceLanguageCode: smithy_client_1.expectString,
1257
- Status: smithy_client_1.expectString,
1258
- TargetLanguageCodes: smithy_client_1._json,
1259
- });
1260
- };
1261
- const de_ParallelDataPropertiesList = (output, context) => {
1262
- const retVal = (output || [])
1263
- .filter((e) => e != null)
1264
- .map((entry) => {
1265
- return de_ParallelDataProperties(entry, context);
1266
- });
1267
- return retVal;
1268
- };
1269
- const de_TerminologyProperties = (output, context) => {
1270
- return (0, smithy_client_1.take)(output, {
1271
- Arn: smithy_client_1.expectString,
1272
- CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1273
- Description: smithy_client_1.expectString,
1274
- Directionality: smithy_client_1.expectString,
1275
- EncryptionKey: smithy_client_1._json,
1276
- Format: smithy_client_1.expectString,
1277
- LastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1278
- Message: smithy_client_1.expectString,
1279
- Name: smithy_client_1.expectString,
1280
- SizeBytes: smithy_client_1.expectInt32,
1281
- SkippedTermCount: smithy_client_1.expectInt32,
1282
- SourceLanguageCode: smithy_client_1.expectString,
1283
- TargetLanguageCodes: smithy_client_1._json,
1284
- TermCount: smithy_client_1.expectInt32,
1285
- });
1286
- };
1287
- const de_TerminologyPropertiesList = (output, context) => {
1288
- const retVal = (output || [])
1289
- .filter((e) => e != null)
1290
- .map((entry) => {
1291
- return de_TerminologyProperties(entry, context);
1292
- });
1293
- return retVal;
1294
- };
1295
- const de_TextTranslationJobProperties = (output, context) => {
1296
- return (0, smithy_client_1.take)(output, {
1297
- DataAccessRoleArn: smithy_client_1.expectString,
1298
- EndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1299
- InputDataConfig: smithy_client_1._json,
1300
- JobDetails: smithy_client_1._json,
1301
- JobId: smithy_client_1.expectString,
1302
- JobName: smithy_client_1.expectString,
1303
- JobStatus: smithy_client_1.expectString,
1304
- Message: smithy_client_1.expectString,
1305
- OutputDataConfig: smithy_client_1._json,
1306
- ParallelDataNames: smithy_client_1._json,
1307
- Settings: smithy_client_1._json,
1308
- SourceLanguageCode: smithy_client_1.expectString,
1309
- SubmittedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1310
- TargetLanguageCodes: smithy_client_1._json,
1311
- TerminologyNames: smithy_client_1._json,
1312
- });
1313
- };
1314
- const de_TextTranslationJobPropertiesList = (output, context) => {
1315
- const retVal = (output || [])
1316
- .filter((e) => e != null)
1317
- .map((entry) => {
1318
- return de_TextTranslationJobProperties(entry, context);
1319
- });
1320
- return retVal;
1321
- };
1322
- const de_TranslatedDocument = (output, context) => {
1323
- return (0, smithy_client_1.take)(output, {
1324
- Content: context.base64Decoder,
1325
- });
1326
- };
1327
- const de_TranslateDocumentResponse = (output, context) => {
1328
- return (0, smithy_client_1.take)(output, {
1329
- AppliedSettings: smithy_client_1._json,
1330
- AppliedTerminologies: smithy_client_1._json,
1331
- SourceLanguageCode: smithy_client_1.expectString,
1332
- TargetLanguageCode: smithy_client_1.expectString,
1333
- TranslatedDocument: (_) => de_TranslatedDocument(_, context),
1334
- });
1335
- };
1336
- const de_UpdateParallelDataResponse = (output, context) => {
1337
- return (0, smithy_client_1.take)(output, {
1338
- LatestUpdateAttemptAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1339
- LatestUpdateAttemptStatus: smithy_client_1.expectString,
1340
- Name: smithy_client_1.expectString,
1341
- Status: smithy_client_1.expectString,
1342
- });
1343
- };
1344
- const deserializeMetadata = (output) => ({
1345
- httpStatusCode: output.statusCode,
1346
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1347
- extendedRequestId: output.headers["x-amz-id-2"],
1348
- cfId: output.headers["x-amz-cf-id"],
1349
- });
1350
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1351
- const throwDefaultError = (0, smithy_client_1.withBaseException)(TranslateServiceException_1.TranslateServiceException);
1352
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1353
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1354
- const contents = {
1355
- protocol,
1356
- hostname,
1357
- port,
1358
- method: "POST",
1359
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1360
- headers,
1361
- };
1362
- if (resolvedHostname !== undefined) {
1363
- contents.hostname = resolvedHostname;
1364
- }
1365
- if (body !== undefined) {
1366
- contents.body = body;
1367
- }
1368
- return new protocol_http_1.HttpRequest(contents);
1369
- };
1370
- function sharedHeaders(operation) {
1371
- return {
1372
- "content-type": "application/x-amz-json-1.1",
1373
- "x-amz-target": `AWSShineFrontendService_20170701.${operation}`,
1374
- };
1375
- }
1376
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1377
- if (encoded.length) {
1378
- return JSON.parse(encoded);
1379
- }
1380
- return {};
1381
- });
1382
- const parseErrorBody = async (errorBody, context) => {
1383
- const value = await parseBody(errorBody, context);
1384
- value.message = value.message ?? value.Message;
1385
- return value;
1386
- };
1387
- const loadRestJsonErrorCode = (output, data) => {
1388
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1389
- const sanitizeErrorCode = (rawValue) => {
1390
- let cleanValue = rawValue;
1391
- if (typeof cleanValue === "number") {
1392
- cleanValue = cleanValue.toString();
1393
- }
1394
- if (cleanValue.indexOf(",") >= 0) {
1395
- cleanValue = cleanValue.split(",")[0];
1396
- }
1397
- if (cleanValue.indexOf(":") >= 0) {
1398
- cleanValue = cleanValue.split(":")[0];
1399
- }
1400
- if (cleanValue.indexOf("#") >= 0) {
1401
- cleanValue = cleanValue.split("#")[1];
1402
- }
1403
- return cleanValue;
1404
- };
1405
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1406
- if (headerKey !== undefined) {
1407
- return sanitizeErrorCode(output.headers[headerKey]);
1408
- }
1409
- if (data.code !== undefined) {
1410
- return sanitizeErrorCode(data.code);
1411
- }
1412
- if (data["__type"] !== undefined) {
1413
- return sanitizeErrorCode(data["__type"]);
1414
- }
1415
- };
1
+ module.exports = require("../index.js");