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