@aws-sdk/client-transcribe-streaming 3.141.0 → 3.150.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 CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.150.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.149.0...v3.150.0) (2022-08-15)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
9
+
10
+
11
+
12
+
13
+
14
+ # [3.145.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.144.0...v3.145.0) (2022-08-08)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
17
+
18
+
19
+
20
+
21
+
22
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
23
+
24
+
25
+ ### Features
26
+
27
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
34
 
8
35
  **Note:** Version bump only for package @aws-sdk/client-transcribe-streaming
@@ -7,31 +7,31 @@ const models_0_1 = require("../models/models_0");
7
7
  const TranscribeStreamingServiceException_1 = require("../models/TranscribeStreamingServiceException");
8
8
  const serializeAws_restJson1StartMedicalStreamTranscriptionCommand = async (input, context) => {
9
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
- const headers = {
11
- ...(isSerializableHeaderValue(input.LanguageCode) && { "x-amzn-transcribe-language-code": input.LanguageCode }),
12
- ...(isSerializableHeaderValue(input.MediaSampleRateHertz) && {
13
- "x-amzn-transcribe-sample-rate": input.MediaSampleRateHertz.toString(),
14
- }),
15
- ...(isSerializableHeaderValue(input.MediaEncoding) && { "x-amzn-transcribe-media-encoding": input.MediaEncoding }),
16
- ...(isSerializableHeaderValue(input.VocabularyName) && {
17
- "x-amzn-transcribe-vocabulary-name": input.VocabularyName,
18
- }),
19
- ...(isSerializableHeaderValue(input.Specialty) && { "x-amzn-transcribe-specialty": input.Specialty }),
20
- ...(isSerializableHeaderValue(input.Type) && { "x-amzn-transcribe-type": input.Type }),
21
- ...(isSerializableHeaderValue(input.ShowSpeakerLabel) && {
22
- "x-amzn-transcribe-show-speaker-label": input.ShowSpeakerLabel.toString(),
23
- }),
24
- ...(isSerializableHeaderValue(input.SessionId) && { "x-amzn-transcribe-session-id": input.SessionId }),
25
- ...(isSerializableHeaderValue(input.EnableChannelIdentification) && {
26
- "x-amzn-transcribe-enable-channel-identification": input.EnableChannelIdentification.toString(),
27
- }),
28
- ...(isSerializableHeaderValue(input.NumberOfChannels) && {
29
- "x-amzn-transcribe-number-of-channels": input.NumberOfChannels.toString(),
30
- }),
31
- ...(isSerializableHeaderValue(input.ContentIdentificationType) && {
32
- "x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
33
- }),
34
- };
10
+ const headers = map({}, isSerializableHeaderValue, {
11
+ "x-amzn-transcribe-language-code": input.LanguageCode,
12
+ "x-amzn-transcribe-sample-rate": [
13
+ () => isSerializableHeaderValue(input.MediaSampleRateHertz),
14
+ () => input.MediaSampleRateHertz.toString(),
15
+ ],
16
+ "x-amzn-transcribe-media-encoding": input.MediaEncoding,
17
+ "x-amzn-transcribe-vocabulary-name": input.VocabularyName,
18
+ "x-amzn-transcribe-specialty": input.Specialty,
19
+ "x-amzn-transcribe-type": input.Type,
20
+ "x-amzn-transcribe-show-speaker-label": [
21
+ () => isSerializableHeaderValue(input.ShowSpeakerLabel),
22
+ () => input.ShowSpeakerLabel.toString(),
23
+ ],
24
+ "x-amzn-transcribe-session-id": input.SessionId,
25
+ "x-amzn-transcribe-enable-channel-identification": [
26
+ () => isSerializableHeaderValue(input.EnableChannelIdentification),
27
+ () => input.EnableChannelIdentification.toString(),
28
+ ],
29
+ "x-amzn-transcribe-number-of-channels": [
30
+ () => isSerializableHeaderValue(input.NumberOfChannels),
31
+ () => input.NumberOfChannels.toString(),
32
+ ],
33
+ "x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
34
+ });
35
35
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/medical-stream-transcription";
36
36
  let body;
37
37
  if (input.AudioStream !== undefined) {
@@ -50,65 +50,47 @@ const serializeAws_restJson1StartMedicalStreamTranscriptionCommand = async (inpu
50
50
  exports.serializeAws_restJson1StartMedicalStreamTranscriptionCommand = serializeAws_restJson1StartMedicalStreamTranscriptionCommand;
51
51
  const serializeAws_restJson1StartStreamTranscriptionCommand = async (input, context) => {
52
52
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
53
- const headers = {
54
- ...(isSerializableHeaderValue(input.LanguageCode) && { "x-amzn-transcribe-language-code": input.LanguageCode }),
55
- ...(isSerializableHeaderValue(input.MediaSampleRateHertz) && {
56
- "x-amzn-transcribe-sample-rate": input.MediaSampleRateHertz.toString(),
57
- }),
58
- ...(isSerializableHeaderValue(input.MediaEncoding) && { "x-amzn-transcribe-media-encoding": input.MediaEncoding }),
59
- ...(isSerializableHeaderValue(input.VocabularyName) && {
60
- "x-amzn-transcribe-vocabulary-name": input.VocabularyName,
61
- }),
62
- ...(isSerializableHeaderValue(input.SessionId) && { "x-amzn-transcribe-session-id": input.SessionId }),
63
- ...(isSerializableHeaderValue(input.VocabularyFilterName) && {
64
- "x-amzn-transcribe-vocabulary-filter-name": input.VocabularyFilterName,
65
- }),
66
- ...(isSerializableHeaderValue(input.VocabularyFilterMethod) && {
67
- "x-amzn-transcribe-vocabulary-filter-method": input.VocabularyFilterMethod,
68
- }),
69
- ...(isSerializableHeaderValue(input.ShowSpeakerLabel) && {
70
- "x-amzn-transcribe-show-speaker-label": input.ShowSpeakerLabel.toString(),
71
- }),
72
- ...(isSerializableHeaderValue(input.EnableChannelIdentification) && {
73
- "x-amzn-transcribe-enable-channel-identification": input.EnableChannelIdentification.toString(),
74
- }),
75
- ...(isSerializableHeaderValue(input.NumberOfChannels) && {
76
- "x-amzn-transcribe-number-of-channels": input.NumberOfChannels.toString(),
77
- }),
78
- ...(isSerializableHeaderValue(input.EnablePartialResultsStabilization) && {
79
- "x-amzn-transcribe-enable-partial-results-stabilization": input.EnablePartialResultsStabilization.toString(),
80
- }),
81
- ...(isSerializableHeaderValue(input.PartialResultsStability) && {
82
- "x-amzn-transcribe-partial-results-stability": input.PartialResultsStability,
83
- }),
84
- ...(isSerializableHeaderValue(input.ContentIdentificationType) && {
85
- "x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
86
- }),
87
- ...(isSerializableHeaderValue(input.ContentRedactionType) && {
88
- "x-amzn-transcribe-content-redaction-type": input.ContentRedactionType,
89
- }),
90
- ...(isSerializableHeaderValue(input.PiiEntityTypes) && {
91
- "x-amzn-transcribe-pii-entity-types": input.PiiEntityTypes,
92
- }),
93
- ...(isSerializableHeaderValue(input.LanguageModelName) && {
94
- "x-amzn-transcribe-language-model-name": input.LanguageModelName,
95
- }),
96
- ...(isSerializableHeaderValue(input.IdentifyLanguage) && {
97
- "x-amzn-transcribe-identify-language": input.IdentifyLanguage.toString(),
98
- }),
99
- ...(isSerializableHeaderValue(input.LanguageOptions) && {
100
- "x-amzn-transcribe-language-options": input.LanguageOptions,
101
- }),
102
- ...(isSerializableHeaderValue(input.PreferredLanguage) && {
103
- "x-amzn-transcribe-preferred-language": input.PreferredLanguage,
104
- }),
105
- ...(isSerializableHeaderValue(input.VocabularyNames) && {
106
- "x-amzn-transcribe-vocabulary-names": input.VocabularyNames,
107
- }),
108
- ...(isSerializableHeaderValue(input.VocabularyFilterNames) && {
109
- "x-amzn-transcribe-vocabulary-filter-names": input.VocabularyFilterNames,
110
- }),
111
- };
53
+ const headers = map({}, isSerializableHeaderValue, {
54
+ "x-amzn-transcribe-language-code": input.LanguageCode,
55
+ "x-amzn-transcribe-sample-rate": [
56
+ () => isSerializableHeaderValue(input.MediaSampleRateHertz),
57
+ () => input.MediaSampleRateHertz.toString(),
58
+ ],
59
+ "x-amzn-transcribe-media-encoding": input.MediaEncoding,
60
+ "x-amzn-transcribe-vocabulary-name": input.VocabularyName,
61
+ "x-amzn-transcribe-session-id": input.SessionId,
62
+ "x-amzn-transcribe-vocabulary-filter-name": input.VocabularyFilterName,
63
+ "x-amzn-transcribe-vocabulary-filter-method": input.VocabularyFilterMethod,
64
+ "x-amzn-transcribe-show-speaker-label": [
65
+ () => isSerializableHeaderValue(input.ShowSpeakerLabel),
66
+ () => input.ShowSpeakerLabel.toString(),
67
+ ],
68
+ "x-amzn-transcribe-enable-channel-identification": [
69
+ () => isSerializableHeaderValue(input.EnableChannelIdentification),
70
+ () => input.EnableChannelIdentification.toString(),
71
+ ],
72
+ "x-amzn-transcribe-number-of-channels": [
73
+ () => isSerializableHeaderValue(input.NumberOfChannels),
74
+ () => input.NumberOfChannels.toString(),
75
+ ],
76
+ "x-amzn-transcribe-enable-partial-results-stabilization": [
77
+ () => isSerializableHeaderValue(input.EnablePartialResultsStabilization),
78
+ () => input.EnablePartialResultsStabilization.toString(),
79
+ ],
80
+ "x-amzn-transcribe-partial-results-stability": input.PartialResultsStability,
81
+ "x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
82
+ "x-amzn-transcribe-content-redaction-type": input.ContentRedactionType,
83
+ "x-amzn-transcribe-pii-entity-types": input.PiiEntityTypes,
84
+ "x-amzn-transcribe-language-model-name": input.LanguageModelName,
85
+ "x-amzn-transcribe-identify-language": [
86
+ () => isSerializableHeaderValue(input.IdentifyLanguage),
87
+ () => input.IdentifyLanguage.toString(),
88
+ ],
89
+ "x-amzn-transcribe-language-options": input.LanguageOptions,
90
+ "x-amzn-transcribe-preferred-language": input.PreferredLanguage,
91
+ "x-amzn-transcribe-vocabulary-names": input.VocabularyNames,
92
+ "x-amzn-transcribe-vocabulary-filter-names": input.VocabularyFilterNames,
93
+ });
112
94
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/stream-transcription";
113
95
  let body;
114
96
  if (input.AudioStream !== undefined) {
@@ -129,61 +111,36 @@ const deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = async (ou
129
111
  if (output.statusCode !== 200 && output.statusCode >= 300) {
130
112
  return deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError(output, context);
131
113
  }
132
- const contents = {
114
+ const contents = map({
133
115
  $metadata: deserializeMetadata(output),
134
- ContentIdentificationType: undefined,
135
- EnableChannelIdentification: undefined,
136
- LanguageCode: undefined,
137
- MediaEncoding: undefined,
138
- MediaSampleRateHertz: undefined,
139
- NumberOfChannels: undefined,
140
- RequestId: undefined,
141
- SessionId: undefined,
142
- ShowSpeakerLabel: undefined,
143
- Specialty: undefined,
144
- TranscriptResultStream: undefined,
145
- Type: undefined,
146
- VocabularyName: undefined,
147
- };
148
- if (output.headers["x-amzn-request-id"] !== undefined) {
149
- contents.RequestId = output.headers["x-amzn-request-id"];
150
- }
151
- if (output.headers["x-amzn-transcribe-language-code"] !== undefined) {
152
- contents.LanguageCode = output.headers["x-amzn-transcribe-language-code"];
153
- }
154
- if (output.headers["x-amzn-transcribe-sample-rate"] !== undefined) {
155
- contents.MediaSampleRateHertz = (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-sample-rate"]);
156
- }
157
- if (output.headers["x-amzn-transcribe-media-encoding"] !== undefined) {
158
- contents.MediaEncoding = output.headers["x-amzn-transcribe-media-encoding"];
159
- }
160
- if (output.headers["x-amzn-transcribe-vocabulary-name"] !== undefined) {
161
- contents.VocabularyName = output.headers["x-amzn-transcribe-vocabulary-name"];
162
- }
163
- if (output.headers["x-amzn-transcribe-specialty"] !== undefined) {
164
- contents.Specialty = output.headers["x-amzn-transcribe-specialty"];
165
- }
166
- if (output.headers["x-amzn-transcribe-type"] !== undefined) {
167
- contents.Type = output.headers["x-amzn-transcribe-type"];
168
- }
169
- if (output.headers["x-amzn-transcribe-show-speaker-label"] !== undefined) {
170
- contents.ShowSpeakerLabel = (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-show-speaker-label"]);
171
- }
172
- if (output.headers["x-amzn-transcribe-session-id"] !== undefined) {
173
- contents.SessionId = output.headers["x-amzn-transcribe-session-id"];
174
- }
175
- if (output.headers["x-amzn-transcribe-enable-channel-identification"] !== undefined) {
176
- contents.EnableChannelIdentification = (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-enable-channel-identification"]);
177
- }
178
- if (output.headers["x-amzn-transcribe-number-of-channels"] !== undefined) {
179
- contents.NumberOfChannels = (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-number-of-channels"]);
180
- }
181
- if (output.headers["x-amzn-transcribe-content-identification-type"] !== undefined) {
182
- contents.ContentIdentificationType = output.headers["x-amzn-transcribe-content-identification-type"];
183
- }
116
+ RequestId: [, output.headers["x-amzn-request-id"]],
117
+ LanguageCode: [, output.headers["x-amzn-transcribe-language-code"]],
118
+ MediaSampleRateHertz: [
119
+ () => void 0 !== output.headers["x-amzn-transcribe-sample-rate"],
120
+ () => (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-sample-rate"]),
121
+ ],
122
+ MediaEncoding: [, output.headers["x-amzn-transcribe-media-encoding"]],
123
+ VocabularyName: [, output.headers["x-amzn-transcribe-vocabulary-name"]],
124
+ Specialty: [, output.headers["x-amzn-transcribe-specialty"]],
125
+ Type: [, output.headers["x-amzn-transcribe-type"]],
126
+ ShowSpeakerLabel: [
127
+ () => void 0 !== output.headers["x-amzn-transcribe-show-speaker-label"],
128
+ () => (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-show-speaker-label"]),
129
+ ],
130
+ SessionId: [, output.headers["x-amzn-transcribe-session-id"]],
131
+ EnableChannelIdentification: [
132
+ () => void 0 !== output.headers["x-amzn-transcribe-enable-channel-identification"],
133
+ () => (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-enable-channel-identification"]),
134
+ ],
135
+ NumberOfChannels: [
136
+ () => void 0 !== output.headers["x-amzn-transcribe-number-of-channels"],
137
+ () => (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-number-of-channels"]),
138
+ ],
139
+ ContentIdentificationType: [, output.headers["x-amzn-transcribe-content-identification-type"]],
140
+ });
184
141
  const data = output.body;
185
142
  contents.TranscriptResultStream = deserializeAws_restJson1MedicalTranscriptResultStream(data, context);
186
- return Promise.resolve(contents);
143
+ return contents;
187
144
  };
188
145
  exports.deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = deserializeAws_restJson1StartMedicalStreamTranscriptionCommand;
189
146
  const deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = async (output, context) => {
@@ -191,7 +148,6 @@ const deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = asyn
191
148
  ...output,
192
149
  body: await parseBody(output.body, context),
193
150
  };
194
- let response;
195
151
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
196
152
  switch (errorCode) {
197
153
  case "BadRequestException":
@@ -211,115 +167,64 @@ const deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = asyn
211
167
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
212
168
  default:
213
169
  const parsedBody = parsedOutput.body;
214
- const $metadata = deserializeMetadata(output);
215
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
216
- response = new TranscribeStreamingServiceException_1.TranscribeStreamingServiceException({
217
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
218
- $fault: "client",
219
- $metadata,
170
+ (0, smithy_client_1.throwDefaultError)({
171
+ output,
172
+ parsedBody,
173
+ exceptionCtor: TranscribeStreamingServiceException_1.TranscribeStreamingServiceException,
174
+ errorCode,
220
175
  });
221
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
222
176
  }
223
177
  };
224
178
  const deserializeAws_restJson1StartStreamTranscriptionCommand = async (output, context) => {
225
179
  if (output.statusCode !== 200 && output.statusCode >= 300) {
226
180
  return deserializeAws_restJson1StartStreamTranscriptionCommandError(output, context);
227
181
  }
228
- const contents = {
182
+ const contents = map({
229
183
  $metadata: deserializeMetadata(output),
230
- ContentIdentificationType: undefined,
231
- ContentRedactionType: undefined,
232
- EnableChannelIdentification: undefined,
233
- EnablePartialResultsStabilization: undefined,
234
- IdentifyLanguage: undefined,
235
- LanguageCode: undefined,
236
- LanguageModelName: undefined,
237
- LanguageOptions: undefined,
238
- MediaEncoding: undefined,
239
- MediaSampleRateHertz: undefined,
240
- NumberOfChannels: undefined,
241
- PartialResultsStability: undefined,
242
- PiiEntityTypes: undefined,
243
- PreferredLanguage: undefined,
244
- RequestId: undefined,
245
- SessionId: undefined,
246
- ShowSpeakerLabel: undefined,
247
- TranscriptResultStream: undefined,
248
- VocabularyFilterMethod: undefined,
249
- VocabularyFilterName: undefined,
250
- VocabularyFilterNames: undefined,
251
- VocabularyName: undefined,
252
- VocabularyNames: undefined,
253
- };
254
- if (output.headers["x-amzn-request-id"] !== undefined) {
255
- contents.RequestId = output.headers["x-amzn-request-id"];
256
- }
257
- if (output.headers["x-amzn-transcribe-language-code"] !== undefined) {
258
- contents.LanguageCode = output.headers["x-amzn-transcribe-language-code"];
259
- }
260
- if (output.headers["x-amzn-transcribe-sample-rate"] !== undefined) {
261
- contents.MediaSampleRateHertz = (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-sample-rate"]);
262
- }
263
- if (output.headers["x-amzn-transcribe-media-encoding"] !== undefined) {
264
- contents.MediaEncoding = output.headers["x-amzn-transcribe-media-encoding"];
265
- }
266
- if (output.headers["x-amzn-transcribe-vocabulary-name"] !== undefined) {
267
- contents.VocabularyName = output.headers["x-amzn-transcribe-vocabulary-name"];
268
- }
269
- if (output.headers["x-amzn-transcribe-session-id"] !== undefined) {
270
- contents.SessionId = output.headers["x-amzn-transcribe-session-id"];
271
- }
272
- if (output.headers["x-amzn-transcribe-vocabulary-filter-name"] !== undefined) {
273
- contents.VocabularyFilterName = output.headers["x-amzn-transcribe-vocabulary-filter-name"];
274
- }
275
- if (output.headers["x-amzn-transcribe-vocabulary-filter-method"] !== undefined) {
276
- contents.VocabularyFilterMethod = output.headers["x-amzn-transcribe-vocabulary-filter-method"];
277
- }
278
- if (output.headers["x-amzn-transcribe-show-speaker-label"] !== undefined) {
279
- contents.ShowSpeakerLabel = (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-show-speaker-label"]);
280
- }
281
- if (output.headers["x-amzn-transcribe-enable-channel-identification"] !== undefined) {
282
- contents.EnableChannelIdentification = (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-enable-channel-identification"]);
283
- }
284
- if (output.headers["x-amzn-transcribe-number-of-channels"] !== undefined) {
285
- contents.NumberOfChannels = (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-number-of-channels"]);
286
- }
287
- if (output.headers["x-amzn-transcribe-enable-partial-results-stabilization"] !== undefined) {
288
- contents.EnablePartialResultsStabilization = (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-enable-partial-results-stabilization"]);
289
- }
290
- if (output.headers["x-amzn-transcribe-partial-results-stability"] !== undefined) {
291
- contents.PartialResultsStability = output.headers["x-amzn-transcribe-partial-results-stability"];
292
- }
293
- if (output.headers["x-amzn-transcribe-content-identification-type"] !== undefined) {
294
- contents.ContentIdentificationType = output.headers["x-amzn-transcribe-content-identification-type"];
295
- }
296
- if (output.headers["x-amzn-transcribe-content-redaction-type"] !== undefined) {
297
- contents.ContentRedactionType = output.headers["x-amzn-transcribe-content-redaction-type"];
298
- }
299
- if (output.headers["x-amzn-transcribe-pii-entity-types"] !== undefined) {
300
- contents.PiiEntityTypes = output.headers["x-amzn-transcribe-pii-entity-types"];
301
- }
302
- if (output.headers["x-amzn-transcribe-language-model-name"] !== undefined) {
303
- contents.LanguageModelName = output.headers["x-amzn-transcribe-language-model-name"];
304
- }
305
- if (output.headers["x-amzn-transcribe-identify-language"] !== undefined) {
306
- contents.IdentifyLanguage = (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-identify-language"]);
307
- }
308
- if (output.headers["x-amzn-transcribe-language-options"] !== undefined) {
309
- contents.LanguageOptions = output.headers["x-amzn-transcribe-language-options"];
310
- }
311
- if (output.headers["x-amzn-transcribe-preferred-language"] !== undefined) {
312
- contents.PreferredLanguage = output.headers["x-amzn-transcribe-preferred-language"];
313
- }
314
- if (output.headers["x-amzn-transcribe-vocabulary-names"] !== undefined) {
315
- contents.VocabularyNames = output.headers["x-amzn-transcribe-vocabulary-names"];
316
- }
317
- if (output.headers["x-amzn-transcribe-vocabulary-filter-names"] !== undefined) {
318
- contents.VocabularyFilterNames = output.headers["x-amzn-transcribe-vocabulary-filter-names"];
319
- }
184
+ RequestId: [, output.headers["x-amzn-request-id"]],
185
+ LanguageCode: [, output.headers["x-amzn-transcribe-language-code"]],
186
+ MediaSampleRateHertz: [
187
+ () => void 0 !== output.headers["x-amzn-transcribe-sample-rate"],
188
+ () => (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-sample-rate"]),
189
+ ],
190
+ MediaEncoding: [, output.headers["x-amzn-transcribe-media-encoding"]],
191
+ VocabularyName: [, output.headers["x-amzn-transcribe-vocabulary-name"]],
192
+ SessionId: [, output.headers["x-amzn-transcribe-session-id"]],
193
+ VocabularyFilterName: [, output.headers["x-amzn-transcribe-vocabulary-filter-name"]],
194
+ VocabularyFilterMethod: [, output.headers["x-amzn-transcribe-vocabulary-filter-method"]],
195
+ ShowSpeakerLabel: [
196
+ () => void 0 !== output.headers["x-amzn-transcribe-show-speaker-label"],
197
+ () => (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-show-speaker-label"]),
198
+ ],
199
+ EnableChannelIdentification: [
200
+ () => void 0 !== output.headers["x-amzn-transcribe-enable-channel-identification"],
201
+ () => (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-enable-channel-identification"]),
202
+ ],
203
+ NumberOfChannels: [
204
+ () => void 0 !== output.headers["x-amzn-transcribe-number-of-channels"],
205
+ () => (0, smithy_client_1.strictParseInt32)(output.headers["x-amzn-transcribe-number-of-channels"]),
206
+ ],
207
+ EnablePartialResultsStabilization: [
208
+ () => void 0 !== output.headers["x-amzn-transcribe-enable-partial-results-stabilization"],
209
+ () => (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-enable-partial-results-stabilization"]),
210
+ ],
211
+ PartialResultsStability: [, output.headers["x-amzn-transcribe-partial-results-stability"]],
212
+ ContentIdentificationType: [, output.headers["x-amzn-transcribe-content-identification-type"]],
213
+ ContentRedactionType: [, output.headers["x-amzn-transcribe-content-redaction-type"]],
214
+ PiiEntityTypes: [, output.headers["x-amzn-transcribe-pii-entity-types"]],
215
+ LanguageModelName: [, output.headers["x-amzn-transcribe-language-model-name"]],
216
+ IdentifyLanguage: [
217
+ () => void 0 !== output.headers["x-amzn-transcribe-identify-language"],
218
+ () => (0, smithy_client_1.parseBoolean)(output.headers["x-amzn-transcribe-identify-language"]),
219
+ ],
220
+ LanguageOptions: [, output.headers["x-amzn-transcribe-language-options"]],
221
+ PreferredLanguage: [, output.headers["x-amzn-transcribe-preferred-language"]],
222
+ VocabularyNames: [, output.headers["x-amzn-transcribe-vocabulary-names"]],
223
+ VocabularyFilterNames: [, output.headers["x-amzn-transcribe-vocabulary-filter-names"]],
224
+ });
320
225
  const data = output.body;
321
226
  contents.TranscriptResultStream = deserializeAws_restJson1TranscriptResultStream(data, context);
322
- return Promise.resolve(contents);
227
+ return contents;
323
228
  };
324
229
  exports.deserializeAws_restJson1StartStreamTranscriptionCommand = deserializeAws_restJson1StartStreamTranscriptionCommand;
325
230
  const deserializeAws_restJson1StartStreamTranscriptionCommandError = async (output, context) => {
@@ -327,7 +232,6 @@ const deserializeAws_restJson1StartStreamTranscriptionCommandError = async (outp
327
232
  ...output,
328
233
  body: await parseBody(output.body, context),
329
234
  };
330
- let response;
331
235
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
332
236
  switch (errorCode) {
333
237
  case "BadRequestException":
@@ -347,20 +251,19 @@ const deserializeAws_restJson1StartStreamTranscriptionCommandError = async (outp
347
251
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
348
252
  default:
349
253
  const parsedBody = parsedOutput.body;
350
- const $metadata = deserializeMetadata(output);
351
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
352
- response = new TranscribeStreamingServiceException_1.TranscribeStreamingServiceException({
353
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
354
- $fault: "client",
355
- $metadata,
254
+ (0, smithy_client_1.throwDefaultError)({
255
+ output,
256
+ parsedBody,
257
+ exceptionCtor: TranscribeStreamingServiceException_1.TranscribeStreamingServiceException,
258
+ errorCode,
356
259
  });
357
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
358
260
  }
359
261
  };
262
+ const map = smithy_client_1.map;
360
263
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
361
- const contents = {};
264
+ const contents = map({});
362
265
  const data = parsedOutput.body;
363
- if (data.Message !== undefined && data.Message !== null) {
266
+ if (data.Message != null) {
364
267
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
365
268
  }
366
269
  const exception = new models_0_1.BadRequestException({
@@ -370,9 +273,9 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
370
273
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
371
274
  };
372
275
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
373
- const contents = {};
276
+ const contents = map({});
374
277
  const data = parsedOutput.body;
375
- if (data.Message !== undefined && data.Message !== null) {
278
+ if (data.Message != null) {
376
279
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
377
280
  }
378
281
  const exception = new models_0_1.ConflictException({
@@ -382,9 +285,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
382
285
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
383
286
  };
384
287
  const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOutput, context) => {
385
- const contents = {};
288
+ const contents = map({});
386
289
  const data = parsedOutput.body;
387
- if (data.Message !== undefined && data.Message !== null) {
290
+ if (data.Message != null) {
388
291
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
389
292
  }
390
293
  const exception = new models_0_1.InternalFailureException({
@@ -394,9 +297,9 @@ const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOu
394
297
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
395
298
  };
396
299
  const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
397
- const contents = {};
300
+ const contents = map({});
398
301
  const data = parsedOutput.body;
399
- if (data.Message !== undefined && data.Message !== null) {
302
+ if (data.Message != null) {
400
303
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
401
304
  }
402
305
  const exception = new models_0_1.LimitExceededException({
@@ -406,9 +309,9 @@ const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutp
406
309
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
407
310
  };
408
311
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
409
- const contents = {};
312
+ const contents = map({});
410
313
  const data = parsedOutput.body;
411
- if (data.Message !== undefined && data.Message !== null) {
314
+ if (data.Message != null) {
412
315
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
413
316
  }
414
317
  const exception = new models_0_1.ServiceUnavailableException({
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseBoolean as __parseBoolean, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
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";
4
4
  import { AudioStream, BadRequestException, ConflictException, InternalFailureException, LimitExceededException, ServiceUnavailableException, } from "../models/models_0";
5
5
  import { TranscribeStreamingServiceException as __BaseException } from "../models/TranscribeStreamingServiceException";
6
6
  export var serializeAws_restJson1StartMedicalStreamTranscriptionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -10,19 +10,31 @@ export var serializeAws_restJson1StartMedicalStreamTranscriptionCommand = functi
10
10
  case 0: return [4, context.endpoint()];
11
11
  case 1:
12
12
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (isSerializableHeaderValue(input.LanguageCode) && { "x-amzn-transcribe-language-code": input.LanguageCode })), (isSerializableHeaderValue(input.MediaSampleRateHertz) && {
14
- "x-amzn-transcribe-sample-rate": input.MediaSampleRateHertz.toString(),
15
- })), (isSerializableHeaderValue(input.MediaEncoding) && { "x-amzn-transcribe-media-encoding": input.MediaEncoding })), (isSerializableHeaderValue(input.VocabularyName) && {
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,
16
20
  "x-amzn-transcribe-vocabulary-name": input.VocabularyName,
17
- })), (isSerializableHeaderValue(input.Specialty) && { "x-amzn-transcribe-specialty": input.Specialty })), (isSerializableHeaderValue(input.Type) && { "x-amzn-transcribe-type": input.Type })), (isSerializableHeaderValue(input.ShowSpeakerLabel) && {
18
- "x-amzn-transcribe-show-speaker-label": input.ShowSpeakerLabel.toString(),
19
- })), (isSerializableHeaderValue(input.SessionId) && { "x-amzn-transcribe-session-id": input.SessionId })), (isSerializableHeaderValue(input.EnableChannelIdentification) && {
20
- "x-amzn-transcribe-enable-channel-identification": input.EnableChannelIdentification.toString(),
21
- })), (isSerializableHeaderValue(input.NumberOfChannels) && {
22
- "x-amzn-transcribe-number-of-channels": input.NumberOfChannels.toString(),
23
- })), (isSerializableHeaderValue(input.ContentIdentificationType) && {
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
+ ],
24
36
  "x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
25
- }));
37
+ });
26
38
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/medical-stream-transcription";
27
39
  if (input.AudioStream !== undefined) {
28
40
  body = serializeAws_restJson1AudioStream(input.AudioStream, context);
@@ -46,43 +58,47 @@ export var serializeAws_restJson1StartStreamTranscriptionCommand = function (inp
46
58
  case 0: return [4, context.endpoint()];
47
59
  case 1:
48
60
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
49
- headers = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (isSerializableHeaderValue(input.LanguageCode) && { "x-amzn-transcribe-language-code": input.LanguageCode })), (isSerializableHeaderValue(input.MediaSampleRateHertz) && {
50
- "x-amzn-transcribe-sample-rate": input.MediaSampleRateHertz.toString(),
51
- })), (isSerializableHeaderValue(input.MediaEncoding) && { "x-amzn-transcribe-media-encoding": input.MediaEncoding })), (isSerializableHeaderValue(input.VocabularyName) && {
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,
52
68
  "x-amzn-transcribe-vocabulary-name": input.VocabularyName,
53
- })), (isSerializableHeaderValue(input.SessionId) && { "x-amzn-transcribe-session-id": input.SessionId })), (isSerializableHeaderValue(input.VocabularyFilterName) && {
69
+ "x-amzn-transcribe-session-id": input.SessionId,
54
70
  "x-amzn-transcribe-vocabulary-filter-name": input.VocabularyFilterName,
55
- })), (isSerializableHeaderValue(input.VocabularyFilterMethod) && {
56
71
  "x-amzn-transcribe-vocabulary-filter-method": input.VocabularyFilterMethod,
57
- })), (isSerializableHeaderValue(input.ShowSpeakerLabel) && {
58
- "x-amzn-transcribe-show-speaker-label": input.ShowSpeakerLabel.toString(),
59
- })), (isSerializableHeaderValue(input.EnableChannelIdentification) && {
60
- "x-amzn-transcribe-enable-channel-identification": input.EnableChannelIdentification.toString(),
61
- })), (isSerializableHeaderValue(input.NumberOfChannels) && {
62
- "x-amzn-transcribe-number-of-channels": input.NumberOfChannels.toString(),
63
- })), (isSerializableHeaderValue(input.EnablePartialResultsStabilization) && {
64
- "x-amzn-transcribe-enable-partial-results-stabilization": input.EnablePartialResultsStabilization.toString(),
65
- })), (isSerializableHeaderValue(input.PartialResultsStability) && {
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
+ ],
66
88
  "x-amzn-transcribe-partial-results-stability": input.PartialResultsStability,
67
- })), (isSerializableHeaderValue(input.ContentIdentificationType) && {
68
89
  "x-amzn-transcribe-content-identification-type": input.ContentIdentificationType,
69
- })), (isSerializableHeaderValue(input.ContentRedactionType) && {
70
90
  "x-amzn-transcribe-content-redaction-type": input.ContentRedactionType,
71
- })), (isSerializableHeaderValue(input.PiiEntityTypes) && {
72
91
  "x-amzn-transcribe-pii-entity-types": input.PiiEntityTypes,
73
- })), (isSerializableHeaderValue(input.LanguageModelName) && {
74
92
  "x-amzn-transcribe-language-model-name": input.LanguageModelName,
75
- })), (isSerializableHeaderValue(input.IdentifyLanguage) && {
76
- "x-amzn-transcribe-identify-language": input.IdentifyLanguage.toString(),
77
- })), (isSerializableHeaderValue(input.LanguageOptions) && {
93
+ "x-amzn-transcribe-identify-language": [
94
+ function () { return isSerializableHeaderValue(input.IdentifyLanguage); },
95
+ function () { return input.IdentifyLanguage.toString(); },
96
+ ],
78
97
  "x-amzn-transcribe-language-options": input.LanguageOptions,
79
- })), (isSerializableHeaderValue(input.PreferredLanguage) && {
80
98
  "x-amzn-transcribe-preferred-language": input.PreferredLanguage,
81
- })), (isSerializableHeaderValue(input.VocabularyNames) && {
82
99
  "x-amzn-transcribe-vocabulary-names": input.VocabularyNames,
83
- })), (isSerializableHeaderValue(input.VocabularyFilterNames) && {
84
100
  "x-amzn-transcribe-vocabulary-filter-names": input.VocabularyFilterNames,
85
- }));
101
+ });
86
102
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/stream-transcription";
87
103
  if (input.AudioStream !== undefined) {
88
104
  body = serializeAws_restJson1AudioStream(input.AudioStream, context);
@@ -105,65 +121,40 @@ export var deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = func
105
121
  if (output.statusCode !== 200 && output.statusCode >= 300) {
106
122
  return [2, deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError(output, context)];
107
123
  }
108
- contents = {
124
+ contents = map({
109
125
  $metadata: deserializeMetadata(output),
110
- ContentIdentificationType: undefined,
111
- EnableChannelIdentification: undefined,
112
- LanguageCode: undefined,
113
- MediaEncoding: undefined,
114
- MediaSampleRateHertz: undefined,
115
- NumberOfChannels: undefined,
116
- RequestId: undefined,
117
- SessionId: undefined,
118
- ShowSpeakerLabel: undefined,
119
- Specialty: undefined,
120
- TranscriptResultStream: undefined,
121
- Type: undefined,
122
- VocabularyName: undefined,
123
- };
124
- if (output.headers["x-amzn-request-id"] !== undefined) {
125
- contents.RequestId = output.headers["x-amzn-request-id"];
126
- }
127
- if (output.headers["x-amzn-transcribe-language-code"] !== undefined) {
128
- contents.LanguageCode = output.headers["x-amzn-transcribe-language-code"];
129
- }
130
- if (output.headers["x-amzn-transcribe-sample-rate"] !== undefined) {
131
- contents.MediaSampleRateHertz = __strictParseInt32(output.headers["x-amzn-transcribe-sample-rate"]);
132
- }
133
- if (output.headers["x-amzn-transcribe-media-encoding"] !== undefined) {
134
- contents.MediaEncoding = output.headers["x-amzn-transcribe-media-encoding"];
135
- }
136
- if (output.headers["x-amzn-transcribe-vocabulary-name"] !== undefined) {
137
- contents.VocabularyName = output.headers["x-amzn-transcribe-vocabulary-name"];
138
- }
139
- if (output.headers["x-amzn-transcribe-specialty"] !== undefined) {
140
- contents.Specialty = output.headers["x-amzn-transcribe-specialty"];
141
- }
142
- if (output.headers["x-amzn-transcribe-type"] !== undefined) {
143
- contents.Type = output.headers["x-amzn-transcribe-type"];
144
- }
145
- if (output.headers["x-amzn-transcribe-show-speaker-label"] !== undefined) {
146
- contents.ShowSpeakerLabel = __parseBoolean(output.headers["x-amzn-transcribe-show-speaker-label"]);
147
- }
148
- if (output.headers["x-amzn-transcribe-session-id"] !== undefined) {
149
- contents.SessionId = output.headers["x-amzn-transcribe-session-id"];
150
- }
151
- if (output.headers["x-amzn-transcribe-enable-channel-identification"] !== undefined) {
152
- contents.EnableChannelIdentification = __parseBoolean(output.headers["x-amzn-transcribe-enable-channel-identification"]);
153
- }
154
- if (output.headers["x-amzn-transcribe-number-of-channels"] !== undefined) {
155
- contents.NumberOfChannels = __strictParseInt32(output.headers["x-amzn-transcribe-number-of-channels"]);
156
- }
157
- if (output.headers["x-amzn-transcribe-content-identification-type"] !== undefined) {
158
- contents.ContentIdentificationType = output.headers["x-amzn-transcribe-content-identification-type"];
159
- }
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
+ });
160
151
  data = output.body;
161
152
  contents.TranscriptResultStream = deserializeAws_restJson1MedicalTranscriptResultStream(data, context);
162
- return [2, Promise.resolve(contents)];
153
+ return [2, contents];
163
154
  });
164
155
  }); };
