@aws-sdk/client-transcribe-streaming 3.183.0 → 3.186.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 +19 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2 -2
- package/dist-es/TranscribeStreaming.js +17 -10
- package/dist-es/TranscribeStreamingClient.js +32 -26
- package/dist-es/commands/StartMedicalStreamTranscriptionCommand.js +28 -21
- package/dist-es/commands/StartStreamTranscriptionCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/TranscribeStreamingServiceException.js +10 -5
- package/dist-es/models/models_0.js +91 -127
- package/dist-es/protocols/Aws_restJson1.js +654 -503
- package/dist-es/runtimeConfig.browser.js +12 -28
- package/dist-es/runtimeConfig.js +19 -33
- package/dist-es/runtimeConfig.native.js +5 -10
- package/dist-es/runtimeConfig.shared.js +11 -8
- package/package.json +39 -39
|
@@ -1,465 +1,598 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, parseBoolean as __parseBoolean, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { AudioStream, BadRequestException, ConflictException, InternalFailureException, LimitExceededException, ServiceUnavailableException, } from "../models/models_0";
|
|
4
5
|
import { TranscribeStreamingServiceException as __BaseException } from "../models/TranscribeStreamingServiceException";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
6
|
+
export var serializeAws_restJson1StartMedicalStreamTranscriptionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
8
|
+
return __generator(this, function (_c) {
|
|
9
|
+
switch (_c.label) {
|
|
10
|
+
case 0: return [4, context.endpoint()];
|
|
11
|
+
case 1:
|
|
12
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
13
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
14
|
+
"x-amzn-transcribe-language-code": input.LanguageCode,
|
|
15
|
+
"x-amzn-transcribe-sample-rate": [
|
|
16
|
+
function () { return isSerializableHeaderValue(input.MediaSampleRateHertz); },
|
|
17
|
+
function () { return input.MediaSampleRateHertz.toString(); },
|
|
18
|
+
],
|
|
19
|
+
"x-amzn-transcribe-media-encoding": input.MediaEncoding,
|
|
20
|
+
"x-amzn-transcribe-vocabulary-name": input.VocabularyName,
|
|
21
|
+
"x-amzn-transcribe-specialty": input.Specialty,
|
|
22
|
+
"x-amzn-transcribe-type": input.Type,
|
|
23
|
+
"x-amzn-transcribe-show-speaker-label": [
|
|
24
|
+
function () { return isSerializableHeaderValue(input.ShowSpeakerLabel); },
|
|
25
|
+
function () { return input.ShowSpeakerLabel.toString(); },
|
|
26
|
+
],
|
|
27
|
+
"x-amzn-transcribe-session-id": input.SessionId,
|
|
28
|
+
"x-amzn-transcribe-enable-channel-identification": [
|
|
29
|
+
function () { return isSerializableHeaderValue(input.EnableChannelIdentification); },
|
|
30
|
+
function () { return input.EnableChannelIdentification.toString(); },
|
|
31
|
+
],
|
|
32
|
+
"x-amzn-transcribe-number-of-channels": [
|
|
33
|
+
function () { return isSerializableHeaderValue(input.NumberOfChannels); },
|
|
34
|
+
function () { return input.NumberOfChannels.toString(); },
|
|
35
|
+
],
|
|
36
|
+
"x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
|
|
37
|
+
});
|
|
38
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/medical-stream-transcription";
|
|
39
|
+
if (input.AudioStream !== undefined) {
|
|
40
|
+
body = serializeAws_restJson1AudioStream(input.AudioStream, context);
|
|
41
|
+
}
|
|
42
|
+
return [2, new __HttpRequest({
|
|
43
|
+
protocol: protocol,
|
|
44
|
+
hostname: hostname,
|
|
45
|
+
port: port,
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: headers,
|
|
48
|
+
path: resolvedPath,
|
|
49
|
+
body: body,
|
|
50
|
+
})];
|
|
51
|
+
}
|
|
45
52
|
});
|
|
46
|
-
};
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
53
|
+
}); };
|
|
54
|
+
export var serializeAws_restJson1StartStreamTranscriptionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
56
|
+
return __generator(this, function (_c) {
|
|
57
|
+
switch (_c.label) {
|
|
58
|
+
case 0: return [4, context.endpoint()];
|
|
59
|
+
case 1:
|
|
60
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
61
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
62
|
+
"x-amzn-transcribe-language-code": input.LanguageCode,
|
|
63
|
+
"x-amzn-transcribe-sample-rate": [
|
|
64
|
+
function () { return isSerializableHeaderValue(input.MediaSampleRateHertz); },
|
|
65
|
+
function () { return input.MediaSampleRateHertz.toString(); },
|
|
66
|
+
],
|
|
67
|
+
"x-amzn-transcribe-media-encoding": input.MediaEncoding,
|
|
68
|
+
"x-amzn-transcribe-vocabulary-name": input.VocabularyName,
|
|
69
|
+
"x-amzn-transcribe-session-id": input.SessionId,
|
|
70
|
+
"x-amzn-transcribe-vocabulary-filter-name": input.VocabularyFilterName,
|
|
71
|
+
"x-amzn-transcribe-vocabulary-filter-method": input.VocabularyFilterMethod,
|
|
72
|
+
"x-amzn-transcribe-show-speaker-label": [
|
|
73
|
+
function () { return isSerializableHeaderValue(input.ShowSpeakerLabel); },
|
|
74
|
+
function () { return input.ShowSpeakerLabel.toString(); },
|
|
75
|
+
],
|
|
76
|
+
"x-amzn-transcribe-enable-channel-identification": [
|
|
77
|
+
function () { return isSerializableHeaderValue(input.EnableChannelIdentification); },
|
|
78
|
+
function () { return input.EnableChannelIdentification.toString(); },
|
|
79
|
+
],
|
|
80
|
+
"x-amzn-transcribe-number-of-channels": [
|
|
81
|
+
function () { return isSerializableHeaderValue(input.NumberOfChannels); },
|
|
82
|
+
function () { return input.NumberOfChannels.toString(); },
|
|
83
|
+
],
|
|
84
|
+
"x-amzn-transcribe-enable-partial-results-stabilization": [
|
|
85
|
+
function () { return isSerializableHeaderValue(input.EnablePartialResultsStabilization); },
|
|
86
|
+
function () { return input.EnablePartialResultsStabilization.toString(); },
|
|
87
|
+
],
|
|
88
|
+
"x-amzn-transcribe-partial-results-stability": input.PartialResultsStability,
|
|
89
|
+
"x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
|
|
90
|
+
"x-amzn-transcribe-content-redaction-type": input.ContentRedactionType,
|
|
91
|
+
"x-amzn-transcribe-pii-entity-types": input.PiiEntityTypes,
|
|
92
|
+
"x-amzn-transcribe-language-model-name": input.LanguageModelName,
|
|
93
|
+
"x-amzn-transcribe-identify-language": [
|
|
94
|
+
function () { return isSerializableHeaderValue(input.IdentifyLanguage); },
|
|
95
|
+
function () { return input.IdentifyLanguage.toString(); },
|
|
96
|
+
],
|
|
97
|
+
"x-amzn-transcribe-language-options": input.LanguageOptions,
|
|
98
|
+
"x-amzn-transcribe-preferred-language": input.PreferredLanguage,
|
|
99
|
+
"x-amzn-transcribe-vocabulary-names": input.VocabularyNames,
|
|
100
|
+
"x-amzn-transcribe-vocabulary-filter-names": input.VocabularyFilterNames,
|
|
101
|
+
});
|
|
102
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/stream-transcription";
|
|
103
|
+
if (input.AudioStream !== undefined) {
|
|
104
|
+
body = serializeAws_restJson1AudioStream(input.AudioStream, context);
|
|
105
|
+
}
|
|
106
|
+
return [2, new __HttpRequest({
|
|
107
|
+
protocol: protocol,
|
|
108
|
+
hostname: hostname,
|
|
109
|
+
port: port,
|
|
110
|
+
method: "POST",
|
|
111
|
+
headers: headers,
|
|
112
|
+
path: resolvedPath,
|
|
113
|
+
body: body,
|
|
114
|
+
})];
|
|
115
|
+
}
|
|
89
116
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
117
|
+
}); };
|
|
118
|
+
export var deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
119
|
+
var contents, data;
|
|
120
|
+
return __generator(this, function (_a) {
|
|
121
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
122
|
+
return [2, deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError(output, context)];
|
|
123
|
+
}
|
|
124
|
+
contents = map({
|
|
125
|
+
$metadata: deserializeMetadata(output),
|
|
126
|
+
RequestId: [, output.headers["x-amzn-request-id"]],
|
|
127
|
+
LanguageCode: [, output.headers["x-amzn-transcribe-language-code"]],
|
|
128
|
+
MediaSampleRateHertz: [
|
|
129
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-sample-rate"]; },
|
|
130
|
+
function () { return __strictParseInt32(output.headers["x-amzn-transcribe-sample-rate"]); },
|
|
131
|
+
],
|
|
132
|
+
MediaEncoding: [, output.headers["x-amzn-transcribe-media-encoding"]],
|
|
133
|
+
VocabularyName: [, output.headers["x-amzn-transcribe-vocabulary-name"]],
|
|
134
|
+
Specialty: [, output.headers["x-amzn-transcribe-specialty"]],
|
|
135
|
+
Type: [, output.headers["x-amzn-transcribe-type"]],
|
|
136
|
+
ShowSpeakerLabel: [
|
|
137
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-show-speaker-label"]; },
|
|
138
|
+
function () { return __parseBoolean(output.headers["x-amzn-transcribe-show-speaker-label"]); },
|
|
139
|
+
],
|
|
140
|
+
SessionId: [, output.headers["x-amzn-transcribe-session-id"]],
|
|
141
|
+
EnableChannelIdentification: [
|
|
142
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-enable-channel-identification"]; },
|
|
143
|
+
function () { return __parseBoolean(output.headers["x-amzn-transcribe-enable-channel-identification"]); },
|
|
144
|
+
],
|
|
145
|
+
NumberOfChannels: [
|
|
146
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-number-of-channels"]; },
|
|
147
|
+
function () { return __strictParseInt32(output.headers["x-amzn-transcribe-number-of-channels"]); },
|
|
148
|
+
],
|
|
149
|
+
ContentIdentificationType: [, output.headers["x-amzn-transcribe-content-identification-type"]],
|
|
150
|
+
});
|
|
151
|
+
data = output.body;
|
|
152
|
+
contents.TranscriptResultStream = deserializeAws_restJson1MedicalTranscriptResultStream(data, context);
|
|
153
|
+
return [2, contents];
|
|
103
154
|
});
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
155
|
+
}); };
|
|
156
|
+
var deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
157
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
158
|
+
var _c;
|
|
159
|
+
return __generator(this, function (_d) {
|
|
160
|
+
switch (_d.label) {
|
|
161
|
+
case 0:
|
|
162
|
+
_a = [__assign({}, output)];
|
|
163
|
+
_c = {};
|
|
164
|
+
return [4, parseErrorBody(output.body, context)];
|
|
165
|
+
case 1:
|
|
166
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
167
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
168
|
+
_b = errorCode;
|
|
169
|
+
switch (_b) {
|
|
170
|
+
case "BadRequestException": return [3, 2];
|
|
171
|
+
case "com.amazonaws.transcribestreaming#BadRequestException": return [3, 2];
|
|
172
|
+
case "ConflictException": return [3, 4];
|
|
173
|
+
case "com.amazonaws.transcribestreaming#ConflictException": return [3, 4];
|
|
174
|
+
case "InternalFailureException": return [3, 6];
|
|
175
|
+
case "com.amazonaws.transcribestreaming#InternalFailureException": return [3, 6];
|
|
176
|
+
case "LimitExceededException": return [3, 8];
|
|
177
|
+
case "com.amazonaws.transcribestreaming#LimitExceededException": return [3, 8];
|
|
178
|
+
case "ServiceUnavailableException": return [3, 10];
|
|
179
|
+
case "com.amazonaws.transcribestreaming#ServiceUnavailableException": return [3, 10];
|
|
180
|
+
}
|
|
181
|
+
return [3, 12];
|
|
182
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
183
|
+
case 3: throw _d.sent();
|
|
184
|
+
case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
185
|
+
case 5: throw _d.sent();
|
|
186
|
+
case 6: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
187
|
+
case 7: throw _d.sent();
|
|
188
|
+
case 8: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
189
|
+
case 9: throw _d.sent();
|
|
190
|
+
case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
191
|
+
case 11: throw _d.sent();
|
|
192
|
+
case 12:
|
|
193
|
+
parsedBody = parsedOutput.body;
|
|
194
|
+
throwDefaultError({
|
|
195
|
+
output: output,
|
|
196
|
+
parsedBody: parsedBody,
|
|
197
|
+
exceptionCtor: __BaseException,
|
|
198
|
+
errorCode: errorCode,
|
|
199
|
+
});
|
|
200
|
+
_d.label = 13;
|
|
201
|
+
case 13: return [2];
|
|
202
|
+
}
|
|
135
203
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
output,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
ShowSpeakerLabel: [
|
|
190
|
-
() => void 0 !== output.headers["x-amzn-transcribe-show-speaker-label"],
|
|
191
|
-
() => __parseBoolean(output.headers["x-amzn-transcribe-show-speaker-label"]),
|
|
192
|
-
],
|
|
193
|
-
EnableChannelIdentification: [
|
|
194
|
-
() => void 0 !== output.headers["x-amzn-transcribe-enable-channel-identification"],
|
|
195
|
-
() => __parseBoolean(output.headers["x-amzn-transcribe-enable-channel-identification"]),
|
|
196
|
-
],
|
|
197
|
-
NumberOfChannels: [
|
|
198
|
-
() => void 0 !== output.headers["x-amzn-transcribe-number-of-channels"],
|
|
199
|
-
() => __strictParseInt32(output.headers["x-amzn-transcribe-number-of-channels"]),
|
|
200
|
-
],
|
|
201
|
-
EnablePartialResultsStabilization: [
|
|
202
|
-
() => void 0 !== output.headers["x-amzn-transcribe-enable-partial-results-stabilization"],
|
|
203
|
-
() => __parseBoolean(output.headers["x-amzn-transcribe-enable-partial-results-stabilization"]),
|
|
204
|
-
],
|
|
205
|
-
PartialResultsStability: [, output.headers["x-amzn-transcribe-partial-results-stability"]],
|
|
206
|
-
ContentIdentificationType: [, output.headers["x-amzn-transcribe-content-identification-type"]],
|
|
207
|
-
ContentRedactionType: [, output.headers["x-amzn-transcribe-content-redaction-type"]],
|
|
208
|
-
PiiEntityTypes: [, output.headers["x-amzn-transcribe-pii-entity-types"]],
|
|
209
|
-
LanguageModelName: [, output.headers["x-amzn-transcribe-language-model-name"]],
|
|
210
|
-
IdentifyLanguage: [
|
|
211
|
-
() => void 0 !== output.headers["x-amzn-transcribe-identify-language"],
|
|
212
|
-
() => __parseBoolean(output.headers["x-amzn-transcribe-identify-language"]),
|
|
213
|
-
],
|
|
214
|
-
LanguageOptions: [, output.headers["x-amzn-transcribe-language-options"]],
|
|
215
|
-
PreferredLanguage: [, output.headers["x-amzn-transcribe-preferred-language"]],
|
|
216
|
-
VocabularyNames: [, output.headers["x-amzn-transcribe-vocabulary-names"]],
|
|
217
|
-
VocabularyFilterNames: [, output.headers["x-amzn-transcribe-vocabulary-filter-names"]],
|
|
204
|
+
}); };
|
|
205
|
+
export var deserializeAws_restJson1StartStreamTranscriptionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
206
|
+
var contents, data;
|
|
207
|
+
return __generator(this, function (_a) {
|
|
208
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
209
|
+
return [2, deserializeAws_restJson1StartStreamTranscriptionCommandError(output, context)];
|
|
210
|
+
}
|
|
211
|
+
contents = map({
|
|
212
|
+
$metadata: deserializeMetadata(output),
|
|
213
|
+
RequestId: [, output.headers["x-amzn-request-id"]],
|
|
214
|
+
LanguageCode: [, output.headers["x-amzn-transcribe-language-code"]],
|
|
215
|
+
MediaSampleRateHertz: [
|
|
216
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-sample-rate"]; },
|
|
217
|
+
function () { return __strictParseInt32(output.headers["x-amzn-transcribe-sample-rate"]); },
|
|
218
|
+
],
|
|
219
|
+
MediaEncoding: [, output.headers["x-amzn-transcribe-media-encoding"]],
|
|
220
|
+
VocabularyName: [, output.headers["x-amzn-transcribe-vocabulary-name"]],
|
|
221
|
+
SessionId: [, output.headers["x-amzn-transcribe-session-id"]],
|
|
222
|
+
VocabularyFilterName: [, output.headers["x-amzn-transcribe-vocabulary-filter-name"]],
|
|
223
|
+
VocabularyFilterMethod: [, output.headers["x-amzn-transcribe-vocabulary-filter-method"]],
|
|
224
|
+
ShowSpeakerLabel: [
|
|
225
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-show-speaker-label"]; },
|
|
226
|
+
function () { return __parseBoolean(output.headers["x-amzn-transcribe-show-speaker-label"]); },
|
|
227
|
+
],
|
|
228
|
+
EnableChannelIdentification: [
|
|
229
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-enable-channel-identification"]; },
|
|
230
|
+
function () { return __parseBoolean(output.headers["x-amzn-transcribe-enable-channel-identification"]); },
|
|
231
|
+
],
|
|
232
|
+
NumberOfChannels: [
|
|
233
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-number-of-channels"]; },
|
|
234
|
+
function () { return __strictParseInt32(output.headers["x-amzn-transcribe-number-of-channels"]); },
|
|
235
|
+
],
|
|
236
|
+
EnablePartialResultsStabilization: [
|
|
237
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-enable-partial-results-stabilization"]; },
|
|
238
|
+
function () { return __parseBoolean(output.headers["x-amzn-transcribe-enable-partial-results-stabilization"]); },
|
|
239
|
+
],
|
|
240
|
+
PartialResultsStability: [, output.headers["x-amzn-transcribe-partial-results-stability"]],
|
|
241
|
+
ContentIdentificationType: [, output.headers["x-amzn-transcribe-content-identification-type"]],
|
|
242
|
+
ContentRedactionType: [, output.headers["x-amzn-transcribe-content-redaction-type"]],
|
|
243
|
+
PiiEntityTypes: [, output.headers["x-amzn-transcribe-pii-entity-types"]],
|
|
244
|
+
LanguageModelName: [, output.headers["x-amzn-transcribe-language-model-name"]],
|
|
245
|
+
IdentifyLanguage: [
|
|
246
|
+
function () { return void 0 !== output.headers["x-amzn-transcribe-identify-language"]; },
|
|
247
|
+
function () { return __parseBoolean(output.headers["x-amzn-transcribe-identify-language"]); },
|
|
248
|
+
],
|
|
249
|
+
LanguageOptions: [, output.headers["x-amzn-transcribe-language-options"]],
|
|
250
|
+
PreferredLanguage: [, output.headers["x-amzn-transcribe-preferred-language"]],
|
|
251
|
+
VocabularyNames: [, output.headers["x-amzn-transcribe-vocabulary-names"]],
|
|
252
|
+
VocabularyFilterNames: [, output.headers["x-amzn-transcribe-vocabulary-filter-names"]],
|
|
253
|
+
});
|
|
254
|
+
data = output.body;
|
|
255
|
+
contents.TranscriptResultStream = deserializeAws_restJson1TranscriptResultStream(data, context);
|
|
256
|
+
return [2, contents];
|
|
218
257
|
});
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
258
|
+
}); };
|
|
259
|
+
var deserializeAws_restJson1StartStreamTranscriptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
260
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
261
|
+
var _c;
|
|
262
|
+
return __generator(this, function (_d) {
|
|
263
|
+
switch (_d.label) {
|
|
264
|
+
case 0:
|
|
265
|
+
_a = [__assign({}, output)];
|
|
266
|
+
_c = {};
|
|
267
|
+
return [4, parseErrorBody(output.body, context)];
|
|
268
|
+
case 1:
|
|
269
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
270
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
271
|
+
_b = errorCode;
|
|
272
|
+
switch (_b) {
|
|
273
|
+
case "BadRequestException": return [3, 2];
|
|
274
|
+
case "com.amazonaws.transcribestreaming#BadRequestException": return [3, 2];
|
|
275
|
+
case "ConflictException": return [3, 4];
|
|
276
|
+
case "com.amazonaws.transcribestreaming#ConflictException": return [3, 4];
|
|
277
|
+
case "InternalFailureException": return [3, 6];
|
|
278
|
+
case "com.amazonaws.transcribestreaming#InternalFailureException": return [3, 6];
|
|
279
|
+
case "LimitExceededException": return [3, 8];
|
|
280
|
+
case "com.amazonaws.transcribestreaming#LimitExceededException": return [3, 8];
|
|
281
|
+
case "ServiceUnavailableException": return [3, 10];
|
|
282
|
+
case "com.amazonaws.transcribestreaming#ServiceUnavailableException": return [3, 10];
|
|
283
|
+
}
|
|
284
|
+
return [3, 12];
|
|
285
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
286
|
+
case 3: throw _d.sent();
|
|
287
|
+
case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
288
|
+
case 5: throw _d.sent();
|
|
289
|
+
case 6: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
290
|
+
case 7: throw _d.sent();
|
|
291
|
+
case 8: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
292
|
+
case 9: throw _d.sent();
|
|
293
|
+
case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
294
|
+
case 11: throw _d.sent();
|
|
295
|
+
case 12:
|
|
296
|
+
parsedBody = parsedOutput.body;
|
|
297
|
+
throwDefaultError({
|
|
298
|
+
output: output,
|
|
299
|
+
parsedBody: parsedBody,
|
|
300
|
+
exceptionCtor: __BaseException,
|
|
301
|
+
errorCode: errorCode,
|
|
302
|
+
});
|
|
303
|
+
_d.label = 13;
|
|
304
|
+
case 13: return [2];
|
|
305
|
+
}
|
|
265
306
|
});
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
307
|
+
}); };
|
|
308
|
+
var map = __map;
|
|
309
|
+
var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
310
|
+
var contents, data, exception;
|
|
311
|
+
return __generator(this, function (_a) {
|
|
312
|
+
contents = map({});
|
|
313
|
+
data = parsedOutput.body;
|
|
314
|
+
if (data.Message != null) {
|
|
315
|
+
contents.Message = __expectString(data.Message);
|
|
316
|
+
}
|
|
317
|
+
exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
318
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
277
319
|
});
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
288
|
-
|
|
320
|
+
}); };
|
|
321
|
+
var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
322
|
+
var contents, data, exception;
|
|
323
|
+
return __generator(this, function (_a) {
|
|
324
|
+
contents = map({});
|
|
325
|
+
data = parsedOutput.body;
|
|
326
|
+
if (data.Message != null) {
|
|
327
|
+
contents.Message = __expectString(data.Message);
|
|
328
|
+
}
|
|
329
|
+
exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
330
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
289
331
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
300
|
-
|
|
332
|
+
}); };
|
|
333
|
+
var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
334
|
+
var contents, data, exception;
|
|
335
|
+
return __generator(this, function (_a) {
|
|
336
|
+
contents = map({});
|
|
337
|
+
data = parsedOutput.body;
|
|
338
|
+
if (data.Message != null) {
|
|
339
|
+
contents.Message = __expectString(data.Message);
|
|
340
|
+
}
|
|
341
|
+
exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
342
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
301
343
|
});
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
312
|
-
|
|
344
|
+
}); };
|
|
345
|
+
var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
346
|
+
var contents, data, exception;
|
|
347
|
+
return __generator(this, function (_a) {
|
|
348
|
+
contents = map({});
|
|
349
|
+
data = parsedOutput.body;
|
|
350
|
+
if (data.Message != null) {
|
|
351
|
+
contents.Message = __expectString(data.Message);
|
|
352
|
+
}
|
|
353
|
+
exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
354
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
313
355
|
});
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
356
|
+
}); };
|
|
357
|
+
var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
358
|
+
var contents, data, exception;
|
|
359
|
+
return __generator(this, function (_a) {
|
|
360
|
+
contents = map({});
|
|
361
|
+
data = parsedOutput.body;
|
|
362
|
+
if (data.Message != null) {
|
|
363
|
+
contents.Message = __expectString(data.Message);
|
|
364
|
+
}
|
|
365
|
+
exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
366
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
320
367
|
});
|
|
368
|
+
}); };
|
|
369
|
+
var serializeAws_restJson1AudioStream = function (input, context) {
|
|
370
|
+
var eventMarshallingVisitor = function (event) {
|
|
371
|
+
return AudioStream.visit(event, {
|
|
372
|
+
AudioEvent: function (value) { return serializeAws_restJson1AudioEvent_event(value, context); },
|
|
373
|
+
_: function (value) { return value; },
|
|
374
|
+
});
|
|
375
|
+
};
|
|
321
376
|
return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
|
|
322
377
|
};
|
|
323
|
-
|
|
324
|
-
|
|
378
|
+
var serializeAws_restJson1AudioEvent_event = function (input, context) {
|
|
379
|
+
var headers = {
|
|
325
380
|
":event-type": { type: "string", value: "AudioEvent" },
|
|
326
381
|
":message-type": { type: "string", value: "event" },
|
|
327
382
|
":content-type": { type: "string", value: "application/octet-stream" },
|
|
328
383
|
};
|
|
329
|
-
|
|
384
|
+
var body = new Uint8Array();
|
|
330
385
|
if (input.AudioChunk != null) {
|
|
331
386
|
body = input.AudioChunk;
|
|
332
387
|
}
|
|
333
|
-
return { headers, body };
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
return context.eventStreamMarshaller.deserialize(output,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
388
|
+
return { headers: headers, body: body };
|
|
389
|
+
};
|
|
390
|
+
var deserializeAws_restJson1MedicalTranscriptResultStream = function (output, context) {
|
|
391
|
+
return context.eventStreamMarshaller.deserialize(output, function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
392
|
+
var _a, _b, _c, _d, _e, _f;
|
|
393
|
+
return __generator(this, function (_g) {
|
|
394
|
+
switch (_g.label) {
|
|
395
|
+
case 0:
|
|
396
|
+
if (!(event["TranscriptEvent"] != null)) return [3, 2];
|
|
397
|
+
_a = {};
|
|
398
|
+
return [4, deserializeAws_restJson1MedicalTranscriptEvent_event(event["TranscriptEvent"], context)];
|
|
399
|
+
case 1: return [2, (_a.TranscriptEvent = _g.sent(),
|
|
400
|
+
_a)];
|
|
401
|
+
case 2:
|
|
402
|
+
if (!(event["BadRequestException"] != null)) return [3, 4];
|
|
403
|
+
_b = {};
|
|
404
|
+
return [4, deserializeAws_restJson1BadRequestException_event(event["BadRequestException"], context)];
|
|
405
|
+
case 3: return [2, (_b.BadRequestException = _g.sent(),
|
|
406
|
+
_b)];
|
|
407
|
+
case 4:
|
|
408
|
+
if (!(event["LimitExceededException"] != null)) return [3, 6];
|
|
409
|
+
_c = {};
|
|
410
|
+
return [4, deserializeAws_restJson1LimitExceededException_event(event["LimitExceededException"], context)];
|
|
411
|
+
case 5: return [2, (_c.LimitExceededException = _g.sent(),
|
|
412
|
+
_c)];
|
|
413
|
+
case 6:
|
|
414
|
+
if (!(event["InternalFailureException"] != null)) return [3, 8];
|
|
415
|
+
_d = {};
|
|
416
|
+
return [4, deserializeAws_restJson1InternalFailureException_event(event["InternalFailureException"], context)];
|
|
417
|
+
case 7: return [2, (_d.InternalFailureException = _g.sent(),
|
|
418
|
+
_d)];
|
|
419
|
+
case 8:
|
|
420
|
+
if (!(event["ConflictException"] != null)) return [3, 10];
|
|
421
|
+
_e = {};
|
|
422
|
+
return [4, deserializeAws_restJson1ConflictException_event(event["ConflictException"], context)];
|
|
423
|
+
case 9: return [2, (_e.ConflictException = _g.sent(),
|
|
424
|
+
_e)];
|
|
425
|
+
case 10:
|
|
426
|
+
if (!(event["ServiceUnavailableException"] != null)) return [3, 12];
|
|
427
|
+
_f = {};
|
|
428
|
+
return [4, deserializeAws_restJson1ServiceUnavailableException_event(event["ServiceUnavailableException"], context)];
|
|
429
|
+
case 11: return [2, (_f.ServiceUnavailableException = _g.sent(),
|
|
430
|
+
_f)];
|
|
431
|
+
case 12: return [2, { $unknown: output }];
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}); });
|
|
435
|
+
};
|
|
436
|
+
var deserializeAws_restJson1TranscriptResultStream = function (output, context) {
|
|
437
|
+
return context.eventStreamMarshaller.deserialize(output, function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
438
|
+
var _a, _b, _c, _d, _e, _f;
|
|
439
|
+
return __generator(this, function (_g) {
|
|
440
|
+
switch (_g.label) {
|
|
441
|
+
case 0:
|
|
442
|
+
if (!(event["TranscriptEvent"] != null)) return [3, 2];
|
|
443
|
+
_a = {};
|
|
444
|
+
return [4, deserializeAws_restJson1TranscriptEvent_event(event["TranscriptEvent"], context)];
|
|
445
|
+
case 1: return [2, (_a.TranscriptEvent = _g.sent(),
|
|
446
|
+
_a)];
|
|
447
|
+
case 2:
|
|
448
|
+
if (!(event["BadRequestException"] != null)) return [3, 4];
|
|
449
|
+
_b = {};
|
|
450
|
+
return [4, deserializeAws_restJson1BadRequestException_event(event["BadRequestException"], context)];
|
|
451
|
+
case 3: return [2, (_b.BadRequestException = _g.sent(),
|
|
452
|
+
_b)];
|
|
453
|
+
case 4:
|
|
454
|
+
if (!(event["LimitExceededException"] != null)) return [3, 6];
|
|
455
|
+
_c = {};
|
|
456
|
+
return [4, deserializeAws_restJson1LimitExceededException_event(event["LimitExceededException"], context)];
|
|
457
|
+
case 5: return [2, (_c.LimitExceededException = _g.sent(),
|
|
458
|
+
_c)];
|
|
459
|
+
case 6:
|
|
460
|
+
if (!(event["InternalFailureException"] != null)) return [3, 8];
|
|
461
|
+
_d = {};
|
|
462
|
+
return [4, deserializeAws_restJson1InternalFailureException_event(event["InternalFailureException"], context)];
|
|
463
|
+
case 7: return [2, (_d.InternalFailureException = _g.sent(),
|
|
464
|
+
_d)];
|
|
465
|
+
case 8:
|
|
466
|
+
if (!(event["ConflictException"] != null)) return [3, 10];
|
|
467
|
+
_e = {};
|
|
468
|
+
return [4, deserializeAws_restJson1ConflictException_event(event["ConflictException"], context)];
|
|
469
|
+
case 9: return [2, (_e.ConflictException = _g.sent(),
|
|
470
|
+
_e)];
|
|
471
|
+
case 10:
|
|
472
|
+
if (!(event["ServiceUnavailableException"] != null)) return [3, 12];
|
|
473
|
+
_f = {};
|
|
474
|
+
return [4, deserializeAws_restJson1ServiceUnavailableException_event(event["ServiceUnavailableException"], context)];
|
|
475
|
+
case 11: return [2, (_f.ServiceUnavailableException = _g.sent(),
|
|
476
|
+
_f)];
|
|
477
|
+
case 12: return [2, { $unknown: output }];
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
}); });
|
|
481
|
+
};
|
|
482
|
+
var deserializeAws_restJson1BadRequestException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
483
|
+
var parsedOutput, _a;
|
|
484
|
+
var _b;
|
|
485
|
+
return __generator(this, function (_c) {
|
|
486
|
+
switch (_c.label) {
|
|
487
|
+
case 0:
|
|
488
|
+
_a = [__assign({}, output)];
|
|
489
|
+
_b = {};
|
|
490
|
+
return [4, parseBody(output.body, context)];
|
|
491
|
+
case 1:
|
|
492
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
493
|
+
return [2, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
494
|
+
}
|
|
368
495
|
});
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
return {
|
|
384
|
-
LimitExceededException: await deserializeAws_restJson1LimitExceededException_event(event["LimitExceededException"], context),
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
if (event["InternalFailureException"] != null) {
|
|
388
|
-
return {
|
|
389
|
-
InternalFailureException: await deserializeAws_restJson1InternalFailureException_event(event["InternalFailureException"], context),
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
if (event["ConflictException"] != null) {
|
|
393
|
-
return {
|
|
394
|
-
ConflictException: await deserializeAws_restJson1ConflictException_event(event["ConflictException"], context),
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
if (event["ServiceUnavailableException"] != null) {
|
|
398
|
-
return {
|
|
399
|
-
ServiceUnavailableException: await deserializeAws_restJson1ServiceUnavailableException_event(event["ServiceUnavailableException"], context),
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
return { $unknown: output };
|
|
496
|
+
}); };
|
|
497
|
+
var deserializeAws_restJson1ConflictException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
498
|
+
var parsedOutput, _a;
|
|
499
|
+
var _b;
|
|
500
|
+
return __generator(this, function (_c) {
|
|
501
|
+
switch (_c.label) {
|
|
502
|
+
case 0:
|
|
503
|
+
_a = [__assign({}, output)];
|
|
504
|
+
_b = {};
|
|
505
|
+
return [4, parseBody(output.body, context)];
|
|
506
|
+
case 1:
|
|
507
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
508
|
+
return [2, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
509
|
+
}
|
|
403
510
|
});
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
return
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
511
|
+
}); };
|
|
512
|
+
var deserializeAws_restJson1InternalFailureException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
513
|
+
var parsedOutput, _a;
|
|
514
|
+
var _b;
|
|
515
|
+
return __generator(this, function (_c) {
|
|
516
|
+
switch (_c.label) {
|
|
517
|
+
case 0:
|
|
518
|
+
_a = [__assign({}, output)];
|
|
519
|
+
_b = {};
|
|
520
|
+
return [4, parseBody(output.body, context)];
|
|
521
|
+
case 1:
|
|
522
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
523
|
+
return [2, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
}); };
|
|
527
|
+
var deserializeAws_restJson1LimitExceededException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
528
|
+
var parsedOutput, _a;
|
|
529
|
+
var _b;
|
|
530
|
+
return __generator(this, function (_c) {
|
|
531
|
+
switch (_c.label) {
|
|
532
|
+
case 0:
|
|
533
|
+
_a = [__assign({}, output)];
|
|
534
|
+
_b = {};
|
|
535
|
+
return [4, parseBody(output.body, context)];
|
|
536
|
+
case 1:
|
|
537
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
538
|
+
return [2, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}); };
|
|
542
|
+
var deserializeAws_restJson1MedicalTranscriptEvent_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
543
|
+
var contents, data;
|
|
544
|
+
return __generator(this, function (_a) {
|
|
545
|
+
switch (_a.label) {
|
|
546
|
+
case 0:
|
|
547
|
+
contents = {};
|
|
548
|
+
return [4, parseBody(output.body, context)];
|
|
549
|
+
case 1:
|
|
550
|
+
data = _a.sent();
|
|
551
|
+
Object.assign(contents, deserializeAws_restJson1MedicalTranscriptEvent(data, context));
|
|
552
|
+
return [2, contents];
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
}); };
|
|
556
|
+
var deserializeAws_restJson1ServiceUnavailableException_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
557
|
+
var parsedOutput, _a;
|
|
558
|
+
var _b;
|
|
559
|
+
return __generator(this, function (_c) {
|
|
560
|
+
switch (_c.label) {
|
|
561
|
+
case 0:
|
|
562
|
+
_a = [__assign({}, output)];
|
|
563
|
+
_b = {};
|
|
564
|
+
return [4, parseBody(output.body, context)];
|
|
565
|
+
case 1:
|
|
566
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
|
|
567
|
+
return [2, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
}); };
|
|
571
|
+
var deserializeAws_restJson1TranscriptEvent_event = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
572
|
+
var contents, data;
|
|
573
|
+
return __generator(this, function (_a) {
|
|
574
|
+
switch (_a.label) {
|
|
575
|
+
case 0:
|
|
576
|
+
contents = {};
|
|
577
|
+
return [4, parseBody(output.body, context)];
|
|
578
|
+
case 1:
|
|
579
|
+
data = _a.sent();
|
|
580
|
+
Object.assign(contents, deserializeAws_restJson1TranscriptEvent(data, context));
|
|
581
|
+
return [2, contents];
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
}); };
|
|
585
|
+
var deserializeAws_restJson1Alternative = function (output, context) {
|
|
453
586
|
return {
|
|
454
587
|
Entities: output.Entities != null ? deserializeAws_restJson1EntityList(output.Entities, context) : undefined,
|
|
455
588
|
Items: output.Items != null ? deserializeAws_restJson1ItemList(output.Items, context) : undefined,
|
|
456
589
|
Transcript: __expectString(output.Transcript),
|
|
457
590
|
};
|
|
458
591
|
};
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
.filter((e)
|
|
462
|
-
.map((entry)
|
|
592
|
+
var deserializeAws_restJson1AlternativeList = function (output, context) {
|
|
593
|
+
var retVal = (output || [])
|
|
594
|
+
.filter(function (e) { return e != null; })
|
|
595
|
+
.map(function (entry) {
|
|
463
596
|
if (entry === null) {
|
|
464
597
|
return null;
|
|
465
598
|
}
|
|
@@ -467,7 +600,7 @@ const deserializeAws_restJson1AlternativeList = (output, context) => {
|
|
|
467
600
|
});
|
|
468
601
|
return retVal;
|
|
469
602
|
};
|
|
470
|
-
|
|
603
|
+
var deserializeAws_restJson1Entity = function (output, context) {
|
|
471
604
|
return {
|
|
472
605
|
Category: __expectString(output.Category),
|
|
473
606
|
Confidence: __limitedParseDouble(output.Confidence),
|
|
@@ -477,10 +610,10 @@ const deserializeAws_restJson1Entity = (output, context) => {
|
|
|
477
610
|
Type: __expectString(output.Type),
|
|
478
611
|
};
|
|
479
612
|
};
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
.filter((e)
|
|
483
|
-
.map((entry)
|
|
613
|
+
var deserializeAws_restJson1EntityList = function (output, context) {
|
|
614
|
+
var retVal = (output || [])
|
|
615
|
+
.filter(function (e) { return e != null; })
|
|
616
|
+
.map(function (entry) {
|
|
484
617
|
if (entry === null) {
|
|
485
618
|
return null;
|
|
486
619
|
}
|
|
@@ -488,7 +621,7 @@ const deserializeAws_restJson1EntityList = (output, context) => {
|
|
|
488
621
|
});
|
|
489
622
|
return retVal;
|
|
490
623
|
};
|
|
491
|
-
|
|
624
|
+
var deserializeAws_restJson1Item = function (output, context) {
|
|
492
625
|
return {
|
|
493
626
|
Confidence: __limitedParseDouble(output.Confidence),
|
|
494
627
|
Content: __expectString(output.Content),
|
|
@@ -500,10 +633,10 @@ const deserializeAws_restJson1Item = (output, context) => {
|
|
|
500
633
|
VocabularyFilterMatch: __expectBoolean(output.VocabularyFilterMatch),
|
|
501
634
|
};
|
|
502
635
|
};
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
.filter((e)
|
|
506
|
-
.map((entry)
|
|
636
|
+
var deserializeAws_restJson1ItemList = function (output, context) {
|
|
637
|
+
var retVal = (output || [])
|
|
638
|
+
.filter(function (e) { return e != null; })
|
|
639
|
+
.map(function (entry) {
|
|
507
640
|
if (entry === null) {
|
|
508
641
|
return null;
|
|
509
642
|
}
|
|
@@ -511,10 +644,10 @@ const deserializeAws_restJson1ItemList = (output, context) => {
|
|
|
511
644
|
});
|
|
512
645
|
return retVal;
|
|
513
646
|
};
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
.filter((e)
|
|
517
|
-
.map((entry)
|
|
647
|
+
var deserializeAws_restJson1LanguageIdentification = function (output, context) {
|
|
648
|
+
var retVal = (output || [])
|
|
649
|
+
.filter(function (e) { return e != null; })
|
|
650
|
+
.map(function (entry) {
|
|
518
651
|
if (entry === null) {
|
|
519
652
|
return null;
|
|
520
653
|
}
|
|
@@ -522,23 +655,23 @@ const deserializeAws_restJson1LanguageIdentification = (output, context) => {
|
|
|
522
655
|
});
|
|
523
656
|
return retVal;
|
|
524
657
|
};
|
|
525
|
-
|
|
658
|
+
var deserializeAws_restJson1LanguageWithScore = function (output, context) {
|
|
526
659
|
return {
|
|
527
660
|
LanguageCode: __expectString(output.LanguageCode),
|
|
528
661
|
Score: __limitedParseDouble(output.Score),
|
|
529
662
|
};
|
|
530
663
|
};
|
|
531
|
-
|
|
664
|
+
var deserializeAws_restJson1MedicalAlternative = function (output, context) {
|
|
532
665
|
return {
|
|
533
666
|
Entities: output.Entities != null ? deserializeAws_restJson1MedicalEntityList(output.Entities, context) : undefined,
|
|
534
667
|
Items: output.Items != null ? deserializeAws_restJson1MedicalItemList(output.Items, context) : undefined,
|
|
535
668
|
Transcript: __expectString(output.Transcript),
|
|
536
669
|
};
|
|
537
670
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
.filter((e)
|
|
541
|
-
.map((entry)
|
|
671
|
+
var deserializeAws_restJson1MedicalAlternativeList = function (output, context) {
|
|
672
|
+
var retVal = (output || [])
|
|
673
|
+
.filter(function (e) { return e != null; })
|
|
674
|
+
.map(function (entry) {
|
|
542
675
|
if (entry === null) {
|
|
543
676
|
return null;
|
|
544
677
|
}
|
|
@@ -546,7 +679,7 @@ const deserializeAws_restJson1MedicalAlternativeList = (output, context) => {
|
|
|
546
679
|
});
|
|
547
680
|
return retVal;
|
|
548
681
|
};
|
|
549
|
-
|
|
682
|
+
var deserializeAws_restJson1MedicalEntity = function (output, context) {
|
|
550
683
|
return {
|
|
551
684
|
Category: __expectString(output.Category),
|
|
552
685
|
Confidence: __limitedParseDouble(output.Confidence),
|
|
@@ -555,10 +688,10 @@ const deserializeAws_restJson1MedicalEntity = (output, context) => {
|
|
|
555
688
|
StartTime: __limitedParseDouble(output.StartTime),
|
|
556
689
|
};
|
|
557
690
|
};
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
.filter((e)
|
|
561
|
-
.map((entry)
|
|
691
|
+
var deserializeAws_restJson1MedicalEntityList = function (output, context) {
|
|
692
|
+
var retVal = (output || [])
|
|
693
|
+
.filter(function (e) { return e != null; })
|
|
694
|
+
.map(function (entry) {
|
|
562
695
|
if (entry === null) {
|
|
563
696
|
return null;
|
|
564
697
|
}
|
|
@@ -566,7 +699,7 @@ const deserializeAws_restJson1MedicalEntityList = (output, context) => {
|
|
|
566
699
|
});
|
|
567
700
|
return retVal;
|
|
568
701
|
};
|
|
569
|
-
|
|
702
|
+
var deserializeAws_restJson1MedicalItem = function (output, context) {
|
|
570
703
|
return {
|
|
571
704
|
Confidence: __limitedParseDouble(output.Confidence),
|
|
572
705
|
Content: __expectString(output.Content),
|
|
@@ -576,10 +709,10 @@ const deserializeAws_restJson1MedicalItem = (output, context) => {
|
|
|
576
709
|
Type: __expectString(output.Type),
|
|
577
710
|
};
|
|
578
711
|
};
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
.filter((e)
|
|
582
|
-
.map((entry)
|
|
712
|
+
var deserializeAws_restJson1MedicalItemList = function (output, context) {
|
|
713
|
+
var retVal = (output || [])
|
|
714
|
+
.filter(function (e) { return e != null; })
|
|
715
|
+
.map(function (entry) {
|
|
583
716
|
if (entry === null) {
|
|
584
717
|
return null;
|
|
585
718
|
}
|
|
@@ -587,7 +720,7 @@ const deserializeAws_restJson1MedicalItemList = (output, context) => {
|
|
|
587
720
|
});
|
|
588
721
|
return retVal;
|
|
589
722
|
};
|
|
590
|
-
|
|
723
|
+
var deserializeAws_restJson1MedicalResult = function (output, context) {
|
|
591
724
|
return {
|
|
592
725
|
Alternatives: output.Alternatives != null
|
|
593
726
|
? deserializeAws_restJson1MedicalAlternativeList(output.Alternatives, context)
|
|
@@ -599,10 +732,10 @@ const deserializeAws_restJson1MedicalResult = (output, context) => {
|
|
|
599
732
|
StartTime: __limitedParseDouble(output.StartTime),
|
|
600
733
|
};
|
|
601
734
|
};
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
.filter((e)
|
|
605
|
-
.map((entry)
|
|
735
|
+
var deserializeAws_restJson1MedicalResultList = function (output, context) {
|
|
736
|
+
var retVal = (output || [])
|
|
737
|
+
.filter(function (e) { return e != null; })
|
|
738
|
+
.map(function (entry) {
|
|
606
739
|
if (entry === null) {
|
|
607
740
|
return null;
|
|
608
741
|
}
|
|
@@ -610,17 +743,17 @@ const deserializeAws_restJson1MedicalResultList = (output, context) => {
|
|
|
610
743
|
});
|
|
611
744
|
return retVal;
|
|
612
745
|
};
|
|
613
|
-
|
|
746
|
+
var deserializeAws_restJson1MedicalTranscript = function (output, context) {
|
|
614
747
|
return {
|
|
615
748
|
Results: output.Results != null ? deserializeAws_restJson1MedicalResultList(output.Results, context) : undefined,
|
|
616
749
|
};
|
|
617
750
|
};
|
|
618
|
-
|
|
751
|
+
var deserializeAws_restJson1MedicalTranscriptEvent = function (output, context) {
|
|
619
752
|
return {
|
|
620
753
|
Transcript: output.Transcript != null ? deserializeAws_restJson1MedicalTranscript(output.Transcript, context) : undefined,
|
|
621
754
|
};
|
|
622
755
|
};
|
|
623
|
-
|
|
756
|
+
var deserializeAws_restJson1Result = function (output, context) {
|
|
624
757
|
return {
|
|
625
758
|
Alternatives: output.Alternatives != null ? deserializeAws_restJson1AlternativeList(output.Alternatives, context) : undefined,
|
|
626
759
|
ChannelId: __expectString(output.ChannelId),
|
|
@@ -634,10 +767,10 @@ const deserializeAws_restJson1Result = (output, context) => {
|
|
|
634
767
|
StartTime: __limitedParseDouble(output.StartTime),
|
|
635
768
|
};
|
|
636
769
|
};
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
.filter((e)
|
|
640
|
-
.map((entry)
|
|
770
|
+
var deserializeAws_restJson1ResultList = function (output, context) {
|
|
771
|
+
var retVal = (output || [])
|
|
772
|
+
.filter(function (e) { return e != null; })
|
|
773
|
+
.map(function (entry) {
|
|
641
774
|
if (entry === null) {
|
|
642
775
|
return null;
|
|
643
776
|
}
|
|
@@ -645,49 +778,67 @@ const deserializeAws_restJson1ResultList = (output, context) => {
|
|
|
645
778
|
});
|
|
646
779
|
return retVal;
|
|
647
780
|
};
|
|
648
|
-
|
|
781
|
+
var deserializeAws_restJson1Transcript = function (output, context) {
|
|
649
782
|
return {
|
|
650
783
|
Results: output.Results != null ? deserializeAws_restJson1ResultList(output.Results, context) : undefined,
|
|
651
784
|
};
|
|
652
785
|
};
|
|
653
|
-
|
|
786
|
+
var deserializeAws_restJson1TranscriptEvent = function (output, context) {
|
|
654
787
|
return {
|
|
655
788
|
Transcript: output.Transcript != null ? deserializeAws_restJson1Transcript(output.Transcript, context) : undefined,
|
|
656
789
|
};
|
|
657
790
|
};
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
791
|
+
var deserializeMetadata = function (output) {
|
|
792
|
+
var _a, _b;
|
|
793
|
+
return ({
|
|
794
|
+
httpStatusCode: output.statusCode,
|
|
795
|
+
requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
|
|
796
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
797
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
798
|
+
});
|
|
799
|
+
};
|
|
800
|
+
var collectBody = function (streamBody, context) {
|
|
801
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
665
802
|
if (streamBody instanceof Uint8Array) {
|
|
666
803
|
return Promise.resolve(streamBody);
|
|
667
804
|
}
|
|
668
805
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
669
806
|
};
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
807
|
+
var collectBodyString = function (streamBody, context) {
|
|
808
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
809
|
+
};
|
|
810
|
+
var isSerializableHeaderValue = function (value) {
|
|
811
|
+
return value !== undefined &&
|
|
812
|
+
value !== null &&
|
|
813
|
+
value !== "" &&
|
|
814
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
815
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
816
|
+
};
|
|
817
|
+
var parseBody = function (streamBody, context) {
|
|
818
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
819
|
+
if (encoded.length) {
|
|
820
|
+
return JSON.parse(encoded);
|
|
821
|
+
}
|
|
822
|
+
return {};
|
|
823
|
+
});
|
|
824
|
+
};
|
|
825
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
826
|
+
var value;
|
|
827
|
+
var _a;
|
|
828
|
+
return __generator(this, function (_b) {
|
|
829
|
+
switch (_b.label) {
|
|
830
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
831
|
+
case 1:
|
|
832
|
+
value = _b.sent();
|
|
833
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
834
|
+
return [2, value];
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
}); };
|
|
838
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
839
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
840
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
841
|
+
var cleanValue = rawValue;
|
|
691
842
|
if (typeof cleanValue === "number") {
|
|
692
843
|
cleanValue = cleanValue.toString();
|
|
693
844
|
}
|
|
@@ -702,7 +853,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
702
853
|
}
|
|
703
854
|
return cleanValue;
|
|
704
855
|
};
|
|
705
|
-
|
|
856
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
706
857
|
if (headerKey !== undefined) {
|
|
707
858
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
708
859
|
}
|