165
156
  var deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
166
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
157
+ var parsedOutput, _a, errorCode, _b, parsedBody;
167
158
  var _c;
168
159
  return __generator(this, function (_d) {
169
160
  switch (_d.label) {
@@ -200,14 +191,14 @@ var deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = functi
200
191
  case 11: throw _d.sent();
201
192
  case 12:
202
193
  parsedBody = parsedOutput.body;
203
- $metadata = deserializeMetadata(output);
204
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
205
- response = new __BaseException({
206
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
207
- $fault: "client",
208
- $metadata: $metadata,
194
+ throwDefaultError({
195
+ output: output,
196
+ parsedBody: parsedBody,
197
+ exceptionCtor: __BaseException,
198
+ errorCode: errorCode,
209
199
  });
210
- throw __decorateServiceException(response, parsedBody);
200
+ _d.label = 13;
201
+ case 13: return [2];
211
202
  }
212
203
  });
213
204
  }); };
@@ -217,105 +208,56 @@ export var deserializeAws_restJson1StartStreamTranscriptionCommand = function (o
217
208
  if (output.statusCode !== 200 && output.statusCode >= 300) {
218
209
  return [2, deserializeAws_restJson1StartStreamTranscriptionCommandError(output, context)];
219
210
  }
220
- contents = {
211
+ contents = map({
221
212
  $metadata: deserializeMetadata(output),
222
- ContentIdentificationType: undefined,
223
- ContentRedactionType: undefined,
224
- EnableChannelIdentification: undefined,
225
- EnablePartialResultsStabilization: undefined,
226
- IdentifyLanguage: undefined,
227
- LanguageCode: undefined,
228
- LanguageModelName: undefined,
229
- LanguageOptions: undefined,
230
- MediaEncoding: undefined,
231
- MediaSampleRateHertz: undefined,
232
- NumberOfChannels: undefined,
233
- PartialResultsStability: undefined,
234
- PiiEntityTypes: undefined,
235
- PreferredLanguage: undefined,
236
- RequestId: undefined,
237
- SessionId: undefined,
238
- ShowSpeakerLabel: undefined,
239
- TranscriptResultStream: undefined,
240
- VocabularyFilterMethod: undefined,
241
- VocabularyFilterName: undefined,
242
- VocabularyFilterNames: undefined,
243
- VocabularyName: undefined,
244
- VocabularyNames: undefined,
245
- };
246
- if (output.headers["x-amzn-request-id"] !== undefined) {
247
- contents.RequestId = output.headers["x-amzn-request-id"];
248
- }
249
- if (output.headers["x-amzn-transcribe-language-code"] !== undefined) {
250
- contents.LanguageCode = output.headers["x-amzn-transcribe-language-code"];
251
- }
252
- if (output.headers["x-amzn-transcribe-sample-rate"] !== undefined) {
253
- contents.MediaSampleRateHertz = __strictParseInt32(output.headers["x-amzn-transcribe-sample-rate"]);
254
- }
255
- if (output.headers["x-amzn-transcribe-media-encoding"] !== undefined) {
256
- contents.MediaEncoding = output.headers["x-amzn-transcribe-media-encoding"];
257
- }
258
- if (output.headers["x-amzn-transcribe-vocabulary-name"] !== undefined) {
259
- contents.VocabularyName = output.headers["x-amzn-transcribe-vocabulary-name"];
260
- }
261
- if (output.headers["x-amzn-transcribe-session-id"] !== undefined) {
262
- contents.SessionId = output.headers["x-amzn-transcribe-session-id"];
263
- }
264
- if (output.headers["x-amzn-transcribe-vocabulary-filter-name"] !== undefined) {
265
- contents.VocabularyFilterName = output.headers["x-amzn-transcribe-vocabulary-filter-name"];
266
- }
267
- if (output.headers["x-amzn-transcribe-vocabulary-filter-method"] !== undefined) {
268
- contents.VocabularyFilterMethod = output.headers["x-amzn-transcribe-vocabulary-filter-method"];
269
- }
270
- if (output.headers["x-amzn-transcribe-show-speaker-label"] !== undefined) {
271
- contents.ShowSpeakerLabel = __parseBoolean(output.headers["x-amzn-transcribe-show-speaker-label"]);
272
- }
273
- if (output.headers["x-amzn-transcribe-enable-channel-identification"] !== undefined) {
274
- contents.EnableChannelIdentification = __parseBoolean(output.headers["x-amzn-transcribe-enable-channel-identification"]);
275
- }
276
- if (output.headers["x-amzn-transcribe-number-of-channels"] !== undefined) {
277
- contents.NumberOfChannels = __strictParseInt32(output.headers["x-amzn-transcribe-number-of-channels"]);
278
- }
279
- if (output.headers["x-amzn-transcribe-enable-partial-results-stabilization"] !== undefined) {
280
- contents.EnablePartialResultsStabilization = __parseBoolean(output.headers["x-amzn-transcribe-enable-partial-results-stabilization"]);
281
- }
282
- if (output.headers["x-amzn-transcribe-partial-results-stability"] !== undefined) {
283
- contents.PartialResultsStability = output.headers["x-amzn-transcribe-partial-results-stability"];
284
- }
285
- if (output.headers["x-amzn-transcribe-content-identification-type"] !== undefined) {
286
- contents.ContentIdentificationType = output.headers["x-amzn-transcribe-content-identification-type"];
287
- }
288
- if (output.headers["x-amzn-transcribe-content-redaction-type"] !== undefined) {
289
- contents.ContentRedactionType = output.headers["x-amzn-transcribe-content-redaction-type"];
290
- }
291
- if (output.headers["x-amzn-transcribe-pii-entity-types"] !== undefined) {
292
- contents.PiiEntityTypes = output.headers["x-amzn-transcribe-pii-entity-types"];
293
- }
294
- if (output.headers["x-amzn-transcribe-language-model-name"] !== undefined) {
295
- contents.LanguageModelName = output.headers["x-amzn-transcribe-language-model-name"];
296
- }
297
- if (output.headers["x-amzn-transcribe-identify-language"] !== undefined) {
298
- contents.IdentifyLanguage = __parseBoolean(output.headers["x-amzn-transcribe-identify-language"]);
299
- }
300
- if (output.headers["x-amzn-transcribe-language-options"] !== undefined) {
301
- contents.LanguageOptions = output.headers["x-amzn-transcribe-language-options"];
302
- }
303
- if (output.headers["x-amzn-transcribe-preferred-language"] !== undefined) {
304
- contents.PreferredLanguage = output.headers["x-amzn-transcribe-preferred-language"];
305
- }
306
- if (output.headers["x-amzn-transcribe-vocabulary-names"] !== undefined) {
307
- contents.VocabularyNames = output.headers["x-amzn-transcribe-vocabulary-names"];
308
- }
309
- if (output.headers["x-amzn-transcribe-vocabulary-filter-names"] !== undefined) {
310
- contents.VocabularyFilterNames = output.headers["x-amzn-transcribe-vocabulary-filter-names"];
311
- }
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
+ });
312
254
  data = output.body;
313
255
  contents.TranscriptResultStream = deserializeAws_restJson1TranscriptResultStream(data, context);
314
- return [2, Promise.resolve(contents)];
256
+ return [2, contents];
315
257
  });
316
258
  }); };
317
259
  var deserializeAws_restJson1StartStreamTranscriptionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
318
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
260
+ var parsedOutput, _a, errorCode, _b, parsedBody;
319
261
  var _c;
320
262
  return __generator(this, function (_d) {
321
263
  switch (_d.label) {
@@ -352,23 +294,24 @@ var deserializeAws_restJson1StartStreamTranscriptionCommandError = function (out
352
294
  case 11: throw _d.sent();
353
295
  case 12:
354
296
  parsedBody = parsedOutput.body;
355
- $metadata = deserializeMetadata(output);
356
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
357
- response = new __BaseException({
358
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
359
- $fault: "client",
360
- $metadata: $metadata,
297
+ throwDefaultError({
298
+ output: output,
299
+ parsedBody: parsedBody,
300
+ exceptionCtor: __BaseException,
301
+ errorCode: errorCode,
361
302
  });
362
- throw __decorateServiceException(response, parsedBody);
303
+ _d.label = 13;
304
+ case 13: return [2];
363
305
  }
364
306
  });
365
307
  }); };
308
+ var map = __map;
366
309
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
367
310
  var contents, data, exception;
368
311
  return __generator(this, function (_a) {
369
- contents = {};
312
+ contents = map({});
370
313
  data = parsedOutput.body;
371
- if (data.Message !== undefined && data.Message !== null) {
314
+ if (data.Message != null) {
372
315
  contents.Message = __expectString(data.Message);
373
316
  }
374
317
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -378,9 +321,9 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
378
321
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
379
322
  var contents, data, exception;
380
323
  return __generator(this, function (_a) {
381
- contents = {};
324
+ contents = map({});
382
325
  data = parsedOutput.body;
383
- if (data.Message !== undefined && data.Message !== null) {
326
+ if (data.Message != null) {
384
327
  contents.Message = __expectString(data.Message);
385
328
  }
386
329
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -390,9 +333,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
390
333
  var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
391
334
  var contents, data, exception;
392
335
  return __generator(this, function (_a) {
393
- contents = {};
336
+ contents = map({});
394
337
  data = parsedOutput.body;
395
- if (data.Message !== undefined && data.Message !== null) {
338
+ if (data.Message != null) {
396
339
  contents.Message = __expectString(data.Message);
397
340
  }
398
341
  exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -402,9 +345,9 @@ var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedO
402
345
  var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
403
346
  var contents, data, exception;
404
347
  return __generator(this, function (_a) {
405
- contents = {};
348
+ contents = map({});
406
349
  data = parsedOutput.body;
407
- if (data.Message !== undefined && data.Message !== null) {
350
+ if (data.Message != null) {
408
351
  contents.Message = __expectString(data.Message);
409
352
  }
410
353
  exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -414,9 +357,9 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
414
357
  var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
415
358
  var contents, data, exception;
416
359
  return __generator(this, function (_a) {
417
- contents = {};
360
+ contents = map({});
418
361
  data = parsedOutput.body;
419
- if (data.Message !== undefined && data.Message !== null) {
362
+ if (data.Message != null) {
420
363
  contents.Message = __expectString(data.Message);
421
364
  }
422
365
  exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-transcribe-streaming",
3
3
  "description": "AWS SDK for JavaScript Transcribe Streaming Client for Node.js, Browser and React Native",
4
- "version": "3.141.0",
4
+ "version": "3.150.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -19,9 +19,9 @@
19
19
  "dependencies": {
20
20
  "@aws-crypto/sha256-browser": "2.0.0",
21
21
  "@aws-crypto/sha256-js": "2.0.0",
22
- "@aws-sdk/client-sts": "3.141.0",
22
+ "@aws-sdk/client-sts": "3.150.0",
23
23
  "@aws-sdk/config-resolver": "3.130.0",
24
- "@aws-sdk/credential-provider-node": "3.141.0",
24
+ "@aws-sdk/credential-provider-node": "3.150.0",
25
25
  "@aws-sdk/eventstream-handler-node": "3.127.0",
26
26
  "@aws-sdk/eventstream-serde-browser": "3.127.0",
27
27
  "@aws-sdk/eventstream-serde-config-resolver": "3.127.0",
@@ -43,15 +43,15 @@
43
43
  "@aws-sdk/node-config-provider": "3.127.0",
44
44
  "@aws-sdk/node-http-handler": "3.127.0",
45
45
  "@aws-sdk/protocol-http": "3.127.0",
46
- "@aws-sdk/smithy-client": "3.137.0",
46
+ "@aws-sdk/smithy-client": "3.142.0",
47
47
  "@aws-sdk/types": "3.127.0",
48
48
  "@aws-sdk/url-parser": "3.127.0",
49
49
  "@aws-sdk/util-base64-browser": "3.109.0",
50
50
  "@aws-sdk/util-base64-node": "3.55.0",
51
51
  "@aws-sdk/util-body-length-browser": "3.55.0",
52
52
  "@aws-sdk/util-body-length-node": "3.55.0",
53
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
54
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
53
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
54
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
55
55
  "@aws-sdk/util-user-agent-browser": "3.127.0",
56
56
  "@aws-sdk/util-user-agent-node": "3.127.0",
57
57
  "@aws-sdk/util-utf8-browser": "3.109.0",
@@ -68,6 +68,11 @@
68
68
  "typedoc": "0.19.2",
69
69
  "typescript": "~4.6.2"
70
70
  },
71
+ "overrides": {
72
+ "typedoc": {
73
+ "typescript": "~4.6.2"
74
+ }
75
+ },
71
76
  "engines": {
72
77
  "node": ">=12.0.0"
73
78
  },